On Sat, Mar 12, 2011 at 03:42:26PM +0000, Roger Leigh wrote:
> readrel: error: syntax error in 
> /var/lib/apt/lists/ftp.uk.debian.org_debian_dists_unstable_InRelease at line 
> 1537: line with unknown format (not field-colon-value)
> 
> This is the relevant part of the InRelease file:
> 
> ---------
>   1534         
> f61f27bd17de546264aa58f40f3aafaac7021e0ef69c17f6b1b4cd7664a037ec       20 
> non-free/debian-installer/binary-kfreebsd-amd64/Packages.gz
>   1535         
> d3dda84eb03b9738d118eb2be78e246106900493c0ae07819ad60815134a8058       14 
> non-free/debian-installer/binary-kfreebsd-amd64/Packages.bz2
>   1536        -----BEGIN PGP SIGNATURE-----
>   1537        Version: GnuPG v1.4.9 (GNU/Linux)
>        
>   1538        iQIcBAEBAgAGBQJNeoUbAAoJEK7UsG9HMEH6DYUP/1m/VgSdgSj+Cyv+282xvFOn
>   1539        gmgCR5IA51NEJvfHXIHPmHte18vSU2TO6l64M07aNgFTk22UnSl5mwnTYh+deTAM
>   1540        xwAAlb7P4Iq7csmchobutgvpQLBMzVjqq0Zu7IX9mO2mjrhBkhcQqGdVz3X1pXPl
>   1541        +a7lnt0frDd5JjkV03+NDIuNN2H2DzF8rHNuG1kajUV6E/z+LMaamvvShduK1vsS
> ---------
> 
> So it looks like it's choking on the inline PGP signature, despite
> using allow_pgp=>1 to tell it to ignore it.

Patch attached which fixes it for me.  Note that I don't quite
get why you're skipping whitespace--I'm not sure why there would
be whitespace before the PGP signature, so I'm not sure if the
whitespace skipping is necessarily related to the PGP part.

The patch just allows for a PGP signature in the absence of trailing
whitespace, in addition to what's currently permitted.  This allows
parsing of current InRelease files.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
From 0d1379df597ec86b82af4366a450d123e9da9dba Mon Sep 17 00:00:00 2001
From: Roger Leigh <[email protected]>
Date: Sat, 12 Mar 2011 16:04:31 +0000
Subject: [PATCH] Dpkg::Control::Hash: Skip PGP signatures with no trailing whitespace

---
 scripts/Dpkg/Control/Hash.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/Dpkg/Control/Hash.pm b/scripts/Dpkg/Control/Hash.pm
index 9ecf7d3..a28bd2d 100644
--- a/scripts/Dpkg/Control/Hash.pm
+++ b/scripts/Dpkg/Control/Hash.pm
@@ -193,7 +193,7 @@ sub parse {
 	    } else {
 		syntaxerr($desc, _g("PGP signature not allowed here"));
 	    }
-	} elsif (m/^$/) {
+	} elsif (m/^$/ || m/^-----BEGIN PGP SIGNATURE/) {
 	    if ($expect_pgp_sig) {
 		# Skip empty lines
 		$_ = <$fh> while defined($_) && $_ =~ /^\s*$/;
-- 
1.7.4.1

Attachment: signature.asc
Description: Digital signature

Reply via email to