diff mbox series

[bug#40601,7/7] guix-install.sh: Add missing variable quoting & curly-bracketing in guix_get_bin().

Message ID 20200531204257.18725-7-vincent.legoll@gmail.com
State Under Review
Delegated to: Christopher Baines
Headers show
Series [bug#40601,1/7] guix-install.sh: Remove "[[" bashisms in chk_init_sys(). | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Vincent Legoll May 31, 2020, 8:42 p.m. UTC
* etc/guix-install.sh (guix_get_bin)[dl_path]: Add missing variable quoting and
curly-bracketing, [_PROGRESS_OPT]: Likewise.
---
 etc/guix-install.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Christopher Baines Dec. 18, 2020, 11:37 a.m. UTC | #1
Vincent Legoll <vincent.legoll@gmail.com> writes:

> * etc/guix-install.sh (guix_get_bin)[dl_path]: Add missing variable quoting and
> curly-bracketing, [_PROGRESS_OPT]: Likewise.
> ---
>  etc/guix-install.sh | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/etc/guix-install.sh b/etc/guix-install.sh
> index 7d635c2c38..f0d4a38838 100755
> --- a/etc/guix-install.sh
> +++ b/etc/guix-install.sh
> @@ -239,7 +239,8 @@ guix_get_bin()
>  
>      wget --help | grep -q '\--show-progress' && \
>          _PROGRESS_OPT="-q --show-progress" || _PROGRESS_OPT=""
> -    wget $_PROGRESS_OPT -P "$dl_path" "${url}/${bin_ver}.tar.xz" "${url}/${bin_ver}.tar.xz.sig"
> +    wget "${_PROGRESS_OPT}" -P "${dl_path}" "${url}/${bin_ver}.tar.xz" \
> +        "${url}/${bin_ver}.tar.xz.sig"

I believe the variable quoting here will break the wget command in the
case where _PROGRESS_OPT="-q --show-progress"

  → wget "-q --show-progress" https://guix.gnu.org/
  wget: invalid option -- ' '
  wget: invalid option -- '-'
  wget: invalid option -- '-'
  wget: invalid option -- 's'
  Usage: wget [OPTION]... [URL]...

  Try `wget --help' for more options.

>      if [[ "$?" -eq 0 ]]; then
>         _msg "${PAS}download completed."
> @@ -248,7 +249,7 @@ guix_get_bin()
>          exit 1
>      fi
>  
> -    pushd $dl_path >/dev/null
> +    pushd "${dl_path}" >/dev/null
>      gpg --verify "${bin_ver}.tar.xz.sig" >/dev/null 2>&1
>      if [[ "$?" -eq 0 ]]; then
>          _msg "${PAS}Signature is valid."
diff mbox series

Patch

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index 7d635c2c38..f0d4a38838 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -239,7 +239,8 @@  guix_get_bin()
 
     wget --help | grep -q '\--show-progress' && \
         _PROGRESS_OPT="-q --show-progress" || _PROGRESS_OPT=""
-    wget $_PROGRESS_OPT -P "$dl_path" "${url}/${bin_ver}.tar.xz" "${url}/${bin_ver}.tar.xz.sig"
+    wget "${_PROGRESS_OPT}" -P "${dl_path}" "${url}/${bin_ver}.tar.xz" \
+        "${url}/${bin_ver}.tar.xz.sig"
 
     if [[ "$?" -eq 0 ]]; then
        _msg "${PAS}download completed."
@@ -248,7 +249,7 @@  guix_get_bin()
         exit 1
     fi
 
-    pushd $dl_path >/dev/null
+    pushd "${dl_path}" >/dev/null
     gpg --verify "${bin_ver}.tar.xz.sig" >/dev/null 2>&1
     if [[ "$?" -eq 0 ]]; then
         _msg "${PAS}Signature is valid."