[Reproducible-commits] [dpkg] 33/90: Dpkg::Control::HashCore: Remove trailing space before handling dot-separators

Jérémy Bobbio lunar at moszumanska.debian.org
Sat Aug 29 18:26:12 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 95d9b43f8ad87bcfc180bd3cd9631c1f7ea83569
Author: Guillem Jover <guillem at debian.org>
Date:   Mon Jun 22 13:15:03 2015 +0200

    Dpkg::Control::HashCore: Remove trailing space before handling dot-separators
    
    Regression introduced in commit aea291e3db1ac0414dcf005a0a607e78bdd77a5e.
    
    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
    Stable-Candidate: 1.16.x 1.17.x
---
 debian/changelog                 | 3 +++
 scripts/Dpkg/Control/HashCore.pm | 2 +-
 scripts/t/Dpkg_Control.t         | 2 ++
 scripts/t/Dpkg_Control/control-1 | 1 +
 4 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 019fc26..db5dae3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,9 @@ dpkg (1.18.2) UNRELEASED; urgency=low
     - Add new function changelog_parse_debian() in Dpkg::Changelog::Parse, and
       use it in changelog_parse() instead of the external plugin parser when
       the input format is “debian”. This significantly speeds up the parsing.
+    - Remove trailing space before handling blank line dot-separator in
+      Dpkg::Control::HashCore. Regression introduced in dpkg 1.18.0.
+      Reported by Jakub Wilk <jwilk at debian.org>. Closes: #789580
   * Documentation:
     - Fix grammar in dpkg-architecture(1).
       Thanks to Chris Lamb <lamby at debian.org>. Closes: #787616
diff --git a/scripts/Dpkg/Control/HashCore.pm b/scripts/Dpkg/Control/HashCore.pm
index 3a7b551..21b474e 100644
--- a/scripts/Dpkg/Control/HashCore.pm
+++ b/scripts/Dpkg/Control/HashCore.pm
@@ -220,10 +220,10 @@ sub parse {
 	    unless (defined($cf)) {
 		$self->parse_error($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/Dpkg_Control.t b/scripts/t/Dpkg_Control.t
index e73f8ec..e8089fb 100644
--- a/scripts/t/Dpkg_Control.t
+++ b/scripts/t/Dpkg_Control.t
@@ -53,6 +53,7 @@ Long-Field: line1
  line 2 line 2 line 2
  .
    line 3 line 3 line 3
+ .
  ..
  line 4
 Empty-Field:
@@ -83,6 +84,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/Dpkg_Control/control-1 b/scripts/t/Dpkg_Control/control-1
index afe618e..0c70533 100644
--- a/scripts/t/Dpkg_Control/control-1
+++ b/scripts/t/Dpkg_Control/control-1
@@ -7,6 +7,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