← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/bug-1480013 into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/bug-1480013 into lp:launchpad.

Commit message:
Fix BinaryPackageBuild.updateDependencies to handle </> constraints again. Regression from the python-apt -> python-debian port.

Requested reviews:
  William Grant (wgrant): code
Related bugs:
  Bug #1480013 in Launchpad itself: "buildd-retry-depwait crashes on </> version mismatches from launchpad-buildd"
  https://bugs.launchpad.net/launchpad/+bug/1480013

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/bug-1480013/+merge/266501

Fix BinaryPackageBuild.updateDependencies to handle </> constraints.

It lost that ability as part of the python-apt -> python-debian port, but launchpad-buildd can still return them.
-- 
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== modified file 'lib/lp/soyuz/model/binarypackagebuild.py'
--- lib/lp/soyuz/model/binarypackagebuild.py	2015-07-29 17:11:58 +0000
+++ lib/lp/soyuz/model/binarypackagebuild.py	2015-07-31 01:59:53 +0000
@@ -517,6 +517,10 @@
             version = ''
         else:
             relation, version = token['version']
+            if relation == '<':
+                relation = '<<'
+            elif relation == '>':
+                relation = '>>'
         return (token['name'], version, relation)
 
     def _checkDependencyVersion(self, available, required, relation):

=== modified file 'lib/lp/soyuz/tests/test_binarypackagebuild.py'
--- lib/lp/soyuz/tests/test_binarypackagebuild.py	2015-07-03 14:30:48 +0000
+++ lib/lp/soyuz/tests/test_binarypackagebuild.py	2015-07-31 01:59:53 +0000
@@ -347,6 +347,23 @@
         depwait_build.updateDependencies()
         self.assertEqual(u'dep-tools', depwait_build.dependencies)
 
+    def testAptVersionConstraints(self):
+        # launchpad-buildd can return apt-style version constraints
+        # using < and > rather than << and >>.
+        depwait_build = self._setupSimpleDepwaitContext()
+        self.layer.txn.commit()
+
+        depwait_build.updateStatus(
+            BuildStatus.MANUALDEPWAIT,
+            slave_status={'dependencies': u'dep-bin (> 666), dep-bin (< 777)'})
+        depwait_build.updateDependencies()
+        self.assertEqual(depwait_build.dependencies, u'dep-bin (> 666)')
+        depwait_build.updateStatus(
+            BuildStatus.MANUALDEPWAIT,
+            slave_status={'dependencies': u'dep-bin (> 665)'})
+        depwait_build.updateDependencies()
+        self.assertEqual(depwait_build.dependencies, u'')
+
 
 class BaseTestCaseWithThreeBuilds(TestCaseWithFactory):
 


References