From: Fabian Groffen Date: Sun, 15 Oct 2006 14:15:06 +0000 (-0000) Subject: Warn about root, only if ROOT != EPREFIX. X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=4267d1141ee82fc50e687f137e3bbe456eb757db;p=portage.git Warn about root, only if ROOT != EPREFIX. Don't do prepstrip on Darwin, it doesn't have ELF objects Make sure EPREFIX ends with a trailing slash, don't double prefix ROOT and use some os.join to glue together paths. svn path=/main/branches/prefix/; revision=4714 --- diff --git a/bin/emerge b/bin/emerge index 873318e36..2c4c39002 100755 --- a/bin/emerge +++ b/bin/emerge @@ -2543,7 +2543,7 @@ def unmerge(settings, myopts, vartree, unmerge_action, unmerge_files, newline="" if (not "--quiet" in myopts): newline="\n" - if settings["ROOT"] != "/": + if settings["ROOT"].startswith(portage_const.EPREFIX) and settings["ROOT"] != portage_const.EPREFIX: print darkgreen(newline+">>> Using system located in ROOT tree "+settings["ROOT"]) if (("--pretend" in myopts) or ("--ask" in myopts)) and not ("--quiet" in myopts): print darkgreen(newline+">>> These are the packages that would be unmerged:") diff --git a/bin/prepstrip b/bin/prepstrip index d5cf0bc82..781dc34ce 100755 --- a/bin/prepstrip +++ b/bin/prepstrip @@ -3,6 +3,9 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ +# on Darwin this stuff all doesn't work, as we dont have ELF +[[ ${USERLAND} == "Darwin" ]] && return 0 + source "${PORTAGE_BIN_PATH:-${EPREFIX}/usr/lib/portage/bin}"/isolated-functions.sh unset NOSTRIP diff --git a/pym/portage.py b/pym/portage.py index abdfbad08..278fabfa6 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -1587,7 +1587,7 @@ class config: # We grab the latest profile.env here since it changes frequently. self.configdict["env.d"].clear() env_d = getconfig( - os.path.join(self["ROOT"], "etc", "profile.env"), expand=False) + os.path.join(self["ROOT"] + portage_const.EPREFIX, "etc", "profile.env"), expand=False) if env_d: # env_d will be None if profile.env doesn't exist. self.configdict["env.d"].update(env_d) @@ -2588,24 +2588,25 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, m # due to how it's coded... Don't overwrite this so we can use it. mysettings["PORTAGE_DEBUG"] = "1" - mysettings["ROOT"] = normalize_path(myroot+portage_const.EPREFIX)+"/" + mysettings["EPREFIX"] = portage_const.EPREFIX.rstrip(os.sep)+os.sep + #mysettings["ROOT"] = normalize_path(myroot+portage_const.EPREFIX).rstrip(os.sep)+os.sep + mysettings["ROOT"] = myroot mysettings["STARTDIR"] = getcwd() mysettings["EBUILD"] = ebuild_path mysettings["O"] = pkg_dir mysettings.configdict["pkg"]["CATEGORY"] = cat - mysettings["FILESDIR"] = pkg_dir+"/files" + mysettings["FILESDIR"] = os.path.join(pkg_dir, "files") mysettings["PF"] = mypv - mysettings["ECLASSDIR"] = mysettings["PORTDIR"]+"/eclass" - mysettings["SANDBOX_LOG"] = mycpv.replace("/", "_-_") + mysettings["ECLASSDIR"] = os.path.join(mysettings["PORTDIR"], "eclass") + mysettings["SANDBOX_LOG"] = mycpv.replace(os.path.sep, "_-_") mysettings["PROFILE_PATHS"] = string.join(mysettings.profiles,"\n")+"\n"+CUSTOM_PROFILE_PATH mysettings["P"] = mysplit[0]+"-"+mysplit[1] mysettings["PN"] = mysplit[0] mysettings["PV"] = mysplit[1] mysettings["PR"] = mysplit[2] - mysettings["EPREFIX"] = portage_const.EPREFIX if portage_util.noiselimit < 0: mysettings["PORTAGE_QUIET"] = "1" @@ -2651,7 +2652,7 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, m mysettings["HOME"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "homedir") mysettings["WORKDIR"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "work") mysettings["EDEST"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "image") + os.sep - mysettings["D"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "image" + mysettings["EPREFIX"]) + os.sep + mysettings["D"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "image" + mysettings["EPREFIX"]) mysettings["T"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "temp") mysettings["PORTAGE_BASHRC"] = os.path.join( @@ -7057,7 +7058,7 @@ def init_legacy_globals(): kwargs = {} for k, envvar in (("config_root", "PORTAGE_CONFIGROOT"), ("target_root", "ROOT")): kwargs[k] = os.path.join( - os.environ.get(envvar, os.sep)) + os.environ.get(envvar, "/")) db = create_trees(**kwargs)