diff options
author | Florian Weimer <fw@deneb.enyo.de> | 2014-03-13 10:23:56 +0100 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-03-22 19:39:42 -0500 |
commit | d523f9b3d4ce3463e8816cad2139ea397e00f8d1 (patch) | |
tree | 4494819c0735a25c2522ddc2dd2ae72c621e1bc8 /sync-all | |
parent | c99941cfeee033fca2df45e9523b65c83be20d31 (diff) | |
download | haskell-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>
Diffstat (limited to 'sync-all')
-rwxr-xr-x | sync-all | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); |