autoconf-patches
[Top][All Lists]
Advanced

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

catching write errors to stdout for --help and --version


From: Paul Eggert
Subject: catching write errors to stdout for --help and --version
Date: Wed, 02 Feb 2005 15:32:28 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

I installed this:

2005-02-02  Paul Eggert  <address@hidden>

        * bin/autoconf.as: Don't exit with status 0 after write failure
        with --help or --version.
        * lib/autoconf/general.m4 (_AC_INIT_HELP, _AC_INIT_VERSION): Likewise.
        * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Likewise.

Index: bin/autoconf.as
===================================================================
RCS file: /cvsroot/autoconf/autoconf/bin/autoconf.as,v
retrieving revision 1.11
diff -p -u -r1.11 autoconf.as
--- bin/autoconf.as     3 Jan 2005 07:38:01 -0000       1.11
+++ bin/autoconf.as     2 Feb 2005 23:27:06 -0000
@@ -1,6 +1,6 @@
 AS_INIT[]dnl                                            -*- shell-script -*-
 # autoconf -- create `configure' using m4 macros
-# Copyright (C) 1992, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2003, 2004
+# Copyright (C) 1992, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2003, 2004, 
2005
 # Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -91,9 +91,9 @@ while test $# -gt 0 ; do
               "x$1" : 'x-.\(.*\)'`]
   case $1 in
     --version | -V )
-       echo "$version" ; exit 0 ;;
+       echo "$version" ; exit ;;
     --help | -h )
-       echo "$usage"; exit 0 ;;
+       echo "$usage"; exit ;;
 
     --verbose | -v )
        verbose=echo
Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.840
diff -p -u -r1.840 general.m4
--- lib/autoconf/general.m4     5 Jan 2005 07:53:52 -0000       1.840
+++ lib/autoconf/general.m4     2 Feb 2005 23:27:07 -0000
@@ -355,7 +355,7 @@ m4_ifset([AC_PACKAGE_BUGREPORT],
 m4_define([_AC_INIT_COPYRIGHT],
 [AC_COPYRIGHT(
 [Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
-2003, 2004 Free Software Foundation, Inc.
+2003, 2004, 2005 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.],
              [VERSION_FSF])dnl
@@ -1045,6 +1045,7 @@ m4_divert_push([HELP_END])dnl
 m4_ifset([AC_PACKAGE_BUGREPORT], [
 Report bugs to <AC_PACKAGE_BUGREPORT>.])
 _ACEOF
+ac_status=$?
 fi
 
 if test "$ac_init_help" = "recursive"; then
@@ -1053,26 +1054,26 @@ if test "$ac_init_help" = "recursive"; t
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
     test -d $ac_dir || continue
     _AC_SRCDIRS(["$ac_dir"])
-    cd $ac_dir
+    cd $ac_dir || { ac_status=$?; continue; }
     # Check for guested configure; otherwise get Cygnus style configure.
     if test -f $ac_srcdir/configure.gnu; then
-      echo
+      echo &&
       $SHELL $ac_srcdir/configure.gnu  --help=recursive
     elif test -f $ac_srcdir/configure; then
-      echo
+      echo &&
       $SHELL $ac_srcdir/configure  --help=recursive
     elif test -f $ac_srcdir/configure.ac ||
           test -f $ac_srcdir/configure.in; then
-      echo
+      echo &&
       $ac_configure --help
     else
       AC_MSG_WARN([no configuration information is in $ac_dir])
-    fi
-    cd "$ac_popdir"
+    fi || ac_status=$?
+    cd "$ac_popdir" || { ac_status=$?; break; }
   done
 fi
 
-test -n "$ac_init_help" && exit 0
+test -n "$ac_init_help" && exit $ac_status
 m4_divert_pop([HELP_END])dnl
 ])# _AC_INIT_HELP
 
@@ -1092,7 +1093,7 @@ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACK
 generated by m4_PACKAGE_STRING])])
 m4_divert_text([VERSION_END],
 [_ACEOF
-  exit 0
+  exit
 fi])dnl
 ])# _AC_INIT_VERSION
 
Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.48
diff -p -u -r1.48 status.m4
--- lib/autoconf/status.m4      21 Dec 2004 14:24:01 -0000      1.48
+++ lib/autoconf/status.m4      2 Feb 2005 23:27:07 -0000
@@ -1,7 +1,7 @@
 # This file is part of Autoconf.                       -*- Autoconf -*-
 # Parameterizing and creating config.status.
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -1390,7 +1390,7 @@ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACK
 configured by $[0], generated by m4_PACKAGE_STRING,
   with options \\"`echo "$ac_configure_args" | sed 's/[[\\""\`\$]]/\\\\&/g'`\\"
 
-Copyright (C) 2004 Free Software Foundation, Inc.
+Copyright (C) 2005 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 srcdir=$srcdir
@@ -1431,13 +1431,13 @@ cat >>$CONFIG_STATUS <<\_ACEOF
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
   --version | --vers* | -V )
-    echo "$ac_cs_version"; exit 0 ;;
+    echo "$ac_cs_version"; exit ;;
   --he | --h)
     # Conflict between --help and --header
     AC_MSG_ERROR([ambiguous option: $[1]
 Try `$[0] --help' for more information.]);;
   --help | --hel | -h )
-    echo "$ac_cs_usage"; exit 0 ;;
+    echo "$ac_cs_usage"; exit ;;
   --debug | --d* | -d )
     debug=: ;;
   --file | --fil | --fi | --f )




reply via email to

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