3 # Check utils.parse_changes()'s for handling of multi-line fields
4 # Copyright (C) 2000, 2006 James Troup <james@nocrew.org>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 ################################################################################
22 # The deal here is that for the first 6 months of dak's
23 # implementation it has been misparsing multi-line fields in .changes
24 # files; specifically multi-line fields where there _is_ data on the
25 # first line. So, for example:
30 # Became "foo: bar bazbat bant" rather than "foo: bar baz\nbat bant"
32 ################################################################################
36 sys.path.append(os.path.abspath('../../'))
40 ################################################################################
43 sys.stderr.write("%s\n" % (message))
46 ################################################################################
49 # Valid .changes file with a multi-line Binary: field
51 changes = utils.parse_changes('krb5_1.2.2-4_m68k.changes', 0)
52 except utils.changes_parse_error_exc, line:
53 fail("parse_changes() returned an exception with error message `%s'." % (line))
55 o = changes.get("binary", "")
58 changes["binary"] = {}
60 changes["binary"][j] = 1
62 if not changes["binary"].has_key("krb5-ftpd"):
63 fail("parse_changes() is broken; 'krb5-ftpd' is not in the Binary: dictionary.")
65 ################################################################################
67 if __name__ == '__main__':