Hello, all. I've been working on solving the issues we had with Python script wrapping. I'd like to present the best solution I could think of, along with a technical demo, and ask for your opinion.
Wrapping Python scripts currently involves renaming them through
appending ${EPYTHON} suffix. This change in filename sometimes results
in unexpected results, especially with packages that use sys.argv[0].
This breaks mis-designed packages such as gentoolkit or pkgcore,
and often results in unexpected help output.
It should be noted that kernel has special behavior wrt shebangs,
and modifies argv[0] when they are involved. Therefore 'simple' setting
of argv[0] for exec*() calls in the wrapper doesn't help here.
In the past, python.eclass used Gentoo-specific patches to Python to
work around those issues, and overriding sys.argv[0] on Python-side.
python-r1 no longer uses those patches, and we will hopefully drop them
after getting rid of python.eclass.
The new way would involve moving them into dedicated directory instead.
That is:
old way: /usr/bin/foo-pythonX.Y
new way: /usr/lib/python-bin/pythonX.Y/foo
While this still involves changing argv[0], it has a few advantages
over the current solution:
1. basename(sys.argv[0]) stays unchanged. this fixes gentoolkit,
pkgcore and makes 'foo --help' output 'foo'.
2. PATH is no longer polluted by a dozen of foo-* variants. While some
people may consider this a disadvantage, it makes bash completion
a little less irritating at least. It also avoids having sub-commands
like 'git bz-python2.7' :).
3. variant choice can be implemented purely using PATH adjustments.
That is, in a very optimistic case the wrapper scripts wouldn't need to
be called.
If you'd like to test it, I'm attaching a complete patch that should
work on top of current tree. It modifies the python eclasses and adds
a new slot to python-exec. The same changesets can be found on
python-script-location-r1 branch of my gx86-working-tree repo [1].
It should be noted that while the eclass changes on that branch can be
considered testing-ready, the C wrapper code is a quick, dirty hack
and will be rewritten in the future if we decide to go this way.
Currently known issues with the demo:
1. the few ebuilds that try to play with wrappers directly do not work
because they rely on old paths (dev-python/wxpython),
2. parallel 'doins' is broken in portage [2] which can break a few
more ebuilds (dev-python/docutils),
3. baselayout doesn't provide a way to prepend paths before
the standard set [3], so the wrapper are always used indep of PATH.
[1]:https://bitbucket.org/mgorny/gx86-working-tree/commits/branch/python-script-location-r1
[2]:https://bugs.gentoo.org/show_bug.cgi?id=484332
[3]:https://bugs.gentoo.org/show_bug.cgi?id=484268
Please let me know what you think of this solution. It could be
implemented mostly safely since the 'old' and 'new' wrappers can
co-exist on the system.
--
Best regards,
Michał Górny
diff --git a/gx86/dev-python/python-exec/Manifest b/gx86/dev-python/python-exec/Manifest index 8cf6142..daa6d72 100644 --- a/gx86/dev-python/python-exec/Manifest +++ b/gx86/dev-python/python-exec/Manifest @@ -1,29 +1,11 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA512 - DIST python-exec-0.2.tar.bz2 65466 SHA256 df61ec2968930016dd14d5d1c5f12b5e501bc572bfe07f07e294906070e144fc SHA512 5f66eadedc9acfb915f830d8d8d16c2645d5f22f65fa0bfc9eb0ae77061c51484e07b98edcceb0b0cf6143c246cd3fa8f95b03c89b14e1fb1f0a6951a301d806 WHIRLPOOL 33e797f0bd3a259e8850a054c94c6cb68a32836e02a7a142de11bf8c838e6dab230f368d53fb4928dd62869794ec4ee84ba6c4bbdd0c8a60dce9c83759d23cd0 DIST python-exec-0.3.1.tar.bz2 74441 SHA256 460837775167108419b9497353a6f832fc8a249c341469dd235c70633ac37557 SHA512 764d1aaf3b4f9679be6ab1105b4b4d9222b245502114ee3d451b4507f86679ae05136eeae3337351c80b52ee03b9461a2f89c87e63cc4cbb76a1023fb243f84e WHIRLPOOL 6b34c2f44976a33a67269c766bd13401b6b1b39fad3d5df6bbef2bd06e15e09bd2ac13123718b8fa0bdb67f812c7407192b9c16860ab442d3c35259afeb3da82 DIST python-exec-0.3.tar.bz2 73698 SHA256 3d593d3d06d2a05b90be014577c7d096e30dbe093176cc69c9c7a8deb00c0d7a SHA512 d52497dc81a72550da1c461d8e26fe9640ea02c2b8a8f2437ef4a714a007717d4eaf3508e22569b6693b38caea41934cfc057a398b9d5f5a3cff35c7ad52629a WHIRLPOOL 5b0aaeb20915b9190f648bf552f72842a329c10f1eafcdde3e118ef442a94d309b26462447f1ff42e561a86fb798e5de3478a7c06298f86ca66f5e4699dc1fde EBUILD python-exec-0.2.ebuild 1089 SHA256 ee151de72bc789ea1c4e74418fbdb0150b4ae02ed4f96118116fc8f530f4e82c SHA512 2c7c518fb34c0cfc131917571219ddd6f5c6c1b3efd3e78332eaa08f3a57770954f7090d66655c7c02d5a0edfefe90e4debbd615ed05d151aae0ca9d0cbe4143 WHIRLPOOL 70163f1fc2364db548dd7878ff13311911dc7ada81b1e705bcee7b808d963a8371870cb7f29f5cbc133756e4e0fe3a0b6673fa8428643dffa2c9ca7f9cdcd759 EBUILD python-exec-0.3.1.ebuild 1088 SHA256 f76f577167aa049d36d99dfb8975938753c5d9b33c221768757359ebe95a0024 SHA512 97c8077874c8be68cdc619a55c707c69b686c2543cb3761023acfeea4968e38ee193b3634e04742fbb08e336208ee883918a75e3b1caf3d9c1733109ae2cf596 WHIRLPOOL 3a9d900ab1ff8c641744f89c535f953aa593f9dcb7224f5db9ba8a566b48b8450aae1a6a108373c8e3c6c047bfe43a4f761088d6cf2bd4dd28afad3b76526063 EBUILD python-exec-0.3.ebuild 1099 SHA256 75218367b33249e8f4ef01b0e35ef30708a4805e57b6e09ae12a6d44194fcb8a SHA512 e8670571ea319d8301843aab0f4d649a5e7b8b7e04895b7c601b76c46bc66b0ad9d4bd20bc275420c6a200f1b895eabcee8a01fe6bc5ca486e0c5a105b3f5213 WHIRLPOOL d7755b4d1bd9d910e8e16fa97fec6f8c85a089f4753d4dc924e664ecb1b109b66ed87141250230e86852a15b3826c490a4a0a6539979def5bb72a4b743bef8ec +EBUILD python-exec-0.9999.ebuild 1247 SHA256 7a10485cb24235b19d2233a888a2240332f283b7d11c48c66d537907bccc22aa SHA512 8380213389f2f288df3411817438577bae59d9647eee1e3961556a8e4da65bc635c8d0c395615598456a7284a234446a427c2a419a725a31af9ad06351d5cd97 WHIRLPOOL 151aa8e815bc4192287d886a6b6e489ead55dc7355962f20b949aac27691ee88eee1a47a2a182a2349daf3ee03c999b2bc3d156721d2eb37b7f2f148ec19bf2e +EBUILD python-exec-1.9999.ebuild 1285 SHA256 11813d8a42aff1589dceb4ad467286a133935124a64f54e17a2601197db30a7e SHA512 fa0ad63d4b73a9e399d5ee6ba8cd9b165d448bad91120c69f831d88d21d4db2e0872b4691b39c50a6f0e4284b4ea2f54cc7a4ba348c4958a880158945117d343 WHIRLPOOL 654ad8e5cb800b5844bfbf88b3beb19b46671e72723d0aa25836dc9710ac7d496bcf212a112565d9a4a9374f335d0d5a3cc980b2ffd211366502900df90b20df EBUILD python-exec-9999.ebuild 1247 SHA256 7a10485cb24235b19d2233a888a2240332f283b7d11c48c66d537907bccc22aa SHA512 8380213389f2f288df3411817438577bae59d9647eee1e3961556a8e4da65bc635c8d0c395615598456a7284a234446a427c2a419a725a31af9ad06351d5cd97 WHIRLPOOL 151aa8e815bc4192287d886a6b6e489ead55dc7355962f20b949aac27691ee88eee1a47a2a182a2349daf3ee03c999b2bc3d156721d2eb37b7f2f148ec19bf2e MISC ChangeLog 6288 SHA256 b6bd24503c48d1eb06563b89b7c3108ede5f3978bf7df98f10731b64d897329e SHA512 7e1ff99465d71713f727ee0ba417d93a794ee48813d5701490d16cedf1bee0e118c0aa5029fc7ae25706879b69ce27a85fc16cd55ddbe1992fff451c5374a5bc WHIRLPOOL 0d9cbfb18894d0defefc4d1e0f1c33106881e31d309d469014800c8c1172a8823e8bfbb03e505e86934b711c8cc7980cfe080deba6556ddd25f8116499d3a2c7 MISC metadata.xml 369 SHA256 8b6dcc8bc5a5198e3df4c844ebf07234f8c9eb1ff4e10fa7bccc07a0e5dc7517 SHA512 8cc3738e0fd501a4b374d9e18f5676c78d285549c88061aab63697011f43163275751341dc1199aa9a0e4eb3bc9c8e436df261ede8bcf2f759aab096a53d04e0 WHIRLPOOL c99edc69d860d148ebd3d004131e448a957a1f6a3cb3f32b51e94bed79eee6060e41f0de18edc6dd63b83f507f25ab6f0105e593d7d14b1050106aaa3b45e342 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.19 (GNU/Linux) - -iQIcBAEBCgAGBQJRapbPAAoJELp701BxlEWfsGcP/RwzgNPFxWuBC1PGnot/pN6+ -vBmpQdKJFU8U3Gdi4Wy8ie4+68qqjNau/wxvbjuid4oWCvDpYcR0G+jOlXek0OGY -ld2bSmAvHCy+lqVHTWFR6u2tjz3PHWxeSYb3ec7SVqpwgpzK978237atnRBh5KWM -dW/kSvB6zdp1P6emAqCwMnmSAKWZ1lNfIq6/NvSYVVV0MzfsrEiBW4JDtKny40Jh -bNid6tb7jjfUQi1ROVeCC7cMgeWEooI/fgvxpTLq73jHp7ar5dewOaEbcsrUQHIn -gdAAeAms5d7Gz+yPaq9/zcijF3vfgbPqrZMaUlrieO/sfoydbxmrSrKYBDqzzX15 -KO1SW79O4xGopYBKRlaoEpl163ZdqAgWPCVlrsPczt+P51nQVlleDzPY2Q3CnPY7 -bzvq3sNLqM7w7BFHQTXZcmWv8f0IWjaOREBewb9EusdJcynaiqngFPUtHskjPWuE -thorlz6LpWmOY6f8hKppvcycwj10j+DUlg02hR7OOmDFyrqjKZdG22M30kDahg4G -YTJfl5yveEkzI+Bj+Z+X3cZUFWxp0a866EOk8LuUPtA7VX/8BJbP09Gq047Q1h2O -YfUQx/wlRqSsQCjr92U6TEXfUs+/1R021IzNjBQsMAYj3lIrueaVALXDO6y9JHuk -Fb1BUofsVfo3qn76BrWI -=qw2V ------END PGP SIGNATURE----- diff --git a/gx86/dev-python/python-exec/python-exec-9999.ebuild b/gx86/dev-python/python-exec/python-exec-0.9999.ebuild similarity index 100% rename from gx86/dev-python/python-exec/python-exec-9999.ebuild rename to gx86/dev-python/python-exec/python-exec-0.9999.ebuild diff --git a/gx86/dev-python/python-exec/python-exec-1.9999.ebuild b/gx86/dev-python/python-exec/python-exec-1.9999.ebuild new file mode 100644 index 0000000..3b54adc --- /dev/null +++ b/gx86/dev-python/python-exec/python-exec-1.9999.ebuild @@ -0,0 +1,50 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/python-exec/python-exec-9999.ebuild,v 1.5 2013/02/26 18:36:57 mgorny Exp $ + +EAPI=5 + +#if LIVE +AUTOTOOLS_AUTORECONF=yes +EGIT_REPO_URI="http://bitbucket.org/mgorny/${PN}.git" +EGIT_BRANCH=v2.x-test1 + +inherit git-2 +#endif + +# Kids, don't do this at home! +inherit python-utils-r1 +PYTHON_COMPAT=( "${_PYTHON_ALL_IMPLS[@]}" ) + +inherit autotools-utils python-r1 + +DESCRIPTION="Python script wrapper" +HOMEPAGE="https://bitbucket.org/mgorny/python-exec/" +SRC_URI="mirror://bitbucket/mgorny/${PN}/downloads/${P}.tar.bz2" + +LICENSE="BSD" +SLOT="2" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="" + +#if LIVE +KEYWORDS= +SRC_URI= +#endif + +RESTRICT=test + +src_configure() { + local pyimpls i EPYTHON + for i in "${PYTHON_COMPAT[@]}"; do + python_export "${i}" EPYTHON + pyimpls+=" ${EPYTHON}" + done + + local myeconfargs=( + --with-eprefix="${EPREFIX}" + --with-python-impls="${pyimpls}" + ) + + autotools-utils_src_configure +} diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass index c2872b3..4fb160e 100644 --- a/gx86/eclass/distutils-r1.eclass +++ b/gx86/eclass/distutils-r1.eclass @@ -409,39 +409,41 @@ distutils-r1_python_test() { : } -# @FUNCTION: _distutils-r1_rename_scripts -# @USAGE: <path> +# @FUNCTION: _distutils-r1_create_wrappers +# @USAGE: <root> # @INTERNAL # @DESCRIPTION: -# Renames installed Python scripts to be implementation-suffixed. -# ${EPYTHON} needs to be set to the implementation name. +# Creates wrappers for Python scripts installed in fake root ${root}. # -# All executable scripts having shebang referencing ${EPYTHON} -# in given path will be renamed. -_distutils-r1_rename_scripts() { +# Non-Python scripts will be moved back to /usr/bin. +_distutils-r1_create_wrappers() { debug-print-function ${FUNCNAME} "${@}" local path=${1} [[ ${path} ]] || die "${FUNCNAME}: no path given" + mkdir -p "${path}${EPREFIX}/usr/bin" || die local f - while IFS= read -r -d '' f; do - debug-print "${FUNCNAME}: found executable at ${f#${D}/}" + for f in "${path}${PYTHON_SCRIPTDIR}"/*; do + debug-print "${FUNCNAME}: found executable at ${f#${path}}" local shebang read -r shebang < "${f}" - if [[ ${shebang} == '#!'*${EPYTHON}* ]] - then + + if [[ ${shebang} == '#!'*${EPYTHON}* ]]; then + local basename=${f##*/} debug-print "${FUNCNAME}: matching shebang: ${shebang}" - local newf=${f}-${EPYTHON} - debug-print "${FUNCNAME}: renaming to ${newf#${D}/}" - mv "${f}" "${newf}" || die + debug-print "${FUNCNAME}: installing wrapper at /usr/bin/${basename}" + _python_ln_rel "${path}${EPREFIX}"/usr/bin/python-exec2 \ + "${path}${EPREFIX}/usr/bin/${basename}" || die + else + debug-print "${FUNCNAME}: non-matching shebang: ${shebang}" - debug-print "${FUNCNAME}: installing wrapper at ${f#${D}/}" - _python_ln_rel "${path}${EPREFIX}"/usr/bin/python-exec "${f}" || die + debug-print "${FUNCNAME}: moving to /usr/bin/${basename}" + mv "${f}" "${path}${EPREFIX}/usr/bin/" || die fi - done < <(find "${path}" -type f -executable -print0) + done } # @FUNCTION: distutils-r1_python_install @@ -474,15 +476,20 @@ distutils-r1_python_install() { local root=${D}/_${EPYTHON} [[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D} + local PYTHON_SCRIPTDIR=${PYTHON_SCRIPTDIR} + python_export PYTHON_SCRIPTDIR - esetup.py install "${flags[@]}" --root="${root}" "${@}" + esetup.py install "${flags[@]}" \ + --root="${root}" \ + --install-scripts="${PYTHON_SCRIPTDIR}" \ + "${@}" if [[ -d ${root}$(python_get_sitedir)/tests ]]; then die "Package installs 'tests' package, file collisions likely." fi if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then - _distutils-r1_rename_scripts "${root}" + _distutils-r1_create_wrappers "${root}" multibuild_merge_root "${root}" "${D}" fi } diff --git a/gx86/eclass/python-r1.eclass b/gx86/eclass/python-r1.eclass index 5c5b33c..2879a8d 100644 --- a/gx86/eclass/python-r1.eclass +++ b/gx86/eclass/python-r1.eclass @@ -122,7 +122,7 @@ fi # # Example value: # @CODE -# dev-python/python-exec +# dev-python/python-exec:2 # python_targets_python2_6? ( dev-lang/python:2.6[gdbm] ) # python_targets_python2_7? ( dev-lang/python:2.7[gdbm] ) # @CODE @@ -203,7 +203,7 @@ _python_set_globals() { # but no point in making this overcomplex, BDEP doesn't hurt anyone # 2) python-exec should be built with all targets forced anyway # but if new targets were added, we may need to force a rebuild - PYTHON_DEPS+="dev-python/python-exec[${PYTHON_USEDEP}]" + PYTHON_DEPS+="dev-python/python-exec:2[${PYTHON_USEDEP}]" } _python_set_globals @@ -741,28 +741,23 @@ python_export_best() { python_replicate_script() { debug-print-function ${FUNCNAME} "${@}" - local suffixes=() + _replicate_impl() { + local PYTHON_SCRIPTDIR + python_export PYTHON_SCRIPTDIR - _add_suffix() { - suffixes+=( "${EPYTHON}" ) - } - python_foreach_impl _add_suffix - debug-print "${FUNCNAME}: suffixes = ( ${suffixes[@]} )" - - local f suffix - for suffix in "${suffixes[@]}"; do - for f; do - local newf=${f}-${suffix} - - debug-print "${FUNCNAME}: ${f} -> ${newf}" - cp "${f}" "${newf}" || die - done + mkdir -p "${D%/}/${PYTHON_SCRIPTDIR}" || die + cp "${files[@]}" "${D%/}/${PYTHON_SCRIPTDIR}"/ || die - _python_rewrite_shebang "${suffix}" "${@/%/-${suffix}}" - done + _python_rewrite_shebang "${EPYTHON}" \ + "${files[@]/*\//${D%/}/${PYTHON_SCRIPTDIR}/}" + } + local files=( "${@}" ) + python_foreach_impl _replicate_impl + # install the wrappers + local f for f; do - _python_ln_rel "${ED}"/usr/bin/python-exec "${f}" || die + _python_ln_rel "${ED}"/usr/bin/python-exec2 "${f}" || die done } diff --git a/gx86/eclass/python-single-r1.eclass b/gx86/eclass/python-single-r1.eclass index 768bbd8..62aedc3 100644 --- a/gx86/eclass/python-single-r1.eclass +++ b/gx86/eclass/python-single-r1.eclass @@ -110,7 +110,7 @@ fi # # Example value: # @CODE -# dev-python/python-exec +# dev-python/python-exec:2 # python_single_target_python2_6? ( dev-lang/python:2.6[gdbm] ) # python_single_target_python2_7? ( dev-lang/python:2.7[gdbm] ) # @CODE @@ -193,7 +193,7 @@ _python_single_set_globals() { # but no point in making this overcomplex, BDEP doesn't hurt anyone # 2) python-exec should be built with all targets forced anyway # but if new targets were added, we may need to force a rebuild - PYTHON_DEPS+="dev-python/python-exec[${PYTHON_USEDEP}]" + PYTHON_DEPS+="dev-python/python-exec:2[${PYTHON_USEDEP}]" } _python_single_set_globals diff --git a/gx86/eclass/python-utils-r1.eclass b/gx86/eclass/python-utils-r1.eclass index 3a1c4ee..b0b2b00 100644 --- a/gx86/eclass/python-utils-r1.eclass +++ b/gx86/eclass/python-utils-r1.eclass @@ -195,6 +195,18 @@ _python_impl_supported() { # dev-lang/python:2.7[xml] # @CODE +# @ECLASS-VARIABLE: PYTHON_SCRIPTDIR +# @DEFAULT_UNSET +# @DESCRIPTION: +# The location where Python scripts must be installed for current impl. +# +# Set and exported on request using python_export(). +# +# Example value: +# @CODE +# /usr/lib/python-bin/python2.7 +# @CODE + # @FUNCTION: python_export # @USAGE: [<impl>] <variables>... # @DESCRIPTION: @@ -359,6 +371,11 @@ python_export() { export PYTHON_PKG_DEP debug-print "${FUNCNAME}: PYTHON_PKG_DEP = ${PYTHON_PKG_DEP}" ;; + PYTHON_SCRIPTDIR) + local dir + export PYTHON_SCRIPTDIR=${EPREFIX}/usr/lib/python-bin/${impl} + debug-print "${FUNCNAME}: PYTHON_SCRIPTDIR = ${PYTHON_SCRIPTDIR}" + ;; *) die "python_export: unknown variable ${var}" esac @@ -475,6 +492,19 @@ python_get_LIBS() { echo "${PYTHON_LIBS}" } +# @FUNCTION: python_get_scriptdir +# @USAGE: [<impl>] +# @DESCRIPTION: +# Obtain and print the script install path for the given +# implementation. If no implementation is provided, ${EPYTHON} will +# be used. +python_get_scriptdir() { + debug-print-function ${FUNCNAME} "${@}" + + python_export "${@}" PYTHON_SCRIPTDIR + echo "${PYTHON_SCRIPTDIR}" +} + # @FUNCTION: _python_rewrite_shebang # @USAGE: [<EPYTHON>] <path>... # @INTERNAL @@ -727,21 +757,20 @@ python_newscript() { local d=${python_scriptroot:-${DESTTREE}/bin} local INSDESTTREE INSOPTIONS + local PYTHON_SCRIPTDIR=${PYTHON_SCRIPTDIR} + [[ ${PYTHON_SCRIPTDIR} ]] || python_export PYTHON_SCRIPTDIR - insinto "${d}" + insinto "${PYTHON_SCRIPTDIR#${EPREFIX}}" insopts -m755 local f=${1} - local barefn=${2} - - local newfn=${barefn}-${EPYTHON} + local newfn=${2} - debug-print "${FUNCNAME}: ${f} -> ${d}/${newfn}" + debug-print "${FUNCNAME}: ${f} -> ${INSDESTTREE}/${newfn}" newins "${f}" "${newfn}" || die - _python_rewrite_shebang "${ED}/${d}/${newfn}" - - # install the wrapper - _python_ln_rel "${ED}"/usr/bin/python-exec "${ED}/${d}/${barefn}" || die + _python_rewrite_shebang "${ED%/}/${INSDESTTREE}/${newfn}" + mkdir -p "${ED%/}/${d}" || die + _python_ln_rel "${ED}"/usr/bin/python-exec2 "${ED%/}/${d}/${newfn}" || die } # @ECLASS-VARIABLE: python_moduleroot @@ -879,8 +908,8 @@ python_wrapper_setup() { rm -f "${workdir}"/bin/2to3 rm -f "${workdir}"/pkgconfig/python{,2,3}.pc - local EPYTHON PYTHON - python_export "${impl}" EPYTHON PYTHON + local EPYTHON PYTHON PYTHON_SCRIPTDIR + python_export "${impl}" EPYTHON PYTHON PYTHON_SCRIPTDIR local pyver if python_is_python3; then @@ -932,9 +961,10 @@ __EOF__ # Now, set the environment. # But note that ${workdir} may be shared with something else, # and thus already on top of PATH. - if [[ ${PATH##:*} != ${workdir}/bin ]]; then - PATH=${workdir}/bin${PATH:+:${PATH}} - fi +# if [[ ${PATH##:*} != ${workdir}/bin ]]; then + PATH=${workdir}/bin:${PYTHON_SCRIPTDIR}${PATH:+:${PATH}} +# fi + # TODO: ^ clean this up, add other impl scriptdirs to PATH? if [[ ${PKG_CONFIG_PATH##:*} != ${workdir}/pkgconfig ]]; then PKG_CONFIG_PATH=${workdir}/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}} fi diff --git a/gx86/eclass/tests/python-utils-r1.sh b/gx86/eclass/tests/python-utils-r1.sh index d4f8dae..680af57 100755 --- a/gx86/eclass/tests/python-utils-r1.sh +++ b/gx86/eclass/tests/python-utils-r1.sh @@ -38,6 +38,7 @@ test_var PYTHON_SITEDIR python2_7 /usr/lib/python2.7/site-packages test_var PYTHON_INCLUDEDIR python2_7 /usr/include/python2.7 test_var PYTHON_LIBPATH python2_7 /usr/lib/libpython2.7$(get_libname) test_var PYTHON_PKG_DEP python2_7 dev-lang/python:2.7 +test_var PYTHON_SCRIPTDIR python2_7 /usr/lib/python-bin/python2.7 test_var EPYTHON python3_3 python3.3 test_var PYTHON python3_3 /usr/bin/python3.3 @@ -45,17 +46,20 @@ test_var PYTHON_SITEDIR python3_3 /usr/lib/python3.3/site-packages test_var PYTHON_INCLUDEDIR python3_3 /usr/include/python3.3 test_var PYTHON_LIBPATH python3_3 /usr/lib/libpython3.3$(get_libname) test_var PYTHON_PKG_DEP python3_3 dev-lang/python:3.3 +test_var PYTHON_SCRIPTDIR python3_3 /usr/lib/python-bin/python3.3 test_var EPYTHON jython2_7 jython2.7 test_var PYTHON jython2_7 /usr/bin/jython2.7 test_var PYTHON_SITEDIR jython2_7 /usr/share/jython-2.7/Lib/site-packages test_var PYTHON_PKG_DEP jython2_7 dev-java/jython:2.7 +test_var PYTHON_SCRIPTDIR jython2_7 /usr/lib/python-bin/jython2.7 test_var EPYTHON pypy2_0 pypy-c2.0 test_var PYTHON pypy2_0 /usr/bin/pypy-c2.0 test_var PYTHON_SITEDIR pypy2_0 /usr/lib/pypy2.0/site-packages test_var PYTHON_INCLUDEDIR pypy2_0 /usr/lib/pypy2.0/include test_var PYTHON_PKG_DEP pypy2_0 virtual/pypy:2.0 +test_var PYTHON_SCRIPTDIR pypy2_0 /usr/lib/python-bin/pypy-c2.0 test_is python_is_python3 python2.7 1 test_is python_is_python3 python3.2 0
signature.asc
Description: PGP signature
