[PATCH] etc/guix-install.sh: Explicit shebang to use /usr/bin/env.

  • Open
  • quality assurance status badge
Details
2 participants
  • Janneke Nieuwenhuizen
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Maxim Cournoyer
Severity
normal
M
M
Maxim Cournoyer wrote 4 days ago
(address . guix-patches@gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
0e7da0b076ebc6a90ae1c8c2c760b89ad6dd1d5e.1734591473.git.maxim.cournoyer@gmail.com
Having an explicit shebang tells something useful: we depend on Bash. Tools
such as shellcheck make use of it. The original technical reason for avoiding
/usr/bin/env is no more (Guix System lacking it).

* etc/guix-install.sh: Adjust shebang. Remove conditional 'exec bash' further
block below.

Change-Id: I3c92a9e58fe11610dfbf74dbbd4b1ac8852abcf0
---
etc/guix-install.sh | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)

Toggle diff (48 lines)
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index f07b2741bb..481eb6f12a 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
# GNU Guix --- Functional package management for GNU
# Copyright © 2017 sharlatan <sharlatanus@gmail.com>
# Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
@@ -9,7 +9,7 @@
# Copyright © 2020 Daniel Brooks <db48x@db48x.net>
# Copyright © 2021 Jakub K?dzio?ka <kuba@kadziolka.net>
# Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
-# Copyright © 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+# Copyright © 2021, 2022, 2023, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
# Copyright © 2022 Prafulla Giri <prafulla.giri@protonmail.com>
# Copyright © 2023 Andrew Tropin <andrew@trop.in>
# Copyright © 2020 David A. Redick <david.a.redick@gmail.com>
@@ -31,10 +31,8 @@
#
# You should have received a copy of the GNU General Public License
# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
-
-# We require Bash but for portability we'd rather not use /bin/bash or
-# /usr/bin/env in the shebang, hence this hack.
-
+#
+#
# Environment variables
#
# GUIX_BINARY_FILE_NAME
@@ -50,11 +48,6 @@
# installation required the user to extract Guix packs under /gnu to
# satisfy its dependencies.
-if [ "x$BASH_VERSION" = "x" ]
-then
- exec bash "$0" "$@"
-fi
-
set -eo pipefail
[ "$UID" -eq 0 ] || { echo "This script must be run as root."; exit 1; }

