Subject: bug#60778: closed (Re: bug#60778: [PATCH] guix-install.sh: Source both profiles, default user's and home.)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 09 Apr 2023 07:09:01 +0000

Your bug report

#60778: [PATCH] guix-install.sh: Source both profiles, default user's and home.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
60778: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60778
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#60778: [PATCH] guix-install.sh: Source both profiles, default user's and home.
From: Andrew Tropin <[email-masked]>
To: Ludovic Courtès <[email-masked]>
Cc: [email-masked]
Date: Sun, 09 Apr 2023 11:07:41 +0400
List-Id: <debbugs-submit.debbugs.gnu.org>

On 2023-04-07 17:24, Ludovic Courtès wrote:

> Hi,
>
> Andrew Tropin <[email-masked]> skribis:
>
>> * etc/guix-install.sh (sys_create_init_profile): Source both profiles, default
>> user's and home.
>
> [...]
>
>> +[ -L $GUIX_PROFILE ] || \
>
> [...]
>
>> +[ -L $GUIX_PROFILE ] || \
>
> This should be enclosed in double quotes.
>
> Otherwise LGTM, thanks!
>
> Ludo’.

Thank you for the review, adjusted, applied and pushed as
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=02033bfc05

-- 
Best regards,
Andrew Tropin

Subject: [PATCH] guix-install.sh: Source both profiles, default user's and home.
From: Andrew Tropin <[email-masked]>
To: [email-masked]
Date: Fri, 13 Jan 2023 14:09:02 +0400
List-Id: <debbugs-submit.debbugs.gnu.org>

* etc/guix-install.sh (sys_create_init_profile): Source both profiles, default
user's and home.
---
Sourced both profiles and both added to GUIX_LOCPATH if they exist.

return outside of the function AFAIK doesn't make sense, removed it.

In some future we could make a dummy locale-consumer package, which will make
$GUIX_PROFILE/etc/profile export GUIX_LOCPATH, so special treatment in this
script won't be needed anymore.

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

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index 3ce9affc06..79f5be66b1 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -11,6 +11,7 @@
 # Copyright © 2021 Chris Marusich <[email-masked]>
 # Copyright © 2021, 2022 Maxim Cournoyer <[email-masked]>
 # Copyright © 2022 Prafulla Giri <[email-masked]>
+# Copyright © 2023 Andrew Tropin <[email-masked]>
 #
 # This file is part of GNU Guix.
 #
@@ -534,15 +535,19 @@ export PATH="$_GUIX_PROFILE/bin${PATH:+:}$PATH"
 # searches 'Info-default-directory-list'.
 export INFOPATH="$_GUIX_PROFILE/share/info:$INFOPATH"

-# GUIX_PROFILE: User's default profile
-# Prefer the one from 'guix home' if it exists.
+# GUIX_PROFILE: User's default profile and home profile
+GUIX_PROFILE="$HOME/.guix-profile"
+[ -f "$GUIX_PROFILE/etc/profile" ] && . "$GUIX_PROFILE/etc/profile"
+[ -L $GUIX_PROFILE ] || \
+GUIX_LOCPATH="$GUIX_PROFILE/lib/locale:${GUIX_LOCPATH:+:}$GUIX_LOCPATH"
+
 GUIX_PROFILE="$HOME/.guix-home/profile"
-[ -L $GUIX_PROFILE ] || GUIX_PROFILE="$HOME/.guix-profile"
-[ -L $GUIX_PROFILE ] || return
-GUIX_LOCPATH="$GUIX_PROFILE/lib/locale"
+[ -f "$GUIX_PROFILE/etc/profile" ] && . "$GUIX_PROFILE/etc/profile"
+[ -L $GUIX_PROFILE ] || \
+GUIX_LOCPATH="$GUIX_PROFILE/lib/locale:${GUIX_LOCPATH:+:}$GUIX_LOCPATH"
+
 export GUIX_LOCPATH

-[ -f "$GUIX_PROFILE/etc/profile" ] && . "$GUIX_PROFILE/etc/profile"
 EOF
 }

-- 
2.38.1