GNU bug report logs - #45600
[PATCH] /etc/profile.d/guix.sh: Add guix pull profile even when absent

Previous Next

Package: guix-patches;

Reported by: Jakub Kądziołka <kuba <at> kadziolka.net>

Date: Fri, 1 Jan 2021 17:55:01 UTC

Severity: normal

Tags: patch

Done: Jakub Kądziołka <kuba <at> kadziolka.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 45600 in the body.
You can then email your comments to 45600 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#45600; Package guix-patches. (Fri, 01 Jan 2021 17:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 01 Jan 2021 17:55:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: guix-patches <at> gnu.org
Subject: [PATCH] /etc/profile.d/guix.sh: Add guix pull profile even when absent
Date: Fri,  1 Jan 2021 18:53:47 +0100
After initial installation on a foreign distro, the guix pull profile
won't be present in path. This means that the first guix pull won't take
effect until the shell is restarted.

~/.guix-profile cannot be pre-loaded like this as the relevant paths are
stored in ~/.guix-profile/etc/profile, which simply won't exist.
However, guix package will output a relevant hint that instructs the
user to reload the profile, so this isn't a problem.
---

Note on testing: I have verified that non-existent directories are
harmless when included in $PATH and $INFOPATH. However, fully testing
this change requires setting up a virtual machine and installing Guix on
it, which I cannot do right now.

 etc/guix-install.sh | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index 9015f40bb6..69b8b88847 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -454,14 +454,12 @@ sys_create_init_profile()
     cat <<"EOF" > /etc/profile.d/guix.sh
 # _GUIX_PROFILE: `guix pull` profile
 _GUIX_PROFILE="$HOME/.config/guix/current"
-if [ -L $_GUIX_PROFILE ]; then
-  export PATH="$_GUIX_PROFILE/bin${PATH:+:}$PATH"
-  # Export INFOPATH so that the updated info pages can be found
-  # and read by both /usr/bin/info and/or $GUIX_PROFILE/bin/info
-  # When INFOPATH is unset, add a trailing colon so that Emacs
-  # searches 'Info-default-directory-list'.
-  export INFOPATH="$_GUIX_PROFILE/share/info:$INFOPATH"
-fi
+export PATH="$_GUIX_PROFILE/bin${PATH:+:}$PATH"
+# Export INFOPATH so that the updated info pages can be found
+# and read by both /usr/bin/info and/or $GUIX_PROFILE/bin/info
+# When INFOPATH is unset, add a trailing colon so that Emacs
+# searches 'Info-default-directory-list'.
+export INFOPATH="$_GUIX_PROFILE/share/info:$INFOPATH"
 
 # GUIX_PROFILE: User's default profile
 GUIX_PROFILE="$HOME/.guix-profile"
-- 
2.29.2





Information forwarded to guix-patches <at> gnu.org:
bug#45600; Package guix-patches. (Sun, 03 Jan 2021 14:54:01 GMT) Full text and rfc822 format available.

Message #8 received at 45600 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Jakub Kądziołka <kuba <at> kadziolka.net>
Cc: 45600 <at> debbugs.gnu.org
Subject: Re: [bug#45600] [PATCH] /etc/profile.d/guix.sh: Add guix pull
 profile even when absent
Date: Sun, 03 Jan 2021 15:53:46 +0100
Hi,

Jakub Kądziołka <kuba <at> kadziolka.net> skribis:

> After initial installation on a foreign distro, the guix pull profile
> won't be present in path. This means that the first guix pull won't take
> effect until the shell is restarted.
>
> ~/.guix-profile cannot be pre-loaded like this as the relevant paths are
> stored in ~/.guix-profile/etc/profile, which simply won't exist.
> However, guix package will output a relevant hint that instructs the
> user to reload the profile, so this isn't a problem.

LGTM!

Please add something like this to the commit log:

* etc/guix-install.sh (sys_create_init_profile): Set PATH and INFOPATH
even when $_GUIX_PROFILE does not exist.

Thank you,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#45600; Package guix-patches. (Sun, 03 Jan 2021 15:08:02 GMT) Full text and rfc822 format available.

Message #11 received at 45600 <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 45600 <at> debbugs.gnu.org, 45600-done <at> debbugs.gnu.org
Subject: Re: [bug#45600] [PATCH] /etc/profile.d/guix.sh: Add guix pull
 profile even when absent
Date: Sun, 03 Jan 2021 16:06:37 +0100
On Sun Jan 3, 2021 at 3:53 PM CET, Ludovic Courtès wrote:
> Hi,
>
> Jakub Kądziołka <kuba <at> kadziolka.net> skribis:
>
> > After initial installation on a foreign distro, the guix pull profile
> > won't be present in path. This means that the first guix pull won't take
> > effect until the shell is restarted.
> >
> > ~/.guix-profile cannot be pre-loaded like this as the relevant paths are
> > stored in ~/.guix-profile/etc/profile, which simply won't exist.
> > However, guix package will output a relevant hint that instructs the
> > user to reload the profile, so this isn't a problem.
>
> LGTM!
>
> Please add something like this to the commit log:
>
> * etc/guix-install.sh (sys_create_init_profile): Set PATH and INFOPATH
> even when $_GUIX_PROFILE does not exist.

Thanks, forgot about that...

Commit pushed.

Regards,
Jakub Kądziołka




Reply sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
You have taken responsibility. (Sun, 03 Jan 2021 15:08:02 GMT) Full text and rfc822 format available.

Notification sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
bug acknowledged by developer. (Sun, 03 Jan 2021 15:08:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 01 Feb 2021 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 77 days ago.

Previous Next


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