summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2010-09-05 13:34:16 +0200
committerFabian Groffen <grobian@gentoo.org>2010-09-05 13:34:16 +0200
commit272eeb5809192984afeddfcdd10ae317accdfaf5 (patch)
tree1558f001f21ea6cc41033c8acfb91d6a306c4810
parent025a5ab85069b74750b8b165a7ceb02bef6a60a9 (diff)
downloadportage-272eeb5809192984afeddfcdd10ae317accdfaf5.tar.gz
portage-272eeb5809192984afeddfcdd10ae317accdfaf5.tar.bz2
portage-272eeb5809192984afeddfcdd10ae317accdfaf5.zip
always apply EPREFIX prepending to GLOBAL_CONFIG_PATH
-rw-r--r--pym/_emerge/actions.py8
-rw-r--r--pym/_emerge/main.py6
-rw-r--r--pym/portage/package/ebuild/fetch.py9
3 files changed, 18 insertions, 5 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 18052dcda..473f6fb7a 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1837,9 +1837,13 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
portdb = trees[settings["ROOT"]]["porttree"].dbapi
myportdir = portdb.porttree_root
out = portage.output.EOutput()
+ global_config_path = GLOBAL_CONFIG_PATH
+ if settings['EPREFIX']:
+ global_config_path = os.path.join(settings['EPREFIX'],
+ GLOBAL_CONFIG_PATH.lstrip(os.sep))
if not myportdir:
sys.stderr.write("!!! PORTDIR is undefined. " + \
- "Is %s/make.globals missing?\n" % GLOBAL_CONFIG_PATH)
+ "Is %s/make.globals missing?\n" % global_config_path)
sys.exit(1)
if myportdir[-1]=="/":
myportdir=myportdir[:-1]
@@ -1879,7 +1883,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
syncuri = settings.get("SYNC", "").strip()
if not syncuri:
writemsg_level("!!! SYNC is undefined. " + \
- "Is %s/make.globals missing?\n" % GLOBAL_CONFIG_PATH,
+ "Is %s/make.globals missing?\n" % global_config_path,
noiselevel=-1, level=logging.ERROR)
return 1
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index a5d5bf8ca..64733ceaa 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1050,8 +1050,12 @@ def missing_sets_warning(root_config, missing_sets):
"missing set(s): %s" % missing_sets_str]
if root_config.sets:
msg.append(" sets defined: %s" % ", ".join(root_config.sets))
+ global_config_path = portage.const.GLOBAL_CONFIG_PATH
+ if root_config.settings['EPREFIX']:
+ global_config_path = os.path.join(root_config.settings['EPREFIX'],
+ portage.const.GLOBAL_CONFIG_PATH.lstrip(os.sep))
msg.append(" This usually means that '%s'" % \
- (os.path.join(portage.const.GLOBAL_CONFIG_PATH, "sets/portage.conf"),))
+ (os.path.join(global_config_path, "sets/portage.conf"),))
msg.append(" is missing or corrupt.")
msg.append(" Falling back to default world and system set configuration!!!")
for line in msg:
diff --git a/pym/portage/package/ebuild/fetch.py b/pym/portage/package/ebuild/fetch.py
index 06cb90801..d5ad7f827 100644
--- a/pym/portage/package/ebuild/fetch.py
+++ b/pym/portage/package/ebuild/fetch.py
@@ -779,6 +779,11 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
# allow different fetchcommands per protocol
protocol = loc[0:loc.find("://")]
+ global_config_path = GLOBAL_CONFIG_PATH
+ if mysettings['EPREFIX']:
+ global_config_path = os.path.join(mysettings['EPREFIX'],
+ GLOBAL_CONFIG_PATH.lstrip(os.sep))
+
missing_file_param = False
fetchcommand_var = "FETCHCOMMAND_" + protocol.upper()
fetchcommand = mysettings.get(fetchcommand_var)
@@ -789,7 +794,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
writemsg_level(
_("!!! %s is unset. It should "
"have been defined in\n!!! %s/make.globals.\n") \
- % (fetchcommand_var, GLOBAL_CONFIG_PATH),
+ % (fetchcommand_var, global_config_path),
level=logging.ERROR, noiselevel=-1)
return 0
if "${FILE}" not in fetchcommand:
@@ -808,7 +813,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
writemsg_level(
_("!!! %s is unset. It should "
"have been defined in\n!!! %s/make.globals.\n") \
- % (resumecommand_var, GLOBAL_CONFIG_PATH),
+ % (resumecommand_var, global_config_path),
level=logging.ERROR, noiselevel=-1)
return 0
if "${FILE}" not in resumecommand: