From: Pádraig Brady
Date: Thu, 23 Oct 2014 12:59:08 +0000 (+0100) Subject: bootstrap: print more diagnostics for missing programs X-Git-Tag: v1.0~7286 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=1bbbc2c04e265a3282947f0323ddae8fe3d2ec63;p=gnulib.git bootstrap: print more diagnostics for missing programs * build-aux/bootstrap: only suppress stderr when checking for alternative program names. This supports programs issuing non standard error messages like: "Provide an AUTOMAKE_VERSION environment variable, please" Reported by Ingo Schwarze with OpenBSD --- diff --git a/ChangeLog b/ChangeLog index 8b98a79575..b03b571492 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-10-23 Pádraig Brady
+ + bootstrap: print more diagnostics for missing programs + * build-aux/bootstrap: only suppress stderr when checking for + alternative program names. This supports programs issuing non + standard error messages. + 2014-10-23 Pádraig Brady
bootstrap: only update the gnulib submodule diff --git a/build-aux/bootstrap b/build-aux/bootstrap index 5dbd1b14c0..4f0493ad9a 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -210,7 +210,17 @@ bootstrap_sync=false use_git=true check_exists() { - ($1 --version /dev/null 2>&1 + if test "$1" = "--verbose"; then + ($2 --version /dev/null 2>&1 + if test $? -ge 126; then + # If not found, run with diagnostics as one may be + # presented with env variables to set to find the right version + ($2 --version /dev/null 2>&1 + fi + test $? -lt 126 } @@ -408,7 +418,7 @@ sort_ver() { # sort -V is not generally available get_version() { app=$1 - $app --version >/dev/null 2>&1 || return 1 + $app --version >/dev/null 2>&1 || { $app --version; return 1; } $app --version 2>&1 | sed -n '# Move version to start of line. @@ -467,7 +477,7 @@ check_versions() { if [ "$req_ver" = "-" ]; then # Merely require app to exist; not all prereq apps are well-behaved # so we have to rely on $? rather than get_version. - if ! check_exists $app; then + if ! check_exists --verbose $app; then warn_ "Error: '$app' not found" ret=1 fi