guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: guix-install.sh: Exit early if Guix is already installed.


From: guix-commits
Subject: 03/03: guix-install.sh: Exit early if Guix is already installed.
Date: Wed, 5 May 2021 11:06:39 -0400 (EDT)

apteryx pushed a commit to branch version-1.3.0
in repository guix.

commit 74009c4cf04be4872be7bf985b045b922d506be3
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Tue May 4 22:48:20 2021 -0400

    guix-install.sh: Exit early if Guix is already installed.
    
    * etc/guix-install.sh (sys_create_store): Move the check & exit before The
    Guix binary archive is unpacked.  Re-indent tar extraction command.
---
 etc/guix-install.sh | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index 9f7bd20..6a799fa 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -322,20 +322,18 @@ sys_create_store()
 
     _debug "--- [ ${FUNCNAME[0]} ] ---"
 
-    cd "$tmp_path"
-    tar --extract \
-        --file "$pkg" &&
-    _msg "${PAS}unpacked archive"
-
     if [[ -e "/var/guix" || -e "/gnu" ]]; then
         _err "${ERR}A previous Guix installation was found.  Refusing to 
overwrite."
         exit 1
-    else
-        _msg "${INF}Installing /var/guix and /gnu..."
-        mv "${tmp_path}/var/guix" /var/
-        mv "${tmp_path}/gnu" /
     fi
 
+    cd "$tmp_path"
+    tar --extract --file "$pkg" && _msg "${PAS}unpacked archive"
+
+    _msg "${INF}Installing /var/guix and /gnu..."
+    mv "${tmp_path}/var/guix" /var/
+    mv "${tmp_path}/gnu" /
+
     _msg "${INF}Linking the root user's profile"
     mkdir -p "~root/.config/guix"
     ln -sf /var/guix/profiles/per-user/root/current-guix \



reply via email to

[Prev in Thread] Current Thread [Next in Thread]