Selaa lähdekoodia

Dpkg::Vendor::Ubuntu::find_launchpad_closes(): don't return duplicate bug numbers

Ensure we don't return the same bug multiple times even if
it's closed multiple times.
Brian Murray 16 vuotta sitten
vanhempi
commit
5332e0f654
2 muutettua tiedostoa jossa 6 lisäystä ja 3 poistoa
  1. 3 0
      debian/changelog
  2. 3 3
      scripts/Dpkg/Vendor/Ubuntu.pm

+ 3 - 0
debian/changelog

@@ -26,6 +26,9 @@ dpkg (1.15.6) UNRELEASED; urgency=low
   * Fix update-alternatives to not try to reinstall an unknown alternative
   * Fix update-alternatives to not try to reinstall an unknown alternative
     when the link group is broken, instead switch to the best choice in
     when the link group is broken, instead switch to the best choice in
     automatic mode. Closes: #566406
     automatic mode. Closes: #566406
+  * Don't return duplicate bug numbers in Launchpad-Bugs-Fixed:.
+    Thanks to Brian Murray <brian@ubuntu.com> for the report
+    and the patch. Closes: #569618
 
 
   [ Guillem Jover ]
   [ Guillem Jover ]
   * Handle argument parsing in dpkg-checkbuilddeps and dpkg-scanpackages
   * Handle argument parsing in dpkg-checkbuilddeps and dpkg-scanpackages

+ 3 - 3
scripts/Dpkg/Vendor/Ubuntu.pm

@@ -105,14 +105,14 @@ numbers in an array reference.
 
 
 sub find_launchpad_closes {
 sub find_launchpad_closes {
     my ($changes) = @_;
     my ($changes) = @_;
-    my @closes = ();
+    my %closes;
 
 
     while ($changes &&
     while ($changes &&
           ($changes =~ /lp:\s+\#\d+(?:,\s*\#\d+)*/ig)) {
           ($changes =~ /lp:\s+\#\d+(?:,\s*\#\d+)*/ig)) {
-       push(@closes, $& =~ /\#?\s?(\d+)/g);
+        $closes{$_} = 1 foreach($& =~ /\#?\s?(\d+)/g);
     }
     }
 
 
-    @closes = sort { $a <=> $b } @closes;
+    my @closes = sort { $a <=> $b } keys %closes;
 
 
     return \@closes;
     return \@closes;
 }
 }