diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-06 05:49:28 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-06 05:49:28 -0700 |
commit | 73dcdcd67c9c3fd7abf4782aaeab0d1ee126ad33 (patch) | |
tree | d59055911934f42aded629d884f058150ceb24c5 | |
parent | 82a1ed5044a54438392a4e604caf95777d11e0db (diff) | |
download | portage-73dcdcd67c9c3fd7abf4782aaeab0d1ee126ad33.tar.gz portage-73dcdcd67c9c3fd7abf4782aaeab0d1ee126ad33.tar.bz2 portage-73dcdcd67c9c3fd7abf4782aaeab0d1ee126ad33.zip |
Add a _MaskReason.hint attribute that the --autounmask code can use
to simplify the 'unstable keyword' check.
-rw-r--r-- | pym/_emerge/depgraph.py | 3 | ||||
-rw-r--r-- | pym/portage/package/ebuild/getmaskingstatus.py | 10 |
2 files changed, 8 insertions, 5 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 4dd3c3f1c..b7bbbd4b5 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2540,8 +2540,7 @@ class depgraph(object): return False mreasons = _get_masking_status(pkg, pkgsettings, root_config) if len(mreasons) == 1 and \ - mreasons[0].category == 'KEYWORDS' and \ - mreasons[0].message.startswith("~"): + mreasons[0].hint == 'unstable keyword': return True else: return False diff --git a/pym/portage/package/ebuild/getmaskingstatus.py b/pym/portage/package/ebuild/getmaskingstatus.py index 61a06e76a..5b2090186 100644 --- a/pym/portage/package/ebuild/getmaskingstatus.py +++ b/pym/portage/package/ebuild/getmaskingstatus.py @@ -17,11 +17,12 @@ if sys.hexversion >= 0x3000000: class _MaskReason(object): - __slots__ = ('category', 'message') + __slots__ = ('category', 'message', 'hint') - def __init__(self, category, message): + def __init__(self, category, message, hint=None): self.category = category self.message = message + self.hint = hint def getmaskingstatus(mycpv, settings=None, portdb=None): if settings is None: @@ -114,6 +115,7 @@ def _getmaskingstatus(mycpv, settings, portdb): del inc_pgroups kmask = "missing" + kmask_hint = None if '**' in pgroups: kmask = None @@ -133,6 +135,7 @@ def _getmaskingstatus(mycpv, settings, portdb): break elif gp=="~"+myarch and myarch in pgroups: kmask="~"+myarch + kmask_hint = "unstable keyword" break try: @@ -166,6 +169,7 @@ def _getmaskingstatus(mycpv, settings, portdb): # Only show KEYWORDS masks for installed packages # if they're not masked for any other reason. if kmask and (not installed or not rValue): - rValue.append(_MaskReason("KEYWORDS", kmask + " keyword")) + rValue.append(_MaskReason("KEYWORDS", + kmask + " keyword", hint=kmask_hint)) return rValue |