common/migration.py
branchstable
changeset 2122 4ea13a828513
parent 1977 606923dff11b
child 2124 5a0b02f37b23
--- a/common/migration.py	Fri Jun 19 08:28:19 2009 +0200
+++ b/common/migration.py	Fri Jun 19 08:29:22 2009 +0200
@@ -328,14 +328,13 @@
             self.config.add_cubes(newcubes)
         return newcubes
 
-    def cmd_remove_cube(self, cube):
+    def cmd_remove_cube(self, cube, removedeps=True):
+        if removedeps:
+            toremove = self.config.expand_cubes([cube])
+        else:
+            toremove = (cube,)
         origcubes = self.config._cubes
-        basecubes = list(origcubes)
-        for pkg in self.config.expand_cubes([cube]):
-            try:
-                basecubes.remove(pkg)
-            except ValueError:
-                continue
+        basecubes = [c for c in origcubes if not c in toremove]
         self.config._cubes = tuple(self.config.expand_cubes(basecubes))
         removed = [p for p in origcubes if not p in self.config._cubes]
         assert cube in removed, \