]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Trap on 0 is not executed when `exit' is called without argument.
authorAkim Demaille <akim@epita.fr>
Mon, 13 Mar 2000 17:28:06 +0000 (17:28 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 13 Mar 2000 17:28:06 +0000 (17:28 +0000)
* autoheader.sh (trap 1 2 13 15): s/exit/exit $?/.
* autoconf.sh: Likewise.
Remove translate_awk too.
* autoupdate.sh: Likewise.
Handle `--debug'.

ChangeLog
autoconf.in
autoconf.sh
autoheader.in
autoheader.sh
bin/autoconf.in
bin/autoheader.in

index 383c30cb8e080144b4213f3c6619d4b493a5e501..ef3bea6846b23bf4b92b0a2c146ae329be984afb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2000-03-13  Akim Demaille  <akim@epita.fr>
+
+       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  <akim@epita.fr>
 
        More uniform style is scripts.
index b9f0a0b0e5c4d236d42716ba22875bc24abd01d1..93712d4e41d48d4fa78b652732f1b5c5aaf5565d 100644 (file)
@@ -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 |
index b9f0a0b0e5c4d236d42716ba22875bc24abd01d1..93712d4e41d48d4fa78b652732f1b5c5aaf5565d 100644 (file)
@@ -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 |
index b6192d7fed3d561bfaf11337a47922d880bf103f..8a8bbe00b8e8ab555e08860ee2c7acd1b54d6a06 100644 (file)
@@ -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=
index b6192d7fed3d561bfaf11337a47922d880bf103f..8a8bbe00b8e8ab555e08860ee2c7acd1b54d6a06 100644 (file)
@@ -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=
index b9f0a0b0e5c4d236d42716ba22875bc24abd01d1..93712d4e41d48d4fa78b652732f1b5c5aaf5565d 100644 (file)
@@ -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 |
index b6192d7fed3d561bfaf11337a47922d880bf103f..8a8bbe00b8e8ab555e08860ee2c7acd1b54d6a06 100644 (file)
@@ -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=