always apply EPREFIX prepending to GLOBAL_CONFIG_PATH
authorFabian Groffen <grobian@gentoo.org>
Sun, 5 Sep 2010 11:34:16 +0000 (13:34 +0200)
committerFabian Groffen <grobian@gentoo.org>
Sun, 5 Sep 2010 11:34:16 +0000 (13:34 +0200)
pym/_emerge/actions.py
pym/_emerge/main.py
pym/portage/package/ebuild/fetch.py

index 18052dcdace57898c4a855ec0533fbc2556e78f5..473f6fb7a06e1c20c79e582057ba2d343353ad46 100644 (file)
@@ -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
 
index a5d5bf8caa08150f475fa983cc2a2e59539debbb..64733ceaac14f52ee47a8dfd94b8dac80d5b424b 100644 (file)
@@ -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:
index 06cb90801d3acae92db8077c0b7c3f6d852b60d7..d5ad7f82762004e8423f4c31836fa83d56e72f2d 100644 (file)
@@ -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: