]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
admin/install-doc: error out if missing deps
authorKefu Chai <kchai@redhat.com>
Sun, 15 Mar 2020 02:40:16 +0000 (10:40 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 15 Mar 2020 02:56:10 +0000 (10:56 +0800)
we should not `set -e` at the very beginning of this script, which fails
the script if any dependency is missing without printing out error
messages.

in this change `set -e` is removed. and refactor the code to print the
error message.

Signed-off-by: Kefu Chai <kchai@redhat.com>
admin/build-doc

index 289a2a68871143c710ad31cb7a22444cf3344a7a..f74a7d5867336b3331806d558521496089071db2 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/sh
 
 cd "$(dirname "$0")"
 cd ..
@@ -32,12 +32,10 @@ elif command -v yum >/dev/null; then
     fi
 else
     for command in virtualenv doxygen ant ditaa cython; do
-       command -v "$command" > /dev/null;
-       ret_code=$?
-       if [ $ret_code -ne 0 ]; then
+        if ! command -v "$command" > /dev/null; then
             # add a space after old values
-           missing="${missing:+$missing }$command"
-       fi
+            missing="${missing:+$missing }$command"
+        fi
     done
     if [ -n "$missing" ]; then
        echo "$0: missing required command, please install them:" 1>&2