← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jelmer/launchpad/613468-xb-ppa-qa into lp:launchpad

 

Jelmer Vernooij has proposed merging lp:~jelmer/launchpad/613468-xb-ppa-qa into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers): code


This branch fixes some qa-badness in the fix for bug 613468.

Debian control fields have case-insensitive names:

http://www.debian.org/doc/debian-policy/ch-controlfields.html

Previously we would lowercase the field names when parsing them so we could always do lookups on lowercased names. When printing out these fields we would always use predefined formatting, as we only supported a limited set of fields (Build-Depends, Depends, Maintainer, etc.).

Now that custom fields are supported we need to preserve the original field name. To still support case-insensitive lookups we now use the custom Deb822Dict() class from python-debian, which provides support for case-preserving field names on which we can do case-insensitive lookups.
-- 
https://code.launchpad.net/~jelmer/launchpad/613468-xb-ppa-qa/+merge/33804
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jelmer/launchpad/613468-xb-ppa-qa into lp:launchpad.
=== modified file 'lib/lp/archiveuploader/changesfile.py'
--- lib/lp/archiveuploader/changesfile.py	2010-08-20 20:31:18 +0000
+++ lib/lp/archiveuploader/changesfile.py	2010-08-26 17:06:04 +0000
@@ -58,12 +58,12 @@
     """Changesfile model."""
 
     mandatory_fields = set([
-        "source", "binary", "architecture", "version", "distribution",
-        "maintainer", "files", "changes", "date",
+        "Source", "Binary", "Architecture", "Version", "Distribution",
+        "Maintainer", "Files", "Changes", "Date",
         # Changed-By is not technically mandatory according to
         # Debian policy but Soyuz relies on it being set in
         # various places.
-        "changed-by"])
+        "Changed-By"])
 
     # Map urgencies to their dbschema values.
     # Debian policy only permits low, medium, high, emergency.
@@ -117,7 +117,7 @@
                     "file." % field)
 
         try:
-            format = float(self._dict["format"])
+            format = float(self._dict["Format"])
         except KeyError:
             # If format is missing, pretend it's 1.5
             format = 1.5
@@ -158,12 +158,12 @@
             # signed upload.  This is desireable because it avoids us
             # doing ensurePerson() for buildds and sync owners.
             try:
-                self.maintainer = self.parseAddress(self._dict['maintainer'])
+                self.maintainer = self.parseAddress(self._dict['Maintainer'])
             except UploadError, error:
                 yield error
 
         try:
-            self.changed_by = self.parseAddress(self._dict['changed-by'])
+            self.changed_by = self.parseAddress(self._dict['Changed-By'])
         except UploadError, error:
             yield error
 
@@ -188,7 +188,7 @@
         files.
         """
         files = []
-        for fileline in self._dict['files'].strip().split("\n"):
+        for fileline in self._dict['Files'].strip().split("\n"):
             # files lines from a changes file are always of the form:
             # CHECKSUM SIZE [COMPONENT/]SECTION PRIORITY FILENAME
             digest, size, component_and_section, priority_name, filename = (
@@ -237,16 +237,16 @@
         if len(self.files) == 0:
             yield UploadError("No files found in the changes")
 
-        if 'urgency' not in self._dict:
+        if 'Urgency' not in self._dict:
             # Urgency is recommended but not mandatory. Default to 'low'
-            self._dict['urgency'] = "low"
+            self._dict['Urgency'] = "low"
 
-        raw_urgency = self._dict['urgency'].lower()
+        raw_urgency = self._dict['Urgency'].lower()
         if raw_urgency not in self.urgency_map:
             yield UploadWarning(
                 "Unable to grok urgency %s, overriding with 'low'"
                 % (raw_urgency))
-            self._dict['urgency'] = "low"
+            self._dict['Urgency'] = "low"
 
         if not self.policy.unsigned_changes_ok:
             assert self.signer is not None, (
@@ -295,7 +295,7 @@
 
         For example, 'hoary' or 'hoary-security'.
         """
