diff options
author | Michał Górny <mgorny@gentoo.org> | 2015-12-13 09:04:55 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2015-12-20 18:38:49 +0100 |
commit | a41c0f8b9081dad610e6e82ab57a5adce30789ae (patch) | |
tree | 639070615004e4e11a0249e85bc20c41433914a4 | |
parent | Move QA_PREBUILT handling into src_install() (diff) | |
download | portage-a41c0f8b9081dad610e6e82ab57a5adce30789ae.tar.gz portage-a41c0f8b9081dad610e6e82ab57a5adce30789ae.tar.bz2 portage-a41c0f8b9081dad610e6e82ab57a5adce30789ae.zip |
doebuild: Support finding lib* for ccache/distcc/icecc masquerade dir
Gentoo ccache used to historically swap between storing its masquerade
in 'lib' and $(get_libdir). To prevent breakage with any version of it,
and prevent future breakages when other tools change places randomly
try all three of $(get_libdir), 'lib' and 'libexec' looking for
masquerade dir and use the one that's found. Additionally, warn if there
is no masquerade dir.
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=567360
Reviewed-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r-- | pym/portage/package/ebuild/doebuild.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py index ff8958e0b..a4d4d9f7c 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -466,7 +466,6 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None, icecream = "icecream" in mysettings.features if ccache or distcc or icecream: - # Use default ABI libdir in accordance with bug #355283. libdir = None default_abi = mysettings.get("DEFAULT_ABI") if default_abi: @@ -474,17 +473,27 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None, if not libdir: libdir = "lib" + # The installation locations use to vary between versions... + # Safer to look them up rather than assuming + possible_libexecdirs = (libdir, "lib", "libexec") + masquerades = [] if distcc: - mysettings["PATH"] = os.path.join(os.sep, eprefix_lstrip, - "usr", libdir, "distcc", "bin") + ":" + mysettings["PATH"] - + masquerades.append("distcc") if icecream: - mysettings["PATH"] = os.path.join(os.sep, eprefix_lstrip, - "usr", 'libexec', "icecc", "bin") + ":" + mysettings["PATH"] - + masquerades.append("icecc") if ccache: - mysettings["PATH"] = os.path.join(os.sep, eprefix_lstrip, - "usr", libdir, "ccache", "bin") + ":" + mysettings["PATH"] + masquerades.append("ccache") + + for m in masquerades: + for l in possible_libexecdirs: + p = os.path.join(os.sep, eprefix_lstrip, + "usr", l, m, "bin") + if os.path.isdir(p): + mysettings["PATH"] = p + ":" + mysettings["PATH"] + break + else: + writemsg(("Warning: %s requested but no masquerade dir" + + "can be found in /usr/lib*/%s/bin\n") % (m, m)) if 'MAKEOPTS' not in mysettings: nproc = get_cpu_count() |