_create_use_string: pass in feature_flags arg v2.2.0_alpha132
authorZac Medico <zmedico@gentoo.org>
Mon, 24 Sep 2012 03:12:14 +0000 (20:12 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 24 Sep 2012 03:12:14 +0000 (20:12 -0700)
This allows them to be looked up outside of the USE_EXPAND loop.

pym/_emerge/resolver/output.py
pym/_emerge/resolver/output_helpers.py

index 0f2111f6dec071d8574491f4c5bf10433e3fd8c7..6ae022e00186a2c1845dd0c375072e8d9ca93d96 100644 (file)
@@ -14,7 +14,9 @@ from portage import os
 from portage import _unicode_decode
 from portage.dbapi.dep_expand import dep_expand
 from portage.dep import cpvequal, _repo_separator
+from portage.eapi import _get_eapi_attrs
 from portage.exception import InvalidDependString, SignatureException
+from portage.package.ebuild.config import _get_feature_flags
 from portage.package.ebuild._spawn_nofetch import spawn_nofetch
 from portage.output import ( blue, colorize, create_color_func,
        darkblue, darkgreen, green, nc_len, teal)
@@ -247,14 +249,15 @@ class Display(object):
 
                use_expand = sorted(self.use_expand)
                use_expand.insert(0, "USE")
+               feature_flags = _get_feature_flags(_get_eapi_attrs(pkg.metadata["EAPI"]))
 
                for key in use_expand:
                        if key in self.use_expand_hidden:
                                continue
-                       self.verboseadd += _create_use_string(pkg, self.conf, key.upper(),
+                       self.verboseadd += _create_use_string(self.conf, key.upper(),
                                cur_iuse_map[key], iuse_forced[key],
                                cur_use_map[key], old_iuse_map[key],
-                               old_use_map[key], self.is_new,
+                               old_use_map[key], self.is_new, feature_flags,
                                reinst_flags_map.get(key))
                return
 
index 23b056c3ee92e666365564dca482f05fc48b8261..7016ec294acfdae976903a1bf1e9bd5d19b78df4 100644 (file)
@@ -14,11 +14,9 @@ import sys
 from portage import os
 from portage import _encodings, _unicode_encode
 from portage._sets.base import InternalPackageSet
-from portage.eapi import _get_eapi_attrs
 from portage.output import (blue, bold, colorize, create_color_func,
        green, red, teal, turquoise, yellow)
 bad = create_color_func("BAD")
-from portage.package.ebuild.config import _get_feature_flags
 from portage.util import shlex_split, writemsg
 from portage.util.SlotObject import SlotObject
 from portage.versions import catpkgsplit
@@ -248,9 +246,9 @@ def _format_size(mysize):
                mystr=mystr[:mycount]+","+mystr[mycount:]
        return mystr+" kB"
 
-def _create_use_string(pkg, conf, name, cur_iuse, iuse_forced, cur_use,
+def _create_use_string(conf, name, cur_iuse, iuse_forced, cur_use,
        old_iuse, old_use,
-       is_new, reinst_flags):
+       is_new, feature_flags, reinst_flags):
 
        if not conf.print_use_string:
                return ""
@@ -268,7 +266,7 @@ def _create_use_string(pkg, conf, name, cur_iuse, iuse_forced, cur_use,
        any_iuse = cur_iuse.union(old_iuse)
        any_iuse = list(any_iuse)
        any_iuse.sort()
-       feature_flags = _get_feature_flags(_get_eapi_attrs(pkg.metadata["EAPI"]))
+
        for flag in any_iuse:
                flag_str = None
                isEnabled = False