summaryrefslogtreecommitdiff
path: root/Debian/Dgit.pm
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-07-25 16:30:09 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-07-25 17:56:42 +0100
commitd6be829bf56e699d27d388026d4af7ab710ba328 (patch)
treea4eb3ec080271e145d99200a43a3f5d3271e41bc /Debian/Dgit.pm
parent9141753fb5096b41074684d5bdfbb0c6f69a0c1a (diff)
Work around #793471 (madness with $SIG{__WARN__} and Perl's system builtin): move $SIG{} setting into setup_sigwarn in Dgit.pm, and check getppid.
We also need to fix up the expectation for an error message in one of the tests, where the message changes as a side effect.
Diffstat (limited to 'Debian/Dgit.pm')
-rw-r--r--Debian/Dgit.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm
index edb338c..d66b712 100644
--- a/Debian/Dgit.pm
+++ b/Debian/Dgit.pm
@@ -15,7 +15,8 @@ BEGIN {
$VERSION = 1.00;
@ISA = qw(Exporter);
- @EXPORT = qw(debiantag server_branch server_ref
+ @EXPORT = qw(setup_sigwarn
+ debiantag server_branch server_ref
stat_exists fail ensuredir waitstatusmsg failedcmd
cmdoutput cmdoutput_errok
git_rev_parse git_get_ref git_for_each_ref
@@ -48,6 +49,13 @@ sub FRESHREPO () { return 0x4; }
our $debugprefix;
our $debuglevel = 0;
+sub setup_sigwarn () {
+ our $sigwarn_mainprocess = $$;
+ $SIG{__WARN__} = sub {
+ die $_[0] unless getppid == $sigwarn_mainprocess;
+ };
+}
+
sub initdebug ($) {
($debugprefix) = @_;
open DEBUG, ">/dev/null" or die $!;