The following commit has been merged in the master branch:
commit 5332e0f654fc5e4c5608cb64b4a2af314371f010
Author: Brian Murray <[email protected]>
Date:   Sat Feb 13 09:42:35 2010 +0100

    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.

diff --git a/debian/changelog b/debian/changelog
index 29f9483..02d5a43 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -26,6 +26,9 @@ dpkg (1.15.6) UNRELEASED; urgency=low
   * Fix update-alternatives to not try to reinstall an unknown alternative
     when the link group is broken, instead switch to the best choice in
     automatic mode. Closes: #566406
+  * Don't return duplicate bug numbers in Launchpad-Bugs-Fixed:.
+    Thanks to Brian Murray <[email protected]> for the report
+    and the patch. Closes: #569618
 
   [ Guillem Jover ]
   * Handle argument parsing in dpkg-checkbuilddeps and dpkg-scanpackages
diff --git a/scripts/Dpkg/Vendor/Ubuntu.pm b/scripts/Dpkg/Vendor/Ubuntu.pm
index 3a1f078..000d59e 100644
--- a/scripts/Dpkg/Vendor/Ubuntu.pm
+++ b/scripts/Dpkg/Vendor/Ubuntu.pm
@@ -105,14 +105,14 @@ numbers in an array reference.
 
 sub find_launchpad_closes {
     my ($changes) = @_;
-    my @closes = ();
+    my %closes;
 
     while ($changes &&
           ($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;
 }

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to