-        return self._dict['distribution']
+        return self._dict['Distribution']
 
     @property
     def architectures(self):
@@ -304,22 +304,22 @@
         For instance ['source', 'all'] or ['source', 'i386', 'amd64']
         or ['source'].
         """
-        return set(self._dict['architecture'].split())
+        return set(self._dict['Architecture'].split())
 
     @property
     def binaries(self):
         """Return set of binary package names listed."""
-        return set(self._dict['binary'].strip().split())
+        return set(self._dict['Binary'].strip().split())
 
     @property
     def converted_urgency(self):
         """Return the appropriate SourcePackageUrgency item."""
-        return self.urgency_map[self._dict['urgency'].lower()]
+        return self.urgency_map[self._dict['Urgency'].lower()]
 
     @property
     def version(self):
         """Return changesfile claimed version."""
-        return self._dict['version']
+        return self._dict['Version']
 
     @classmethod
     def formatChangesComment(cls, comment):
@@ -336,24 +336,24 @@
     @property
     def changes_comment(self):
         """Return changesfile 'change' comment."""
-        comment = self._dict['changes']
+        comment = self._dict['Changes']
 
         return self.formatChangesComment(comment)
 
     @property
     def date(self):
         """Return changesfile date."""
-        return self._dict['date']
+        return self._dict['Date']
 
     @property
     def source(self):
         """Return changesfile claimed source name."""
-        return self._dict['source']
+        return self._dict['Source']
 
     @property
     def architecture_line(self):
         """Return changesfile archicteture line."""
-        return self._dict['architecture']
+        return self._dict['Architecture']
 
     @property
     def filecontents(self):

=== modified file 'lib/lp/archiveuploader/dscfile.py'
--- lib/lp/archiveuploader/dscfile.py	2010-08-24 20:30:48 +0000
+++ lib/lp/archiveuploader/dscfile.py	2010-08-26 17:06:04 +0000
@@ -17,7 +17,12 @@
     'find_copyright',
     ]
 
+<<<<<<< TREE
 from cStringIO import StringIO
+=======
+import apt_pkg
+from debian.deb822 import Deb822Dict
+>>>>>>> MERGE-SOURCE
 import errno
 import glob
 import os
@@ -204,8 +209,8 @@
 
         person = getUtility(IPersonSet).getByEmail(email)
         if person is None and self.policy.create_people:
-            package = self._dict['source']
-            version = self._dict['version']
+            package = self._dict['Source']
+            version = self._dict['Version']
             if self.policy.distroseries and self.policy.pocket:
                 policy_suite = ('%s/%s' % (self.policy.distroseries.name,
                                            self.policy.pocket.name))
@@ -233,20 +238,20 @@
     """Models a given DSC file and its content."""
 
     mandatory_fields = set([
-        "source",
-        "version",
-        "binary",
-        "maintainer",
-        "architecture",
-        "files"])
+        "Source",
+        "Version",
+        "Binary",
+        "Maintainer",
+        "Architecture",
+        "Files"])
 
     known_fields = mandatory_fields.union(set([
-        "build-depends",
-        "build-depends-indep",
-        "build-conflicts",
-        "build-conflicts-indep",
-        "format",
-        "standards-version",
+        "Build-Depends",
+        "Build-Depends-Indep",
+        "Build-Conflicts",
+        "Build-Conflicts-Indep",
+        "Format",
+        "Standards-Version",
         "filecontents",
         ]))
 
@@ -286,17 +291,17 @@
                     "Unable to find mandatory field %s in %s" % (
                     mandatory_field, self.filename))
 
-        self.maintainer = self.parseAddress(self._dict['maintainer'])
+        self.maintainer = self.parseAddress(self._dict['Maintainer'])
 
         # If format is not present, assume 1.0. At least one tool in
         # the wild generates dsc files with format missing, and we need
         # to accept them.
-        if 'format' not in self._dict:
-            self._dict['format'] = "1.0"
+        if 'Format' not in self._dict:
+            self._dict['Format'] = "1.0"
 
         if self.format is None:
             raise EarlyReturnUploadError(
-                "Unsupported source format: %s" % self._dict['format'])
+                "Unsupported source format: %s" % self._dict['Format'])
 
         if self.policy.unsigned_dsc_ok:
             self.logger.debug("DSC file can be unsigned.")
@@ -309,31 +314,31 @@
     @property
     def source(self):
         """Return the DSC source name."""
-        return self._dict['source']
+        return self._dict['Source']
 
     @property
     def dsc_version(self):
         """Return the DSC source version."""
-        return self._dict['version']
+        return self._dict['Version']
 
     @property
     def format(self):
         """Return the DSC format."""
         try:
             return SourcePackageFormat.getTermByToken(
-                self._dict['format']).value
+                self._dict['Format']).value
         except LookupError:
             return None
 
     @property
     def architecture(self):
         """Return the DSC source architecture."""
-        return self._dict['architecture']
+        return self._dict['Architecture']
 
     @property
     def binary(self):
         """Return the DSC claimed binary line."""
-        return self._dict['binary']
+        return self._dict['Binary']
 
 
     #
@@ -356,7 +361,7 @@
             yield error
 
         files = []
-        for fileline in self._dict['files'].strip().split("\n"):
+        for fileline in self._dict['Files'].strip().split("\n"):
             # DSC lines are always of the form: CHECKSUM SIZE FILENAME
             digest, size, filename = fileline.strip().split()
             if not re_issource.match(filename):
@@ -390,7 +395,7 @@
                 (self.filename, self.format, self.policy.distroseries.name))
 
         # Validate the build dependencies
-        for field_name in ['build-depends', 'build-depends-indep']:
+        for field_name in ['Build-Depends', 'Build-Depends-Indep']:
             field = self._dict.get(field_name, None)
             if field is not None:
                 if field.startswith("ARRAY"):
@@ -669,7 +674,7 @@
 
         # We have no way of knowing what encoding the original copyright
         # file is in, unfortunately, and there is no standard, so guess.
-        encoded = {}
+        encoded = Deb822Dict()
         for key, value in pending.items():
             if value is not None:
                 encoded[key] = guess_encoding(value)
@@ -698,19 +703,19 @@
             sourcepackagename=source_name,
             version=self.dsc_version,
             maintainer=self.maintainer['person'],
-            builddepends=encoded.get('build-depends', ''),
-            builddependsindep=encoded.get('build-depends-indep', ''),
-            build_conflicts=encoded.get('build-conflicts', ''),
-            build_conflicts_indep=encoded.get('build-conflicts-indep', ''),
-            architecturehintlist=encoded.get('architecture', ''),
+            builddepends=encoded.get('Build-Depends', ''),
+            builddependsindep=encoded.get('Build-Depends-Indep', ''),
+            build_conflicts=encoded.get('Build-Conflicts', ''),
+            build_conflicts_indep=encoded.get('Build-Conflicts-Indep', ''),
+            architecturehintlist=encoded.get('Architecture', ''),
             creator=self.changes.changed_by['person'],
             urgency=self.changes.converted_urgency,
             dsc=encoded['filecontents'],
             dscsigningkey=self.signingkey,
-            dsc_maintainer_rfc822=encoded['maintainer'],
-            dsc_format=encoded['format'],
-            dsc_binaries=encoded['binary'],
-            dsc_standards_version=encoded.get('standards-version'),
+            dsc_maintainer_rfc822=encoded['Maintainer'],
+            dsc_format=encoded['Format'],
+            dsc_binaries=encoded['Binary'],
+            dsc_standards_version=encoded.get('Standards-Version'),
             component=self.component,
             changelog=changelog_lfa,
             changelog_entry=encoded.get('simulated_changelog'),

=== modified file 'lib/lp/archiveuploader/nascentuploadfile.py'
--- lib/lp/archiveuploader/nascentuploadfile.py	2010-08-26 16:34:06 +0000
+++ lib/lp/archiveuploader/nascentuploadfile.py	2010-08-26 17:06:04 +0000
@@ -19,6 +19,12 @@
     'splitComponentAndSection',
     ]
 
+<<<<<<< TREE
+=======
+import apt_inst
+import apt_pkg
+from debian.deb822 import Deb822Dict
+>>>>>>> MERGE-SOURCE
 import hashlib
 import os
 import subprocess
@@ -884,7 +890,7 @@
         """Insert this binary release and build into the database."""
         # Reencode everything we are supplying, because old packages
         # contain latin-1 text and that sucks.
-        encoded = {}
+        encoded = Deb822Dict()
         for key, value in self.control.items():
             encoded[key] = guess_encoding(value)
 

=== modified file 'lib/lp/archiveuploader/tagfiles.py'
--- lib/lp/archiveuploader/tagfiles.py	2010-08-20 20:31:18 +0000
+++ lib/lp/archiveuploader/tagfiles.py	2010-08-26 17:06:04 +0000
@@ -1,10 +1,15 @@
 # Copyright 2009 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
-import re
-
-import apt_pkg
-
+<<<<<<< TREE
+import re
+
+import apt_pkg
+
+=======
+import apt_pkg
+import re
+>>>>>>> MERGE-SOURCE
 
 __all__ = [
     'TagFile', 'TagStanza', 'TagFileParseError',
@@ -92,6 +97,7 @@
       '-----BEGIN PGP SIGNATURE-----'.
     """
     error = ""
