From: Zac Medico Date: Fri, 6 Aug 2010 12:49:28 +0000 (-0700) Subject: Add a _MaskReason.hint attribute that the --autounmask code can use X-Git-Tag: v2.2_rc68~380 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=73dcdcd67c9c3fd7abf4782aaeab0d1ee126ad33;p=portage.git Add a _MaskReason.hint attribute that the --autounmask code can use to simplify the 'unstable keyword' check. --- 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