summaryrefslogtreecommitdiff
path: root/Debian/Dgit/ExitStatus.pm
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2018-06-28 11:52:54 +0100
committerSean Whitton <spwhitton@spwhitton.name>2018-06-28 11:52:54 +0100
commit4613f20fafd20f738291b355aced2bb4798ca2b1 (patch)
treee7d9bf11336468eda8076d71240368608cffea0e /Debian/Dgit/ExitStatus.pm
parent36454d4896b806632a7b8b8f08e1b5ec16a1cc4e (diff)
parent152ccd540c3f7809d8235d0907eb0142aed792f4 (diff)
Merge tag 'debian/5.2' into wip/stretch-bpo
dgit release 5.2 for unstable (sid) [dgit] [dgit distro=debian] # gpg: Signature made Sun 24 Jun 2018 23:36:20 BST # gpg: using RSA key 559AE46C2D6B6D3265E7CBA1E3E3392348B50D39 # gpg: Can't check signature: No public key
Diffstat (limited to 'Debian/Dgit/ExitStatus.pm')
-rw-r--r--Debian/Dgit/ExitStatus.pm26
1 files changed, 26 insertions, 0 deletions
diff --git a/Debian/Dgit/ExitStatus.pm b/Debian/Dgit/ExitStatus.pm
new file mode 100644
index 0000000..b69d42d
--- /dev/null
+++ b/Debian/Dgit/ExitStatus.pm
@@ -0,0 +1,26 @@
+# -*- perl -*-
+
+package Debian::Dgit::ExitStatus;
+
+# To use this, at the top (before use strict, even):
+#
+# END { $? = $Debian::Dgit::ExitStatus::desired // -1; };
+# use Debian::Dgit::ExitStatus;
+#
+# and then replace every call to `exit' with `finish'.
+# Add a `finish 0' to the end of the program.
+
+BEGIN {
+ use Exporter;
+ @ISA = qw(Exporter);
+ @EXPORT = qw(finish $desired);
+}
+
+our $desired;
+
+sub finish ($) {
+ $desired = $_[0] // 0;
+ exit $desired;
+}
+
+1;