launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #02240
[Merge] lp:~jelmer/launchpad/435316-binary-new-lines into lp:launchpad
Jelmer Vernooij has proposed merging lp:~jelmer/launchpad/435316-binary-new-lines into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
#435316 new lines in the changes file Binary: field triggers a parsing error
https://bugs.launchpad.net/bugs/435316
For more details, see:
https://code.launchpad.net/~jelmer/launchpad/435316-binary-new-lines/+merge/44570
An earlier change to gina to use the Changes file generator from the "debian" Python package fixed the handling of new lines in generated .changes files.
This branch just adds two tests that demonstrate this is now fixed, and to make sure this doesn't regress in the future.
I've also removed an obsolete comment - we are in fact processing Closes fields nowadays.
Tests:
./bin/test lp.archiveuploader.tests.test_changesfile
./bin/test lp.soyuz.scripts.tests.test_sync_source
--
https://code.launchpad.net/~jelmer/launchpad/435316-binary-new-lines/+merge/44570
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jelmer/launchpad/435316-binary-new-lines into lp:launchpad.
=== modified file 'lib/lp/archiveuploader/tests/test_changesfile.py'
--- lib/lp/archiveuploader/tests/test_changesfile.py 2010-12-20 06:46:09 +0000
+++ lib/lp/archiveuploader/tests/test_changesfile.py 2010-12-23 13:44:00 +0000
@@ -107,6 +107,13 @@
"name": "dulwich_0.4.1-1.dsc"}]
return contents
+ def test_newline_in_Binary_field(self):
+ # Test that newlines in Binary: fields are accepted
+ contents = self.getBaseChanges()
+ contents["Binary"] = "binary1\n binary2 \n binary3"
+ changes = self.createChangesFile("mypkg_0.1_i386.changes", contents)
+ self.assertEquals(set(["binary1", "binary2", "binary3"]), changes.binaries)
+
def test_checkFileName(self):
# checkFileName() yields an UploadError if the filename is invalid.
contents = self.getBaseChanges()
=== modified file 'lib/lp/soyuz/scripts/ftpmaster.py'
--- lib/lp/soyuz/scripts/ftpmaster.py 2010-09-23 02:12:27 +0000
+++ lib/lp/soyuz/scripts/ftpmaster.py 2010-12-23 13:44:00 +0000
@@ -1443,8 +1443,6 @@
# XXX cprov 2007-07-03:
# Changed-By can be extracted from most-recent changelog footer,
# but do we care?
- # XXX James Troup 2006-01-30:
- # 'Closes' but could be gotten from changelog, but we don't use them?
changes = Changes()
changes["Origin"] = "%s/%s" % (origin["name"], origin["suite"])
=== modified file 'lib/lp/soyuz/scripts/tests/test_sync_source.py'
--- lib/lp/soyuz/scripts/tests/test_sync_source.py 2010-12-23 01:02:00 +0000
+++ lib/lp/soyuz/scripts/tests/test_sync_source.py 2010-12-23 13:44:00 +0000
@@ -493,6 +493,14 @@
self.assertEquals("1232 4323", changes["Closes"])
self.assertNotIn("Launchpad-bugs-fixed", changes)
+ def test_binary_newline(self):
+ # If the Dsc Binary: line contains newlines those are properly
+ # formatted in the new changes file.
+ dsc = self.getBaseDsc()
+ dsc["Binary"] = "binary1\n binary2 \n binary3"
+ changes = self.generateChanges(dsc=dsc)
+ self.assertEquals("binary1\n binary2 \n binary3", changes["Binary"])
+
def test_lp_closes(self):
# Launchpad-Bugs-Fixed gets set if any Launchpad bugs to close were
# specified.