Parcourir la source

Dpkg::Control::Hash: accept PGP signature as end of block

Improved-by: Raphaël Hertzog <hertzog@debian.org>
Roger Leigh il y a 15 ans
Parent
commit
898936120e
2 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 3 0
      debian/changelog
  2. 1 1
      scripts/Dpkg/Control/Hash.pm

+ 3 - 0
debian/changelog

@@ -79,6 +79,9 @@ dpkg (1.16.0) UNRELEASED; urgency=low
     - it accepts seeing the same file twice; Closes: #608829
     - it doesn't match on the English text "No newline at end of file" as it
       might be translated in some cases. Closes: #612465
+  * Improve parser in Dpkg::Control::Hash to not require an empty line
+    before the PGP signature. Closes: #617923
+    Thanks to Roger Leigh for the initial patch.
 
   [ Jonathan Nieder ]
   * Remove support for use of synchronous sync(2), due to its pernicious

+ 1 - 1
scripts/Dpkg/Control/Hash.pm

@@ -193,7 +193,7 @@ sub parse {
 	    } else {
 		syntaxerr($desc, _g("PGP signature not allowed here"));
 	    }
-	} elsif (m/^$/) {
+	} elsif (m/^$/ || ($expect_pgp_sig && m/^-----BEGIN PGP SIGNATURE/)) {
 	    if ($expect_pgp_sig) {
 		# Skip empty lines
 		$_ = <$fh> while defined($_) && $_ =~ /^\s*$/;