GNU bug report logs -
#77035
[PATCH 0/2] home: setup-environment: Avoid prepending duplicated PATH.
Previous Next
Full log
Message #11 received at 77035 <at> debbugs.gnu.org (full text, mbox):
This makes best effort to order /run/privileged/bin first.
* gnu/home/services.scm (environment-variables->setup-environment-script):
Avoid prepending duplicated PATH.
Change-Id: I580fbbf4786b56b903c1a4d6eb5fa92a70e331b4
---
gnu/home/services.scm | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index 85a43f80ca..9855e26d97 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -278,9 +278,21 @@ (define (environment-variables->setup-environment-script vars)
# NOTE: Set HOME_ENVIRONMENT before sourcing (home-shell-profile-service-type ensures
# ~/.profile does)
GUIX_PROFILE=\"$HOME_ENVIRONMENT/profile\"
+
+# Check if PATH for home profile was already set by /etc/profile.
+case $PATH in
+ *$GUIX_PROFILE/bin*) OLD_PATH=$PATH ;;
+esac
+
PROFILE_FILE=\"$GUIX_PROFILE/etc/profile\"
[ -f $PROFILE_FILE ] && . $PROFILE_FILE
+# Don't modify PATH if it was already set for home profile.
+# This ensures /run/privileged/bin to be ordered first.
+if [ -n \"$OLD_PATH\" ]; then
+ export PATH=$OLD_PATH
+fi
+
case $GUIX_LOCPATH in
*$GUIX_PROFILE/lib/locale*) ;;
*) export GUIX_LOCPATH=$GUIX_PROFILE/lib/locale:$GUIX_LOCPATH ;;
@@ -307,7 +319,7 @@ (define (environment-variables->setup-environment-script vars)
esac
# Keep the shell environment clean.
-unset GUIX_PROFILE PROFILE_FILE
+unset OLD_PATH GUIX_PROFILE PROFILE_FILE
" port)
(display
--
2.48.1
This bug report was last modified 72 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.