From: Kefu Chai Date: Sun, 15 Mar 2020 02:40:16 +0000 (+0800) Subject: admin/install-doc: error out if missing deps X-Git-Tag: v16.0.0~20^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e88f8eeaf83e91069b672392bdc0d572fdf588e6;p=ceph.git admin/install-doc: error out if missing deps 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 --- diff --git a/admin/build-doc b/admin/build-doc index 289a2a688711..f74a7d586733 100755 --- a/admin/build-doc +++ b/admin/build-doc @@ -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