* [bug#39214] Updates to etc/guix-install.sh
@ 2020-01-21 7:11 Prafulla Giri
2020-01-26 22:19 ` bug#39214: " Ludovic Courtès
0 siblings, 1 reply; 2+ messages in thread
From: Prafulla Giri @ 2020-01-21 7:11 UTC (permalink / raw)
To: 39214
[-- Attachment #1.1: Type: text/plain, Size: 1067 bytes --]
Esteemed Maintainer,
Attached are two patches as a follow-up to
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=39049 that was just recently
applied to the main source tree.
Patch 1 exports the INFOPATH and makes the up-to-date guix info manual
available to the user via both /usr/bin/info and $GUIX_PROFILE/bin/info
(previously `info guix` would either show the out-of-date info file
installed during installation or throw a "No menu item 'guix' in node
'(dir)Top" error if the $GUIX_PROFILE/bin/info was invoked, or if the info
pages weren't installed during installation).
Patch 2 adds a defensive test against (highly unlikely) cases where
/etc/profile.d might not exist, and creates it. The function does not quit
on failure because it is possible that /etc/profile is still configured to
read /etc/profile.d/*.sh files. Even if it is not, guix.sh will merely sit
in /etc/profile.d and cause no changes to the user's environment.
These changes caused no regressions in my local machine.
I hope this helps more foreign distro users in their journey with Guix.
[-- Attachment #1.2: Type: text/html, Size: 1324 bytes --]
[-- Attachment #2: 0001-guix-install.sh-Export-INFOPATH-to-contain-updated-g.patch --]
[-- Type: text/x-patch, Size: 1403 bytes --]
From 0f98891feb2cc3cb4c529c65d789cdfc955cfc41 Mon Sep 17 00:00:00 2001
From: Prafulla Giri <pratheblackdiamond@gmail.com>
Date: Tue, 21 Jan 2020 12:25:24 +0545
Subject: [PATCH 1/2] guix-install.sh: Export INFOPATH to contain updated guix
info-pages
* etc/guix-install.sh (sys_create_init_profile): Export INFOPATH to include
the updated info-pages from ~/.config/guix/current/share/info. This also makes
sure that both /usr/bin/info and $GUIX_PROFILE/bin/info can read guix info pages
without throwing "no menu item 'guix' in node dir(Top)" error.
---
etc/guix-install.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index b57d71981f..ff97c78549 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -398,7 +398,12 @@ sys_create_init_profile()
cat <<"EOF" > /etc/profile.d/guix.sh
# _GUIX_PROFILE: `guix pull` profile
_GUIX_PROFILE="$HOME/.config/guix/current"
-[ -L $_GUIX_PROFILE ] && export PATH="$_GUIX_PROFILE/bin${PATH:+:}$PATH"
+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
+ export INFOPATH="$_GUIX_PROFILE/share/info${INFOPATH:+:}$INFOPATH"
+fi
# GUIX_PROFILE: User's default profile
GUIX_PROFILE="$HOME/.guix-profile"
--
2.25.0
[-- Attachment #3: 0002-guix-install.sh-Create-etc-profile.d-if-it-does-not-.patch --]
[-- Type: text/x-patch, Size: 1060 bytes --]
From dcd2180c36dc0319ebc3ab821879015e30bba94e Mon Sep 17 00:00:00 2001
From: Prafulla Giri <pratheblackdiamond@gmail.com>
Date: Tue, 21 Jan 2020 12:34:10 +0545
Subject: [PATCH 2/2] guix-install.sh: Create /etc/profile.d if it does not
exist
* etc/guix-install.sh (sys_create_init_profile): Add code to create
/etc/profile.d if it somehow does not exist; the function still carries
on because it is possible that /etc/profile is still configured to read
the *.sh files from /etc/profile.d, if they exist.
---
etc/guix-install.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index ff97c78549..0e677c2b90 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -395,6 +395,7 @@ sys_authorize_build_farms()
sys_create_init_profile()
{ # Create /etc/profile.d/guix.sh for better desktop integration
+ [ -d "/etc/profile.d" ] || mkdir /etc/profile.d # Just in case
cat <<"EOF" > /etc/profile.d/guix.sh
# _GUIX_PROFILE: `guix pull` profile
_GUIX_PROFILE="$HOME/.config/guix/current"
--
2.25.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* bug#39214: Updates to etc/guix-install.sh
2020-01-21 7:11 [bug#39214] Updates to etc/guix-install.sh Prafulla Giri
@ 2020-01-26 22:19 ` Ludovic Courtès
0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2020-01-26 22:19 UTC (permalink / raw)
To: Prafulla Giri; +Cc: 39214-done
Hello,
Prafulla Giri <pratheblackdiamond@gmail.com> skribis:
> From 0f98891feb2cc3cb4c529c65d789cdfc955cfc41 Mon Sep 17 00:00:00 2001
> From: Prafulla Giri <pratheblackdiamond@gmail.com>
> Date: Tue, 21 Jan 2020 12:25:24 +0545
> Subject: [PATCH 1/2] guix-install.sh: Export INFOPATH to contain updated guix
> info-pages
>
> * etc/guix-install.sh (sys_create_init_profile): Export INFOPATH to include
> the updated info-pages from ~/.config/guix/current/share/info. This also makes
> sure that both /usr/bin/info and $GUIX_PROFILE/bin/info can read guix info pages
> without throwing "no menu item 'guix' in node dir(Top)" error.
> From dcd2180c36dc0319ebc3ab821879015e30bba94e Mon Sep 17 00:00:00 2001
> From: Prafulla Giri <pratheblackdiamond@gmail.com>
> Date: Tue, 21 Jan 2020 12:34:10 +0545
> Subject: [PATCH 2/2] guix-install.sh: Create /etc/profile.d if it does not
> exist
>
> * etc/guix-install.sh (sys_create_init_profile): Add code to create
> /etc/profile.d if it somehow does not exist; the function still carries
> on because it is possible that /etc/profile is still configured to read
> the *.sh files from /etc/profile.d, if they exist.
Applied both, thank you!
Ludo’.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-26 22:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-21 7:11 [bug#39214] Updates to etc/guix-install.sh Prafulla Giri
2020-01-26 22:19 ` bug#39214: " Ludovic Courtès
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).