X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=tests%2Ftstunt%2Fdpkg-parsechangelog;h=4d7cdf84fb3ad426e31ab755dfc3e5e69d3fe682;hp=2e0360da112c2793532d752ff1bfc6944d782490;hb=523f42f6ba9805aae8245af4f996581d6c7c51a3;hpb=cbe483c32df06d2babbcf99d7ee947c645e7aea3 diff --git a/tests/tstunt/dpkg-parsechangelog b/tests/tstunt/dpkg-parsechangelog index 2e0360da..4d7cdf84 100755 --- a/tests/tstunt/dpkg-parsechangelog +++ b/tests/tstunt/dpkg-parsechangelog @@ -14,10 +14,31 @@ # sys 0m0.012s # $ -die if @ARGV; +$SIG{__WARN__} = sub { die $_[0]; }; # no use of system, so we avoid #793471 + +my $infile = "debian/changelog"; + +my @orgargv = @ARGV; + +if (@ARGV && $ARGV[0] =~ s/^-l//) { + $infile = shift @ARGV; +} + +if (@ARGV) { + my $strip = $0; + $strip =~ s#/[^/]+$## or die "$0 ?"; + foreach my $k (qw(PATH PERLLIB)) { + my @opath = defined $ENV{$k} ? split /\:/, $ENV{$k} : (); + my @npath = grep { $_ ne $strip } @opath; + @npath != @opath or die "$0 $k ".($ENV{$k}//"(undef)")." ?"; + $ENV{$k} = join ':', @npath; + } + die if $ENV{'DGIT_NO_TSTUNT_CLPARSE'}++; + exec 'dpkg-parsechangelog', @orgargv; +} use strict; -open C, "debian/changelog" or die $!; +open C, $infile or die $!; $!=0; $_ = ; m/^(\S+) \(([^()]+)\) (\S+)\; urgency=(\S+)$/ or die "$!, $_ ?";