+
     changes = {}
 
     # Reindex by line number so we can easily verify the format of
@@ -152,7 +158,7 @@
             continue
         slf = re_single_line_field.match(line)
         if slf:
-            field = slf.groups()[0].lower()
+            field = slf.groups()[0]
             changes[field] = slf.groups()[1]
 
             # If there is no value on this line, we assume this is

=== modified file 'lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt'
--- lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt	2008-09-15 08:13:00 +0000
+++ lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt	2010-08-26 17:06:04 +0000
@@ -79,7 +79,7 @@
     >>> bar2_src.changes.changed_by['person'].name
     u'kinnison'
 
-    >>> bar2_src.changes._dict['launchpad-bugs-fixed']
+    >>> bar2_src.changes._dict['Launchpad-bugs-fixed']
     '6'
 
     >>> print bar2_src.changes.changes_comment

=== modified file 'lib/lp/archiveuploader/tests/nascentuploadfile.txt'
--- lib/lp/archiveuploader/tests/nascentuploadfile.txt	2010-08-20 12:11:30 +0000
+++ lib/lp/archiveuploader/tests/nascentuploadfile.txt	2010-08-26 17:06:04 +0000
@@ -233,8 +233,8 @@
 present in ChangesFile and DSCFile:
 
     >>> sig_file._dict = {}
