From: Frank Lichtenheld Date: Mon, 3 Sep 2007 23:17:23 +0000 (+0200) Subject: newpkg_info: Fix handling of removed packages X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=4cb36e543bb889e040b1c95b6d697582e28eeec2;p=deb%2Fpackages.git newpkg_info: Fix handling of removed packages Don't waste time on calling read_entry_simple for removed packages. Also fix error detection for this call. The result is always defined (and an array reference), errors can be detected by checking whether the referenced array is empty. --- diff --git a/bin/newpkg_info b/bin/newpkg_info index e2f36ae..700a079 100755 --- a/bin/newpkg_info +++ b/bin/newpkg_info @@ -64,9 +64,13 @@ for (my $age = 0; $age < 7; $age++) { my %archives = map { $_ => 1 } qw( us security non-US ); foreach (sort keys %changes) { - my $entry = read_entry_simple( \%packages, $_, \%archives, $suite) - or die "Fatal Error: Can't find entry for package $_\n"; - shift @$entry; # remove virtual pkg info + my $entry = []; + if ($changes{$_} == 1) { + $entry = read_entry_simple( \%packages, $_, \%archives, $suite); + die "Fatal Error: Can't find entry for package $_\n" + unless @$entry; + shift @$entry; # remove virtual pkg info + } print CHANGES join(" ", $_, $age, @$entry)."\n"; print "Wrote entry: ".join(" ", $_, $age, @$entry)."\n"; }