From 9ef61fab465e097c00c9458fce0a7ac5b877dc29 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 20 Nov 2010 19:17:49 -0800 Subject: [PATCH] Use Package.use.force/mask attributes. --- pym/_emerge/depgraph.py | 19 ++++++------------- pym/_emerge/resolver/circular_dependency.py | 4 +--- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 8c9d3f049..5727dc296 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2285,10 +2285,8 @@ class depgraph(object): need_enable = sorted(atom.use.enabled.difference(use).intersection(pkg.iuse.all)) need_disable = sorted(atom.use.disabled.intersection(use).intersection(pkg.iuse.all)) - pkgsettings = self._frozen_config.pkgsettings[pkg.root] - pkgsettings.setcpv(pkg) untouchable_flags = \ - frozenset(chain(pkgsettings.usemask, pkgsettings.useforce)) + frozenset(chain(pkg.use.mask, pkg.use.force)) if untouchable_flags.intersection( chain(need_enable, need_disable)): continue @@ -2336,10 +2334,8 @@ class depgraph(object): involved_flags = set(chain(conditional.equal, conditional.not_equal, \ conditional.enabled, conditional.disabled)) - pkgsettings = self._frozen_config.pkgsettings[myparent.root] - pkgsettings.setcpv(myparent) untouchable_flags = \ - frozenset(chain(pkgsettings.usemask, pkgsettings.useforce)) + frozenset(chain(myparent.use.mask, myparent.use.force)) if untouchable_flags.intersection(involved_flags): continue @@ -3096,10 +3092,9 @@ class depgraph(object): ("--newuse" in self._frozen_config.myopts or \ "--reinstall" in self._frozen_config.myopts) and \ cpv in vardb.match(atom): - pkgsettings.setcpv(pkg) forced_flags = set() - forced_flags.update(pkgsettings.useforce) - forced_flags.update(pkgsettings.usemask) + forced_flags.update(pkg.use.force) + forced_flags.update(pkg.use.mask) old_use = vardb.aux_get(cpv, ["USE"])[0].split() old_iuse = set(filter_iuse_defaults( vardb.aux_get(cpv, ["IUSE"])[0].split())) @@ -4798,10 +4793,8 @@ class depgraph(object): affecting_use.update(extract_affecting_use(dep_str, atom)) #Don't show flags as 'affecting' if the user can't change them, - pkgsettings = self._frozen_config.pkgsettings[node.root] - pkgsettings.setcpv(node) - affecting_use.difference_update(pkgsettings.usemask, \ - pkgsettings.useforce) + affecting_use.difference_update(node.use.mask, \ + node.use.force) pkg_name = node.cpv if affecting_use: diff --git a/pym/_emerge/resolver/circular_dependency.py b/pym/_emerge/resolver/circular_dependency.py index 78c5bebc7..9d3f5c68d 100644 --- a/pym/_emerge/resolver/circular_dependency.py +++ b/pym/_emerge/resolver/circular_dependency.py @@ -79,9 +79,7 @@ class circular_dependency_handler(object): return "\n".join(msg) def _get_use_mask_and_force(self, pkg): - pkgsettings = self.depgraph._frozen_config.pkgsettings[pkg.root] - pkgsettings.setcpv(pkg) - return frozenset(pkgsettings.usemask), frozenset(pkgsettings.useforce) + return pkg.use.mask, pkg.use.force def _get_autounmask_changes(self, pkg): needed_use_config_change = self.depgraph._dynamic_config._needed_use_config_changes.get(pkg) -- 2.26.2