From f557b692127ed70ef39b7895017cb7e1736eb609 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sun, 21 Oct 2007 18:58:03 +0000 Subject: [PATCH] Allow to override EPREFIX, basically for the purpose of "cloning" a prefix install, or to facilitate a cross-compilation environment. svn path=/main/branches/prefix/; revision=8216 --- pym/_emerge/__init__.py | 8 +++++--- pym/portage/__init__.py | 4 ++-- pym/portage/const.py | 5 +++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 2c743555c..62ef5d81c 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -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 ("+ \ diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 4df7c20f3..28bb2d77b 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -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 = {} diff --git a/pym/portage/const.py b/pym/portage/const.py index 46a27e2c5..53232f161 100644 --- a/pym/portage/const.py +++ b/pym/portage/const.py @@ -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 -- 2.26.2