Subject: bug#31522: closed (Re: [bug#31522] [PATCH] guix-install.sh: Fix chk_require exiting without warning.)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 19 May 2018 20:48:02 +0000

Your bug report

#31522: [PATCH] guix-install.sh: Fix chk_require exiting without warning.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
31522: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31522
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#31522] [PATCH] guix-install.sh: Fix chk_require exiting without warning.
From: [email-masked] (Ludovic Courtès)
To: Maxim Cournoyer <[email-masked]>
Cc: [email-masked]
Date: Sat, 19 May 2018 22:47:18 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Maxim Cournoyer <[email-masked]> skribis:

> From 726d05a99529823d94c3fff1fa8619953e384b44 Mon Sep 17 00:00:00 2001
> From: Maxim Cournoyer <[email-masked]>
> Date: Fri, 18 May 2018 10:51:29 -0400
> Subject: [PATCH] guix-install.sh: Fix chk_require exiting without warning.
>
> * etc/guix-install.sh (chk_require): Because of the set -e option, Bash was
> exiting when the command `command -v "$c" &>/dev/null' was running on its
> own. Instead, we now test the command and accumulate warning messages in a
> single statement by chaining the command with a logical OR.

Applied, thanks!  :-)

Ludo'.

Subject: [PATCH] guix-install.sh: Fix chk_require exiting without warning.
From: Maxim Cournoyer <[email-masked]>
To: guix-patches <[email-masked]>
Date: Fri, 18 May 2018 17:29:19 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Attached is a patch to fix a problem in the detection of missing
programs in the guix-install.sh Bash script.

Maxim
From 726d05a99529823d94c3fff1fa8619953e384b44 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <[email-masked]>
Date: Fri, 18 May 2018 10:51:29 -0400
Subject: [PATCH] guix-install.sh: Fix chk_require exiting without warning.

* etc/guix-install.sh (chk_require): Because of the set -e option, Bash was
exiting when the command `command -v "$c" &>/dev/null' was running on its
own. Instead, we now test the command and accumulate warning messages in a
single statement by chaining the command with a logical OR.
---
 etc/guix-install.sh | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index 78cd7580b..d9f195509 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -86,9 +86,7 @@ chk_require()
     _debug "--- [ $FUNCNAME ] ---"
 
     for c in ${cmds[@]}; do
-        command -v "$c" &>/dev/null
-        [ "$?" -eq "1" ] &&
-            warn+=("$c")
+        command -v "$c" &>/dev/null || warn+=("$c")
     done
 
     [ "${#warn}" -ne 0 ] &&
-- 
2.17.0