> 
> > John, thanks for the patch.  Don't hesitate to send its siblings (that
> > of autoupdate, autoreconf, autoscan, autoheader and ifnames :) :) :)
> 
> Here is a patch for the siblings.  I also reverted the two `|| exit'
> commands in autoconf.sh to `|| { (exit 1); exit; }' because I had one
> test failure under hpux (Semantics 4).  However, the debug script was
> sucessfull.  I also couldn't get it to happen again run the script
> manually.  Possibly, `exit' doesn't always provide a defined exit to
> the exit trap or maybe the `rm' in the exit trap failed because one
> of the files in tmp was still busy.

Here is a revised patch which is a little cleaner.  There are no functional
changes.

Dave
-- 
J. David Anglin                                  [EMAIL PROTECTED]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

PS: 2.49a can rebuild configure in fileutils without my having to hack
aclocal.m4.  Yeah!

2000-08-11  J. David Anglin  <[EMAIL PROTECTED]>

        * autoheader.sh: Fix trap (EXIT) status.
        autoreconf.sh: Likewise.
        autoupdate.sh: Likewise.
        autoconf.sh: Change `exit' to `{ (exit 1); exit; }' after m4 and
        awk commands to ensure exit state is defined.

--- autoheader.sh.orig  Mon Aug  7 15:03:20 2000
+++ autoheader.sh       Fri Aug 11 19:53:17 2000
@@ -179,7 +179,7 @@
 $debug ||
 {
   trap 'status=$?; rm -rf $tmp && exit $status' 0
-  trap 'exit $?' 1 2 13 15
+  trap '(exit $?); exit' 1 2 13 15
 }
 
 # Create a (secure) tmp directory for tmp files.
@@ -193,7 +193,7 @@
 } ||
 {
    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
-   exit 1;
+   (exit 1); exit
 }
 
 # Preach.
@@ -216,7 +216,7 @@
     More sophisticated templates can also be produced, see the
     documentation.
 EOF
-  $warning_error && exit 1
+  $warning_error && { (exit 1); exit; }
 fi
 
 acconfigs=
@@ -229,7 +229,7 @@
   *) exec >&2
      echo "$me: invalid number of arguments."
      echo "$help"
-     exit 1 ;;
+     (exit 1); exit ;;
 esac
 
 # Set up autoconf.
@@ -248,7 +248,7 @@
 $2"' \
   --trace AC_DEFINE:'syms="$$syms $1"' \
   --trace AC_DEFINE_UNQUOTED:'syms="$$syms $1"' \
-  $infile >$tmp/traces.sh || exit 1
+  $infile >$tmp/traces.sh || { (exit 1); exit; }
 
 $verbose $me: sourcing $tmp/traces.sh >&2
 . $tmp/traces.sh
@@ -270,7 +270,8 @@
 config_h=`echo "$config_h" | sed -e 's/ .*//'`
 # Support "outfile[:infile]", defaulting infile="outfile.in".
 case "$config_h" in
-"") echo "$me: error: AC_CONFIG_HEADERS not found in $infile" >&2; exit 1 ;;
+"") echo "$me: error: AC_CONFIG_HEADERS not found in $infile" >&2
+    (exit 1); exit ;;
 *:*) config_h_in=`echo "$config_h" | sed 's/.*://'`
      config_h=`echo "$config_h" | sed 's/:.*//'` ;;
 *) config_h_in="$config_h.in" ;;
@@ -335,4 +336,4 @@
   fi
 fi
 
-exit $status
+(exit $status); exit
--- autoreconf.sh.orig  Wed Aug  9 13:06:15 2000
+++ autoreconf.sh       Fri Aug 11 19:55:17 2000
@@ -240,7 +240,7 @@
 $debug ||
 {
   trap 'status=$?; rm -rf $tmp && exit $status' 0
-  trap 'exit $?' 1 2 13 15
+  trap '(exit $?); exit' 1 2 13 15
 }
 
 # Create a (secure) tmp directory for tmp files.
@@ -254,7 +254,7 @@
 } ||
 {
    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
-   exit 1;
+   (exit 1); exit
 }
 
 # When debugging, it is convenient that all the related temporary
@@ -273,7 +273,7 @@
 EOF
 
 # update.sh --
-# Exit 0 iff the first argument is not the most recent of all or is missing.
+# Exit 0 if the first argument is not the most recent of all or is missing.
 cat >$tmp/update.sh <<\EOF
 test -f "$1" || exit 0
 test x`ls -1dt "$@" 2>/dev/null | sed 1q` != x"$1"
--- autoupdate.sh.orig  Mon Aug  7 15:03:26 2000
+++ autoupdate.sh       Fri Aug 11 19:56:31 2000
@@ -160,7 +160,7 @@
 $debug ||
 {
   trap 'status=$?; rm -rf $tmp && exit $status' 0
-  trap 'exit $?' 1 2 13 15
+  trap '(exit $?); exit' 1 2 13 15
 }
 
 # Create a (secure) tmp directory for tmp files.
@@ -174,7 +174,7 @@
 } ||
 {
    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
-   exit 1;
+   (exit 1); exit
 }
 
 # Find the input files.
@@ -260,7 +260,7 @@
     cat >$file
   elif test ! -r "$file"; then
     echo "$me: $file: No such file or directory" >&2
-    exit 1
+    (exit 1); exit
   fi
 
   # input.m4 -- m4 program to produce the updated file.
@@ -334,7 +334,7 @@
   fi
 done
 
-exit 0
+(exit 0); exit
 
 # No shell is expected to read this, nevertheless, we still use a here
 # document so that `sh -n' succeeds.
--- autoconf.sh.orig    Fri Aug 11 12:47:47 2000
+++ autoconf.sh Fri Aug 11 18:11:17 2000
@@ -297,7 +297,8 @@
   ## --------------------------------- ##
   script)
   # M4 expansion.
-  $run_m4f -D_AC_WARNINGS=$_ac_warnings $infile >$tmp/configure || exit
+  $run_m4f -D_AC_WARNINGS=$_ac_warnings $infile >$tmp/configure ||
+    { (exit 1); exit; }
 
   # You can add your own prefixes to pattern if you want to check for
   # them too.
@@ -552,7 +553,8 @@
   do
     # The request may be several lines long, hence sed has to quit.
     trace_opt="$trace_opt -t "`echo "$trace" | sed -e 's/:.*//;q'`
-    echo "$trace" | $AWK -f $tmp/translate.awk >>$tmp/trace.m4 || exit
+    echo "$trace" | $AWK -f $tmp/translate.awk >>$tmp/trace.m4 ||
+      { (exit 1); exit; }
   done
   echo "divert(0)dnl" >>$tmp/trace.m4
 

Reply via email to