X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=tests%2Ftstunt%2Fdpkg-parsechangelog;h=6a9198abb21caccb7b0dc5f5e25fb901e9c08867;hp=f1e75a88fa14320ae047fbba03f8e83f8fa78769;hb=92e02c105c5b673502689ff4785ef54002b49a1b;hpb=417bcf4ea06b9e181c39734e121d9a32cf7cbb21 diff --git a/tests/tstunt/dpkg-parsechangelog b/tests/tstunt/dpkg-parsechangelog index f1e75a88..6a9198ab 100755 --- a/tests/tstunt/dpkg-parsechangelog +++ b/tests/tstunt/dpkg-parsechangelog @@ -18,11 +18,27 @@ $SIG{__WARN__} = sub { die $_[0]; }; # no use of system, so we avoid #793471 my $infile = "debian/changelog"; +#print STDERR ">@ARGV<\n"; + +my @orgargv = @ARGV; + if (@ARGV && $ARGV[0] =~ s/^-l//) { $infile = shift @ARGV; } -die if @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; + delete $ENV{$k} if !@npath; + } + die if $ENV{'DGIT_NO_TSTUNT_CLPARSE'}++; + exec 'dpkg-parsechangelog', @orgargv; +} use strict; open C, $infile or die $!; @@ -46,7 +62,8 @@ for (;;) { Maintainer: $1 Date: $2 END - last; + print "Timestamp: " or die $!; + exec qw(date +%s -d), $2; die $!; } elsif (m/^ --\s*$/) { last; } elsif (!m/\S/) {