From: Ralf Wildenhues Date: Mon, 18 Jan 2010 19:26:22 +0000 (+0100) Subject: config.status: consistent exit status with nonexistent config file input. X-Git-Tag: v2.66~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57b9bc399fd2ea4d8a320f7e044e9223ddb8528a;p=thirdparty%2Fautoconf.git config.status: consistent exit status with nonexistent config file input. * lib/autoconf/status.m4 (_AC_OUTPUT_MAIN_LOOP): Ensure we exit with status 1 rather than with that of 'false', for reproducibility. (AC_OUTPUT): Ensure to exit 1 in case of config.status failure. * tests/torture.at (Missing templates): Also test code path for $srcdir != '.'. Report by Tim Rice. --- diff --git a/ChangeLog b/ChangeLog index 1719deb9..eaee96bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2010-01-19 Ralf Wildenhues + + config.status: consistent exit status with nonexistent config file input. + * lib/autoconf/status.m4 (_AC_OUTPUT_MAIN_LOOP): Ensure we + exit with status 1 rather than with that of 'false', for + reproducibility. + (AC_OUTPUT): Ensure to exit 1 in case of config.status failure. + * tests/torture.at (Missing templates): Also test code path + for $srcdir != '.'. + Report by Tim Rice. + 2010-01-13 Eric Blake Fix previous example. diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4 index f74bd347..3fddc38b 100644 --- a/lib/autoconf/status.m4 +++ b/lib/autoconf/status.m4 @@ -1294,7 +1294,7 @@ if test "$no_create" != yes; then exec AS_MESSAGE_LOG_FD>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || AS_EXIT + $ac_cs_success || AS_EXIT([1]) fi dnl config.status should not do recursion. AC_PROVIDE_IFELSE([AC_CONFIG_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl @@ -1666,7 +1666,7 @@ do [[\\/$]]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - AC_MSG_ERROR([cannot find input file: `$ac_f']);; + AC_MSG_ERROR([cannot find input file: `$ac_f'], [1]);; esac case $ac_f in *\'*) ac_f=`AS_ECHO(["$ac_f"]) | sed "s/'/'\\\\\\\\''/g"`;; esac AS_VAR_APPEND([ac_file_inputs], [" '$ac_f'"]) diff --git a/tests/torture.at b/tests/torture.at index ceea62c5..82916947 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -370,6 +370,15 @@ AC_OUTPUT ]]) AT_CHECK_AUTOCONF +mkdir build +AT_CAPTURE_FILE([build/config.log])[]dnl +cd build +AT_CHECK([../configure], [1], [ignore], +[[config.status: error: cannot find input file: `nonexistent.in' +]]) +# Make sure that the output file doesn't exist +AT_CHECK([test -f nonexistent], 1) +cd .. AT_CHECK_CONFIGURE([], [1], [], [[config.status: error: cannot find input file: `nonexistent.in' ]])