From: Zac Medico Date: Sat, 19 Jan 2013 22:01:26 +0000 (-0800) Subject: Fix stable mask logic for repoman. X-Git-Tag: v2.2.0_alpha156~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=00c9dd27618d20acdb9a700fbef09e292c329fe3;p=portage.git Fix stable mask logic for repoman. For repoman, if the package has an effective stable keyword that intersects with the effective ACCEPT_KEYWORDS for the current profile, then consider it stable. --- diff --git a/pym/portage/package/ebuild/_config/KeywordsManager.py b/pym/portage/package/ebuild/_config/KeywordsManager.py index d4778899c..3e029c381 100644 --- a/pym/portage/package/ebuild/_config/KeywordsManager.py +++ b/pym/portage/package/ebuild/_config/KeywordsManager.py @@ -111,15 +111,25 @@ class KeywordsManager(object): if self._getMissingKeywords(pkg, pgroups, mygroups): return False - # If replacing all keywords with unstable variants would mask the - # package, then it's considered stable. - unstable = [] - for kw in mygroups: - if kw[:1] != "~": - kw = "~" + kw - unstable.append(kw) - - return bool(self._getMissingKeywords(pkg, pgroups, set(unstable))) + if pkg.cpv._settings.local_config: + # If replacing all keywords with unstable variants would mask the + # package, then it's considered stable. + unstable = [] + for kw in mygroups: + if kw[:1] != "~": + kw = "~" + kw + unstable.append(kw) + + return bool(self._getMissingKeywords(pkg, pgroups, set(unstable))) + else: + # For repoman, if the package has an effective stable keyword that + # intersects with the effective ACCEPT_KEYWORDS for the current + # profile, then consider it stable. + for kw in pgroups: + if kw[:1] != "~": + if kw in mygroups: + return True + return False def getMissingKeywords(self, cpv, diff --git a/pym/portage/versions.py b/pym/portage/versions.py index d78873f9e..1dd2ff359 100644 --- a/pym/portage/versions.py +++ b/pym/portage/versions.py @@ -409,7 +409,10 @@ class _pkg_str(_unicode): except AttributeError: raise AttributeError('stable') stable = settings._isStable(self) - self.__dict__['_stable'] = stable + if settings.local_config: + # For repoman, don't cache this value, since + # it needs to be re-computed for each profile. + self.__dict__['_stable'] = stable return stable def pkgsplit(mypkg, silent=1, eapi=None):