_doebuild_path: rely on DEFAULT_PATH and EXTRA_PATH
authorFabian Groffen <grobian@gentoo.org>
Fri, 2 Dec 2011 19:15:49 +0000 (20:15 +0100)
committerFabian Groffen <grobian@gentoo.org>
Fri, 2 Dec 2011 19:15:49 +0000 (20:15 +0100)
Prefix uses DEFAULT_PATH (contains offset paths) and EXTRA_PATH
(contains host paths), which are in particular during bootstrap quite
important because then they contain extra paths foreign to the prefix
(pointing to the temporary tools location).
Hence, don't "compute" the path for Prefix, configure knows best.

bin/ebuild-helpers/prepallinfo
pym/portage/package/ebuild/doebuild.py

index 2b1b5b48ec6ecd200b2678e2ecfad48d648b2bbc..de52098bdf20c6a5c5e8f4d8ebaaa3563e511e92 100755 (executable)
@@ -2,7 +2,7 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-source "${PORTAGE_BIN_PATH:-@PORTAGE_BIN_PATH@}"/isolated-functions.sh
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
 
 # PREFIX LOCAL: always support ED
 #case "$EAPI" in 0|1|2) ED=${D} ;; esac
index 0ba1f9687c6c9d434549e9b218acd5a5352c0d04..f8e4a482331b2462bebe5710addb66c43f20002e 100644 (file)
@@ -127,25 +127,20 @@ def _doebuild_path(settings, eapi=None):
        eprefix = settings["EPREFIX"]
        prerootpath = [x for x in settings.get("PREROOTPATH", "").split(":") if x]
        rootpath = [x for x in settings.get("ROOTPATH", "").split(":") if x]
-
-       prefixes = []
-       if eprefix:
-               prefixes.append(eprefix)
-       prefixes.append("/")
-
-       path = []
+       # PREFIX LOCAL: use DEFAULT_PATH and EXTRA_PATH from make.globals
+       defaultpath = [x for x in settings.get("DEFAULT_PATH", "").split(":") if x]
+       extrapath = [x for x in settings.get("EXTRA_PATH", "").split(":") if x]
 
        if eapi not in (None, "0", "1", "2", "3"):
                path.append(os.path.join(portage_bin_path, "ebuild-helpers", "4"))
 
        path.append(os.path.join(portage_bin_path, "ebuild-helpers"))
        path.extend(prerootpath)
-
-       for prefix in prefixes:
-               for x in ("usr/local/sbin", "usr/local/bin", "usr/sbin", "usr/bin", "sbin", "bin"):
-                       path.append(os.path.join(prefix, x))
-
+       path.extend(defaultpath)
        path.extend(rootpath)
+       path.extend(extrapath)
+       # END PREFIX LOCAL
+
        settings["PATH"] = ":".join(path)
 
 def doebuild_environment(myebuild, mydo, myroot=None, settings=None,