From patchwork Sun Oct 21 20:49:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 1595 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D2B7A1672F; Sun, 21 Oct 2018 21:51:08 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id 8E5A41672E for ; Sun, 21 Oct 2018 21:51:08 +0100 (BST) Received: from localhost ([::1]:60179 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEKgl-0001SG-V1 for patchwork@mira.cbaines.net; Sun, 21 Oct 2018 16:51:07 -0400 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 X-Loop: help-debbugs@gnu.org 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-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 21 Oct 2018 20:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33111 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 33111@debbugs.gnu.org Received: via spool by 33111-submit@debbugs.gnu.org id=B33111.154015501232590 (code B ref 33111); Sun, 21 Oct 2018 20:51:01 +0000 Received: (at 33111) by debbugs.gnu.org; 21 Oct 2018 20:50:12 +0000 Received: from localhost ([127.0.0.1]:34664 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gEKfs-0008TZ-8g for submit@debbugs.gnu.org; Sun, 21 Oct 2018 16:50:12 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gEKfq-0008T9-45 for 33111@debbugs.gnu.org; Sun, 21 Oct 2018 16:50:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEKfj-0005CE-Ro for 33111@debbugs.gnu.org; Sun, 21 Oct 2018 16:50:04 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEKfb-000589-JI; Sun, 21 Oct 2018 16:49:57 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=33222 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gEKfa-0003ed-Fh; Sun, 21 Oct 2018 16:49:55 -0400 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> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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