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 /pym/portage/package | |
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.
Diffstat (limited to 'pym/portage/package')
-rw-r--r-- | pym/portage/package/ebuild/getmaskingstatus.py | 10 |
1 files changed, 7 insertions, 3 deletions
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 |