X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=autogen.sh;h=fd09398694568a1bf3c2f8b48c99b748849f3030;hb=33c6f2aff8cd4eb5c73f871dbf02319435300881;hp=5bd10be1f482c9944a6e76db5a4cd1162d997603;hpb=25c93758d6b1136d268fe3fcc1c4979c17463c0b;p=fs%2Flustre-release.git diff --git a/autogen.sh b/autogen.sh index 5bd10be..fd09398 100644 --- a/autogen.sh +++ b/autogen.sh @@ -2,9 +2,27 @@ # NOTE: Please avoid bashisms (bash specific syntax) in this script +# die a horrible death. All output goes to stderr. +# +die() +{ + echo "bootstrap failure: $*" + echo Aborting + exit 1 +} 1>&2 + +run_cmd() +{ + echo -n "Running $*" + eval "$@" || die "command exited with code $?" + echo +} + # install Lustre Git commit hooks by default - LU-2083 for HOOK in commit-msg prepare-commit-msg; do - [ -e .git/hooks/$HOOK ] || ln -sf ../../build/$HOOK .git/hooks/ + if [ -d .git/hooks -a ! -e .git/hooks/$HOOK ]; then + ln -sf ../../build/$HOOK .git/hooks/ + fi done echo "Checking for a complete tree..." @@ -13,13 +31,10 @@ OPTIONAL_DIRS="snmp portals" CONFIGURE_DIRS="libsysio lustre-iokit ldiskfs" for dir in $REQUIRED_DIRS ; do - if [ ! -d "$dir" ] ; then - cat >&2 <