Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: [gentoo-portage-dev] [PATCH] _doebuild_path: add fallback for temp PORTAGE_BIN_PATH (bug 547086)
Date: Sun, 19 Apr 2015 19:27:26
Message-Id: 1429471630-29167-1-git-send-email-zmedico@gentoo.org
1 X-Gentoo-Bug: 547086
2 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=547086
3 ---
4 pym/portage/package/ebuild/doebuild.py | 19 +++++++++++++------
5 1 file changed, 13 insertions(+), 6 deletions(-)
6
7 diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
8 index 1be83ad..4d926c7 100644
9 --- a/pym/portage/package/ebuild/doebuild.py
10 +++ b/pym/portage/package/ebuild/doebuild.py
11 @@ -195,7 +195,10 @@ def _doebuild_path(settings, eapi=None):
12
13 # Note: PORTAGE_BIN_PATH may differ from the global constant
14 # when portage is reinstalling itself.
15 - portage_bin_path = settings["PORTAGE_BIN_PATH"]
16 + portage_bin_path = [settings["PORTAGE_BIN_PATH"]]
17 + if portage_bin_path[0] != portage.const.PORTAGE_BIN_PATH:
18 + # Add a fallback path for restarting failed builds (bug 547086)
19 + portage_bin_path.append(portage.const.PORTAGE_BIN_PATH)
20 eprefix = portage.const.EPREFIX
21 prerootpath = [x for x in settings.get("PREROOTPATH", "").split(":") if x]
22 rootpath = [x for x in settings.get("ROOTPATH", "").split(":") if x]
23 @@ -210,18 +213,22 @@ def _doebuild_path(settings, eapi=None):
24 path = overrides
25
26 if "xattr" in settings.features:
27 - path.append(os.path.join(portage_bin_path, "ebuild-helpers", "xattr"))
28 + for x in portage_bin_path:
29 + path.append(os.path.join(x, "ebuild-helpers", "xattr"))
30
31 if uid != 0 and \
32 "unprivileged" in settings.features and \
33 "fakeroot" not in settings.features:
34 - path.append(os.path.join(portage_bin_path,
35 - "ebuild-helpers", "unprivileged"))
36 + for x in portage_bin_path:
37 + path.append(os.path.join(x,
38 + "ebuild-helpers", "unprivileged"))
39
40 if settings.get("USERLAND", "GNU") != "GNU":
41 - path.append(os.path.join(portage_bin_path, "ebuild-helpers", "bsd"))
42 + for x in portage_bin_path:
43 + path.append(os.path.join(x, "ebuild-helpers", "bsd"))
44
45 - path.append(os.path.join(portage_bin_path, "ebuild-helpers"))
46 + for x in portage_bin_path:
47 + path.append(os.path.join(x, "ebuild-helpers"))
48 path.extend(prerootpath)
49
50 for prefix in prefixes:
51 --
52 2.3.1

Replies