[PATCH] guix-install.sh: Run guix.sh script in /etc/profile.d last.

OpenSubmitted by Konrad Hinsen.
Details
2 participants
  • Konrad Hinsen
  • Ludovic Courtès
Owner
unassigned
Severity
normal
K
K
Konrad Hinsen wrote on 30 Dec 2021 09:39
(address . guix-patches@gnu.org)
m1lf02qyf0.fsf@fastmail.net
* etc/guix-install.sh: Rename /etc/profile.d/guix.sh to zzz-guix.sh.

This script refers to environment variables set by the host distribution.
They may be set in other scripts in /etc/profile.d, which must therefore
be run first.
Example: in Ubuntu 20.04, XDG_DATA_DIRS is set in
/etc/profile.d/xdg_dirs_desktop_session.sh
---
etc/guix-install.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index cd1a1c34c1..00a9fc5377 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -503,7 +503,7 @@ sys_create_init_profile()
 { # Define for better desktop integration
   # This will not take effect until the next shell or desktop session!
     [ -d "/etc/profile.d" ] || mkdir /etc/profile.d # Just in case
-    cat <<"EOF" > /etc/profile.d/guix.sh
+    cat <<"EOF" > /etc/profile.d/zzz-guix.sh
 # _GUIX_PROFILE: `guix pull` profile
 _GUIX_PROFILE="$HOME/.config/guix/current"
 export PATH="$_GUIX_PROFILE/bin${PATH:+:}$PATH"
-- 
2.34.0
L
L
Ludovic Courtès wrote on 14 Jan 09:27 +0100
(name . Konrad Hinsen)(address . konrad.hinsen@fastmail.net)(address . 52891@debbugs.gnu.org)
875yqm67tm.fsf@gnu.org
Hi Konrad,

Konrad Hinsen <konrad.hinsen@fastmail.net> skribis:

Toggle quote (8 lines)
> * etc/guix-install.sh: Rename /etc/profile.d/guix.sh to zzz-guix.sh.
>
> This script refers to environment variables set by the host distribution.
> They may be set in other scripts in /etc/profile.d, which must therefore
> be run first.
> Example: in Ubuntu 20.04, XDG_DATA_DIRS is set in
> /etc/profile.d/xdg_dirs_desktop_session.sh

[...]

Toggle quote (3 lines)
> - cat <<"EOF" > /etc/profile.d/guix.sh
> + cat <<"EOF" > /etc/profile.d/zzz-guix.sh

Does anybody have objections, such as distros where this would not work?

Otherwise let’s apply it in time for the upcoming release.

Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 14 Jan 09:27 +0100
control message for bug #53214
(address . control@debbugs.gnu.org)
874k6667t3.fsf@gnu.org
block 53214 by 52891
quit
?