diff options
author | Raphaël Hertzog <hertzog@debian.org> | 2009-10-18 23:21:42 +0200 |
---|---|---|
committer | Raphaël Hertzog <hertzog@debian.org> | 2009-10-18 23:24:12 +0200 |
commit | a8a51a4a53e923250ccc4bf0c2c040a211991c90 (patch) | |
tree | 80bc99bdafdba723040d460be189df7ef23eab0f /scripts | |
parent | 43c42b3ea29daab2bf5d1f6ed4d741d33d50d4d8 (diff) | |
download | dpkg-a8a51a4a53e923250ccc4bf0c2c040a211991c90.tar.gz |
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.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Dpkg/Changelog.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/Dpkg/Changelog.pm b/scripts/Dpkg/Changelog.pm index 5aca5b449..4433722e1 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; } |