[dpkg] 116/192: Dpkg::Changelog::Parse: Disable compression when using the default file

Ximin Luo infinity0 at debian.org
Tue Oct 17 11:04:07 UTC 2017


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

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

commit da7c7542f1337d15f1435ca30eb3a4348fefe3e7
Author: Guillem Jover <guillem at debian.org>
Date:   Sun Jul 16 17:35:03 2017 +0200

    Dpkg::Changelog::Parse: Disable compression when using the default file
---
 debian/changelog                |  2 ++
 scripts/Dpkg/Changelog/Parse.pm | 13 +++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b215cae..c65294e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -44,6 +44,8 @@ dpkg (1.19.0) UNRELEASED; urgency=medium
     - Add support for new DPKG_NLS environment variable in Dpkg::Gettext,
       that when set to 0 will disable NLS (i18n) support in the Dpkg modules,
       and reduce the load chain.
+    - Disable compression when using the default file in
+      Dpkg::Changelog::Parse.
   * Documentation:
     - Document currently accepted syntax for changelogs in deb-changelog(5).
       Closes: #858579
diff --git a/scripts/Dpkg/Changelog/Parse.pm b/scripts/Dpkg/Changelog/Parse.pm
index e26a090..e107dcf 100644
--- a/scripts/Dpkg/Changelog/Parse.pm
+++ b/scripts/Dpkg/Changelog/Parse.pm
@@ -33,7 +33,7 @@ package Dpkg::Changelog::Parse;
 use strict;
 use warnings;
 
-our $VERSION = '1.02';
+our $VERSION = '1.03';
 our @EXPORT = qw(
     changelog_parse_debian
     changelog_parse_plugin
@@ -125,6 +125,10 @@ up in the 40 last lines of the changelog itself (extracted with this perl
 regular expression "\schangelog-format:\s+([0-9a-z]+)\W"). But it can be
 overridden with $opt{changelogformat}.
 
+If $opt{compression} is false, the file will be loaded without compression
+support, otherwise by default compression support is disabled if the file
+is the default.
+
 All the other keys in %opt are forwarded to the parser module constructor.
 
 =cut
@@ -142,6 +146,7 @@ sub _changelog_parse {
     $options{label} //= $options{file};
     $options{changelogformat} //= _changelog_detect_format($options{file});
     $options{format} //= 'dpkg';
+    $options{compression} //= $options{file} ne 'debian/changelog';
 
     my @range_opts = qw(since until from to offset count all);
     $options{all} = 1 if exists $options{all};
@@ -165,7 +170,7 @@ sub _changelog_parse {
     $changes->set_options(reportfile => $options{label}, range => $range);
 
     # Load and parse the changelog.
-    $changes->load($options{file})
+    $changes->load($options{file}, compression => $options{compression})
         or error(g_('fatal error occurred while parsing %s'), $options{file});
 
     # Get the output into several Dpkg::Control objects.
@@ -200,6 +205,10 @@ sub changelog_parse {
 
 =head1 CHANGES
 
+=head2 Version 1.03 (dpkg 1.19.0)
+
+New option: 'compression' in changelog_parse().
+
 =head2 Version 1.02 (dpkg 1.18.8)
 
 Deprecated functions: changelog_parse_debian(), changelog_parse_plugin().

-- 
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