merge changes from stable branch
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Fri, 29 Oct 2010 00:03:48 +0200
changeset 6660 f5a018f330ac
parent 6658 e8ede572b221 (current diff)
parent 6659 6205927e927a (diff)
child 6662 8862bf4a6dd4
merge changes from stable branch
cwconfig.py
--- a/cwconfig.py	Thu Oct 28 19:39:19 2010 +0200
+++ b/cwconfig.py	Fri Oct 29 00:03:48 2010 +0200
@@ -495,8 +495,6 @@
                 deps = dict( (x[len('cubicweb-'):], v)
                              for x, v in gendeps.iteritems()
                              if x.startswith('cubicweb-'))
-                if 'cubicweb' in gendeps:
-                    deps['cubicweb'] = gendeps['cubicweb']
         if not isinstance(deps, dict):
             deps = dict((key, None) for key in deps)
             warn('[3.8] cube %s should define %s as a dict' % (cube, key),
@@ -511,6 +509,16 @@
         return deps
 
     @classmethod
+    def cube_depends_cubicweb_version(cls, cube):
+        # XXX no backward compat (see _cube_deps above)
+        try:
+            pkginfo = cls.cube_pkginfo(cube)
+            deps = getattr(pkginfo, '__depends__')
+            return deps.get('cubicweb')
+        except AttributeError:
+            return None
+
+    @classmethod
     def cube_dependencies(cls, cube):
         """return cubicweb cubes used by the given cube"""
         return cls._cube_deps(cube, '__depends_cubes__', '__use__')
--- a/migration.py	Thu Oct 28 19:39:19 2010 +0200
+++ b/migration.py	Fri Oct 29 00:03:48 2010 +0200
@@ -470,6 +470,7 @@
         for cube in self.cubes:
             if cube == 'cubicweb': continue
             self.dependencies[cube] = dict(self.config.cube_dependencies(cube))
+            self.dependencies[cube]['cubicweb'] = self.config.cube_depends_cubicweb_version(cube)
         # compute reverse dependencies
         for cube, dependencies in self.dependencies.iteritems():
             for name, constraint in dependencies.iteritems():