From ce06761841f181d12c004a56ac945a14bb5d1758 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 10 Feb 2013 22:30:13 -0800 Subject: [PATCH] repoman: fix use.stable, bug #456342 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 | 8 ++++++++ pym/portage/dbapi/__init__.py | 6 ++++-- pym/portage/package/ebuild/_config/UseManager.py | 12 +++++++----- pym/portage/package/ebuild/config.py | 9 +++++---- 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/bin/repoman b/bin/repoman index 3532babf3..c1bb35714 100755 --- a/bin/repoman +++ b/bin/repoman @@ -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) diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py index 79d1e7a3d..ab4306d70 100644 --- a/pym/portage/dbapi/__init__.py +++ b/pym/portage/dbapi/__init__.py @@ -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 diff --git a/pym/portage/package/ebuild/_config/UseManager.py b/pym/portage/package/ebuild/_config/UseManager.py index 743160c42..8e7aaa23f 100644 --- a/pym/portage/package/ebuild/_config/UseManager.py +++ b/pym/portage/package/ebuild/_config/UseManager.py @@ -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 = [] diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index a40cdd7c2..0090e4ed2 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -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): """ -- 2.26.2