[config] new with_recommends option to expand_cubes
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 11 Aug 2009 12:21:45 +0200
changeset 2762 b1bb33b37992
parent 2761 7c583d02917b
child 2763 39b42e158249
[config] new with_recommends option to expand_cubes
cwconfig.py
--- a/cwconfig.py	Tue Aug 11 12:21:09 2009 +0200
+++ b/cwconfig.py	Tue Aug 11 12:21:45 2009 +0200
@@ -316,7 +316,7 @@
         return getattr(cls.cube_pkginfo(cube), '__recommend__', ())
 
     @classmethod
-    def expand_cubes(cls, cubes):
+    def expand_cubes(cls, cubes, with_recommends=False):
         """expand the given list of top level cubes used by adding recursivly
         each cube dependencies
         """
@@ -329,6 +329,12 @@
                     depcube = CW_MIGRATION_MAP.get(depcube, depcube)
                     cubes.append(depcube)
                     todo.append(depcube)
+            if with_recommends:
+                for depcube in cls.cube_recommends(cube):
+                    if depcube not in cubes:
+                        depcube = CW_MIGRATION_MAP.get(depcube, depcube)
+                        cubes.append(depcube)
+                        todo.append(depcube)
         return cubes
 
     @classmethod