-    >>> sig_file._dict['source'] = 'some-source'
-    >>> sig_file._dict['version'] = '6.6.6'
+    >>> sig_file._dict['Source'] = 'some-source'
+    >>> sig_file._dict['Version'] = '6.6.6'
 
 After initiliasing sig_file we can parse addresses and look them up in
 Launchpad:

=== modified file 'lib/lp/archiveuploader/tests/test_nascentuploadfile.py'
--- lib/lp/archiveuploader/tests/test_nascentuploadfile.py	2010-08-25 11:48:45 +0000
+++ lib/lp/archiveuploader/tests/test_nascentuploadfile.py	2010-08-26 17:06:04 +0000
@@ -175,6 +175,21 @@
         self.assertEquals("0.42", release.version)
         self.assertEquals("dpkg, bzr", release.builddepends)
 
+    def test_storeInDatabase_case_sensitivity(self):
+        # storeInDatabase supports field names with different cases,
+        # confirming to Debian policy.
+        dsc = self.getBaseDsc()
+        dsc["buIld-depends"] = "dpkg, bzr"
+        changes = self.getBaseChanges()
+        uploadfile = self.createDSCFile(
+            "foo.dsc", dsc, "main/net", "extra", "dulwich", "0.42",
+            self.createChangesFile("foo.changes", changes))
+        uploadfile.files = []
+        (uploadfile.changelog_path, changelog_digest, changelog_size) = (
+            self.writeUploadFile("changelog", "DUMMY"))
+        release = uploadfile.storeInDatabase(None)
+        self.assertEquals("dpkg, bzr", release.builddepends)
+
     def test_user_defined_fields(self):
         # Test that storeInDatabase updates user_defined_fields.
         dsc = self.getBaseDsc()
