← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~allenap/launchpad/ddebs-n-udebs-go-shopping-bug-886452 into lp:launchpad

 

Gavin Panella has proposed merging lp:~allenap/launchpad/ddebs-n-udebs-go-shopping-bug-886452 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #886452 in Launchpad itself: "NascentUpload._matchDDEBs fails to handle ddebs for udebs"
  https://bugs.launchpad.net/launchpad/+bug/886452

For more details, see:
https://code.launchpad.net/~allenap/launchpad/ddebs-n-udebs-go-shopping-bug-886452/+merge/83632
-- 
https://code.launchpad.net/~allenap/launchpad/ddebs-n-udebs-go-shopping-bug-886452/+merge/83632
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~allenap/launchpad/ddebs-n-udebs-go-shopping-bug-886452 into lp:launchpad.
=== modified file 'lib/lp/archiveuploader/nascentupload.py'
--- lib/lp/archiveuploader/nascentupload.py	2011-10-25 11:44:47 +0000
+++ lib/lp/archiveuploader/nascentupload.py	2011-11-28 16:12:11 +0000
@@ -33,6 +33,7 @@
     DdebBinaryUploadFile,
     DebBinaryUploadFile,
     SourceUploadFile,
+    UdebBinaryUploadFile,
     UploadError,
     UploadWarning,
     )
@@ -348,9 +349,12 @@
                     unmatched_ddebs[ddeb_key] = uploaded_file
 
         for uploaded_file in self.changes.files:
-            # We need exactly a DEB, not a DDEB.
-            if (isinstance(uploaded_file, DebBinaryUploadFile) and
-                not isinstance(uploaded_file, DdebBinaryUploadFile)):
+            is_deb = isinstance(
+                uploaded_file, (DebBinaryUploadFile, UdebBinaryUploadFile))
+            is_ddeb = isinstance(
+                uploaded_file, DdebBinaryUploadFile)
+            # We need exactly a DEB or UDEB, not a DDEB.
+            if is_deb and not is_ddeb:
                 try:
                     matching_ddeb = unmatched_ddebs.pop(
                         (uploaded_file.package + '-dbgsym',

=== modified file 'lib/lp/archiveuploader/tests/test_nascentupload.py'
--- lib/lp/archiveuploader/tests/test_nascentupload.py	2011-10-19 11:09:38 +0000
+++ lib/lp/archiveuploader/tests/test_nascentupload.py	2011-11-28 16:12:11 +0000
@@ -1,4 +1,4 @@
-# Copyright 2010 Canonical Ltd.  This software is licensed under the
+# Copyright 2010-2011 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Test NascentUpload functionality."""
@@ -65,6 +65,8 @@
         self.addFile('blah_1.0_all.deb')
         self.addFile('libblah_1.0_i386.deb')
         self.addFile('libblah-dbgsym_1.0_i386.ddeb')
+        self.addFile('libfooble_1.0_i386.udeb')
+        self.addFile('libfooble-dbgsym_1.0_i386.ddeb')
         self.assertMatchDDEBErrors([])
         self.assertIs(None, self.changes.files[0].ddeb_file)
         self.assertIs(self.changes.files[2], self.changes.files[1].ddeb_file)