From e2a14474bf723d3db7f31ae1eb208560e4bbb5bc Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 20 Aug 2010 10:20:59 -0700 Subject: Make DEPCACHE_PATH relative to EPREFIX, and comment about similarity to make.globals handling. --- pym/portage/package/ebuild/config.py | 19 +++++++++++++++++-- 1 file 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 -- cgit v1.2.3-1-g7c22