From 72854d117ff4a60b56f7d1b3efebad03ed22675a Mon Sep 17 00:00:00 2001 From: James Troup Date: Wed, 21 Jan 2004 03:48:58 +0000 Subject: [PATCH] Moron. Test your changes. --- TODO | 5 +++++ test/005/evil.changes | 43 ------------------------------------------- test/005/test.py | 6 ++---- utils.py | 6 +++--- 4 files changed, 10 insertions(+), 50 deletions(-) delete mode 100644 test/005/evil.changes diff --git a/TODO b/TODO index 4b623b70..02b24fb0 100644 --- a/TODO +++ b/TODO @@ -27,6 +27,11 @@ queue/approved Others ------ + i'd be kinda inclined to go with insisting the .changes file take + the form ---- BEGIN PGP MESSAGE --- -- + BEGIN PGP SIG -- END PGP MESSAGE -- with no lines before or after, + and rejecting .changes that didn't match that + o rene should check for source packages not building any binaries o heidi should have a diff mode that accepts diff output! diff --git a/test/005/evil.changes b/test/005/evil.changes deleted file mode 100644 index 7076f608..00000000 --- a/test/005/evil.changes +++ /dev/null @@ -1,43 +0,0 @@ ------BEGIN PGP SIGNED MESSAGE----- - -You: have been 0wned ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - -Format: 1.7 -Date: Tue, 9 Sep 2003 01:16:01 +0100 -Source: gawk -Binary: gawk -Architecture: source i386 -Version: 1:3.1.3-2 -Distribution: unstable -Urgency: low -Maintainer: James Troup -Changed-By: James Troup -Description: - gawk - GNU awk, a pattern scanning and processing language -Closes: 204699 204701 -Changes: - gawk (1:3.1.3-2) unstable; urgency=low - . - * debian/control (Standards-Version): bump to 3.6.1.0. - . - * 02_fix-ascii.dpatch: new patch from upstream to fix [[:ascii:]]. - Thanks to for reporting the bug and forwarding it - upstream. Closes: #204701 - . - * 03_fix-high-char-ranges.dpatch: new patch from upstream to fix - [\x80-\xff]. Thanks to for reporting the bug and - forwarding it upstream. Closes: #204699 -Files: - 0e6542c48bcc9d9586fc8ebe4e7242a4 561 interpreters optional gawk_3.1.3-2.dsc - 50a29dce4a2c6e2ac38069eb7c41d9c4 8302 interpreters optional gawk_3.1.3-2.diff.gz - 5a255c7b421ac699804212e10205f22d 871114 interpreters optional gawk_3.1.3-2_i386.deb - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) - -iEYEARECAAYFAj9dHWsACgkQgD/uEicUG7DUnACglndvU4LCA0/k36Qp873N0Sau -fCwAoMdgIOUBcUfMqXvVnxdW03ev5bNB -=O7Gh ------END PGP SIGNATURE----- diff --git a/test/005/test.py b/test/005/test.py index 3f6ca258..84970664 100755 --- a/test/005/test.py +++ b/test/005/test.py @@ -2,7 +2,7 @@ # Check utils.parse_changes()'s for handling of multi-line fields # Copyright (C) 2004 James Troup -# $Id: test.py,v 1.1 2004-01-21 03:20:52 troup Exp $ +# $Id: test.py,v 1.2 2004-01-21 03:48:58 troup Exp $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -39,10 +39,8 @@ def fail(message): ################################################################################ def main (): - for file in [ "valid", "bogus-pre", "bogus-post", "evil" ]: + for file in [ "valid", "bogus-pre", "bogus-post" ]: for strict_whitespace in [ 0, 1 ]: - if file == "evil" and strict_whitespace == 1: - continue; try: changes = utils.parse_changes("%s.changes" % (file), strict_whitespace) except utils.changes_parse_error_exc, line: diff --git a/utils.py b/utils.py index 2b40501c..c2424cf7 100644 --- a/utils.py +++ b/utils.py @@ -2,7 +2,7 @@ # Utility functions # Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup -# $Id: utils.py,v 1.61 2004-01-21 03:20:52 troup Exp $ +# $Id: utils.py,v 1.62 2004-01-21 03:48:58 troup Exp $ ################################################################################ @@ -45,7 +45,7 @@ re_parse_maintainer = re.compile(r"^\s*(\S.*\S)\s*\<([^\> \t]+)\>"); changes_parse_error_exc = "Can't parse line in .changes file"; invalid_dsc_format_exc = "Invalid .dsc file"; nk_format_exc = "Unknown Format: in .changes file"; -no_files_exc = "No Files: field in .dsc file."; +no_files_exc = "No Files: field in .dsc or .changes file."; cant_open_exc = "Can't read file."; unknown_hostname_exc = "Unknown hostname"; cant_overwrite_exc = "Permission denied; can't overwrite existent file." @@ -176,8 +176,8 @@ def parse_changes(filename, dsc_whitespace_rules=0): if line.startswith("-----BEGIN PGP SIGNATURE"): break; if line.startswith("-----BEGIN PGP SIGNED MESSAGE"): + inside_signature = 1; if dsc_whitespace_rules: - inside_signature = 1; while index < num_of_lines and line != "": index += 1; line = indexed_lines[index]; -- 2.39.5