summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-20 10:20:59 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-20 10:20:59 -0700
commite2a14474bf723d3db7f31ae1eb208560e4bbb5bc (patch)
tree5806c5858f4c297abdabb95b46dc709471d58c51
parent1824d5744ffcfa25bb92c40e2498dd0d3fc5989c (diff)
downloadportage-e2a14474bf723d3db7f31ae1eb208560e4bbb5bc.tar.gz
portage-e2a14474bf723d3db7f31ae1eb208560e4bbb5bc.tar.bz2
portage-e2a14474bf723d3db7f31ae1eb208560e4bbb5bc.zip
Make DEPCACHE_PATH relative to EPREFIX, and comment about similarity
to make.globals handling.
-rw-r--r--pym/portage/package/ebuild/config.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 2f886fc78..85417b411 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -475,8 +475,6 @@ class config(object):
check_var_directory("PORTAGE_CONFIGROOT", config_root)
abs_user_config = os.path.join(config_root, USER_CONFIG_PATH)
- self.depcachedir = DEPCACHE_PATH
-
if not config_profile_path:
config_profile_path = \
os.path.join(config_root, PROFILE_PATH)
@@ -1060,6 +1058,23 @@ class config(object):
self["PORTAGE_GID"] = str(portage_gid)
self.backup_changes("PORTAGE_GID")
+ self.depcachedir = DEPCACHE_PATH
+ if eprefix:
+ # See comments about make.globals and EPREFIX
+ # above. DEPCACHE_PATH is similar.
+ if target_root == "/":
+ # case (1) above
+ self.depcachedir = os.path.join(eprefix,
+ DEPCACHE_PATH.lstrip(os.sep))
+ else:
+ # case (2) above
+ # For now, just assume DEPCACHE_PATH is relative
+ # to EPREFIX.
+ # TODO: Pass in more info to the constructor,
+ # so we know the host system configuration.
+ self.depcachedir = os.path.join(eprefix,
+ DEPCACHE_PATH.lstrip(os.sep))
+
if self.get("PORTAGE_DEPCACHEDIR", None):
self.depcachedir = self["PORTAGE_DEPCACHEDIR"]
self["PORTAGE_DEPCACHEDIR"] = self.depcachedir