@@ -188,7 +203,7 @@
         release = uploadfile.storeInDatabase(None)
         # DSCFile lowercases the field names
         self.assertEquals(
-            [["python-version", u"2.5"]], release.user_defined_fields)
+            [["Python-Version", u"2.5"]], release.user_defined_fields)
 
 
 class DebBinaryUploadFileTests(PackageUploadFileTestCase):

=== modified file 'lib/lp/archiveuploader/tests/test_tagfiles.py'
--- lib/lp/archiveuploader/tests/test_tagfiles.py	2010-08-20 20:31:18 +0000
+++ lib/lp/archiveuploader/tests/test_tagfiles.py	2010-08-26 17:06:04 +0000
@@ -76,7 +76,7 @@
                           parse_tagfile, datadir("bad-multiline-changes"), 1)
 
     def testCheckParseUnterminatedSigRaises(self):
-        """lp.archiveuploader.tagfiles.parse_chantges should raise
+        """lp.archiveuploader.tagfiles.parse_changes should raise
            TagFileParseError on unterminated signatures
         """
         self.assertRaises(TagFileParseError,
@@ -128,7 +128,7 @@
 
         self.assertEqual(
             expected_text,
-            self.parse_tagfile_version['binary'])
+            self.parse_tagfile_version['Binary'])
 
     def test_parse_tagfile_with_newline_delimited_field(self):
         """parse_tagfile should not leave leading or tailing '\n' when
@@ -157,7 +157,7 @@
 
         self.assertEqual(
             expected_text,
-            self.parse_tagfile_version['files'])
+            self.parse_tagfile_version['Files'])
 
     def test_parse_description_field(self):
         """Apt-pkg preserves the blank-line indicator and does not strip
@@ -186,4 +186,4 @@
         # replaced by ParseTagFiles).
         self.assertEqual(
             expected_text,
-            self.parse_tagfile_version['description'])
+            self.parse_tagfile_version['Description'])

=== modified file 'lib/lp/archiveuploader/tests/test_uploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_uploadprocessor.py	2010-08-20 20:31:18 +0000
+++ lib/lp/archiveuploader/tests/test_uploadprocessor.py	2010-08-26 17:06:04 +0000
@@ -1200,7 +1200,7 @@
         error_report.write(fp)
         error_text = fp.getvalue()
         self.assertTrue(
-            "Unable to find mandatory field 'files' in the changes file" in error_text)
+            "Unable to find mandatory field 'Files' in the changes file" in error_text)
 
         # Housekeeping so the next test won't fail.
         shutil.rmtree(upload_dir)
@@ -1367,7 +1367,7 @@
             % error_text)
 
         expected_explanation = (
-            "Unable to find mandatory field 'files' in the changes file.")
+            "Unable to find mandatory field 'Files' in the changes file.")
         self.failUnless(
             error_text.find(expected_explanation) >= 0,
             'Expected Exception text not found in OOPS report:\n%s'

=== modified file 'lib/lp/archiveuploader/tests/test_utils.py'
--- lib/lp/archiveuploader/tests/test_utils.py	2010-08-20 20:31:18 +0000
+++ lib/lp/archiveuploader/tests/test_utils.py	2010-08-26 17:06:04 +0000
@@ -124,17 +124,6 @@
         self.assertEquals(sect, "libs")
         self.assertEquals(comp, "restricted")
 
-    def testBuildFileListFromChanges(self):
-        """lp.archiveuploader.utils.build_file_list should be capable of
-           reading changes files
-        """
-        from lp.archiveuploader.utils import build_file_list
-        from lp.archiveuploader.tagfiles import parse_tagfile
-
-        ch = parse_tagfile(datadir("good-signed-changes"))
-        fl = build_file_list(ch)
-        self.assertEquals("abiword_2.0.10-1.2_mips.deb" in fl, True)
-
     def testFixMaintainerOkay(self):
         """lp.archiveuploader.utils.fix_maintainer should parse correct values
         """

=== modified file 'lib/lp/soyuz/model/queue.py'
--- lib/lp/soyuz/model/queue.py	2010-08-20 20:31:18 +0000
+++ lib/lp/soyuz/model/queue.py	2010-08-26 17:06:04 +0000
@@ -799,16 +799,16 @@
         :changes: A dictionary with the changes file content.
         """
         # Add the date field.
