summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-07-16 03:32:53 +0000
committerZac Medico <zmedico@gentoo.org>2008-07-16 03:32:53 +0000
commitf40d16e3dc580979b1e18bf4cef7221e56657f85 (patch)
tree1278a910e941c7a77798704c23874dac35cdc6bf /pym
parentc7bd931aca83453b79098382aaf00c1cd270fce4 (diff)
downloadportage-f40d16e3dc580979b1e18bf4cef7221e56657f85.tar.gz
portage-f40d16e3dc580979b1e18bf4cef7221e56657f85.tar.bz2
portage-f40d16e3dc580979b1e18bf4cef7221e56657f85.zip
Remove the config._filter_calling_env attribute since it's not really needed.
Replace it with an simple os.path.exists() call inside config.environ(). svn path=/main/trunk/; revision=11071
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/__init__.py27
1 files changed, 13 insertions, 14 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index c9586c19a..ff83658bc 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -1034,7 +1034,6 @@ class config(object):
self.already_in_regenerate = 0
- self._filter_calling_env = False
self.locked = 0
self.mycpv = None
self.puse = []
@@ -1060,7 +1059,6 @@ class config(object):
self.local_config = local_config
if clone:
- self._filter_calling_env = copy.deepcopy(clone._filter_calling_env)
self.incrementals = copy.deepcopy(clone.incrementals)
self.profile_path = copy.deepcopy(clone.profile_path)
self.user_profile_dir = copy.deepcopy(clone.user_profile_dir)
@@ -2808,7 +2806,13 @@ class config(object):
"return our locally-maintained environment"
mydict={}
environ_filter = self._environ_filter
- filter_calling_env = self._filter_calling_env
+
+ filter_calling_env = False
+ temp_dir = self.get("T")
+ if temp_dir is not None and \
+ os.path.exists(os.path.join(temp_dir, "environment")):
+ filter_calling_env = True
+
environ_whitelist = self._environ_whitelist
env_d = self.configdict["env.d"]
for x in self:
@@ -4230,16 +4234,14 @@ def spawnebuild(mydo, actionmap, mysettings, debug, alwaysdep=0,
mysettings["EBUILD_PHASE"] = mydo
_doebuild_exit_status_unlink(
mysettings.get("EBUILD_EXIT_STATUS_FILE"))
- filter_calling_env_state = mysettings._filter_calling_env
- if os.path.exists(os.path.join(mysettings["T"], "environment")):
- mysettings._filter_calling_env = True
+
try:
phase_retval = spawn(actionmap[mydo]["cmd"] % mydo,
mysettings, debug=debug, logfile=logfile,
fd_pipes=fd_pipes, returnpid=returnpid, **kwargs)
finally:
mysettings["EBUILD_PHASE"] = ""
- mysettings._filter_calling_env = filter_calling_env_state
+
if returnpid:
return phase_retval
msg = _doebuild_exit_status_check(mydo, mysettings)
@@ -4434,9 +4436,6 @@ def _spawn_misc_sh(mysettings, commands, **kwargs):
mycommand = " ".join([_shell_quote(misc_sh_binary)] + commands)
_doebuild_exit_status_unlink(
mysettings.get("EBUILD_EXIT_STATUS_FILE"))
- filter_calling_env_state = mysettings._filter_calling_env
- if os.path.exists(os.path.join(mysettings["T"], "environment")):
- mysettings._filter_calling_env = True
debug = mysettings.get("PORTAGE_DEBUG") == "1"
logfile = mysettings.get("PORTAGE_LOG_FILE")
mydo = mysettings["EBUILD_PHASE"]
@@ -4444,7 +4443,7 @@ def _spawn_misc_sh(mysettings, commands, **kwargs):
rval = spawn(mycommand, mysettings, debug=debug,
logfile=logfile, **kwargs)
finally:
- mysettings._filter_calling_env = filter_calling_env_state
+ pass
msg = _doebuild_exit_status_check(mydo, mysettings)
if msg:
rval = 1
@@ -5062,7 +5061,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
builddir_lock = None
tmpdir = None
tmpdir_orig = None
- filter_calling_env_state = mysettings._filter_calling_env
+
try:
if mydo in ("digest", "manifest", "help"):
# Temporarily exempt the depend phase from manifest checks, in case
@@ -5278,7 +5277,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
del e
env_stat = None
if env_stat:
- mysettings._filter_calling_env = True
+ pass
else:
for var in ("ARCH", ):
value = mysettings.get(var)
@@ -5587,7 +5586,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
return retval
finally:
- mysettings._filter_calling_env = filter_calling_env_state
+
if tmpdir:
mysettings["PORTAGE_TMPDIR"] = tmpdir_orig
shutil.rmtree(tmpdir)