From 442604dee954b47b2b17b6ae0bcae21f9af1599a Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 21 Nov 2007 04:06:26 +0000 Subject: [PATCH] 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. (trunk r8524) svn path=/main/branches/2.1.2/; revision=8567 --- pym/portage.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pym/portage.py b/pym/portage.py index f0152e4f8..2a28c52b7 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -1071,8 +1071,6 @@ class config: self._use_wildcards = copy.deepcopy(clone._use_wildcards) else: - # backupenv is for calculated incremental variables. - self.backupenv = os.environ.copy() if not local_config: # Clean up pollution from portage_data so that it doesn't # interfere with repoman. @@ -1330,15 +1328,16 @@ class config: 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] if not local_config: # Clean up pollution from portage_data so that it doesn't -- 2.26.2