diff options
author | Michał Górny <mgorny@gentoo.org> | 2016-01-30 12:29:48 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2016-02-06 10:57:35 +0100 |
commit | 8bea0d57f8e47a532b7d1ccc22296e61573dc66a (patch) | |
tree | c3fec8a72726783b415fb58465240f87583881b4 /dev-lang/python-exec | |
parent | dev-java/sbt: Bump to 0.13.10_rc2 (diff) | |
download | gentoo-8bea0d57f8e47a532b7d1ccc22296e61573dc66a.tar.gz gentoo-8bea0d57f8e47a532b7d1ccc22296e61573dc66a.tar.bz2 gentoo-8bea0d57f8e47a532b7d1ccc22296e61573dc66a.zip |
dev-lang/python-exec: Reclaim /usr/bin/py* wrappers, #573254
Diffstat (limited to 'dev-lang/python-exec')
-rw-r--r-- | dev-lang/python-exec/python-exec-2.9999.ebuild | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/dev-lang/python-exec/python-exec-2.9999.ebuild b/dev-lang/python-exec/python-exec-2.9999.ebuild index cf4c3ebd2fcd..80026683a4fe 100644 --- a/dev-lang/python-exec/python-exec-2.9999.ebuild +++ b/dev-lang/python-exec/python-exec-2.9999.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -27,8 +27,14 @@ SLOT="2" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~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="" -RDEPEND="!<dev-python/python-exec-10000 - !<app-eselect/eselect-python-20151117" +# eselect-python because of /usr/bin/python* collisions +# python versions because of missing $scriptdir/python* symlinks +RDEPEND=" + !<app-eselect/eselect-python-20160206 + !<dev-lang/python-2.7.10-r4:2.7 + !<dev-lang/python-3.3.5-r4:3.3 + !<dev-lang/python-3.4.3-r4:3.4 + !<dev-lang/python-3.5.0-r3:3.5" #if LIVE KEYWORDS= @@ -53,3 +59,34 @@ src_configure() { econf "${myconf[@]}" } + +src_install() { + default + + local f + for f in python{,2,3}; do + # can't use symlinks here since random stuff + # loves to do readlink on sys.executable... + newbin python-exec2-c "${f}" + done + for f in python{,2,3}-config 2to3 idle pydoc pyvenv; do + dosym ../lib/python-exec/python-exec2 /usr/bin/"${f}" + done +} + +pkg_preinst() { + local py + + # Copy python[23] selection from the old format (symlink) + for py in 2 3; do + if [[ -L ${EROOT}/usr/bin/python${py} ]]; then + local target=$(readlink "${EROOT}/usr/bin/python${py}") + + # check if it's actually old eselect symlink + if [[ ${target} == python?.? ]]; then + einfo "Preserving Python${py} as ${target}" + echo "${target}" > "${EROOT}/etc/env.d/python/python${py}" || die + fi + fi + done +} |