public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] _doebuild_path: add fallback for temp PORTAGE_BIN_PATH (bug 547086)
@ 2015-04-19 19:27 Zac Medico
  2015-04-21 23:20 ` Brian Dolbec
  0 siblings, 1 reply; 2+ messages in thread
From: Zac Medico @ 2015-04-19 19:27 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

X-Gentoo-Bug: 547086
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=547086
---
 pym/portage/package/ebuild/doebuild.py | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 1be83ad..4d926c7 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -195,7 +195,10 @@ def _doebuild_path(settings, eapi=None):
 
 	# Note: PORTAGE_BIN_PATH may differ from the global constant
 	# when portage is reinstalling itself.
-	portage_bin_path = settings["PORTAGE_BIN_PATH"]
+	portage_bin_path = [settings["PORTAGE_BIN_PATH"]]
+	if portage_bin_path[0] != portage.const.PORTAGE_BIN_PATH:
+		# Add a fallback path for restarting failed builds (bug 547086)
+		portage_bin_path.append(portage.const.PORTAGE_BIN_PATH)
 	eprefix = portage.const.EPREFIX
 	prerootpath = [x for x in settings.get("PREROOTPATH", "").split(":") if x]
 	rootpath = [x for x in settings.get("ROOTPATH", "").split(":") if x]
@@ -210,18 +213,22 @@ def _doebuild_path(settings, eapi=None):
 	path = overrides
 
 	if "xattr" in settings.features:
-		path.append(os.path.join(portage_bin_path, "ebuild-helpers", "xattr"))
+		for x in portage_bin_path:
+			path.append(os.path.join(x, "ebuild-helpers", "xattr"))
 
 	if uid != 0 and \
 		"unprivileged" in settings.features and \
 		"fakeroot" not in settings.features:
-		path.append(os.path.join(portage_bin_path,
-			"ebuild-helpers", "unprivileged"))
+		for x in portage_bin_path:
+			path.append(os.path.join(x,
+				"ebuild-helpers", "unprivileged"))
 
 	if settings.get("USERLAND", "GNU") != "GNU":
-		path.append(os.path.join(portage_bin_path, "ebuild-helpers", "bsd"))
+		for x in portage_bin_path:
+			path.append(os.path.join(x, "ebuild-helpers", "bsd"))
 
-	path.append(os.path.join(portage_bin_path, "ebuild-helpers"))
+	for x in portage_bin_path:
+		path.append(os.path.join(x, "ebuild-helpers"))
 	path.extend(prerootpath)
 
 	for prefix in prefixes:
-- 
2.3.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [gentoo-portage-dev] [PATCH] _doebuild_path: add fallback for temp PORTAGE_BIN_PATH (bug 547086)
  2015-04-19 19:27 [gentoo-portage-dev] [PATCH] _doebuild_path: add fallback for temp PORTAGE_BIN_PATH (bug 547086) Zac Medico
@ 2015-04-21 23:20 ` Brian Dolbec
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Dolbec @ 2015-04-21 23:20 UTC (permalink / raw
  To: gentoo-portage-dev

On Sun, 19 Apr 2015 12:27:10 -0700
Zac Medico <zmedico@gentoo.org> wrote:

> X-Gentoo-Bug: 547086
> X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=547086
> ---
>  pym/portage/package/ebuild/doebuild.py | 19 +++++++++++++------
>  1 file changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/pym/portage/package/ebuild/doebuild.py
> b/pym/portage/package/ebuild/doebuild.py index 1be83ad..4d926c7 100644
> --- a/pym/portage/package/ebuild/doebuild.py
> +++ b/pym/portage/package/ebuild/doebuild.py
> @@ -195,7 +195,10 @@ def _doebuild_path(settings, eapi=None):
>  
>  	# Note: PORTAGE_BIN_PATH may differ from the global constant
>  	# when portage is reinstalling itself.
> -	portage_bin_path = settings["PORTAGE_BIN_PATH"]
> +	portage_bin_path = [settings["PORTAGE_BIN_PATH"]]
> +	if portage_bin_path[0] != portage.const.PORTAGE_BIN_PATH:
> +		# Add a fallback path for restarting failed builds
> (bug 547086)
> +
> portage_bin_path.append(portage.const.PORTAGE_BIN_PATH) eprefix =
> portage.const.EPREFIX prerootpath = [x for x in
> settings.get("PREROOTPATH", "").split(":") if x] rootpath = [x for x
> in settings.get("ROOTPATH", "").split(":") if x] @@ -210,18 +213,22
> @@ def _doebuild_path(settings, eapi=None): path = overrides
>  
>  	if "xattr" in settings.features:
> -		path.append(os.path.join(portage_bin_path,
> "ebuild-helpers", "xattr"))
> +		for x in portage_bin_path:
> +			path.append(os.path.join(x,
> "ebuild-helpers", "xattr")) 
>  	if uid != 0 and \
>  		"unprivileged" in settings.features and \
>  		"fakeroot" not in settings.features:
> -		path.append(os.path.join(portage_bin_path,
> -			"ebuild-helpers", "unprivileged"))
> +		for x in portage_bin_path:
> +			path.append(os.path.join(x,
> +				"ebuild-helpers", "unprivileged"))
>  
>  	if settings.get("USERLAND", "GNU") != "GNU":
> -		path.append(os.path.join(portage_bin_path,
> "ebuild-helpers", "bsd"))
> +		for x in portage_bin_path:
> +			path.append(os.path.join(x,
> "ebuild-helpers", "bsd")) 
> -	path.append(os.path.join(portage_bin_path, "ebuild-helpers"))
> +	for x in portage_bin_path:
> +		path.append(os.path.join(x, "ebuild-helpers"))
>  	path.extend(prerootpath)
>  
>  	for prefix in prefixes:

LGTM

-- 
Brian Dolbec <dolsen>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-21 23:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-19 19:27 [gentoo-portage-dev] [PATCH] _doebuild_path: add fallback for temp PORTAGE_BIN_PATH (bug 547086) Zac Medico
2015-04-21 23:20 ` Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox