Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Cc: python@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-python] [PATCH 2/8] Clean up python_replicate_script().
Date: Fri, 13 Sep 2013 18:58:31
Message-Id: 1379098729-2801-3-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-python] Clean up of python eclasses and support for python-exec:2 by "Michał Górny"
1 ---
2 gx86/eclass/python-r1.eclass | 30 ++++++++++++------------------
3 1 file changed, 12 insertions(+), 18 deletions(-)
4
5 diff --git a/gx86/eclass/python-r1.eclass b/gx86/eclass/python-r1.eclass
6 index 6994952..e006744 100644
7 --- a/gx86/eclass/python-r1.eclass
8 +++ b/gx86/eclass/python-r1.eclass
9 @@ -741,28 +741,22 @@ python_export_best() {
10 python_replicate_script() {
11 debug-print-function ${FUNCNAME} "${@}"
12
13 - local suffixes=()
14 -
15 - _add_suffix() {
16 - suffixes+=( "${EPYTHON}" )
17 - }
18 - python_foreach_impl _add_suffix
19 - debug-print "${FUNCNAME}: suffixes = ( ${suffixes[@]} )"
20 -
21 - local f suffix
22 - for suffix in "${suffixes[@]}"; do
23 - for f; do
24 - local newf=${f}-${suffix}
25 -
26 - debug-print "${FUNCNAME}: ${f} -> ${newf}"
27 - cp "${f}" "${newf}" || die
28 + _python_replicate_script() {
29 + local f
30 + for f in "${files[@]}"; do
31 + cp -p "${f}" "${f}-${EPYTHON}" || die
32 done
33 + _python_rewrite_shebang "${EPYTHON}" \
34 + "${files[@]/%/-${EPYTHON}}"
35 + }
36
37 - _python_rewrite_shebang "${suffix}" "${@/%/-${suffix}}"
38 - done
39 + local files=( "${@}" )
40 + python_foreach_impl _python_replicate_script
41
42 + # install the wrappers
43 + local f
44 for f; do
45 - _python_ln_rel "${ED}"/usr/bin/python-exec "${f}" || die
46 + _python_ln_rel "${ED%/}"/usr/bin/python-exec "${f}" || die
47 done
48 }
49
50 --
51 1.8.3.2

Replies