diff options
-rw-r--r-- | pym/_emerge/Package.py | 21 | ||||
-rw-r--r-- | pym/_emerge/resolver/output.py | 13 |
2 files changed, 25 insertions, 9 deletions
diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index 593e0d3eb..7a25638c8 100644 --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@ -389,10 +389,13 @@ class Package(Task): class _use_class(object): - __slots__ = ("enabled", "_force", "_pkg", "_mask") + __slots__ = ("enabled", "_expand", "_expand_hidden", + "_force", "_pkg", "_mask") def __init__(self, pkg, use_str): self._pkg = pkg + self._expand = None + self._expand_hidden = None self._force = None self._mask = None self.enabled = frozenset(use_str.split()) @@ -407,10 +410,26 @@ class Package(Task): def _init_force_mask(self): pkgsettings = self._pkg._get_pkgsettings() + self._expand = frozenset( + pkgsettings.get("USE_EXPAND", "").lower().split()) + self._expand_hidden = frozenset( + pkgsettings.get("USE_EXPAND_HIDDEN", "").lower().split()) self._force = pkgsettings.useforce self._mask = pkgsettings.usemask @property + def expand(self): + if self._expand is None: + self._init_force_mask() + return self._expand + + @property + def expand_hidden(self): + if self._expand_hidden is None: + self._init_force_mask() + return self._expand_hidden + + @property def force(self): if self._force is None: self._init_force_mask() diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py index 6c3579f73..69a30ccd0 100644 --- a/pym/_emerge/resolver/output.py +++ b/pym/_emerge/resolver/output.py @@ -151,11 +151,8 @@ class Display(object): self.old_use = [flag for flag in self.old_use if flag in self.old_iuse] - self.use_expand = self.pkgsettings["USE_EXPAND"].lower().split() - self.use_expand.sort() - self.use_expand.reverse() - self.use_expand_hidden = \ - self.pkgsettings["USE_EXPAND_HIDDEN"].lower().split() + self.use_expand = pkg.use.expand + self.use_expand_hidden = pkg.use.expand_hidden return def include_mask_str(self): @@ -253,10 +250,10 @@ class Display(object): old_iuse_map = self.map_to_use_expand(self.old_iuse) old_use_map = self.map_to_use_expand(self.old_use) - self.use_expand.sort() - self.use_expand.insert(0, "USE") + use_expand = sorted(self.use_expand) + use_expand.insert(0, "USE") - for key in self.use_expand: + for key in use_expand: if key in self.use_expand_hidden: continue self.verboseadd += _create_use_string(self.conf, key.upper(), |