From: Akim Demaille Date: Mon, 13 Mar 2000 17:28:06 +0000 (+0000) Subject: Trap on 0 is not executed when `exit' is called without argument. X-Git-Tag: autoconf-2.50~1060 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e6f17e1f2c87516b52575d320471591c618b18a;p=thirdparty%2Fautoconf.git Trap on 0 is not executed when `exit' is called without argument. * autoheader.sh (trap 1 2 13 15): s/exit/exit $?/. * autoconf.sh: Likewise. Remove translate_awk too. * autoupdate.sh: Likewise. Handle `--debug'. --- diff --git a/ChangeLog b/ChangeLog index 383c30cb8..ef3bea684 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2000-03-13 Akim Demaille + + Trap on 0 is not executed when `exit' is called without argument. + + * autoheader.sh (trap 1 2 13 15): s/exit/exit $?/. + * autoconf.sh: Likewise. + Remove translate_awk too. + * autoupdate.sh: Likewise. + Handle `--debug'. + 2000-03-13 Akim Demaille More uniform style is scripts. diff --git a/autoconf.in b/autoconf.in index b9f0a0b0e..93712d4e4 100644 --- a/autoconf.in +++ b/autoconf.in @@ -96,6 +96,8 @@ debug=false initialization=false localdir= outfile= +# Exit status. +status=0 # Tasks: # - trace # Trace the first arguments of some macros @@ -200,11 +202,13 @@ case $# in esac # Trap on 0 to stop playing with `rm'. -if $debug; then +$debug || +{ trap 'status=$? - rm -f $tmpin $tmpout $silent_m4 $trace_m4 && exit $status' 0 - trap exit 1 2 13 15 -fi + rm -f $tmpin $tmpout $silent_m4 $trace_m4 $translate_awk && + exit $status' 0 + trap 'exit $?' 1 2 13 15 +} if test z$infile = z-; then infile=$tmpin @@ -236,7 +240,6 @@ case $task in # alternation. pattern="A[CHM]_" - status=0 if grep "^[^#]*$pattern" $tmpout >/dev/null 2>&1; then echo "$me: undefined macros:" >&2 sed -n "s/^[^#]*\\($pattern[_A-Za-z0-9]*\\).*/\\1/p" $tmpout | diff --git a/autoconf.sh b/autoconf.sh index b9f0a0b0e..93712d4e4 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -96,6 +96,8 @@ debug=false initialization=false localdir= outfile= +# Exit status. +status=0 # Tasks: # - trace # Trace the first arguments of some macros @@ -200,11 +202,13 @@ case $# in esac # Trap on 0 to stop playing with `rm'. -if $debug; then +$debug || +{ trap 'status=$? - rm -f $tmpin $tmpout $silent_m4 $trace_m4 && exit $status' 0 - trap exit 1 2 13 15 -fi + rm -f $tmpin $tmpout $silent_m4 $trace_m4 $translate_awk && + exit $status' 0 + trap 'exit $?' 1 2 13 15 +} if test z$infile = z-; then infile=$tmpin @@ -236,7 +240,6 @@ case $task in # alternation. pattern="A[CHM]_" - status=0 if grep "^[^#]*$pattern" $tmpout >/dev/null 2>&1; then echo "$me: undefined macros:" >&2 sed -n "s/^[^#]*\\($pattern[_A-Za-z0-9]*\\).*/\\1/p" $tmpout | diff --git a/autoheader.in b/autoheader.in index b6192d7fe..8a8bbe00b 100644 --- a/autoheader.in +++ b/autoheader.in @@ -158,8 +158,11 @@ case $# in esac # Trap on 0 to stop playing with `rm'. -$debug || trap 'status=$?; rm -f $tmpbase* && exit $status' 0 -$debug || trap exit 1 2 13 15 +$debug || +{ + trap 'status=$?; rm -f $tmpbase* && exit $status' 0 + trap 'exit $?' 1 2 13 15 +} # Well, work now! config_h= diff --git a/autoheader.sh b/autoheader.sh index b6192d7fe..8a8bbe00b 100644 --- a/autoheader.sh +++ b/autoheader.sh @@ -158,8 +158,11 @@ case $# in esac # Trap on 0 to stop playing with `rm'. -$debug || trap 'status=$?; rm -f $tmpbase* && exit $status' 0 -$debug || trap exit 1 2 13 15 +$debug || +{ + trap 'status=$?; rm -f $tmpbase* && exit $status' 0 + trap 'exit $?' 1 2 13 15 +} # Well, work now! config_h= diff --git a/bin/autoconf.in b/bin/autoconf.in index b9f0a0b0e..93712d4e4 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -96,6 +96,8 @@ debug=false initialization=false localdir= outfile= +# Exit status. +status=0 # Tasks: # - trace # Trace the first arguments of some macros @@ -200,11 +202,13 @@ case $# in esac # Trap on 0 to stop playing with `rm'. -if $debug; then +$debug || +{ trap 'status=$? - rm -f $tmpin $tmpout $silent_m4 $trace_m4 && exit $status' 0 - trap exit 1 2 13 15 -fi + rm -f $tmpin $tmpout $silent_m4 $trace_m4 $translate_awk && + exit $status' 0 + trap 'exit $?' 1 2 13 15 +} if test z$infile = z-; then infile=$tmpin @@ -236,7 +240,6 @@ case $task in # alternation. pattern="A[CHM]_" - status=0 if grep "^[^#]*$pattern" $tmpout >/dev/null 2>&1; then echo "$me: undefined macros:" >&2 sed -n "s/^[^#]*\\($pattern[_A-Za-z0-9]*\\).*/\\1/p" $tmpout | diff --git a/bin/autoheader.in b/bin/autoheader.in index b6192d7fe..8a8bbe00b 100644 --- a/bin/autoheader.in +++ b/bin/autoheader.in @@ -158,8 +158,11 @@ case $# in esac # Trap on 0 to stop playing with `rm'. -$debug || trap 'status=$?; rm -f $tmpbase* && exit $status' 0 -$debug || trap exit 1 2 13 15 +$debug || +{ + trap 'status=$?; rm -f $tmpbase* && exit $status' 0 + trap 'exit $?' 1 2 13 15 +} # Well, work now! config_h=