Fix stable mask logic for repoman.
authorZac Medico <zmedico@gentoo.org>
Sat, 19 Jan 2013 22:01:26 +0000 (14:01 -0800)
committerZac Medico <zmedico@gentoo.org>
Sat, 19 Jan 2013 22:01:26 +0000 (14:01 -0800)
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.

pym/portage/package/ebuild/_config/KeywordsManager.py
pym/portage/versions.py

index d4778899c7db97f08e383e5dfcbaa0e571f05318..3e029c3816224beeb6a5b64a157c55336cd2a4d7 100644 (file)
@@ -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,
index d78873f9ee4b16b9096f6bb2c228fd320cf94459..1dd2ff359b32e738e2f358e5380b7e047c2c54f4 100644 (file)
@@ -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):