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]
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
"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:
# 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)
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:
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: