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: Mon, 09 Sep 2019 18:48:21
Message-Id: 1568054888.e9df59462c9f3731db65e62fd852605ad569f702.mgorny@gentoo
1 commit: e9df59462c9f3731db65e62fd852605ad569f702
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 9 16:19:26 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 9 18:48:08 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9df5946
7
8 dev-lang/python-exec: Install python{2,3} conditionally
9
10 Closes: https://bugs.gentoo.org/693910
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12 Closes: https://github.com/gentoo/gentoo/pull/12892
13 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
14
15 dev-lang/python-exec/python-exec-2.4.6-r1.ebuild | 20 ++++++++++++++++++--
16 dev-lang/python-exec/python-exec-9999.ebuild | 20 ++++++++++++++++++--
17 2 files changed, 36 insertions(+), 4 deletions(-)
18
19 diff --git a/dev-lang/python-exec/python-exec-2.4.6-r1.ebuild b/dev-lang/python-exec/python-exec-2.4.6-r1.ebuild
20 index 9f56ea1a1d8..d18086c2f13 100644
21 --- a/dev-lang/python-exec/python-exec-2.4.6-r1.ebuild
22 +++ b/dev-lang/python-exec/python-exec-2.4.6-r1.ebuild
23 @@ -49,13 +49,29 @@ src_install() {
24 newins - python-exec.conf \
25 < <(sed -n -e '/^#/p' config/python-exec.conf.example)
26
27 + local programs=( python )
28 + local scripts=( python-config 2to3 idle pydoc pyvenv )
29 + local i
30 + for i in "${_PYTHON_ALL_IMPLS[@]}"; do
31 + if use "python_targets_${i}"; then
32 + # NB: duplicate entries are harmless
33 + if python_is_python3 "${i}"; then
34 + programs+=( python3 )
35 + scripts+=( python3-config )
36 + else
37 + programs+=( python2 )
38 + scripts+=( python2-config )
39 + fi
40 + fi
41 + done
42 +
43 local f
44 - for f in python{,2,3}; do
45 + for f in "${programs[@]}"; do
46 # symlink the C wrapper for python to avoid shebang recursion
47 # bug #568974
48 dosym python-exec2c /usr/bin/"${f}"
49 done
50 - for f in python{,2,3}-config 2to3 idle pydoc pyvenv; do
51 + for f in "${scripts[@]}"; do
52 # those are python scripts (except for new python-configs)
53 # so symlink them via the python wrapper
54 dosym ../lib/python-exec/python-exec2 /usr/bin/"${f}"
55
56 diff --git a/dev-lang/python-exec/python-exec-9999.ebuild b/dev-lang/python-exec/python-exec-9999.ebuild
57 index ca430aeaf2d..b37d3e0c3b6 100644
58 --- a/dev-lang/python-exec/python-exec-9999.ebuild
59 +++ b/dev-lang/python-exec/python-exec-9999.ebuild
60 @@ -55,13 +55,29 @@ src_install() {
61 newins - python-exec.conf \
62 < <(sed -n -e '/^#/p' config/python-exec.conf.example)
63
64 + local programs=( python )
65 + local scripts=( python-config 2to3 idle pydoc pyvenv )
66 + local i
67 + for i in "${_PYTHON_ALL_IMPLS[@]}"; do
68 + if use "python_targets_${i}"; then
69 + # NB: duplicate entries are harmless
70 + if python_is_python3 "${i}"; then
71 + programs+=( python3 )
72 + scripts+=( python3-config )
73 + else
74 + programs+=( python2 )
75 + scripts+=( python2-config )
76 + fi
77 + fi
78 + done
79 +
80 local f
81 - for f in python{,2,3}; do
82 + for f in "${programs[@]}"; do
83 # symlink the C wrapper for python to avoid shebang recursion
84 # bug #568974
85 dosym python-exec2c /usr/bin/"${f}"
86 done
87 - for f in python{,2,3}-config 2to3 idle pydoc pyvenv; do
88 + for f in "${scripts[@]}"; do
89 # those are python scripts (except for new python-configs)
90 # so symlink them via the python wrapper
91 dosym ../lib/python-exec/python-exec2 /usr/bin/"${f}"