-        message.DATE = 'Date: %s' % changes['date']
+        message.DATE = 'Date: %s' % changes['Date']
 
         # Add the debian 'Changed-By:' field.
-        changed_by = changes.get('changed-by')
+        changed_by = changes.get('Changed-By')
         if changed_by is not None:
             changed_by = sanitize_string(changed_by)
             message.CHANGEDBY = '\nChanged-By: %s' % changed_by
 
         # Add maintainer if present and different from changed-by.
-        maintainer = changes.get('maintainer')
+        maintainer = changes.get('Maintainer')
         if maintainer is not None:
             maintainer = sanitize_string(maintainer)
             if maintainer != changed_by:
@@ -829,8 +829,8 @@
                 message.SIGNER = '\nSigned-By: %s' % signer_signature
 
         # Add the debian 'Origin:' field if present.
-        if changes.get('origin') is not None:
-            message.ORIGIN = '\nOrigin: %s' % changes['origin']
+        if changes.get('Origin') is not None:
+            message.ORIGIN = '\nOrigin: %s' % changes['Origin']
 
         if self.sources or self.builds:
             message.SPR_URL = canonical_url(self.my_source_package_release)
@@ -853,7 +853,7 @@
             template = get_email_template('upload-rejection.txt')
             SUMMARY = sanitize_string(summary_text)
             CHANGESFILE = sanitize_string(
-                ChangesFile.formatChangesComment(changes['changes']))
+                ChangesFile.formatChangesComment(changes['Changes']))
             CHANGEDBY = ''
             ORIGIN = ''
             SIGNER = ''
@@ -931,7 +931,7 @@
             STATUS = "New"
             SUMMARY = summarystring
             CHANGESFILE = sanitize_string(
-                ChangesFile.formatChangesComment(changes['changes']))
+                ChangesFile.formatChangesComment(changes['Changes']))
             DISTRO = self.distroseries.distribution.title
             if announce_list:
                 ANNOUNCE = 'Announcing to %s' % announce_list
@@ -946,7 +946,7 @@
             SUMMARY = summarystring + (
                     "\nThis upload awaits approval by a distro manager\n")
             CHANGESFILE = sanitize_string(
-                ChangesFile.formatChangesComment(changes['changes']))
+                ChangesFile.formatChangesComment(changes['Changes']))
             DISTRO = self.distroseries.distribution.title
             if announce_list:
                 ANNOUNCE = 'Announcing to %s' % announce_list
@@ -965,7 +965,7 @@
             STATUS = "Accepted"
             SUMMARY = summarystring
             CHANGESFILE = sanitize_string(
-                ChangesFile.formatChangesComment(changes['changes']))
+                ChangesFile.formatChangesComment(changes['Changes']))
             DISTRO = self.distroseries.distribution.title
             if announce_list:
                 ANNOUNCE = 'Announcing to %s' % announce_list
