summaryrefslogtreecommitdiffstats
path: root/pym/portage.py
diff options
context:
space:
mode:
Diffstat (limited to 'pym/portage.py')
-rw-r--r--pym/portage.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/pym/portage.py b/pym/portage.py
index bddc3f257..5e3cb6bd6 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1301,6 +1301,13 @@ class config:
"this. Do not use them.\n", noiselevel=-1)
sys.exit(1)
+
+ # Don't allow the user to override certain variables in make.conf
+ 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
# special exception for a very common use case, config_root == "/"
@@ -1324,7 +1331,12 @@ class config:
self.configlist.append(self.backupenv) # XXX Why though?
self.configdict["backupenv"]=self.configlist[-1]
- self.configlist.append(os.environ.copy())
+ 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.configlist.append(myenv)
self.configdict["env"]=self.configlist[-1]
if not local_config:
# Clean up pollution from portage_data so that it doesn't