From: Zac Medico Date: Mon, 19 Nov 2007 00:02:34 +0000 (-0000) Subject: Fix PROFILE_ONLY_VARIABLES handling in the config constructor X-Git-Tag: v2.2_pre1~380 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7fa6df01d53bba3c05d6c6f12eca652c0f954edc;p=portage.git Fix PROFILE_ONLY_VARIABLES handling in the config constructor so that variables are appropriately filtered from "backupenv", since otherwise they can leak in from there. svn path=/main/trunk/; revision=8524 --- diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 57ba5ce0a..487dd6ba9 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -969,9 +969,6 @@ class config(object): self._use_wildcards = copy.deepcopy(clone._use_wildcards) else: - # backupenv is for calculated incremental variables. - self.backupenv = os.environ.copy() - def check_var_directory(varname, var): if not os.path.isdir(var): writemsg(("!!! Error: %s='%s' is not a directory. " + \ @@ -1224,15 +1221,16 @@ class config(object): self.configlist.append({}) self.configdict["auto"]=self.configlist[-1] + # backupenv is used for calculating incremental variables. + self.backupenv = os.environ.copy() self.configlist.append(self.backupenv) # XXX Why though? self.configdict["backupenv"]=self.configlist[-1] - myenv = os.environ.copy() # Don't allow the user to override certain variables in the env for k in profile_only_variables: - myenv.pop(k, None) + self.backupenv.pop(k, None) - self.configlist.append(myenv) + self.configlist.append(self.backupenv.copy()) self.configdict["env"]=self.configlist[-1] # make lookuplist for loading package.*