# policy hook exit status bits
# see dgit-repos-server head comment for documentation
-# 1 is reserved in case something fails with `exit 1'
+# 1 is reserved in case something fails with `exit 1' and to spot
+# dynamic loader, runtime, etc., failures, which report 127 or 255
sub NOFFCHECK () { return 0x2; }
sub FRESHREPO () { return 0x4; }
-# 0x80 is reserved
sub debiantag ($) {
my ($v) = @_;
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";
}
my $sleepy=0;
-our $rcode = 127;
+my $rcode;
for (;;) {
poldb_setup(poldb_path($repos));
$poldbh->rollback;
}
-print STDERR $stderr;
-exit $rcode;
+print STDERR $stderr or die $!;
+flush STDERR or die $!;
+_exit $rcode;