From 272eeb5809192984afeddfcdd10ae317accdfaf5 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sun, 5 Sep 2010 13:34:16 +0200 Subject: always apply EPREFIX prepending to GLOBAL_CONFIG_PATH --- pym/_emerge/actions.py | 8 ++++++-- pym/_emerge/main.py | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'pym/_emerge') 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: -- cgit v1.2.3-1-g7c22