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, 01 Oct 2020 14:04:44
Message-Id: 1601561072.df59915cc50be96870432e3ceb123d970eb6037a.mgorny@gentoo
1 commit: df59915cc50be96870432e3ceb123d970eb6037a
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 1 13:38:21 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 1 14:04:32 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=df59915c
7
8 dev-lang/python-exec: Remove the live ebuild
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-lang/python-exec/python-exec-9999.ebuild | 143 ---------------------------
13 1 file changed, 143 deletions(-)
14
15 diff --git a/dev-lang/python-exec/python-exec-9999.ebuild b/dev-lang/python-exec/python-exec-9999.ebuild
16 deleted file mode 100644
17 index 57a8be114e0..00000000000
18 --- a/dev-lang/python-exec/python-exec-9999.ebuild
19 +++ /dev/null
20 @@ -1,143 +0,0 @@
21 -# Copyright 1999-2020 Gentoo Authors
22 -# Distributed under the terms of the GNU General Public License v2
23 -
24 -EAPI=7
25 -
26 -inherit autotools git-r3 python-utils-r1
27 -
28 -DESCRIPTION="Python script wrapper"
29 -HOMEPAGE="https://github.com/mgorny/python-exec/"
30 -SRC_URI=""
31 -EGIT_REPO_URI="https://github.com/mgorny/python-exec.git"
32 -
33 -LICENSE="BSD-2"
34 -SLOT="2"
35 -KEYWORDS=""
36 -# Internal Python project hack. Do not copy it. Ever.
37 -IUSE="${_PYTHON_ALL_IMPLS[@]/#/python_targets_}"
38 -
39 -src_prepare() {
40 - default
41 - eautoreconf
42 -}
43 -
44 -src_configure() {
45 - local pyimpls=() i EPYTHON
46 - for i in "${_PYTHON_ALL_IMPLS[@]}"; do
47 - if use "python_targets_${i}"; then
48 - python_export "${i}" EPYTHON
49 - pyimpls+=( "${EPYTHON}" )
50 - fi
51 - done
52 -
53 - local myconf=(
54 - --with-fallback-path="${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin"
55 - --with-python-impls="${pyimpls[*]}"
56 - )
57 -
58 - econf "${myconf[@]}"
59 -}
60 -
61 -src_install() {
62 - default
63 -
64 - # Prepare and own the template
65 - insinto /etc/python-exec
66 - newins - python-exec.conf \
67 - < <(sed -n -e '/^#/p' config/python-exec.conf.example)
68 -
69 - local programs=( python )
70 - local scripts=( python-config 2to3 idle pydoc pyvenv )
71 - local i
72 - for i in "${_PYTHON_ALL_IMPLS[@]}"; do
73 - if use "python_targets_${i}"; then
74 - # NB: duplicate entries are harmless
75 - if python_is_python3 "${i}"; then
76 - programs+=( python3 )
77 - scripts+=( python3-config )
78 - else
79 - programs+=( python2 )
80 - scripts+=( python2-config )
81 - fi
82 - fi
83 - done
84 -
85 - local f
86 - for f in "${programs[@]}"; do
87 - # symlink the C wrapper for python to avoid shebang recursion
88 - # bug #568974
89 - dosym python-exec2c /usr/bin/"${f}"
90 - done
91 - for f in "${scripts[@]}"; do
92 - # those are python scripts (except for new python-configs)
93 - # so symlink them via the python wrapper
94 - dosym ../lib/python-exec/python-exec2 /usr/bin/"${f}"
95 - done
96 -}
97 -
98 -pkg_preinst() {
99 - if [[ -e ${EROOT}/etc/python-exec/python-exec.conf ]]; then
100 - # preserve current configuration
101 - cp "${EROOT}"/etc/python-exec/python-exec.conf \
102 - "${ED}"/etc/python-exec/python-exec.conf || die
103 - else
104 - # preserve previous Python version preference
105 - local py old_pythons=()
106 - local config_base=${EROOT}/etc/env.d/python
107 -
108 - # start with the 'global' preference (2 vs 3)
109 - if [[ -f ${config_base}/config ]]; then
110 - old_pythons+=( "$(<${config_base}/config)" )
111 - fi
112 -
113 - # then try specific py3 selection
114 - for py in 3; do
115 - local target=
116 -
117 - if [[ -f ${config_base}/python${py} ]]; then
118 - # try the newer config files
119 - target=$(<${config_base}/python${py})
120 - elif [[ -L ${EROOT}/usr/bin/python${py} ]]; then
121 - # check the older symlink format
122 - target=$(readlink "${EROOT}/usr/bin/python${py}")
123 -
124 - # check if it's actually old eselect symlink
125 - [[ ${target} == python?.? ]] || target=
126 - fi
127 -
128 - # add the extra target if found and != global
129 - if [[ ${target} && ${old_pythons[0]} != ${target} ]]; then
130 - old_pythons+=( "${target}" )
131 - fi
132 - done
133 -
134 - if [[ ${old_pythons[@]} ]]; then
135 - elog "You seem to have just upgraded into the new version of python-exec"
136 - elog "that uses python-exec.conf for configuration. The ebuild has attempted"
137 - elog "to convert your previous configuration to the new format, resulting"
138 - elog "in the following preferences (most preferred version first):"
139 - elog
140 - for py in "${old_pythons[@]}"; do
141 - elog " ${py}"
142 - done
143 - elog
144 - elog "Those interpreters will be preferred when running Python scripts or"
145 - elog "calling wrapped Python executables (python, python2, pydoc...)."
146 - elog "If none of the preferred interpreters are supported, python-exec will"
147 - elog "fall back to the newest supported Python version."
148 - elog
149 - elog "Please note that due to the ambiguous character of the old settings,"
150 - elog "you may want to modify the preference list yourself. In order to do so,"
151 - elog "open the following file in your favorite editor:"
152 - elog
153 - elog " ${EROOT}/etc/python-exec/python-exec.conf"
154 - elog
155 - elog "For more information on the new configuration format, please read"
156 - elog "the comment on top of the installed configuration file."
157 -
158 - local IFS=$'\n'
159 - echo "${old_pythons[*]}" \
160 - >> "${ED}"/etc/python-exec/python-exec.conf || die
161 - fi
162 - fi
163 -}