From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEKgh-0001Rz-0R for guix-patches@gnu.org; Sun, 21 Oct 2018 16:51:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEKgg-0005oG-01 for guix-patches@gnu.org; Sun, 21 Oct 2018 16:51:02 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:58645) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gEKgf-0005oA-Rq for guix-patches@gnu.org; Sun, 21 Oct 2018 16:51:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gEKgf-0008V4-OP for guix-patches@gnu.org; Sun, 21 Oct 2018 16:51:01 -0400 Subject: [bug#33111] [PATCH 1/3] install: Parameterize the profile name for 'populate-single-profile-directory'. References: <20181021204506.1978-1-ludo@gnu.org> In-Reply-To: <20181021204506.1978-1-ludo@gnu.org> Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sun, 21 Oct 2018 22:49:41 +0200 Message-Id: <20181021204943.2142-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 33111@debbugs.gnu.org * gnu/build/install.scm (populate-single-profile-directory): Add #:profile-name. Replace hard-coded occurrences of "guix-profile" with PROFILE-NAME. Make the symlink part under /root a function of PROFILE-NAME. --- gnu/build/install.scm | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/gnu/build/install.scm b/gnu/build/install.scm index c602d6948..98c547f2e 100644 --- a/gnu/build/install.scm +++ b/gnu/build/install.scm @@ -160,6 +160,7 @@ deduplicates files common to CLOSURE and the rest of PREFIX." (define* (populate-single-profile-directory directory #:key profile closure + (profile-name "guix-profile") deduplicate? register? schema) "Populate DIRECTORY with a store containing PROFILE, whose closure is given @@ -169,6 +170,9 @@ When REGISTER? is true, initialize DIRECTORY/var/guix/db to reflect the contents of the store; DEDUPLICATE? determines whether to deduplicate files in the store. +PROFILE-NAME is the name of the profile being created under +/var/guix/profiles, typically either \"guix-profile\" or \"current-guix\". + This is used to create the self-contained tarballs with 'guix pack'." (define (scope file) (string-append directory "/" file)) @@ -198,12 +202,20 @@ This is used to create the self-contained tarballs with 'guix pack'." ;; Make root's profile, which makes it a GC root. (mkdir-p* %root-profile) (symlink* profile - (string-append %root-profile "/guix-profile-1-link")) - (symlink* "guix-profile-1-link" - (string-append %root-profile "/guix-profile")) + (string-append %root-profile "/" profile-name "-1-link")) + (symlink* (string-append profile-name "-1-link") + (string-append %root-profile "/" profile-name)) - (mkdir-p* "/root") - (symlink* (string-append %root-profile "/guix-profile") - "/root/.guix-profile")) + (match profile-name + ("guix-profile" + (mkdir-p* "/root") + (symlink* (string-append %root-profile "/guix-profile") + "/root/.guix-profile")) + ("current-guix" + (mkdir-p* "/root/.config/guix") + (symlink* (string-append %root-profile "/current-guix") + "/root/.config/guix/current")) + (_ + #t))) ;;; install.scm ends here -- 2.19.1