diff options
| author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2021-05-04 22:48:20 -0400 |
|---|---|---|
| committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2021-05-05 11:01:07 -0400 |
| commit | 74009c4cf04be4872be7bf985b045b922d506be3 (patch) | |
| tree | f834b2c65ac543184b88cb60bccca50068a34b38 | |
| parent | 5b0ce3393b7f8853d3154ede930482446a7c0376 (diff) | |
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.
| -rwxr-xr-x | etc/guix-install.sh | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 9f7bd2038a6..6a799fa8235 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh | |||
| @@ -322,20 +322,18 @@ sys_create_store() | |||
| 322 | 322 | ||
| 323 | _debug "--- [ ${FUNCNAME[0]} ] ---" | 323 | _debug "--- [ ${FUNCNAME[0]} ] ---" |
| 324 | 324 | ||
| 325 | cd "$tmp_path" | ||
| 326 | tar --extract \ | ||
| 327 | --file "$pkg" && | ||
| 328 | _msg "${PAS}unpacked archive" | ||
| 329 | |||
| 330 | if [[ -e "/var/guix" || -e "/gnu" ]]; then | 325 | if [[ -e "/var/guix" || -e "/gnu" ]]; then |
| 331 | _err "${ERR}A previous Guix installation was found. Refusing to overwrite." | 326 | _err "${ERR}A previous Guix installation was found. Refusing to overwrite." |
| 332 | exit 1 | 327 | exit 1 |
| 333 | else | ||
| 334 | _msg "${INF}Installing /var/guix and /gnu..." | ||
| 335 | mv "${tmp_path}/var/guix" /var/ | ||
| 336 | mv "${tmp_path}/gnu" / | ||
| 337 | fi | 328 | fi |
| 338 | 329 | ||
| 330 | cd "$tmp_path" | ||
| 331 | tar --extract --file "$pkg" && _msg "${PAS}unpacked archive" | ||
| 332 | |||
| 333 | _msg "${INF}Installing /var/guix and /gnu..." | ||
| 334 | mv "${tmp_path}/var/guix" /var/ | ||
| 335 | mv "${tmp_path}/gnu" / | ||
| 336 | |||
| 339 | _msg "${INF}Linking the root user's profile" | 337 | _msg "${INF}Linking the root user's profile" |
| 340 | mkdir -p "~root/.config/guix" | 338 | mkdir -p "~root/.config/guix" |
| 341 | ln -sf /var/guix/profiles/per-user/root/current-guix \ | 339 | ln -sf /var/guix/profiles/per-user/root/current-guix \ |
