summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-19 22:56:26 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-19 22:56:26 -0700
commitce6be8caaaba3151f6d7681180c21a6f2a756a40 (patch)
tree3224b5e14cf9f2fd5fb26e248379db63ce6cd848
parent975059ae8857a557c2a294e097febeb620533dec (diff)
downloadportage-ce6be8caaaba3151f6d7681180c21a6f2a756a40.tar.gz
portage-ce6be8caaaba3151f6d7681180c21a6f2a756a40.tar.bz2
portage-ce6be8caaaba3151f6d7681180c21a6f2a756a40.zip
Make the make.globals path relative to EPREFIX, and add comments possible
alternative behavior for target systems.
-rw-r--r--pym/portage/package/ebuild/config.py26
1 files changed, 24 insertions, 2 deletions
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 46cac3b49..2f886fc78 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -723,8 +723,30 @@ class config(object):
self.configdict["env"] = LazyItemsDict(self.backupenv)
# make.globals should not be relative to config_root
- # because it only contains constants.
- for x in (GLOBAL_CONFIG_PATH,):
+ # because it only contains constants. However, if EPREFIX
+ # is set then there are two possible scenarios:
+ # 1) If $ROOT == "/" then make.globals should be
+ # relative to EPREFIX.
+ # 2) If $ROOT != "/" then the correct location of
+ # make.globals needs to be specified in the constructor
+ # parameters, since it's a property of the host system
+ # (and the current config represents the target system).
+ global_config_path = GLOBAL_CONFIG_PATH
+ if eprefix:
+ if target_root == "/":
+ # case (1) above
+ global_config_path = os.path.join(eprefix,
+ GLOBAL_CONFIG_PATH.lstrip(os.sep))
+ else:
+ # case (2) above
+ # For now, just assume make.globals is relative
+ # to EPREFIX.
+ # TODO: Pass in more info to the constructor,
+ # so we know the host system configuration.
+ global_config_path = os.path.join(eprefix,
+ GLOBAL_CONFIG_PATH.lstrip(os.sep))
+
+ for x in (global_config_path,):
self.mygcfg = getconfig(os.path.join(x, "make.globals"),
expand=expand_map)
if self.mygcfg: