summaryrefslogtreecommitdiff
path: root/infra/dgit-repos-policy-debian
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-05-17 14:13:25 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-05-31 11:54:14 +0100
commitae4dea507387c90a796e2a752a717f8bc5ed1dae (patch)
treedcd9dd9d104cf32907bdf8a042585f0782149a7a /infra/dgit-repos-policy-debian
parent7684f83e49bdc4d883e682abd922a7722cf996c4 (diff)
Infra: Exit statuses: work around bizarre behaviour of perl die wrt $?, and de-reserve policy hook status flag 0x80
Diffstat (limited to 'infra/dgit-repos-policy-debian')
-rwxr-xr-xinfra/dgit-repos-policy-debian9
1 files changed, 6 insertions, 3 deletions
diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian
index 6e0f0dc..06ad002 100755
--- a/infra/dgit-repos-policy-debian
+++ b/infra/dgit-repos-policy-debian
@@ -17,6 +17,8 @@ use Debian::Dgit::Policy::Debian;
initdebug('%');
enabledebuglevel $ENV{'DGIT_DRS_DEBUG'};
+END { $? = 127; } # deliberate exit uses _exit
+
our $distro = shift @ARGV // die "need DISTRO";
our $repos = shift @ARGV // die "need DGIT-REPOS-DIR";
our $dgitlive = shift @ARGV // die "need DGIT-LIVE-DIR";
@@ -434,7 +436,7 @@ if (!$fn) {
}
my $sleepy=0;
-our $rcode = 127;
+my $rcode;
for (;;) {
poldb_setup(poldb_path($repos));
@@ -453,5 +455,6 @@ for (;;) {
$poldbh->rollback;
}
-print STDERR $stderr;
-exit $rcode;
+print STDERR $stderr or die $!;
+flush STDERR or die $!;
+_exit $rcode;