← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/allow-missing-changes-binary into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/allow-missing-changes-binary into lp:launchpad.

Commit message:
Allow source .changes files to omit the Binary field.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1813037 in Launchpad itself: ".changes from dpkg-genchanges 1.19.3 are rejected"
  https://bugs.launchpad.net/launchpad/+bug/1813037

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/allow-missing-changes-binary/+merge/363379
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/allow-missing-changes-binary into lp:launchpad.
=== modified file 'lib/lp/archiveuploader/changesfile.py'
--- lib/lp/archiveuploader/changesfile.py	2017-09-17 10:35:57 +0000
+++ lib/lp/archiveuploader/changesfile.py	2019-02-19 16:55:44 +0000
@@ -58,7 +58,7 @@
     """Changesfile model."""
 
     mandatory_fields = set([
-        "Source", "Binary", "Architecture", "Version", "Distribution",
+        "Source", "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
@@ -311,7 +311,7 @@
     @property
     def binaries(self):
         """Return set of binary package names listed."""
-        return set(self._dict['Binary'].strip().split())
+        return set(self._dict.get('Binary', '').strip().split())
 
     @property
     def converted_urgency(self):

=== added directory 'lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_no_binary_field'
=== added file 'lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_no_binary_field/bar_1.0-1.diff.gz'
Binary files lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_no_binary_field/bar_1.0-1.diff.gz	1970-01-01 00:00:00 +0000 and lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_no_binary_field/bar_1.0-1.diff.gz	2019-02-19 16:55:44 +0000 differ
=== added file 'lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_no_binary_field/bar_1.0-1.dsc'
--- lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_no_binary_field/bar_1.0-1.dsc	1970-01-01 00:00:00 +0000
+++ lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_no_binary_field/bar_1.0-1.dsc	2019-02-19 16:55:44 +0000
@@ -0,0 +1,21 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+Format: 1.0
+Source: bar
+Version: 1.0-1
+Binary: bar
+Maintainer: Launchpad team <launchpad@xxxxxxxxxxxxxxxxxxx>
+Architecture: any
+Standards-Version: 3.6.2
+Files: 
+ fc1464e5985b962a042d5354452f361d 164 bar_1.0.orig.tar.gz
+ 1e35b810764f140af9616de8274e6e73 537 bar_1.0-1.diff.gz
+
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.3 (GNU/Linux)
+
+iD8DBQFFt7Cojn63CGxkqMURAo6FAJ9ZUagUNtYpmZrqFwL6LXDKOUSOPwCdFqPa
+BdrMeT+0Hg+yMS69uO+qJRI=
+=mjFU
+-----END PGP SIGNATURE-----

=== added file 'lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_no_binary_field/bar_1.0-1_source.changes'
--- lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_no_binary_field/bar_1.0-1_source.changes	1970-01-01 00:00:00 +0000
+++ lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_no_binary_field/bar_1.0-1_source.changes	2019-02-19 16:55:44 +0000
@@ -0,0 +1,27 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+Format: 1.7
+Date: Thu, 16 Feb 2006 15:34:09 +0000
+Source: bar
+Architecture: source
+Version: 1.0-1
+Distribution: breezy
+Urgency: low
+Maintainer: Launchpad team <launchpad@xxxxxxxxxxxxxxxxxxx>
+Changed-By: Daniel Silverstone <daniel.silverstone@xxxxxxxxxxxxx>
+Changes: 
+ bar (1.0-1) breezy; urgency=low
+ .
+   * Initial version
+Files: 
+ 5d533778b698edc1a122098a98c8490e 512 devel optional bar_1.0-1.dsc
+ fc1464e5985b962a042d5354452f361d 164 devel optional bar_1.0.orig.tar.gz
+ 1e35b810764f140af9616de8274e6e73 537 devel optional bar_1.0-1.diff.gz
+
+-----BEGIN PGP SIGNATURE-----
+
+iF0EARECAB0WIQQ0DKO7Jw4nFsnuC3aOfrcIbGSoxQUCXGws2QAKCRCOfrcIbGSo
+xcvwAJ4qSgGJOxs95sQMqWnBtEqJvmVVlgCfQ6Tdctq1YPjdsPEHDtqOdAMCvcc=
+=iQ/q
+-----END PGP SIGNATURE-----

=== added file 'lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_no_binary_field/bar_1.0.orig.tar.gz'
Binary files lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_no_binary_field/bar_1.0.orig.tar.gz	1970-01-01 00:00:00 +0000 and lib/lp/archiveuploader/tests/data/suite/bar_1.0-1_no_binary_field/bar_1.0.orig.tar.gz	2019-02-19 16:55:44 +0000 differ
=== modified file 'lib/lp/archiveuploader/tests/test_uploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_uploadprocessor.py	2018-05-03 15:10:39 +0000
+++ lib/lp/archiveuploader/tests/test_uploadprocessor.py	2019-02-19 16:55:44 +0000
@@ -1486,6 +1486,35 @@
             "Expected one 'bar' item in the queue, actually got %d."
                 % queue_items.count())
 
+    def testSourceUploadWithoutBinaryField(self):
+        """Source uploads may omit the Binary field.
+
+        dpkg >= 1.19.3 omits the Binary field (as well as Description) from
+        sourceful .changes files, so don't require it.
+        """
+        self.setupBreezy()
+        self.layer.txn.commit()
+        self.options.context = 'absolutely-anything'
+        uploadprocessor = self.getUploadProcessor(self.layer.txn)
+
+        upload_dir = self.queueUpload("bar_1.0-1_no_binary_field")
+        self.processUpload(uploadprocessor, upload_dir)
+        [msg] = pop_notifications()
+        self.assertNotIn(
+            "rejected", str(msg), "Failed to upload bar source:\n%s" % msg)
+        spph = self.publishPackage("bar", "1.0-1")
+
+        self.assertEqual(
+            sorted((sprf.libraryfile.filename, sprf.filetype)
+                   for sprf in spph.sourcepackagerelease.files),
+            [('bar_1.0-1.diff.gz',
+              SourcePackageFileType.DIFF),
+             ('bar_1.0-1.dsc',
+              SourcePackageFileType.DSC),
+             ('bar_1.0.orig.tar.gz',
+              SourcePackageFileType.ORIG_TARBALL),
+             ])
+
     def testUploadResultingInNoBuilds(self):
         """Source uploads resulting in no builds.
 


Follow ups