[Reproducible-commits] [dpkg] 01/10: Dpkg::Control::Hash: Remove trailing space before handling dot-separators
Holger Levsen
holger at layer-acht.org
Tue May 3 08:44:04 UTC 2016
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to annotated tag 1.16.18
in repository dpkg.
commit 1a27c6ed43dd29e024335aad7c611bac3d8b29cc
Author: Guillem Jover <guillem at debian.org>
Date: Mon Jun 22 13:15:03 2015 +0200
Dpkg::Control::Hash: Remove trailing space before handling dot-separators
Regression introduced in commit c49d104601b673c11c981dc9b6d8247e6da64edd.
Any spaces after the blank line dot-separator should be stripped before
handling the dot-separator, otherwise we get duplicated dots in field
contents.
Closes: #789580
---
debian/changelog | 8 ++++++++
scripts/Dpkg/Control/Hash.pm | 2 +-
scripts/t/700_Dpkg_Control.t | 2 ++
scripts/t/700_Dpkg_Control/control-1 | 1 +
4 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 1c5a662..0a109aa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+dpkg (1.16.18) UNRELEASED; urgency=medium
+
+ * Remove trailing space before handling blank line dot-separator in
+ Dpkg::Control::Hash. Regression introduced in dpkg 1.16.16.
+ Reported by Jakub Wilk <jwilk at debian.org>. Closes: #789580
+
+ -- Guillem Jover <guillem at debian.org> Sat, 19 Mar 2016 19:13:34 +0100
+
dpkg (1.16.17) wheezy-security; urgency=high
[ Guillem Jover ]
diff --git a/scripts/Dpkg/Control/Hash.pm b/scripts/Dpkg/Control/Hash.pm
index a21b75d..278928b 100644
--- a/scripts/Dpkg/Control/Hash.pm
+++ b/scripts/Dpkg/Control/Hash.pm
@@ -195,10 +195,10 @@ sub parse {
unless (defined($cf)) {
syntaxerr($desc, _g("continued value line not in field"));
}
+ $line =~ s/\s*$//;
if ($line =~ /^\.+$/) {
$line = substr $line, 1;
}
- $line =~ s/\s*$//;
$self->{$cf} .= "\n$line";
} elsif (m/^-----BEGIN PGP SIGNED MESSAGE-----[\r\t ]*$/) {
$expect_pgp_sig = 1;
diff --git a/scripts/t/700_Dpkg_Control.t b/scripts/t/700_Dpkg_Control.t
index 2331b10..c9345e1 100644
--- a/scripts/t/700_Dpkg_Control.t
+++ b/scripts/t/700_Dpkg_Control.t
@@ -51,6 +51,7 @@ Long-Field: line1
line 2 line 2 line 2
.
line 3 line 3 line 3
+ .
..
line 4
Empty-Field:
@@ -80,6 +81,7 @@ is($src->{'long-field'},
line 2 line 2 line 2
line 3 line 3 line 3
+
.
line 4', "Get multi-line field");
is($src->{'Empty-field'}, "", "Get empty field");
diff --git a/scripts/t/700_Dpkg_Control/control-1 b/scripts/t/700_Dpkg_Control/control-1
index 85bdbb5..434fdb7 100644
--- a/scripts/t/700_Dpkg_Control/control-1
+++ b/scripts/t/700_Dpkg_Control/control-1
@@ -6,6 +6,7 @@ long-field: line1
line 2 line 2 line 2
.
line 3 line 3 line 3
+ .
..
line 4
empty-field:
--
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