[Reproducible-commits] [dpkg] 28/90: Dpkg::Changelog::Parse: Refactor changelog_parse into changelog_parse_plugin

Jérémy Bobbio lunar at moszumanska.debian.org
Sat Aug 29 18:26:11 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit 8c368c0005e7e26105f440be2b623d23b6bd7fcb
Author: Guillem Jover <guillem at debian.org>
Date:   Wed Jul 1 08:00:05 2015 +0200

    Dpkg::Changelog::Parse: Refactor changelog_parse into changelog_parse_plugin
---
 debian/changelog                |  1 +
 scripts/Dpkg/Changelog/Parse.pm | 34 +++++++++++++++++++++++++++++-----
 2 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index ef6662d..5091452 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,7 @@ dpkg (1.18.2) UNRELEASED; urgency=low
       Date::Parse in Dpkg::Changelog::Entry::Debian. This reduces the build
       and run-time dependencies, and helps architecture bootstrapping.
     - Simplify distribution splitting in Dpkg::Changelog::Entry::Debian.
+    - Add new function changelog_parse_plugin() in Dpkg::Changelog::Parse.
   * Documentation:
     - Fix grammar in dpkg-architecture(1).
       Thanks to Chris Lamb <lamby at debian.org>. Closes: #787616
diff --git a/scripts/Dpkg/Changelog/Parse.pm b/scripts/Dpkg/Changelog/Parse.pm
index bd351e7..dc5b874 100644
--- a/scripts/Dpkg/Changelog/Parse.pm
+++ b/scripts/Dpkg/Changelog/Parse.pm
@@ -23,8 +23,8 @@ Dpkg::Changelog::Parse - generic changelog parser for dpkg-parsechangelog
 
 =head1 DESCRIPTION
 
-This module provides a single function changelog_parse() which reproduces
-all the features of dpkg-parsechangelog.
+This module provides a set of functions which reproduce all the features
+of dpkg-parsechangelog.
 
 =cut
 
@@ -33,8 +33,9 @@ package Dpkg::Changelog::Parse;
 use strict;
 use warnings;
 
-our $VERSION = '1.00';
+our $VERSION = '1.01';
 our @EXPORT = qw(
+    changelog_parse_plugin
     changelog_parse
 );
 
@@ -49,7 +50,7 @@ use Dpkg::Control::Changelog;
 
 =over 4
 
-=item $fields = changelog_parse(%opt)
+=item $fields = changelog_parse_plugin(%opt)
 
 This function will parse a changelog. In list context, it returns as many
 Dpkg::Control objects as the parser did output. In scalar context, it will
@@ -77,7 +78,7 @@ it is passed as the parameter that follows.
 
 =cut
 
-sub changelog_parse {
+sub changelog_parse_plugin {
     my (%options) = @_;
     my @parserpath = ('/usr/local/lib/dpkg/parsechangelog',
                       "$Dpkg::LIBDIR/parsechangelog",
@@ -163,10 +164,33 @@ sub changelog_parse {
     }
 }
 
+=item $fields = changelog_parse(%opt)
+
+This function will parse a changelog. In list context, it returns as many
+Dpkg::Control objects as the parser did create. In scalar context, it will
+return only the first one. If the parser did not return any data, it will
+return an empty list in list context or undef on scalar context. If the
+parser failed, it will die.
+
+The changelog file that is parsed is F<debian/changelog> by default but it
+can be overridden with $opt{file}.
+
+=cut
+
+sub changelog_parse {
+    my (%options) = @_;
+
+    return changelog_parse_plugin(%options);
+}
+
 =back
 
 =head1 CHANGES
 
+=head2 Version 1.01 (dpkg 1.18.2)
+
+New functions: changelog_parse_plugin().
+
 =head2 Version 1.00 (dpkg 1.15.6)
 
 Mark the module as public.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list