summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fw@deneb.enyo.de>2014-03-13 10:23:56 +0100
committerAustin Seipp <austin@well-typed.com>2014-03-22 19:39:42 -0500
commitd523f9b3d4ce3463e8816cad2139ea397e00f8d1 (patch)
tree4494819c0735a25c2522ddc2dd2ae72c621e1bc8
parentc99941cfeee033fca2df45e9523b65c83be20d31 (diff)
downloadhaskell-d523f9b3d4ce3463e8816cad2139ea397e00f8d1.tar.gz
sync-all: Skip END actions on exceptions
Before this change, the END actions were executed even if the code throws an exception using "die". This resulted in very confusing error reporting when an invalid command line option was specified. Signed-off-by: Austin Seipp <austin@well-typed.com>
-rwxr-xr-xsync-all7
1 files changed, 7 insertions, 0 deletions
diff --git a/sync-all b/sync-all
index 4b4b7a3f78..70c9639d1c 100755
--- a/sync-all
+++ b/sync-all
@@ -7,6 +7,7 @@ use English;
$| = 1; # autoflush stdout after each print, to avoid output after die
my $initial_working_directory;
+my $exit_via_die;
my $defaultrepo;
my @packages;
@@ -956,6 +957,11 @@ BEGIN {
}
$initial_working_directory = getcwd();
+ $SIG{__DIE__} = sub {
+ die @_ if $^S;
+ $exit_via_die = 1;
+ };
+
#message "== Checking for left-over testsuite/.git folder";
if (-d "testsuite/.git") {
print <<EOF;
@@ -974,6 +980,7 @@ EOF
}
END {
+ return if $exit_via_die;
my $ec = $?;
chdir($initial_working_directory);