Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/python-exec/
Date: Thu, 26 Jan 2017 17:54:36
Message-Id: 1485453262.9c8a31d1bcf31e512f7e31ef166ad590e2572285.mgorny@gentoo
1 commit: 9c8a31d1bcf31e512f7e31ef166ad590e2572285
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 26 17:43:41 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 26 17:54:22 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c8a31d1
7
8 dev-lang/python-exec: Bump to 2.4.5
9
10 Bump to the new 2.4.5 release. It includes a fallback for symlink
11 resolution when PATH is wiped out the environment (when 'env -i' is
12 used, e.g. in gcc-config).
13
14 dev-lang/python-exec/Manifest | 1 +
15 dev-lang/python-exec/python-exec-2.4.5.ebuild | 135 ++++++++++++++++++++++++++
16 2 files changed, 136 insertions(+)
17
18 diff --git a/dev-lang/python-exec/Manifest b/dev-lang/python-exec/Manifest
19 index d00735b..d8beb03 100644
20 --- a/dev-lang/python-exec/Manifest
21 +++ b/dev-lang/python-exec/Manifest
22 @@ -3,3 +3,4 @@ DIST python-exec-2.0.2.tar.bz2 82217 SHA256 c411638fe94953c1e8ff57e7b66f601a8176
23 DIST python-exec-2.1.tar.bz2 82167 SHA256 adac4e9ae677ca0fbb9efc55573ecbb0e8361ed7a60a5241e7abc1056fba06ad SHA512 cadfb7723aa412caec4a449909769b14a800c19650c64768b0ffb30b2c0645e70c9a039f960f3263c6c18490bb73c0129b83a72c7407f558bcaf3652cc4c8bcf WHIRLPOOL 72b73b216faf7caa8afbc3ce316771bd832e468cf84835267dc3833d5c52fce24578e09f2d3aa8a322f324426eda5e53bd9611711ea976679574b2be764c2525
24 DIST python-exec-2.4.3.tar.bz2 86815 SHA256 581aa0c033632269d553754440d4017c21afc1c1500fd8951de093bc715c63fb SHA512 37fb7f915a2848699e9fca4e09d167b6d6aa192e3c374d7f01aec09529b5f1346ce2c45139f4e8f68b53e3f197b4d77b7f58519b012c117dd5ec8535a43fbe34 WHIRLPOOL 117564deb6f35387757ebbbff96d0325d5979d2933bbfca184cde0170cdd923bf9fa71ba76f234b098df12f006b6f8b5ba388416692ceff56ec7c16173777ab6
25 DIST python-exec-2.4.4.tar.bz2 86945 SHA256 cdc780764bce79047ab047160156c5dc3bf5728d9c59cf1ed904fdf12638d60b SHA512 26b76960430dc3b2b79aab5e8a72498144d4e78bed5291fe9361afe081f0e8d70049a74ec29384cb0fc199f76c23499324d2eddcaea521ef33d88e61b1b674f9 WHIRLPOOL 791fd9732179d17bf5cd981956759e7c25e1e1dcbaf6fdfb05cf4fed8d4f44490740aaa5b4d38335a72128f8fdea0f6ab2e34c331a2b7f6b0897aa7eaa1f0c48
26 +DIST python-exec-2.4.5.tar.bz2 87137 SHA256 8649def42af569cc65598da6af49e554351dc138ccc8a96198c2a425494a8559 SHA512 8c1a520c565afa775cad0e8b88248b688814664e588f683fc2b2c039ee0494b168ebd3cd1042b8b7fe2583f287cf55b22ea0585bfb43efe2f8450d809cde0b21 WHIRLPOOL 5de79c34c31eee131799524a8ad19262a1455d59ee4db0cc99468820fe142c864f10999834734b70a6d6868ead97e2d389e83dc1679248e862b02b332a177954
27
28 diff --git a/dev-lang/python-exec/python-exec-2.4.5.ebuild b/dev-lang/python-exec/python-exec-2.4.5.ebuild
29 new file mode 100644
30 index 00000000..dd199a9
31 --- /dev/null
32 +++ b/dev-lang/python-exec/python-exec-2.4.5.ebuild
33 @@ -0,0 +1,135 @@
34 +# Copyright 1999-2017 Gentoo Foundation
35 +# Distributed under the terms of the GNU General Public License v2
36 +# $Id$
37 +
38 +EAPI=5
39 +
40 +# Kids, don't do this at home!
41 +inherit python-utils-r1
42 +PYTHON_COMPAT=( "${_PYTHON_ALL_IMPLS[@]}" )
43 +
44 +# Inherited purely to have PYTHON_TARGET flags which will satisfy USE
45 +# dependencies and trigger necessary rebuilds.
46 +inherit python-r1
47 +
48 +DESCRIPTION="Python script wrapper"
49 +HOMEPAGE="https://github.com/mgorny/python-exec/"
50 +SRC_URI="https://github.com/mgorny/${PN}/releases/download/${P}/${P}.tar.bz2"
51 +
52 +LICENSE="BSD-2"
53 +SLOT="2"
54 +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"
55 +IUSE=""
56 +
57 +# eselect-python because of /usr/bin/python* collisions and new config
58 +# python versions because of missing $scriptdir/python* symlinks
59 +RDEPEND="
60 + !<app-eselect/eselect-python-20160206
61 + !<dev-lang/python-2.7.10-r4:2.7
62 + !<dev-lang/python-3.3.5-r4:3.3
63 + !<dev-lang/python-3.4.3-r4:3.4
64 + !<dev-lang/python-3.5.0-r3:3.5"
65 +
66 +src_configure() {
67 + local pyimpls=() i EPYTHON
68 + for i in "${PYTHON_COMPAT[@]}"; do
69 + python_export "${i}" EPYTHON
70 + pyimpls+=( "${EPYTHON}" )
71 + done
72 +
73 + local myconf=(
74 + --with-fallback-path="${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin"
75 + --with-python-impls="${pyimpls[*]}"
76 + )
77 +
78 + econf "${myconf[@]}"
79 +}
80 +
81 +src_install() {
82 + default
83 +
84 + # Prepare and own the template
85 + sed -n -e '/^#/p' config/python-exec.conf.example \
86 + > "${T}"/python-exec.conf || die
87 + insinto /etc/python-exec
88 + doins "${T}"/python-exec.conf
89 +
90 + local f
91 + for f in python{,2,3}; do
92 + # symlink the C wrapper for python to avoid shebang recursion
93 + # bug #568974
94 + dosym python-exec2c /usr/bin/"${f}"
95 + done
96 + for f in python{,2,3}-config 2to3 idle pydoc pyvenv; do
97 + # those are python scripts (except for new python-configs)
98 + # so symlink them via the python wrapper
99 + dosym ../lib/python-exec/python-exec2 /usr/bin/"${f}"
100 + done
101 +}
102 +
103 +pkg_preinst() {
104 + if [[ -e ${EROOT}etc/python-exec/python-exec.conf ]]; then
105 + # preserve current configuration
106 + cp "${EROOT}"etc/python-exec/python-exec.conf \
107 + "${ED}"etc/python-exec/python-exec.conf || die
108 + else
109 + # preserve previous Python version preference
110 + local py old_pythons=()
111 + local config_base=${EROOT}etc/env.d/python
112 +
113 + # start with the 'global' preference (2 vs 3)
114 + if [[ -f ${config_base}/config ]]; then
115 + old_pythons+=( "$(<${config_base}/config)" )
116 + fi
117 +
118 + # then try specific py3 selection
119 + for py in 3; do
120 + local target=
121 +
122 + if [[ -f ${config_base}/python${py} ]]; then
123 + # try the newer config files
124 + target=$(<${config_base}/python${py})
125 + elif [[ -L ${EROOT}/usr/bin/python${py} ]]; then
126 + # check the older symlink format
127 + target=$(readlink "${EROOT}/usr/bin/python${py}")
128 +
129 + # check if it's actually old eselect symlink
130 + [[ ${target} == python?.? ]] || target=
131 + fi
132 +
133 + # add the extra target if found and != global
134 + if [[ ${target} && ${old_pythons[0]} != ${target} ]]; then
135 + old_pythons+=( "${target}" )
136 + fi
137 + done
138 +
139 + if [[ ${old_pythons[@]} ]]; then
140 + elog "You seem to have just upgraded into the new version of python-exec"
141 + elog "that uses python-exec.conf for configuration. The ebuild has attempted"
142 + elog "to convert your previous configuration to the new format, resulting"
143 + elog "in the following preferences (most preferred version first):"
144 + elog
145 + for py in "${old_pythons[@]}"; do
146 + elog " ${py}"
147 + done
148 + elog
149 + elog "Those interpreters will be preferred when running Python scripts or"
150 + elog "calling wrapped Python executables (python, python2, pydoc...)."
151 + elog "If none of the preferred interpreters are supported, python-exec will"
152 + elog "fall back to the newest supported Python version."
153 + elog
154 + elog "Please note that due to the ambiguous character of the old settings,"
155 + elog "you may want to modify the preference list yourself. In order to do so,"
156 + elog "open the following file in your favorite editor:"
157 + elog
158 + elog " ${EROOT}etc/python-exec/python-exec.conf"
159 + elog
160 + elog "For more information on the new configuration format, please read"
161 + elog "the comment on top of the installed configuration file."
162 +
163 + local IFS=$'\n'
164 + echo "${old_pythons[*]}" \
165 + >> "${ED}"etc/python-exec/python-exec.conf || die
166 + fi
167 + fi
168 +}