base-commit: 17c0aa6192f6a90c227e92720f2d63240996d0d4
--
2.46.0
M
M
Maxim Cournoyer wrote 3 days ago
[PATCH 1/3] etc/teams.scm: Add etc/guix-install.sh to installer team scope.
(address . 74962@debbugs.gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
f7f432d7d1672c8934a4a3f50db4b858f1261f66.1734592672.git.maxim.cournoyer@gmail.com
* etc/teams.scm (installer) <#:scope>: Add "etc/guix-install.sh".

Change-Id: I351476c3150c25c8d403e9a4ff0a05c98b9d1821
---
etc/teams.scm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Toggle diff (27 lines)
diff --git a/etc/teams.scm b/etc/teams.scm
index 6b492f1d4b..fb6a30ed2f 100755
--- a/etc/teams.scm
+++ b/etc/teams.scm
@@ -10,7 +10,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2022-2024 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
-;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2022, 2023, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2022 Simon Tournier <zimon.toutoune@gmail.com>
;;;
;;; This file is part of GNU Guix.
@@ -523,7 +523,8 @@ (define-team translations
(define-team installer
(team 'installer
#:name "Installer script and system installer"
- #:scope (list (make-regexp* "^gnu/installer(\\.scm$|/)"))))
+ #:scope (list (make-regexp* "^gnu/installer(\\.scm$|/)")
+ "etc/guix-install.sh")))
(define-team home
(team 'home

base-commit: 17c0aa6192f6a90c227e92720f2d63240996d0d4
--
2.46.0
M
M
Maxim Cournoyer wrote 3 days ago
[PATCH 2/3] etc/guix-install.sh: Explicit shebang to use /usr/bin/env.
(address . 74962@debbugs.gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
a2297d9739113db7e5166b9ee3d8fdb1db8e2cf4.1734592672.git.maxim.cournoyer@gmail.com
Having an explicit shebang tells something useful: we depend on Bash. Tools
such as shellcheck make use of it. The original technical reason for avoiding
/usr/bin/env is no more (Guix System lacking it).

* etc/guix-install.sh: Adjust shebang. Remove conditional 'exec bash' further
block below.

Change-Id: I3c92a9e58fe11610dfbf74dbbd4b1ac8852abcf0
---
etc/guix-install.sh | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)

Toggle diff (46 lines)
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index f07b2741bb..481eb6f12a 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
# GNU Guix --- Functional package management for GNU
# Copyright © 2017 sharlatan <sharlatanus@gmail.com>
# Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
@@ -9,7 +9,7 @@
# Copyright © 2020 Daniel Brooks <db48x@db48x.net>
# Copyright © 2021 Jakub K?dzio?ka <kuba@kadziolka.net>
# Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
-# Copyright © 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+# Copyright © 2021, 2022, 2023, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
# Copyright © 2022 Prafulla Giri <prafulla.giri@protonmail.com>
# Copyright © 2023 Andrew Tropin <andrew@trop.in>
# Copyright © 2020 David A. Redick <david.a.redick@gmail.com>
@@ -31,10 +31,8 @@
#
# You should have received a copy of the GNU General Public License
# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
-
-# We require Bash but for portability we'd rather not use /bin/bash or
-# /usr/bin/env in the shebang, hence this hack.
-
+#
+#
# Environment variables
#
# GUIX_BINARY_FILE_NAME
@@ -50,11 +48,6 @@
# installation required the user to extract Guix packs under /gnu to
# satisfy its dependencies.
-if [ "x$BASH_VERSION" = "x" ]
-then
- exec bash "$0" "$@"
-fi
-
set -eo pipefail
[ "$UID" -eq 0 ] || { echo "This script must be run as root."; exit 1; }
--
2.46.0
M
M
Maxim Cournoyer wrote 3 days ago
[PATCH 3/3] etc/guix-install.sh: Fix quoting and other issues.
(address . 74962@debbugs.gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
6b04713cc24b58ab4bbf4ac4060e4d57f7c8e1b3.1734592672.git.maxim.cournoyer@gmail.com
This change fixes most issues reported by the 'shellcheck' command.

* etc/guix-install.sh (add_init_sys_require): Use -n instead of ! -z.
(sys_create_build_user): Quote variable expansion.
(sys_delete_build_user): Likewise.
(sys_create_shell_completion): Likewise.
(sys_delete_user_profiles): Likewise.
(main): Replace $@ with $* inside string.

Change-Id: Ia88509b461b3844f2dd5abf9fb21a5b2bbb8a1e1
---
etc/guix-install.sh | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

Toggle diff (72 lines)
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index 481eb6f12a..2ab443d97b 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -151,7 +151,7 @@ chk_require()
add_init_sys_require()
{ # Add the elements of FOO_INIT_SYS to REQUIRE
local init_require="${INIT_SYS}_REQUIRE[@]"
- if [[ ! -z "$init_require" ]]; then
+ if [[ -n "$init_require" ]]; then
# Have to add piecemeal because ${!foo[@]} performs direct array key
# expansion, not indirect plain array expansion.
for r in "${!init_require}"; do
@@ -427,12 +427,12 @@ sys_create_build_user()
for i in $(seq -w 1 10); do
if id "guixbuilder${i}" &>/dev/null; then
_msg "${INF}user is already in the system, reset"
- usermod -g guixbuild -G guixbuild${KVMGROUP} \
+ usermod -g guixbuild -G "guixbuild${KVMGROUP}" \
-d /var/empty -s "$(which nologin)" \
-c "Guix build user $i" \
"guixbuilder${i}";
else
- useradd -g guixbuild -G guixbuild${KVMGROUP} \
+ useradd -g guixbuild -G "guixbuild${KVMGROUP}" \
-d /var/empty -s "$(which nologin)" \
-c "Guix build user $i" --system \
"guixbuilder${i}";
@@ -445,7 +445,7 @@ sys_delete_build_user()
{
for i in $(seq -w 1 10); do
if id -u "guixbuilder${i}" &>/dev/null; then
- userdel -f guixbuilder${i}
+ userdel -f "guixbuilder${i}"
fi
done
@@ -681,7 +681,7 @@ sys_create_shell_completion()
{ # Just in case
for dir_shell in $bash_completion $zsh_completion $fish_completion; do
- [ -d "$dir_shell" ] || mkdir -p $dir_shell
+ [ -d "$dir_shell" ] || mkdir -p "$dir_shell"
done;
ln -sf ${var_guix}/etc/bash_completion.d/* "$bash_completion";
@@ -747,10 +747,10 @@ sys_delete_user_profiles()
rm -rf ~root/.cache/guix
_msg "${INF}removing .guix-profile, .cache/guix and .config/guix of all /home users"
- for user in `ls -1 /home`; do
- rm -f /home/$user/.guix-profile
- rm -rf /home/$user/.cache/guix
- rm -rf /home/$user/.config/guix
+ for user in /home/*; do
+ rm -f "/home/$user/.guix-profile"
+ rm -rf "/home/$user/.cache/guix"
+ rm -rf "/home/$user/.config/guix"
done
}
@@ -898,7 +898,7 @@ main()
if [ '--uninstall' = "${uninstall_flag}" ]; then
main_uninstall
else
- echo "unsupported parameters: $@"
+ echo "unsupported parameters: $*"
exit 1
fi
fi
--
2.46.0
M
M
Maxim Cournoyer wrote 3 days ago
[PATCH v3 2/5] etc/guix-install.sh: Explicit shebang to use /usr/bin/env.
(address . 74962@debbugs.gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
e7d212e0dc73512f576e47f1a97ebe74a003d251.1734594333.git.maxim.cournoyer@gmail.com
Having an explicit shebang tells something useful: we depend on Bash. Tools
such as shellcheck make use of it. The original technical reason for avoiding
/usr/bin/env is no more (Guix System lacking it).

* etc/guix-install.sh: Adjust shebang. Remove conditional 'exec bash' further
block below.

Change-Id: I3c92a9e58fe11610dfbf74dbbd4b1ac8852abcf0
---

(no changes since v1)

etc/guix-install.sh | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)

Toggle diff (46 lines)
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index f07b2741bb..481eb6f12a 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
# GNU Guix --- Functional package management for GNU
# Copyright © 2017 sharlatan <sharlatanus@gmail.com>
# Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
@@ -9,7 +9,7 @@
# Copyright © 2020 Daniel Brooks <db48x@db48x.net>
# Copyright © 2021 Jakub K?dzio?ka <kuba@kadziolka.net>
# Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
-# Copyright © 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+# Copyright © 2021, 2022, 2023, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
# Copyright © 2022 Prafulla Giri <prafulla.giri@protonmail.com>
# Copyright © 2023 Andrew Tropin <andrew@trop.in>
# Copyright © 2020 David A. Redick <david.a.redick@gmail.com>
@@ -31,10 +31,8 @@
#
# You should have received a copy of the GNU General Public License
# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
-
-# We require Bash but for portability we'd rather not use /bin/bash or
-# /usr/bin/env in the shebang, hence this hack.
-
+#
+#
# Environment variables
#
# GUIX_BINARY_FILE_NAME
@@ -50,11 +48,6 @@
# installation required the user to extract Guix packs under /gnu to
# satisfy its dependencies.
-if [ "x$BASH_VERSION" = "x" ]
-then
- exec bash "$0" "$@"
-fi
-
set -eo pipefail
[ "$UID" -eq 0 ] || { echo "This script must be run as root."; exit 1; }
--
2.46.0
M
M
Maxim Cournoyer wrote 3 days ago
[PATCH v3 3/5] etc/guix-install.sh: Fix quoting and other issues.
(address . 74962@debbugs.gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
093604124092d3b024127068cbbeff3f9aa62d76.1734594333.git.maxim.cournoyer@gmail.com
This change fixes most issues reported by the 'shellcheck' command.

* etc/guix-install.sh (add_init_sys_require): Use -n instead of ! -z.
(sys_create_build_user): Quote variable expansion.
(sys_delete_build_user): Likewise.
(sys_create_shell_completion): Likewise.
(sys_delete_user_profiles): Likewise.
(sys_delete_guix_daemon): Explicitly access first array item.
(sys_create_store): Update shellcheck code to ignore.
(SYSV_INIT_REQUIRE): Ignore unused warning.
(sys_customize_bashrc): Ignore warnings due to using variables inside a
literal.
(main): Replace $@ with $* inside string.

Change-Id: Ia88509b461b3844f2dd5abf9fb21a5b2bbb8a1e1
---

Changes in v3:
- Add comments to avoid remaining shellcheck warnings.

etc/guix-install.sh | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)

Toggle diff (109 lines)
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index 481eb6f12a..8d3d9d224b 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -77,6 +77,7 @@ REQUIRE=(
# Add variables using form FOO_INIT_REQUIRE when init system FOO dependencies
# should be checked.
+# shellcheck disable=SC2034 # the variable name is computed
SYSV_INIT_REQUIRE=(
"daemonize"
)
@@ -151,7 +152,7 @@ chk_require()
add_init_sys_require()
{ # Add the elements of FOO_INIT_SYS to REQUIRE
local init_require="${INIT_SYS}_REQUIRE[@]"
- if [[ ! -z "$init_require" ]]; then
+ if [[ -n "$init_require" ]]; then
# Have to add piecemeal because ${!foo[@]} performs direct array key
# expansion, not indirect plain array expansion.
for r in "${!init_require}"; do
@@ -390,7 +391,7 @@ sys_create_store()
~root/.config/guix/current
GUIX_PROFILE=~root/.config/guix/current
- # shellcheck disable=SC1090
+ # shellcheck disable=SC1091
source "${GUIX_PROFILE}/etc/profile"
_msg "${PAS}activated root profile at ${GUIX_PROFILE}"
}
@@ -427,12 +428,12 @@ sys_create_build_user()
for i in $(seq -w 1 10); do
if id "guixbuilder${i}" &>/dev/null; then
_msg "${INF}user is already in the system, reset"
- usermod -g guixbuild -G guixbuild${KVMGROUP} \
+ usermod -g guixbuild -G "guixbuild${KVMGROUP}" \
-d /var/empty -s "$(which nologin)" \
-c "Guix build user $i" \
"guixbuilder${i}";
else
- useradd -g guixbuild -G guixbuild${KVMGROUP} \
+ useradd -g guixbuild -G "guixbuild${KVMGROUP}" \
-d /var/empty -s "$(which nologin)" \
-c "Guix build user $i" --system \
"guixbuilder${i}";
@@ -445,7 +446,7 @@ sys_delete_build_user()
{
for i in $(seq -w 1 10); do
if id -u "guixbuilder${i}" &>/dev/null; then
- userdel -f guixbuilder${i}
+ userdel -f "guixbuilder${i}"
fi
done
@@ -551,7 +552,7 @@ sys_delete_guix_daemon()
local local_bin
local var_guix
- _debug "--- [ $FUNCNAME ] ---"
+ _debug "--- [ ${FUNCNAME[0]} ] ---"
info_path="/usr/local/share/info"
local_bin="/usr/local/bin"
@@ -681,7 +682,7 @@ sys_create_shell_completion()
{ # Just in case
for dir_shell in $bash_completion $zsh_completion $fish_completion; do
- [ -d "$dir_shell" ] || mkdir -p $dir_shell
+ [ -d "$dir_shell" ] || mkdir -p "$dir_shell"
done;
ln -sf ${var_guix}/etc/bash_completion.d/* "$bash_completion";
@@ -696,8 +697,10 @@ sys_customize_bashrc()
for bashrc in /home/*/.bashrc /root/.bashrc; do
test -f "$bashrc" || continue
+ # shellcheck disable=SC2016 # checking for literal $GUIX_ENVIRONMENT
grep -Fq '$GUIX_ENVIRONMENT' "$bashrc" && continue
cp "${bashrc}" "${bashrc}.bak"
+ # shellcheck disable=SC2016,SC2028 # that's also a string literal
echo '
# Automatically added by the Guix install script.
if [ -n "$GUIX_ENVIRONMENT" ]; then
@@ -747,10 +750,10 @@ sys_delete_user_profiles()
rm -rf ~root/.cache/guix
_msg "${INF}removing .guix-profile, .cache/guix and .config/guix of all /home users"
- for user in `ls -1 /home`; do
- rm -f /home/$user/.guix-profile
- rm -rf /home/$user/.cache/guix
- rm -rf /home/$user/.config/guix
+ for user in /home/*; do
+ rm -f "/home/$user/.guix-profile"
+ rm -rf "/home/$user/.cache/guix"
+ rm -rf "/home/$user/.config/guix"
done
}
@@ -898,7 +901,7 @@ main()
if [ '--uninstall' = "${uninstall_flag}" ]; then
main_uninstall
else
- echo "unsupported parameters: $@"
+ echo "unsupported parameters: $*"
exit 1
fi
fi
--
2.46.0
M
M
Maxim Cournoyer wrote 3 days ago
[PATCH v3 1/5] etc/teams.scm: Add etc/guix-install.sh to installer team scope.
(address . 74962@debbugs.gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
3d0ccfc5f28f48b0a4e513e4ebfd3018c85b4407.1734594333.git.maxim.cournoyer@gmail.com
* etc/teams.scm (installer) <#:scope>: Add "etc/guix-install.sh".

Change-Id: I351476c3150c25c8d403e9a4ff0a05c98b9d1821
---

(no changes since v2)

Changes in v2:
- New.

etc/teams.scm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Toggle diff (27 lines)
diff --git a/etc/teams.scm b/etc/teams.scm
index 6b492f1d4b..fb6a30ed2f 100755
--- a/etc/teams.scm
+++ b/etc/teams.scm
@@ -10,7 +10,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2022-2024 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
-;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2022, 2023, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2022 Simon Tournier <zimon.toutoune@gmail.com>
;;;
;;; This file is part of GNU Guix.
@@ -523,7 +523,8 @@ (define-team translations
(define-team installer
(team 'installer
#:name "Installer script and system installer"
- #:scope (list (make-regexp* "^gnu/installer(\\.scm$|/)"))))
+ #:scope (list (make-regexp* "^gnu/installer(\\.scm$|/)")
+ "etc/guix-install.sh")))
(define-team home
(team 'home

base-commit: 17c0aa6192f6a90c227e92720f2d63240996d0d4
--
2.46.0
M
M
Maxim Cournoyer wrote 3 days ago
[PATCH v3 4/5] etc/guix-install.sh: Remove 'which' commands from requirements.
(address . 74962@debbugs.gnu.org)
6d1f4ffaa70f4cfb3ed9e18b46fe3cedb44025f2.1734594333.git.maxim.cournoyer@gmail.com
* etc/guix-install.sh (REQUIRE): Remove "which". Add "nologin".
(sys_create_build_user): Use 'type' instead of 'which'.

Reported-by: Simon Josefsson <simon@josefsson.org>
Change-Id: I0675716bab3fc22d3289ee7af2cb0ab33a1cee71
---

Changes in v3:
- New.

etc/guix-install.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Toggle diff (30 lines)
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index 8d3d9d224b..fb22287cf4 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -58,7 +58,7 @@ REQUIRE=(
"wget"
"gpg"
"grep"
- "which"
+ "nologin"
"sed"
"sort"
"getent"
@@ -429,12 +429,12 @@ sys_create_build_user()
if id "guixbuilder${i}" &>/dev/null; then
_msg "${INF}user is already in the system, reset"
usermod -g guixbuild -G "guixbuild${KVMGROUP}" \
- -d /var/empty -s "$(which nologin)" \
+ -d /var/empty -s "$(type -P nologin)" \
-c "Guix build user $i" \
"guixbuilder${i}";
else
useradd -g guixbuild -G "guixbuild${KVMGROUP}" \
- -d /var/empty -s "$(which nologin)" \
+ -d /var/empty -s "$(type -P nologin)" \
-c "Guix build user $i" --system \
"guixbuilder${i}";
_msg "${PAS}user added <guixbuilder${i}>"
--
2.46.0
M
M
Maxim Cournoyer wrote 3 days ago
[PATCH v3 5/5] etc/guix-install.sh: Sort requirements.
(address . 74962@debbugs.gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
027645209ae74112b8b70749ab23042a26ad99d6.1734594333.git.maxim.cournoyer@gmail.com
* etc/guix-install.sh (REQUIRE): Sort.

Change-Id: I59c57da31cd3846cf21810d5978d7d32516e0868
---

Changes in v3:
- New

etc/guix-install.sh | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

Toggle diff (42 lines)
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index fb22287cf4..59d0d3820e 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -53,25 +53,25 @@ set -eo pipefail
[ "$UID" -eq 0 ] || { echo "This script must be run as root."; exit 1; }
REQUIRE=(
+ "chmod"
"dirname"
- "readlink"
- "wget"
+ "getent"
"gpg"
"grep"
+ "groupadd"
+ "groupdel"
+ "mktemp"
"nologin"
+ "readlink"
+ "rm"
"sed"
"sort"
- "getent"
- "mktemp"
- "rm"
- "chmod"
+ "tail"
+ "tr"
"uname"
- "groupadd"
- "groupdel"
"useradd"
"userdel"
- "tail"
- "tr"
+ "wget"
"xz"
)
--
2.46.0
J
J
Janneke Nieuwenhuizen wrote 3 days ago
Re: [bug#74962] [PATCH 2/3] etc/guix-install.sh: Explicit shebang to use /usr/bin/env.
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
87bjx8rsqg.fsf@gnu.org
Maxim Cournoyer writes:

Hi Maxim,

Toggle quote (10 lines)
> * etc/guix-install.sh: Adjust shebang. Remove conditional 'exec bash' further
> block below.
>
> Change-Id: I3c92a9e58fe11610dfbf74dbbd4b1ac8852abcf0
> ---
> etc/guix-install.sh | 15 ++++-----------
> 1 file changed, 4 insertions(+), 11 deletions(-)
>
> diff --git a/etc/guix-install.sh b/etc/guix-install.sh
> index f07b2741bb..481eb6f12a 100755
[..]
Toggle quote (6 lines)
> -if [ "x$BASH_VERSION" = "x" ]
> -then
> - exec bash "$0" "$@"
> -fi
> -

+1 for the shebang but I think we want to keep this for people running:
sh install.sh, eg on Debian where sh is dash?

Greetings,
Janneke

--
Janneke Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com| Avatar® https://AvatarAcademy.com
M
M
Maxim Cournoyer wrote 3 days ago
(name . Janneke Nieuwenhuizen)(address . janneke@gnu.org)
87bjx7ltyp.fsf@gmail.com
Hi,

Janneke Nieuwenhuizen <janneke@gnu.org> writes:

Toggle quote (24 lines)
> Maxim Cournoyer writes:
>
> Hi Maxim,
>
>> * etc/guix-install.sh: Adjust shebang. Remove conditional 'exec bash' further
>> block below.
>>
>> Change-Id: I3c92a9e58fe11610dfbf74dbbd4b1ac8852abcf0
>> ---
>> etc/guix-install.sh | 15 ++++-----------
>> 1 file changed, 4 insertions(+), 11 deletions(-)
>>
>> diff --git a/etc/guix-install.sh b/etc/guix-install.sh
>> index f07b2741bb..481eb6f12a 100755
> [..]
>> -if [ "x$BASH_VERSION" = "x" ]
>> -then
>> - exec bash "$0" "$@"
>> -fi
>> -
>
> +1 for the shebang but I think we want to keep this for people running:
> sh install.sh, eg on Debian where sh is dash?

Hm. Good point. I'll restore it in a v4, but I'll give it some time
before I do, so as to avoid sending yet another series in a short time.

--
Thanks,
Maxim
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 74962@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 74962
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch