diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-10-23 19:30:15 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-10-23 19:30:15 +0000 |
commit | 7ba94e9b6c06d73e25f337087340d23707170e75 (patch) | |
tree | 61bd034e2b7cb379585c784341995f0725773c6e | |
parent | c9c8547403579eeeac6d0dafe0199202fba0aa86 (diff) | |
download | portage-7ba94e9b6c06d73e25f337087340d23707170e75.tar.gz portage-7ba94e9b6c06d73e25f337087340d23707170e75.tar.bz2 portage-7ba94e9b6c06d73e25f337087340d23707170e75.zip |
Optimize PROFILE_ONLY_VARIABLES handling.
svn path=/main/trunk/; revision=8255
-rw-r--r-- | pym/portage/__init__.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index ac391e645..cc713c1d2 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -1195,9 +1195,10 @@ class config(object): # Don't allow the user to override certain variables in make.conf - for key in self.mygcfg.keys(): - if key in self.configdict["defaults"].get("PROFILE_ONLY_VARIABLES", "").split(): - del self.mygcfg[key] + profile_only_variables = self.configdict["defaults"].get( + "PROFILE_ONLY_VARIABLES", "").split() + for k in profile_only_variables: + self.mygcfg.pop(k, None) # Allow ROOT setting to come from make.conf if it's not overridden # by the constructor argument (from the calling environment). As a @@ -1224,9 +1225,8 @@ class config(object): myenv = os.environ.copy() # Don't allow the user to override certain variables in the env - for key in myenv.keys(): - if key in self.configdict["defaults"].get("PROFILE_ONLY_VARIABLES", "").split(): - del myenv[key] + for k in profile_only_variables: + myenv.pop(k, None) self.configlist.append(myenv) self.configdict["env"]=self.configlist[-1] |