diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-03-11 06:15:37 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-03-11 06:15:37 +0000 |
commit | 9e8ae920e12e4bee12b1ae99823de2c15d80ffc1 (patch) | |
tree | 07455366ceb81c4240ad868637f37fe5d7b9034e /pym | |
parent | 6193f8959a4ec6c32fc6ddad626431779a842e7d (diff) | |
download | portage-9e8ae920e12e4bee12b1ae99823de2c15d80ffc1.tar.gz portage-9e8ae920e12e4bee12b1ae99823de2c15d80ffc1.tar.bz2 portage-9e8ae920e12e4bee12b1ae99823de2c15d80ffc1.zip |
In config.setcpv(), increase efficiency by filtering USE with IUSE before
calculating USE_EXPAND variables. Also use a generator expression instead
of a list comprehension in the USE_EXPAND generation code. (trunk r12697)
svn path=/main/branches/2.1.6/; revision=12954
Diffstat (limited to 'pym')
-rw-r--r-- | pym/portage/__init__.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index e6bd95259..b4291cfd7 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -2109,6 +2109,8 @@ class config(object): if ebuild_force_test: self.usemask.discard("test") + use.difference_update([x for x in use if x not in iuse_implicit]) + # Use the calculated USE flags to regenerate the USE_EXPAND flags so # that they are consistent. For optimal performance, use slice # comparison instead of startswith(). @@ -2116,8 +2118,8 @@ class config(object): for var in use_expand: prefix = var.lower() + "_" prefix_len = len(prefix) - expand_flags = set([ x[prefix_len:] for x in use \ - if x[:prefix_len] == prefix ]) + expand_flags = set( x[prefix_len:] for x in use \ + if x[:prefix_len] == prefix ) var_split = self.get(var, "").split() # Preserve the order of var_split because it can matter for things # like LINGUAS. @@ -2179,9 +2181,7 @@ class config(object): # attribute since we still want to be able to see global USE # settings for things like emerge --info. - self.configdict["pkg"]["PORTAGE_USE"] = " ".join(sorted( - x for x in use if \ - x in iuse_implicit)) + self.configdict["pkg"]["PORTAGE_USE"] = " ".join(sorted(use)) def _get_implicit_iuse(self): """ |