]> Savannah Git Hosting - gnulib.git/commitdiff
bootstrap: print more diagnostics for missing programs
authorPádraig Brady <P@draigBrady.com>
Thu, 23 Oct 2014 12:59:08 +0000 (13:59 +0100)
committerPádraig Brady <P@draigBrady.com>
Thu, 23 Oct 2014 15:00:58 +0000 (16:00 +0100)
* 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

ChangeLog
build-aux/bootstrap

index 8b98a79575a72fc263cbbdf3a6ec69633daf8725..b03b571492700c6706245f58c77f657063a3a10d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-10-23  Pádraig Brady  <P@draigBrady.com>
+
+       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  <P@draigBrady.com>
 
        bootstrap: only update the gnulib submodule
index 5dbd1b14c068417f71f261434ececfc70b3c64d1..4f0493ad9a185a14f238b8a76778d89218a396c7 100755 (executable)
@@ -210,7 +210,17 @@ bootstrap_sync=false
 use_git=true
 
 check_exists() {
-  ($1 --version </dev/null) >/dev/null 2>&1
+  if test "$1" = "--verbose"; then
+    ($2 --version </dev/null) >/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)
+    fi
+  else
+    ($1 --version </dev/null) >/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