autoconf-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Autoconf source repository branch, master, updated. v2.61a-294


From: Ralf Wildenhues
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.61a-294-g22000bf
Date: Fri, 16 Nov 2007 06:51:26 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=22000bf9f868f8bb2f5e24ee679913c49fab65d3

The branch, master has been updated
       via  22000bf9f868f8bb2f5e24ee679913c49fab65d3 (commit)
      from  c19717746bb8b43a61e5a472b4d1b898a6fb9d32 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 22000bf9f868f8bb2f5e24ee679913c49fab65d3
Author: Ralf Wildenhues <address@hidden>
Date:   Fri Nov 16 07:51:10 2007 +0100

    Diagnose write errors in config.status instantiations.
    
    * lib/autoconf/status.m4 (_AC_OUTPUT_FILE)
    (_AC_OUTPUT_HEADER, _AC_OUTPUT_MAIN_LOOP): Bail out
    on write errors.
    * tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
    Extend test to also check for some write error failures, using...
    <AT_CHECK_CONFIG_CREATION_NOWRITE>: ...this new macro.
    Report by Bruno Haible.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog              |    9 +++++++++
 lib/autoconf/status.m4 |   28 ++++++++++++++++++----------
 tests/torture.at       |   41 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 68 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ddfd871..627adbd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2007-11-16  Ralf Wildenhues  <address@hidden>
 
+       Diagnose write errors in config.status instantiations.
+       * lib/autoconf/status.m4 (_AC_OUTPUT_FILE)
+       (_AC_OUTPUT_HEADER, _AC_OUTPUT_MAIN_LOOP): Bail out
+       on write errors.
+       * tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
+       Extend test to also check for some write error failures, using...
+       <AT_CHECK_CONFIG_CREATION_NOWRITE>: ...this new macro.
+       Report by Bruno Haible.
+
        Indentation fixups.
        * lib/autotest/general.m4 (AT_INIT) <at_func_log_failure>: Fix
        indentation.
diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4
index 0d1d93e..4a617a6 100644
--- a/lib/autoconf/status.m4
+++ b/lib/autoconf/status.m4
@@ -636,7 +636,8 @@ m4_foreach([_AC_Var], [srcdir, abs_srcdir, top_srcdir, 
abs_top_srcdir,
 ])dnl
 m4_ifndef([AC_DATAROOTDIR_CHECKED], [$ac_datarootdir_hack
 ])dnl
-" $ac_file_inputs m4_defn([_AC_SUBST_CMDS]) >$tmp/out
+" $ac_file_inputs m4_defn([_AC_SUBST_CMDS]) >$tmp/out \
+  || AC_MSG_ERROR([could not create $ac_file])
 
 m4_ifndef([AC_DATAROOTDIR_CHECKED],
 [test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
@@ -648,9 +649,10 @@ which seems to be undefined.  Please make sure it is 
defined.])
 
   rm -f "$tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out"; rm -f "$tmp/out";;
-  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
-  esac
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" $ac_file;;
+  esac \
+  || AC_MSG_ERROR([could not create $ac_file])
 dnl This would break Makefile dependencies:
 dnl  if diff $ac_file "$tmp/out" >/dev/null 2>&1; then
 dnl    echo "$ac_file is unchanged"
@@ -838,17 +840,22 @@ m4_define([_AC_OUTPUT_HEADER],
   # CONFIG_HEADER
   #
   if test x"$ac_file" != x-; then
-    AS_ECHO(["/* $configure_input  */"]) >"$tmp/config.h"
-    $AWK -f "$tmp/defines.awk" $ac_file_inputs >>"$tmp/config.h"
+    {
+      AS_ECHO(["/* $configure_input  */"]) \
+      && $AWK -f "$tmp/defines.awk" $ac_file_inputs
+    } >"$tmp/config.h" \
+      || AC_MSG_ERROR([could not create $ac_file])
     if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
       AC_MSG_NOTICE([$ac_file is unchanged])
     else
       rm -f $ac_file
-      mv "$tmp/config.h" $ac_file
+      mv "$tmp/config.h" $ac_file \
+       || AC_MSG_ERROR([could not create $ac_file])
     fi
   else
-    AS_ECHO(["/* $configure_input  */"])
-    $AWK -f "$tmp/defines.awk" $ac_file_inputs
+    AS_ECHO(["/* $configure_input  */"]) \
+      && $AWK -f "$tmp/defines.awk" $ac_file_inputs \
+      || AC_MSG_ERROR([could not create -])
   fi
 dnl If running for Automake, be ready to perform additional
 dnl commands to set up the timestamp files.
@@ -1617,7 +1624,8 @@ do
     fi
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin";;
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || AC_MSG_ERROR([could not create $ac_file]) ;;
     esac
     ;;
   esac
diff --git a/tests/torture.at b/tests/torture.at
index 63d6ef9..a87a33b 100644
--- a/tests/torture.at
+++ b/tests/torture.at
@@ -193,6 +193,29 @@ AT_CHECK([grep OK var-$1], [], [OK
 ])# AT_CHECK_CONFIG_CREATION
 
 
+# AT_CHECK_CONFIG_CREATION_NOWRITE(THING = (header | link | file | command))
+# ------------------------------------------------------------------
+# Check that THING and var-THING (which uses variables in AC_CONFIG_THING)
+# are properly created, with the right content.
+# Use `grep OK' instead of a simple `cat' to avoid banners such as in
+# AC_CONFIG_HEADERS.
+m4_define([AT_CHECK_CONFIG_CREATION_NOWRITE],
+[AT_CHECK_CONFIGURE([what_to_test=$1])
+AT_CHECK([ls header var-header file var-file command var-command link var-link 
2>/dev/null],
+        [ignore], [$1
+])
+AT_CHECK([grep OK $1], [], [OK
+])
+
+AT_CHECK_CONFIGURE([what_to_test=var-$1 --no-create])
+# config.status might be stupidly expecting data on stdin, if it's
+# really broken...
+chmod a-w .
+AT_CHECK([./config.status var-$1 </dev/null], [1], [ignore], [ignore])
+chmod u+w .
+])# AT_CHECK_CONFIG_CREATION_NOWRITE
+
+
 # Create a file
 AT_CHECK_CONFIG_CREATION(file)
 
@@ -205,6 +228,24 @@ AT_CHECK_CONFIG_CREATION(command)
 # Create a link
 AT_CHECK_CONFIG_CREATION(link)
 
+# Now check for write errors
+
+# Create a file
+AT_CHECK_CONFIG_CREATION_NOWRITE(file)
+AT_CHECK([./config.status --file=-:input </dev/null >/dev/full],
+        [1], [ignore], [ignore])
+
+# Create a header
+AT_CHECK_CONFIG_CREATION_NOWRITE(header)
+AT_CHECK([./config.status --header=-:input </dev/null >/dev/full],
+        [1], [ignore], [ignore])
+
+# Execute a command
+AT_CHECK_CONFIG_CREATION_NOWRITE(command)
+
+# Create a link
+AT_CHECK_CONFIG_CREATION_NOWRITE(link)
+
 AT_CLEANUP
 
 


hooks/post-receive
--
GNU Autoconf source repository




reply via email to

[Prev in Thread] Current Thread [Next in Thread]