guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: guix-install.sh: Fix chk_require exiting without warning.


From: Ludovic Courtès
Subject: 03/03: guix-install.sh: Fix chk_require exiting without warning.
Date: Sat, 19 May 2018 16:51:46 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 593fe736674fadedd961c499e5758fa9c96a57aa
Author: Maxim Cournoyer <address@hidden>
Date:   Fri May 18 10:51:29 2018 -0400

    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.
    
    Signed-off-by: Ludovic Courtès <address@hidden>
---
 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 78cd758..d9f1955 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -86,9 +86,7 @@ chk_require()
     _debug "--- [ $FUNCNAME ] ---"
 
     for c in address@hidden; do
-        command -v "$c" &>/dev/null
-        [ "$?" -eq "1" ] &&
-            warn+=("$c")
+        command -v "$c" &>/dev/null || warn+=("$c")
     done
 
     [ "${#warn}" -ne 0 ] &&



reply via email to

[Prev in Thread] Current Thread [Next in Thread]