Allow to override EPREFIX, basically for the purpose of "cloning" a
authorFabian Groffen <grobian@gentoo.org>
Sun, 21 Oct 2007 18:58:03 +0000 (18:58 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 21 Oct 2007 18:58:03 +0000 (18:58 -0000)
prefix install, or to facilitate a cross-compilation environment.

svn path=/main/branches/prefix/; revision=8216

pym/_emerge/__init__.py
pym/portage/__init__.py
pym/portage/const.py

index 2c743555c87c2b7166250b6f847e1f8115941753..62ef5d81c13162b58fae60922f913f1adbf39e62 100644 (file)
@@ -49,7 +49,7 @@ portage.dep._dep_check_strict = True
 import portage.util
 import portage.locks
 import portage.exception
-from portage.const import EPREFIX
+from portage.const import EPREFIX, BPREFIX
 from portage.data import secpass
 from portage.util import normalize_path as normpath
 from portage.util import writemsg
@@ -3400,7 +3400,8 @@ class depgraph(object):
 
                                if myversion != portage.VERSION and "--quiet" not in self.myopts:
                                        if mylist_index < len(mylist) - 1 and \
-                                               "livecvsportage" not in self.settings.features:
+                                               "livecvsportage" not in self.settings.features and \
+                                               EPREFIX == BPREFIX:
                                                p.append(colorize("WARN", "*** Portage will stop merging at this point and reload itself,"))
                                                p.append(colorize("WARN", "    then resume the merge."))
                                                print
@@ -4112,7 +4113,8 @@ class MergeTask(object):
                                                if myver[-3:]=='-r0':
                                                        myver=myver[:-3]
                                                if (myver != portage.VERSION) and \
-                                                  "livecvsportage" not in self.settings.features:
+                                                  "livecvsportage" not in self.settings.features and \
+                                                  EPREFIX == BPREFIX:
                                                        if len(mymergelist) > mergecount:
                                                                emergelog(xterm_titles,
                                                                        " ::: completed emerge ("+ \
index 4df7c20f38247c2856b21c252d4f19bebe20cc22..28bb2d77b396a05481c98051ebd888b1966ea5e8 100644 (file)
@@ -92,7 +92,7 @@ try:
                DEPRECATED_PROFILE_FILE, USER_VIRTUALS_FILE, EBUILD_SH_ENV_FILE, \
                INVALID_ENV_FILE, CUSTOM_MIRRORS_FILE, CONFIG_MEMORY_FILE,\
                INCREMENTALS, EAPI, MISC_SH_BINARY, REPO_NAME_LOC, REPO_NAME_FILE, \
-               EPREFIX, EPREFIX_LSTRIP
+               EPREFIX, EPREFIX_LSTRIP, BPREFIX
 
        from portage.data import ostype, lchown, userland, secpass, uid, wheelgid, \
                                 portage_uid, portage_gid, userpriv_groups
@@ -1128,7 +1128,7 @@ class config(object):
                        del rawpuseforce
 
                        try:
-                               self.mygcfg   = getconfig(os.path.join(config_root, EPREFIX_LSTRIP, "etc", "make.globals"))
+                               self.mygcfg   = getconfig(os.path.join(config_root, BPREFIX.lstrip(os.path.sep), "etc", "make.globals"))
 
                                if self.mygcfg is None:
                                        self.mygcfg = {}
index 46a27e2c52247f12ff5926f903fa01da8ecab7c1..53232f1611149ab1ff3b775851584cdfe3c886aa 100644 (file)
@@ -9,6 +9,11 @@ import os
 # ===========================================================================
 from portage.const_autotool import *
 
+# save the original prefix
+BPREFIX = EPREFIX
+# pick up EPREFIX from the environment if set
+if os.environ.has_key("EPREFIX"):
+       EPREFIX = os.path.normpath(os.environ["EPREFIX"])
 
 # ===========================================================================
 # START OF CONSTANTS -- START OF CONSTANTS -- START OF CONSTANTS -- START OF