GNU bug report logs - #77523
[PATCH v4 1/6] system: /etc/profile: Group profile sourcing.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Hilton Chain <hako@HIDDEN>; Keywords: patch; merged with #77035, #77522, #77524, #77525, #77526, #77527, #77528; dated Fri, 4 Apr 2025 03:24:03 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.
Merged 77035 77522 77523 77524 77525 77526 77527 77528. Request was from Hilton Chain <hako@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 4 Apr 2025 03:23:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 03 23:23:51 2025
Received: from localhost ([127.0.0.1]:36537 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u0Xeo-0002ab-QE
	for submit <at> debbugs.gnu.org; Thu, 03 Apr 2025 23:23:51 -0400
Received: from lists.gnu.org ([2001:470:142::17]:49132)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <hako@HIDDEN>)
 id 1u0Xel-0002Zy-Tf
 for submit <at> debbugs.gnu.org; Thu, 03 Apr 2025 23:23:48 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <hako@HIDDEN>)
 id 1u0Xeg-0006sO-BD
 for guix-patches@HIDDEN; Thu, 03 Apr 2025 23:23:42 -0400
Received: from mx.boiledscript.com ([2a01:4f8:10b:392::42])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <hako@HIDDEN>)
 id 1u0Xee-0002hH-HF
 for guix-patches@HIDDEN; Thu, 03 Apr 2025 23:23:42 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=mail; t=1743737017;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=d0tH94RRK/KrRDzwZPVwFrDUHNaidGFC1Mjnjv4ImOs=;
 b=Gk+xzcD+xBISwfLKRgaiORzZIR+sJ3NlkLciSgUm9Nm1sfzzJEf3rRoEEr5QT4hHA6KGs5
 3vbbsIDb1nIeFwVG5dppzGYKemCuI8v4l/jngLcSNVo9n4vuJYzi7is+EjdPHRVHzOTgSc
 Ai2lPQGDGMssuX23SwnXZYp20CujwkQmMeuF8v3sn7LtOS2E4HeNLt/IMYzr55oNE750p0
 45pEigS9GC4J7C6n4KmjotUrkehnKp6QfwNT+ddbeNbiW7rO4EDrrfWshP/mcBYC5mxBnj
 b37zZX8ziveEc2eIuFSydwmUPVb2olkLjmWz2py/rgQR6UukTm3Ly9UdvIc2Dg==
To: guix-patches@HIDDEN
Subject: [PATCH v4 1/6] system: /etc/profile: Group profile sourcing.
Date: Fri,  4 Apr 2025 11:22:58 +0800
Message-ID: <dc76edab52aa70a440049899d838d2cae44aca4d.1743736516.git.hako@HIDDEN>
In-Reply-To: <cover.1743736516.git.hako@HIDDEN>
References: <cover.1743736516.git.hako@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2a01:4f8:10b:392::42;
 envelope-from=hako@HIDDEN; helo=mx.boiledscript.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: Hilton Chain <hako@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

* gnu/system.scm (operating-system-etc-service)[profile]: Group sourcing of
all default profiles.
Order Guix Home search paths before the default user profile.
Rename iteration variable to GUIX_PROFILE.

Change-Id: I18eac738a5dfade84da2effdd6211119c6fdd96f
---
 gnu/system.scm | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 0d98e5a036..c166222854 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1074,10 +1074,6 @@ (define* (operating-system-etc-service os)
 # Ignore the default value of 'PATH'.
 unset PATH
 
-# Load the system profile's settings.
-GUIX_PROFILE=/run/current-system/profile ; \\
-. /run/current-system/profile/etc/profile
-
 # Since 'lshd' does not use pam_env, /etc/environment must be explicitly
 # loaded when someone logs in via SSH.  See <http://bugs.gnu.org/22175>.
 # We need 'PATH' to be defined here, for 'cat' and 'cut'.  Do this before
@@ -1086,24 +1082,22 @@ (define* (operating-system-etc-service os)
      -a -z \"$LINUX_MODULE_DIRECTORY\" ]
 then
   . /etc/environment
-  export `cat /etc/environment | cut -d= -f1`
+  export `/run/current-system/profile/bin/cut -d= -f1 < /etc/environment`
 fi
 
-# Arrange so that ~/.config/guix/current comes first,
-# and guix-home comes before guix-profile.
-for profile in \"$HOME/.guix-profile\"        \\
-               \"$HOME/.guix-home/profile\"   \\
-               \"$HOME/.config/guix/current\"
+# Set up environment for all default profiles.
+for GUIX_PROFILE in \"/run/current-system/profile\" \\
+                    \"$HOME/.guix-home/profile\"   \\
+                    \"$HOME/.guix-profile\"        \\
+                    \"$HOME/.config/guix/current\"
 do
-  if [ -f \"$profile/etc/profile\" ]
+  if [ -f \"$GUIX_PROFILE/etc/profile\" ]
   then
-    # Load the user profile's settings.
-    GUIX_PROFILE=\"$profile\" ; \\
-    . \"$profile/etc/profile\"
+    . \"$GUIX_PROFILE/etc/profile\"
   else
     # At least define this one so that basic things just work
     # when the user installs their first package.
-    export PATH=\"$profile/bin:$PATH\"
+    export PATH=\"$GUIX_PROFILE/bin:$PATH\"
   fi
 done
 
-- 
2.49.0





Acknowledgement sent to Hilton Chain <hako@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#77523; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 4 Apr 2025 03:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.