The following commit has been merged in the master branch:
commit a8a51a4a53e923250ccc4bf0c2c040a211991c90
Author: Raphaël Hertzog <[email protected]>
Date:   Sun Oct 18 23:21:42 2009 +0200

    Dpkg::Changelog::find_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/scripts/Dpkg/Changelog.pm b/scripts/Dpkg/Changelog.pm
index 5aca5b4..4433722 100644
--- a/scripts/Dpkg/Changelog.pm
+++ b/scripts/Dpkg/Changelog.pm
@@ -719,14 +719,14 @@ numbers in an array reference.
 
 sub find_closes {
     my $changes = shift;
-    my @closes = ();
+    my %closes;
 
     while ($changes &&
           ($changes =~ 
/closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\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