[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.2-58-g7a7b841



The following commit has been merged in the master branch:
commit 20e70d9fda961cc7b2dfa99fcd4caa2aca056c1c
Author: Jakub Wilk <jwilk@debian.org>
Date:   Sun Aug 28 18:29:01 2011 +0200

    Stricten the DCtrl parser
    
    Previously the DCtrl parser in lib/Util.pm would silently ignore
    non-empty non-continuation lines without a colon.
    
    The original patch has been modified to update the test suite.
    With the patch, the "changes-double-signed" test croaked and a
    was therefore re-written.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/debian/changelog b/debian/changelog
index 12bb7d7..d5b52ce 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -86,6 +86,8 @@ lintian (2.5.3) UNRELEASED; urgency=low
   * lib/Util.pm:
     + [JW] Use LC_ALL rather than LANG, since LC_ALL overrules
       LANG.
+    + [JW] Stricten the DCtrl parser to choke on some syntax errors
+      that was silently ignored.  (Closes: #639516)
   * lib/Lintian/Collect/Source.pm:
     + [NT] Removed a requirement for fields that was not needed.
     + [NT] Fixed "index" method for source packages.
diff --git a/lib/Util.pm b/lib/Util.pm
index 7d37965..dda6385 100644
--- a/lib/Util.pm
+++ b/lib/Util.pm
@@ -147,6 +147,12 @@ sub _parse_dpkg_control_iterative {
 	    $value =~ s/\s+$//;
 	    $section->{$last_tag} .= "\n" . $value;
 	}
+	# None of the above => syntax error
+	else {
+	    my $message = "syntax error in section $cur_section";
+	    $message.= " after the tag $last_tag: $_" if defined $last_tag;
+	    fail($message);
+	}
     }
     # pass the last section (if not already done).
     $code->($section) if $open_section;
diff --git a/t/changes/changes-double-signed.changes b/t/changes/changes-double-signed.changes
deleted file mode 100644
index a5cd225..0000000
--- a/t/changes/changes-double-signed.changes
+++ /dev/null
@@ -1,32 +0,0 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-- -----BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-Format: 1.8
-Date: Sat, 10 Jan 2009 10:50:38 -0800
-Source: changed-by-malformed
-Binary: changed-by-malformed
-Architecture: source all
-Version: 1.0
-Distribution: unstable
-Urgency: low
-Maintainer: Debian Lintian Maintainers <lintian-maint@debian.org>
-Changed-By: Russ Allbery <rra@debian.org>
-Description:
- changed-by-malformed - Test Changed-By field with localhost address
-- -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.9 (GNU/Linux)
-
-iEYEARECAAYFAklprBgACgkQ+YXjQAr8dHahYACg1WOxEh9uaavrM6oNNS9VE2rq
-gLUAn1s+SdFHHi8IAwQSvPVFKJSEvGwl
-=MXTD
-- -----END PGP SIGNATURE-----
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.9 (GNU/Linux)
-
-iEYEARECAAYFAklprEwACgkQ+YXjQAr8dHacsgCcDwLS5P/u8VAHXQBQxg3dMOee
-mYcAoMCm5KyefN7DIFqkCQKx993k/koY
-=WuMg
------END PGP SIGNATURE-----
diff --git a/t/changes/changes-double-signed.desc b/t/changes/changes-double-signed.desc
deleted file mode 100644
index e81b18f..0000000
--- a/t/changes/changes-double-signed.desc
+++ /dev/null
@@ -1,5 +0,0 @@
-Testname: changes-double-signed
-Sequence: 6000
-Version: 1.0
-Description: Test double-signed changes file
-Test-For: malformed-changes-file
diff --git a/t/changes/changes-double-signed.tags b/t/changes/changes-double-signed.tags
deleted file mode 100644
index 8ca3164..0000000
--- a/t/changes/changes-double-signed.tags
+++ /dev/null
@@ -1 +0,0 @@
-E: changes-double-signed changes: malformed-changes-file
diff --git a/t/changes/changes-bad-ubuntu-distribution.changes.in b/t/changes/changes-missing-format.changes.in
similarity index 85%
copy from t/changes/changes-bad-ubuntu-distribution.changes.in
copy to t/changes/changes-missing-format.changes.in
index 7d78256..94b1c16 100644
--- a/t/changes/changes-bad-ubuntu-distribution.changes.in
+++ b/t/changes/changes-missing-format.changes.in
@@ -1,10 +1,9 @@
-Format: 1.8
 Date: {$date}
 Source: {$srcpkg}
 Binary: {$srcpkg}
 Architecture: source all
 Version: {$version}
-Distribution: wispy
+Distribution: unstable
 Urgency: low
 Maintainer: {$author}
 Changed-By: {$author}
diff --git a/t/changes/changes-missing-format.desc b/t/changes/changes-missing-format.desc
new file mode 100644
index 0000000..65f784b
--- /dev/null
+++ b/t/changes/changes-missing-format.desc
@@ -0,0 +1,5 @@
+Testname: changes-missing-format
+Sequence: 6000
+Version: 1.0
+Description: Test for missing format field
+Test-For: malformed-changes-file
diff --git a/t/changes/changes-missing-format.tags b/t/changes/changes-missing-format.tags
new file mode 100644
index 0000000..fdc13af
--- /dev/null
+++ b/t/changes/changes-missing-format.tags
@@ -0,0 +1 @@
+E: changes-missing-format changes: malformed-changes-file

-- 
Debian package checker


Reply to: