X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=tests%2Ftstunt%2Fdpkg-parsechangelog;h=6a9198abb21caccb7b0dc5f5e25fb901e9c08867;hp=ce2d66dcab3c32b26f3578da9c26df57cddcaad9;hb=HEAD;hpb=7d64947564587518ec007066ac76e0373cb79da8 diff --git a/tests/tstunt/dpkg-parsechangelog b/tests/tstunt/dpkg-parsechangelog index ce2d66dc..6a9198ab 100755 --- a/tests/tstunt/dpkg-parsechangelog +++ b/tests/tstunt/dpkg-parsechangelog @@ -18,6 +18,8 @@ $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//) { @@ -28,10 +30,11 @@ if (@ARGV) { my $strip = $0; $strip =~ s#/[^/]+$## or die "$0 ?"; foreach my $k (qw(PATH PERLLIB)) { - my @opath = split /\:/, $ENV{$k}; + my @opath = defined $ENV{$k} ? split /\:/, $ENV{$k} : (); my @npath = grep { $_ ne $strip } @opath; - @npath != @opath or die "$0 $k $ENV{$k} ?"; + @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; @@ -59,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/) {