@@ -992,7 +992,7 @@
             STATUS = "Accepted"
             SUMMARY = summarystring
             CHANGESFILE = sanitize_string(
-                ChangesFile.formatChangesComment(changes['changes']))
+                ChangesFile.formatChangesComment(changes['Changes']))
             CHANGEDBY = ''
             ORIGIN = ''
             SIGNER = ''
@@ -1043,14 +1043,14 @@
         do_sendmail(AcceptedMessage)
 
         # Don't send announcements for Debian auto sync uploads.
-        if self.isAutoSyncUpload(changed_by_email=changes['changed-by']):
+        if self.isAutoSyncUpload(changed_by_email=changes['Changed-By']):
             return
 
         if announce_list:
             if not self.signing_key:
                 from_addr = None
             else:
-                from_addr = guess_encoding(changes['changed-by'])
+                from_addr = guess_encoding(changes['Changed-By'])
 
             do_sendmail(
                 AnnouncementMessage,
@@ -1133,7 +1133,7 @@
         """Return a list of recipients for notification emails."""
         candidate_recipients = []
         debug(self.logger, "Building recipients list.")
-        changer = self._emailToPerson(changes['changed-by'])
+        changer = self._emailToPerson(changes['Changed-By'])
 
         if self.signing_key:
             # This is a signed upload.
@@ -1155,7 +1155,7 @@
 
         # If this is not a PPA, we also consider maintainer and changed-by.
         if self.signing_key and not self.isPPA():
-            maintainer = self._emailToPerson(changes['maintainer'])
+            maintainer = self._emailToPerson(changes['Maintainer'])
             if (maintainer and maintainer != signer and
                     maintainer.isUploader(self.distroseries.distribution)):
                 debug(self.logger, "Adding maintainer to recipients")

=== modified file 'lib/lp/soyuz/scripts/processaccepted.py'
--- lib/lp/soyuz/scripts/processaccepted.py	2010-08-20 20:31:18 +0000
+++ lib/lp/soyuz/scripts/processaccepted.py	2010-08-26 17:06:04 +0000
@@ -46,7 +46,7 @@
     contents = changes_file.read()
     changes_lines = contents.splitlines(True)
     tags = parse_tagfile_lines(changes_lines, allow_unsigned=True)
-    bugs_fixed_line = tags.get('launchpad-bugs-fixed', '')
+    bugs_fixed_line = tags.get('Launchpad-bugs-fixed', '')
     bugs = []
     for bug_id in bugs_fixed_line.split():
         if not bug_id.isdigit():

=== modified file 'lib/lp/soyuz/scripts/tests/test_queue.py'
--- lib/lp/soyuz/scripts/tests/test_queue.py	2010-08-20 20:31:18 +0000
+++ lib/lp/soyuz/scripts/tests/test_queue.py	2010-08-26 17:06:04 +0000
@@ -380,10 +380,10 @@
         queue_action = self.execute_command('accept bar', no_mail=False)
 
         # The upload wants to close bug 6:
-        bugs_fixed_header = bar2_src.changes._dict['launchpad-bugs-fixed']
+        bugs_fixed_header = bar2_src.changes._dict['Launchpad-bugs-fixed']
         self.assertEqual(
             bugs_fixed_header, str(the_bug_id),
-            'Expected bug %s in launchpad-bugs-fixed, got %s'
+            'Expected bug %s in Launchpad-bugs-fixed, got %s'
                 % (the_bug_id, bugs_fixed_header))
 
         # The upload should be in the DONE state:

=== modified file 'lib/lp/soyuz/scripts/tests/test_sync_source.py'
--- lib/lp/soyuz/scripts/tests/test_sync_source.py	2010-08-20 20:31:18 +0000
+++ lib/lp/soyuz/scripts/tests/test_sync_source.py	2010-08-26 17:06:04 +0000
@@ -322,25 +322,25 @@
             expected_changesfile, allow_unsigned=True)
 
         # It refers to the right source/version.
