Permit cyclic graphs in module dependencies
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 23 Jan 2009 18:36:02 +0000 (18:36 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 23 Jan 2009 18:36:02 +0000 (18:36 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2221 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BModulePage.py

index f2ecdeba56381445730898f6c605bd699bfa6aef..39cf91d99854e2aa388bf6f60388f95b955f1214 100644 (file)
@@ -169,19 +169,21 @@ class BModulePage(BWizardPage):
                                 QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes)
     
     def selectDependencyCheck(self, module):
-        unsatisfied = []
+        unsatisfied = set()
         modules = self._projectInfoRetrieve("MODULES")
         for dependency in modules[module]["depends"]:
             if not modules[dependency]["enabled"]:
-                unsatisfied.append(dependency)
-                unsatisfied += self.selectDependencyCheck(dependency)
+                unsatisfied |= set([dependency])
+                if dependency not in unsatisfied:
+                    unsatisfied |= self.selectDependencyCheck(dependency)
         return unsatisfied
     
     def unselectDependencyCheck(self, dependency):
-        unsatisfied = []
+        unsatisfied = set()
         modules = self._projectInfoRetrieve("MODULES")
         for module, informations in modules.items():
             if dependency in informations["depends"] and informations["enabled"]:
-                unsatisfied.append(module)
-                unsatisfied += self.unselectDependencyCheck(module)
+                unsatisfied |= set([module])
+                if dependency not in unsatisfied:
+                    unsatisfied |= self.unselectDependencyCheck(module)
         return unsatisfied
\ No newline at end of file