summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Debian/Dgit.pm10
-rw-r--r--debian/changelog3
-rwxr-xr-xdgit4
-rwxr-xr-xinfra/dgit-repos-policy-debian5
-rwxr-xr-xinfra/dgit-repos-server6
-rwxr-xr-xtests/tests/trustingpolicy-replay2
6 files changed, 22 insertions, 8 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 $!;
diff --git a/debian/changelog b/debian/changelog
index 4a0765a..2e6e744 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -25,6 +25,9 @@ dgit (1.1) unstable; urgency=low
packages (!)
* --new is needed for read access to packages in NEW, too. Document
this, and make it work properly.
+ * Work around #793471 (madness with $SIG{__WARN__} and Perl's system
+ builtin): move $SIG{} setting into setup_sigwarn in Dgit.pm, and
+ check getppid.
--
diff --git a/dgit b/dgit
index 1e38908..9dadc8c 100755
--- a/dgit
+++ b/dgit
@@ -18,7 +18,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
-$SIG{__WARN__} = sub { die $_[0]; };
+
+use Debian::Dgit;
+setup_sigwarn();
use IO::Handle;
use Data::Dumper;
diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian
index b6310d9..fbf2d51 100755
--- a/infra/dgit-repos-policy-debian
+++ b/infra/dgit-repos-policy-debian
@@ -2,7 +2,9 @@
# dgit repos policy hook script for Debian
use strict;
-$SIG{__WARN__} = sub { die $_[0]; };
+
+use Debian::Dgit qw(:DEFAULT :policyflags);
+setup_sigwarn();
use POSIX;
use JSON;
@@ -11,7 +13,6 @@ use DBI;
use IPC::Open2;
use Data::Dumper;
-use Debian::Dgit qw(:DEFAULT :policyflags);
use Debian::Dgit::Policy::Debian;
initdebug('%');
diff --git a/infra/dgit-repos-server b/infra/dgit-repos-server
index 92f197b..9705a64 100755
--- a/infra/dgit-repos-server
+++ b/infra/dgit-repos-server
@@ -33,7 +33,9 @@
# (With --cron AUTH-SPEC is not used and may be the empty string.)
use strict;
-$SIG{__WARN__} = sub { die $_[0]; };
+
+use Debian::Dgit qw(:DEFAULT :policyflags);
+setup_sigwarn();
# DGIT-REPOS-DIR contains:
# git tree (or other object) lock (in acquisition order, outer first)
@@ -189,8 +191,6 @@ use Fcntl qw(:flock);
use File::Path qw(rmtree);
use File::Temp qw(tempfile);
-use Debian::Dgit qw(:DEFAULT :policyflags);
-
initdebug('');
our $func;
diff --git a/tests/tests/trustingpolicy-replay b/tests/tests/trustingpolicy-replay
index b779f64..517f98a 100755
--- a/tests/tests/trustingpolicy-replay
+++ b/tests/tests/trustingpolicy-replay
@@ -47,7 +47,7 @@ prepare-replay () {
t-commit "request with $delib that we will replay"
t-dgit build
- t-expect-push-fail E:'policy-hook.*No such file or directory' \
+ t-expect-push-fail 'system: No such file or directory' \
t-dgit push $delib
t-policy dgit-repos-policy-trusting