-        self.assertEqual(parsed_changes['source'], 'bar')
-        self.assertEqual(parsed_changes['version'], '1.0-1')
+        self.assertEqual(parsed_changes['Source'], 'bar')
+        self.assertEqual(parsed_changes['Version'], '1.0-1')
 
         # It includes the correct 'origin' and 'target' information.
-        self.assertEqual(parsed_changes['origin'], 'Debian/incoming')
-        self.assertEqual(parsed_changes['distribution'], 'hoary')
+        self.assertEqual(parsed_changes['Origin'], 'Debian/incoming')
+        self.assertEqual(parsed_changes['Distribution'], 'hoary')
 
         # 'closes' and 'launchpad-bug-fixed' are filled according to
         # what is listed in the debian/changelog.
-        self.assertEqual(parsed_changes['closes'], '1 2 1234 4321')
-        self.assertEqual(parsed_changes['launchpad-bugs-fixed'], '1234 4321')
+        self.assertEqual(parsed_changes['Closes'], '1 2 1234 4321')
+        self.assertEqual(parsed_changes['Launchpad-bugs-fixed'], '1234 4321')
 
         # And finally, 'maintainer' role was preserved and 'changed-by'
         # role was assigned as specified in the sync-source command-line.
         self.assertEqual(
-            parsed_changes['maintainer'],
+            parsed_changes['Maintainer'],
             'Launchpad team <launchpad@xxxxxxxxxxxxxxxxxxx>')
         self.assertEqual(
-            parsed_changes['changed-by'],
+            parsed_changes['Changed-By'],
             'Celso Providelo <celso.providelo@xxxxxxxxxxxxx>')
 
         os.unlink(expected_changesfile)
@@ -397,20 +397,20 @@
             expected_changesfile, allow_unsigned=True)
 
         # It refers to the right source/version.
-        self.assertEqual(parsed_changes['source'], 'sample1')
-        self.assertEqual(parsed_changes['version'], '1.0-1')
+        self.assertEqual(parsed_changes['Source'], 'sample1')
+        self.assertEqual(parsed_changes['Version'], '1.0-1')
 
         # It includes the correct 'origin' and 'target' information.
-        self.assertEqual(parsed_changes['origin'], 'Debian/incoming')
-        self.assertEqual(parsed_changes['distribution'], 'hoary')
+        self.assertEqual(parsed_changes['Origin'], 'Debian/incoming')
+        self.assertEqual(parsed_changes['Distribution'], 'hoary')
 
         # And finally, 'maintainer' role was preserved and 'changed-by'
         # role was assigned as specified in the sync-source command-line.
         self.assertEqual(
-            parsed_changes['maintainer'],
+            parsed_changes['Maintainer'],
             'Raphael Hertzog <hertzog@xxxxxxxxxx>')
         self.assertEqual(
-            parsed_changes['changed-by'],
+            parsed_changes['Changed-By'],
             'Celso Providelo <celso.providelo@xxxxxxxxxxxxx>')
 
         os.unlink(expected_changesfile)

=== modified file 'scripts/ftpmaster-tools/sync-source.py'
--- scripts/ftpmaster-tools/sync-source.py	2010-08-26 06:29:02 +0000
+++ scripts/ftpmaster-tools/sync-source.py	2010-08-26 17:06:04 +0000
@@ -169,7 +169,7 @@
     if closes:
         changes += "Closes: %s\n" % (" ".join(closes))
     if lp_closes:
-        changes += "Launchpad-Bugs-Fixed: %s\n" % (" ".join(lp_closes))
+        changes += "Launchpad-bugs-fixed: %s\n" % (" ".join(lp_closes))
     changes += "Changes: \n"
     changes += changelog
     changes += "Files: \n"


Follow ups