all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 48233@debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: [bug#48233] [PATCH 3/3] guix-install.sh: Exit early if Guix is already installed.
Date: Wed,  5 May 2021 00:32:02 -0400	[thread overview]
Message-ID: <20210505043202.24636-3-maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <20210505043202.24636-1-maxim.cournoyer@gmail.com>

* 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 3d2936c873..f7ef0c2671 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -321,20 +321,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 \
-- 
2.31.1





  parent reply	other threads:[~2021-05-05  4:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05  4:10 [bug#48233] [PATCH 0/3] Modest improvements to the guix-install.sh script Maxim Cournoyer
2021-05-05  4:32 ` [bug#48233] [PATCH 1/3] guix-install.sh: Please the shellcheck linter Maxim Cournoyer
2021-05-05  4:32   ` [bug#48233] [PATCH 2/3] guix-install.sh: Propose automatically fetching OpenPGP keys Maxim Cournoyer
2021-05-05  4:32   ` Maxim Cournoyer [this message]
2021-05-05 10:50   ` [bug#48233] [PATCH 1/3] guix-install.sh: Please the shellcheck linter Julien Lepiller
2021-05-05 15:00     ` bug#48233: " Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210505043202.24636-3-maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=48233@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.