The following commit has been merged in the master branch:
commit c4cca9674d61a7f15e3172a25a49d8d15ab754f0
Author: Guillem Jover <[email protected]>
Date: Wed Aug 8 04:37:03 2012 +0200
Dpkg::Changelog::Parse: Always pass the filename to the changelog parser
This allows the parser to handle compressed files transparently, instead
of opening them and passing the contents through standard input.
Closes: #684196
diff --git a/debian/changelog b/debian/changelog
index 7ee5a55..da49b73 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -107,6 +107,7 @@ dpkg (1.17.0) UNRELEASED; urgency=low
* Switch program usage errors to not print entire --help output.
Closes: #681371
* Document that «dpkg-parsechangelog -l-» can be used to read from stdin.
+ * Support parsing compressed changelog files transparently. Closes: #684196
[ Updated programs translations ]
* Fix typo in Spanish translation of update-alternatives.
diff --git a/scripts/Dpkg/Changelog/Parse.pm b/scripts/Dpkg/Changelog/Parse.pm
index 5d7f127..f7d860e 100644
--- a/scripts/Dpkg/Changelog/Parse.pm
+++ b/scripts/Dpkg/Changelog/Parse.pm
@@ -78,7 +78,6 @@ sub changelog_parse {
"$Dpkg::LIBDIR/parsechangelog",
'/usr/lib/dpkg/parsechangelog');
my $format = 'debian';
- my $changelogfile = 'debian/changelog';
my $force = 0;
# Extract and remove options that do not concern the changelog parser
@@ -87,16 +86,18 @@ sub changelog_parse {
unshift @parserpath, $options{libdir};
delete $options{libdir};
}
- if (exists $options{file}) {
- $changelogfile = $options{file};
- delete $options{file};
- }
if (exists $options{changelogformat}) {
$format = $options{changelogformat};
delete $options{changelogformat};
$force = 1;
}
+ # Set a default filename
+ if (not exists $options{file}) {
+ $options{file} = 'debian/changelog';
+ }
+ my $changelogfile = $options{file};
+
# Extract the format from the changelog file if possible
unless($force or ($changelogfile eq '-')) {
open(my $format_fh, '-|', 'tail', '-n', '40', $changelogfile);
@@ -137,10 +138,6 @@ sub changelog_parse {
my $pid = open(my $parser_fh, '-|');
syserr(_g('cannot fork for %s'), $parser) unless defined $pid;
if (not $pid) {
- if ($changelogfile ne '-') {
- open(STDIN, '<', $changelogfile) or
- syserr(_g('cannot open %s'), $changelogfile);
- }
exec(@exec) || syserr(_g('cannot exec format parser: %s'), $parser);
}
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]