From c75ba4bb378c38fb5c7f8def886b30e4039e3f01 Mon Sep 17 00:00:00 2001 From: Michiel Sikma Date: Sat, 22 Feb 2020 16:36:52 +0100 Subject: [PATCH] Turn e back on afterwards, and only echo the error message if the script actually exited prematurely --- autogen.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/autogen.sh b/autogen.sh index 719ed013b..a7238b6fe 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,16 +1,20 @@ #!/bin/sh -echo "Generating build information using aclocal, autoheader, automake and autoconf" -echo "This may take a while ..." - # If an error occurs, quit the script and inform the user. This ensures scripts # like ./build-macosx etc. don't continue on if Autotools isn't installed. function finish { - echo 'autogen.sh failed to complete: verify that GNU Autotools is installed on the system and try again' + if [ $success -eq 0 ]; then + echo 'autogen.sh failed to complete: verify that GNU Autotools is installed on the system and try again' + fi } + +success=0 trap finish EXIT set -e +echo "Generating build information using aclocal, autoheader, automake and autoconf" +echo "This may take a while ..." + # Regenerate configuration files. aclocal @@ -20,3 +24,7 @@ autoconf echo "Now you are ready to run ./configure." echo "You can also run ./configure --help for extra features to enable/disable." + +# Don't quit on errors again from here on out (for calling scripts). +set +e +success=1