> 
> > 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.
> 
> I have run `make check' man times under i686 linux with no failures.
> 
> Dave
> -- 
> J. David Anglin                                  [EMAIL PROTECTED]
> National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)
> 
> 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 in a defined state.
> 
> --- autoheader.sh.orig        Mon Aug  7 15:03:20 2000
> +++ autoheader.sh     Fri Aug 11 16:47:24 2000
> @@ -88,6 +88,7 @@
>  done
>  debug=false
>  localdir=.
> +status=0
>  tmp=
>  verbose=:
>  warning_all=false
> @@ -179,7 +180,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 +194,7 @@
>  } ||
>  {
>     echo "$me: cannot create a temporary directory in $TMPDIR" >&2
> -   exit 1;
> +   (exit 1); exit
>  }
>  
>  # Preach.
> @@ -216,7 +217,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 +230,7 @@
>    *) exec >&2
>       echo "$me: invalid number of arguments."
>       echo "$help"
> -     exit 1 ;;
> +     (exit 1); exit ;;
>  esac
>  
>  # Set up autoconf.
> @@ -248,7 +249,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 +271,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" ;;
> @@ -304,7 +306,6 @@
>  
>  # Check that all the symbols have a template.
>  $verbose $me: checking completeness of the template >&2
> -status=0
>  # Regexp for a white space.
>  w='[         ]'
>  if test -n "$syms"; then
> @@ -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 16:55:59 2000
> @@ -100,6 +100,7 @@
>  localdir=.
>  # m4dir -- local Autoconf extensions.  Typically `m4'.
>  m4dir=
> +status=0
>  # symlink -- when --install, use symlinks instead.
>  symlink=false
>  verbose=:
> @@ -240,7 +241,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 +255,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 +274,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 16:59:18 2000
> @@ -94,6 +94,7 @@
>  done
>  debug=false
>  localdir=.
> +status=0
>  tmp=
>  verbose=:
>  
> @@ -160,7 +161,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 +175,7 @@
>  } ||
>  {
>     echo "$me: cannot create a temporary directory in $TMPDIR" >&2
> -   exit 1;
> +   (exit 1); exit
>  }
>  
>  # Find the input files.
> @@ -260,7 +261,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 +335,7 @@
>    fi
>  done
>  
> -exit 0
> +(exit $status); 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
>  
> 


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

Reply via email to