The following commit has been merged in the master branch:
commit 1f67f4b22b2c8571a39ff38cf74d259871fdc84c
Author: Raphaël Hertzog <[email protected]>
Date:   Sun Oct 25 19:08:45 2009 +0100

    Move find_closes() into Dpkg::Changelog::Entry::Debian

diff --git a/scripts/Dpkg/Changelog.pm b/scripts/Dpkg/Changelog.pm
index f91258d..03b43d9 100644
--- a/scripts/Dpkg/Changelog.pm
+++ b/scripts/Dpkg/Changelog.pm
@@ -47,7 +47,6 @@ use Dpkg::Vendor qw(run_vendor_hook);
 use base qw(Exporter);
 
 our %EXPORT_TAGS = ( 'util' => [ qw(
-                find_closes
                 data2rfc822
                 data2rfc822_mult
                 get_dpkg_changes
@@ -706,29 +705,6 @@ with only one of the options specified.
 
 =head1 UTILITY FUNCTIONS
 
-=head3 find_closes
-
-Takes one string as argument and finds "Closes: #123456, #654321" statements
-as supported by the Debian Archive software in it. Returns all closed bug
-numbers in an array reference.
-
-=cut
-
-sub find_closes {
-    my $changes = shift;
-    my %closes;
-
-    while ($changes &&
-          ($changes =~ 
/closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\s?\d+)*/ig)) {
-       $closes{$_} = 1 foreach($& =~ /\#?\s?(\d+)/g);
-    }
-
-    my @closes = sort { $a <=> $b } keys %closes;
-    return \...@closes;
-}
-
-=pod
-
 =head3 data2rfc822
 
 Takes a single argument, either a Dpkg::Changelog::Entry object
diff --git a/scripts/Dpkg/Changelog/Entry/Debian.pm 
b/scripts/Dpkg/Changelog/Entry/Debian.pm
index 073ec04..c9c2dde 100644
--- a/scripts/Dpkg/Changelog/Entry/Debian.pm
+++ b/scripts/Dpkg/Changelog/Entry/Debian.pm
@@ -22,13 +22,12 @@ use warnings;
 use Exporter;
 use Dpkg::Changelog::Entry;
 use base qw(Exporter Dpkg::Changelog::Entry);
-our @EXPORT_OK = qw($regex_header $regex_trailer);
+our @EXPORT_OK = qw($regex_header $regex_trailer find_closes);
 
 use Date::Parse;
 
 use Dpkg::Control::Changelog;
 use Dpkg::Version;
-use Dpkg::Changelog qw(:util);
 
 =head1 NAME
 
@@ -208,9 +207,9 @@ sub get_optional_fields {
            }
        }
     }
-    my $closes = find_closes(join("\n", @{$self->{changes}}));
-    if (@$closes) {
-       $f->{Closes} = join(" ", @$closes);
+    my @closes = find_closes(join("\n", @{$self->{changes}}));
+    if (@closes) {
+       $f->{Closes} = join(" ", @closes);
     }
     return $f;
 }
@@ -243,6 +242,29 @@ sub get_timestamp {
 
 =back
 
+=head1 UTILITY FUNCTIONS
+
+=head3 my @closed_bugs = find_closes($changes)
+
+Takes one string as argument and finds "Closes: #123456, #654321" statements
+as supported by the Debian Archive software in it. Returns all closed bug
+numbers in an array.
+
+=cut
+
+sub find_closes {
+    my $changes = shift;
+    my %closes;
+
+    while ($changes &&
+           ($changes =~ 
/closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\s?\d+)*/ig)) {
+        $closes{$_} = 1 foreach($& =~ /\#?\s?(\d+)/g);
+    }
+
+    my @closes = sort { $a <=> $b } keys %closes;
+    return @closes;
+}
+
 =head1 AUTHOR
 
 Raphaël Hertzog <[email protected]>.

-- 
dpkg's main repository


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

Reply via email to