Explorar el Código

dpkg-scanpackages: Properly detect spurious overrides

The detection was being done too late as no overriden information is
kept if the packages is not on the archive.
Guillem Jover hace 17 años
padre
commit
8e3f26ad2d
Se han modificado 2 ficheros con 6 adiciones y 3 borrados
  1. 1 0
      debian/changelog
  2. 5 3
      scripts/dpkg-scanpackages.pl

+ 1 - 0
debian/changelog

@@ -3,6 +3,7 @@ dpkg (1.15.3) UNRELEASED; urgency=low
   [ Guillem Jover ]
   * Unset TAR_OPTIONS when extracting .deb archives. Closes: #530860
   * Use default compressor values in dpkg-source from Dpkg::Source::Compressor.
+  * Fix dpkg-scanpackages to properly detect spurious overrides.
 
   [ Raphael Hertzog ]
   * Unset TAR_OPTIONS when creating/extracting tar archives for source

+ 5 - 3
scripts/dpkg-scanpackages.pl

@@ -14,6 +14,7 @@ use Dpkg::Version qw(compare_versions);
 textdomain("dpkg-dev");
 
 my (@samemaint, @changedmaint);
+my @spuriousover;
 my %packages;
 my %overridden;
 
@@ -85,7 +86,10 @@ sub load_override
 
 	my ($p, $priority, $section, $maintainer) = split(/\s+/, $_, 4);
 
-	next unless defined($packages{$p});
+	if (not defined($packages{$p})) {
+	    push(@spuriousover, $p);
+	    next;
+	}
 
 	for my $package (@{$packages{$p}}) {
 	    if ($maintainer) {
@@ -268,8 +272,6 @@ for my $p (sort keys %packages) {
 }
 close(STDOUT) or syserr(_g("Couldn't close stdout"));
 
-my @spuriousover= grep(!defined($packages{$_}),sort keys %overridden);
-
 writelist(_g("** Packages in archive but missing from override file: **"),
           @missingover);
 if (@changedmaint) {