summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorMaxim Cournoyer <[email protected]>2023-04-24 12:46:22 -0400
committerMaxim Cournoyer <[email protected]>2023-04-24 12:51:41 -0400
commite29571afc642dd4dd3388f742755f1675b3058e6 (patch)
tree5fef975520d3714c37b8606910df89fa27a29ca0 /etc
parent23f11afacdfe755ffa514a8cbf93ba1121b9db0d (diff)
guix-install.sh: Fix GUIX_ALLOW_OVERWRITE condition.
Before this change, the "Overwriting existing installation!" would be displayed erroneously. * etc/guix-install.sh (sys_create_store): Fix overwrite conditional.
Diffstat (limited to 'etc')
-rwxr-xr-xetc/guix-install.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index bbb4219965..e81da7ae71 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -9,7 +9,7 @@
# Copyright © 2020 Daniel Brooks <[email protected]>
# Copyright © 2021 Jakub Kądziołka <[email protected]>
# Copyright © 2021 Chris Marusich <[email protected]>
-# Copyright © 2021, 2022 Maxim Cournoyer <[email protected]>
+# Copyright © 2021, 2022, 2023 Maxim Cournoyer <[email protected]>
# Copyright © 2022 Prafulla Giri <[email protected]>
# Copyright © 2023 Andrew Tropin <[email protected]>
#
@@ -353,10 +353,12 @@ sys_create_store()
_debug "--- [ ${FUNCNAME[0]} ] ---"
- if [[ -z $GUIX_ALLOW_OVERWRITE && (-e /var/guix || -e /gnu) ]]; then
- die "A previous Guix installation was found. Refusing to overwrite."
- else
- _msg "${WAR}Overwriting existing installation!"
+ if [[ -e /var/guix && -e /gnu ]]; then
+ if [ -n "$GUIX_ALLOW_OVERWRITE" ]; then
+ _msg "${WAR}Overwriting existing installation!"
+ else
+ die "A previous Guix installation was found. Refusing to overwrite."
+ fi
fi
cd "$tmp_path"