unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#45600] [PATCH] /etc/profile.d/guix.sh: Add guix pull profile even when absent
@ 2021-01-01 17:53 Jakub Kądziołka
  2021-01-03 14:53 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kądziołka @ 2021-01-01 17:53 UTC (permalink / raw)
  To: 45600

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





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#45600] [PATCH] /etc/profile.d/guix.sh: Add guix pull profile even when absent
  2021-01-01 17:53 [bug#45600] [PATCH] /etc/profile.d/guix.sh: Add guix pull profile even when absent Jakub Kądziołka
@ 2021-01-03 14:53 ` Ludovic Courtès
  2021-01-03 15:06   ` Jakub Kądziołka
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2021-01-03 14:53 UTC (permalink / raw)
  To: Jakub Kądziołka; +Cc: 45600

Hi,

Jakub Kądziołka <kuba@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’.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [bug#45600] [PATCH] /etc/profile.d/guix.sh: Add guix pull profile even when absent
  2021-01-03 14:53 ` Ludovic Courtès
@ 2021-01-03 15:06   ` Jakub Kądziołka
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Kądziołka @ 2021-01-03 15:06 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 45600, 45600-done

On Sun Jan 3, 2021 at 3:53 PM CET, Ludovic Courtès wrote:
> Hi,
>
> Jakub Kądziołka <kuba@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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-03 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-01 17:53 [bug#45600] [PATCH] /etc/profile.d/guix.sh: Add guix pull profile even when absent Jakub Kądziołka
2021-01-03 14:53 ` Ludovic Courtès
2021-01-03 15:06   ` Jakub Kądziołka

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).