Commit d523f9b3 authored by fw's avatar fw Committed by Austin Seipp

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: default avatarAustin Seipp <austin@well-typed.com>
parent c99941cf
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment