summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2017-07-16 17:35:03 +0200
committerGuillem Jover <guillem@debian.org>2017-09-24 21:03:09 +0200
commitda7c7542f1337d15f1435ca30eb3a4348fefe3e7 (patch)
tree3ae22187008cb74c18ca6790c8d4daeca90efeee
parentdd196e60b1b18f8b127a06d24c9095a1696838f1 (diff)
downloaddpkg-da7c7542f1337d15f1435ca30eb3a4348fefe3e7.tar.gz
Dpkg::Changelog::Parse: Disable compression when using the default file
-rw-r--r--debian/changelog2
-rw-r--r--scripts/Dpkg/Changelog/Parse.pm13
2 files changed, 13 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index b215cae60..c65294e3e 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 e26a090db..e107dcf6d 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().