repoman: fix use.stable, bug #456342
authorZac Medico <zmedico@gentoo.org>
Mon, 11 Feb 2013 06:30:13 +0000 (22:30 -0800)
committerZac Medico <zmedico@gentoo.org>
Mon, 11 Feb 2013 06:33:14 +0000 (22:33 -0800)
Make child package inherit stable status from the parent package.
This is required in order for USE deps of unstable packages to be
resolved correctly, since otherwise use.stable.{mask,force} settings
of dependencies may conflict (see bug #456342).

bin/repoman
pym/portage/dbapi/__init__.py
pym/portage/package/ebuild/_config/UseManager.py
pym/portage/package/ebuild/config.py

index 3532babf388f2c8720094d9b4b4b6d0a1cd08480..c1bb35714c2809e10a034e0a6f9cd15258a03ec8 100755 (executable)
@@ -2178,6 +2178,14 @@ for x in effective_scanlist:
                                # just in case, prevent config.reset() from nuking these.
                                dep_settings.backup_changes("ACCEPT_KEYWORDS")
 
+                               # This attribute is used in dbapi._match_use() to apply
+                               # use.stable.{mask,force} settings based on the stable
+                               # status of the parent package. This is required in order
+                               # for USE deps of unstable packages to be resolved correctly,
+                               # since otherwise use.stable.{mask,force} settings of
+                               # dependencies may conflict (see bug #456342).
+                               dep_settings._parent_stable = dep_settings._isStable(pkg)
+
                                if not baddepsyntax:
                                        ismasked = not ebuild_archs or \
                                                pkg.cpv not in portdb.xmatch("match-visible", pkg.cp)
index 79d1e7a3d51e59b4e27c4d44a5dc21666dfba1bc..ab4306d7025cb1b49b9e34c25889a44e59859eaf 100644 (file)
@@ -253,11 +253,13 @@ class dbapi(object):
                                pkg = _pkg_str(cpv, metadata=metadata, settings=self.settings)
                        else:
                                pkg = cpv
-                       usemask = self.settings._getUseMask(pkg)
+                       usemask = self.settings._getUseMask(pkg,
+                               stable=self.settings._parent_stable)
                        if any(x in usemask for x in atom.use.enabled):
                                return False
 
-                       useforce = self.settings._getUseForce(pkg)
+                       useforce = self.settings._getUseForce(pkg,
+                               stable=self.settings._parent_stable)
                        if any(x in useforce and x not in usemask
                                for x in atom.use.disabled):
                                return False
index 743160c42ae5ae50f4e258877d6b5782df388fc1..8e7aaa23f94d404e51a270aa89ae08e9b646cfda 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2010-2012 Gentoo Foundation
+# Copyright 2010-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = (
@@ -291,7 +291,7 @@ class UseManager(object):
                # stable check against the correct profile here.
                return self._is_stable(pkg)
 
-       def getUseMask(self, pkg=None):
+       def getUseMask(self, pkg=None, stable=None):
                if pkg is None:
                        return frozenset(stack_lists(
                                self._usemask_list, incremental=True))
@@ -304,7 +304,8 @@ class UseManager(object):
                        pkg = _pkg_str(remove_slot(pkg), slot=slot, repo=repo)
                        cp = pkg.cp
 
-               stable = self._isStable(pkg)
+               if stable is None:
+                       stable = self._isStable(pkg)
 
                usemask = []
 
@@ -351,7 +352,7 @@ class UseManager(object):
 
                return frozenset(stack_lists(usemask, incremental=True))
 
-       def getUseForce(self, pkg=None):
+       def getUseForce(self, pkg=None, stable=None):
                if pkg is None:
                        return frozenset(stack_lists(
                                self._useforce_list, incremental=True))
@@ -363,7 +364,8 @@ class UseManager(object):
                        pkg = _pkg_str(remove_slot(pkg), slot=slot, repo=repo)
                        cp = pkg.cp
 
-               stable = self._isStable(pkg)
+               if stable is None:
+                       stable = self._isStable(pkg)
 
                useforce = []
 
index a40cdd7c20cebd5edf13dbd175289d1f04ea94b1..0090e4ed23184a154ecfc9192d143c615f2d8b68 100644 (file)
@@ -221,6 +221,7 @@ class config(object):
                self._accept_properties = None
                self._features_overrides = []
                self._make_defaults = None
+               self._parent_stable = None
 
                # _unknown_features records unknown features that
                # have triggered warning messages, and ensures that
@@ -1734,11 +1735,11 @@ class config(object):
 
                return iuse_implicit
 
-       def _getUseMask(self, pkg):
-               return self._use_manager.getUseMask(pkg)
+       def _getUseMask(self, pkg, stable=None):
+               return self._use_manager.getUseMask(pkg, stable=stable)
 
-       def _getUseForce(self, pkg):
-               return self._use_manager.getUseForce(pkg)
+       def _getUseForce(self, pkg, stable=None):
+               return self._use_manager.getUseForce(pkg, stable=stable)
 
        def _getMaskAtom(self, cpv, metadata):
                """