$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
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 $!;
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.
--
# 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;
# 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;
use IPC::Open2;
use Data::Dumper;
-use Debian::Dgit qw(:DEFAULT :policyflags);
use Debian::Dgit::Policy::Debian;
initdebug('%');
# (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)
use File::Path qw(rmtree);
use File::Temp qw(tempfile);
-use Debian::Dgit qw(:DEFAULT :policyflags);
-
initdebug('');
our $func;
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