diff mbox series

[bug#56050,v2,2/2] etc/guix-install.sh: Check for profile from 'guix home'.

Message ID 9e68ef3237150756a97d0e3eba94a6b08879eeca.1656899134.git.philip@philipmcgrath.com
State New
Headers show
Series etc/guix-install.sh: Initialize XDG base directories. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Philip McGrath July 4, 2022, 2:35 a.m. UTC
If "$HOME/.guix-home/profile" exists, use it for GUIX_PROFILE instead of
"$HOME/.guix-profile".

* etc/guix-install.sh (sys_create_init_profile): Check for 'guix home'
profile.
---
 etc/guix-install.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ludovic Courtès July 4, 2022, 9:13 a.m. UTC | #1
Philip McGrath <philip@philipmcgrath.com> skribis:

> If "$HOME/.guix-home/profile" exists, use it for GUIX_PROFILE instead of
> "$HOME/.guix-profile".
>
> * etc/guix-install.sh (sys_create_init_profile): Check for 'guix home'
> profile.

[...]

> +# Prefer the one from 'guix home' if it exists.
> +GUIX_PROFILE="$HOME/.guix-home/profile"
> +[ -L $GUIX_PROFILE ] || GUIX_PROFILE="$HOME/.guix-profile"

Likewise, we should escape dollar signs.

Ludo’.
Andrew Tropin July 12, 2022, 6:44 a.m. UTC | #2
On 2022-07-03 22:35, Philip McGrath wrote:

> If "$HOME/.guix-home/profile" exists, use it for GUIX_PROFILE instead of
> "$HOME/.guix-profile".
>
> * etc/guix-install.sh (sys_create_init_profile): Check for 'guix home'
> profile.
> ---
>  etc/guix-install.sh | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/etc/guix-install.sh b/etc/guix-install.sh
> index 62a33a55c4..300681e111 100755
> --- a/etc/guix-install.sh
> +++ b/etc/guix-install.sh
> @@ -524,7 +524,9 @@ export PATH="$_GUIX_PROFILE/bin${PATH:+:}$PATH"
>  export INFOPATH="$_GUIX_PROFILE/share/info:$INFOPATH"
>  
>  # GUIX_PROFILE: User's default profile
> -GUIX_PROFILE="$HOME/.guix-profile"
> +# Prefer the one from 'guix home' if it exists.
> +GUIX_PROFILE="$HOME/.guix-home/profile"
> +[ -L $GUIX_PROFILE ] || GUIX_PROFILE="$HOME/.guix-profile"
>  [ -L $GUIX_PROFILE ] || return
>  GUIX_LOCPATH="$GUIX_PROFILE/lib/locale"
>  export GUIX_LOCPATH

I think here we don't need to prefer one over another.  Let's just
repeat the process for both of them.  If home profile exists source it,
if user profile exists source it as well.
diff mbox series

Patch

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index 62a33a55c4..300681e111 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -524,7 +524,9 @@  export PATH="$_GUIX_PROFILE/bin${PATH:+:}$PATH"
 export INFOPATH="$_GUIX_PROFILE/share/info:$INFOPATH"
 
 # GUIX_PROFILE: User's default profile
-GUIX_PROFILE="$HOME/.guix-profile"
+# Prefer the one from 'guix home' if it exists.
+GUIX_PROFILE="$HOME/.guix-home/profile"
+[ -L $GUIX_PROFILE ] || GUIX_PROFILE="$HOME/.guix-profile"
 [ -L $GUIX_PROFILE ] || return
 GUIX_LOCPATH="$GUIX_PROFILE/lib/locale"
 export GUIX_LOCPATH