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 6/8] _distutils-r1_wrap_scripts(): do not pass root path explicitly.
Date: Fri, 13 Sep 2013 18:58:43
Message-Id: 1379098729-2801-7-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/distutils-r1.eclass | 16 ++++++----------
3 1 file changed, 6 insertions(+), 10 deletions(-)
4
5 diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass
6 index 5fcb55e..7b119bf 100644
7 --- a/gx86/eclass/distutils-r1.eclass
8 +++ b/gx86/eclass/distutils-r1.eclass
9 @@ -410,7 +410,6 @@ distutils-r1_python_test() {
10 }
11
12 # @FUNCTION: _distutils-r1_wrap_scripts
13 -# @USAGE: <path>
14 # @INTERNAL
15 # @DESCRIPTION:
16 # Moves and wraps all Python scripts installed to PYTHON_SCRIPTDIR
17 @@ -418,14 +417,11 @@ distutils-r1_python_test() {
18 _distutils-r1_wrap_scripts() {
19 debug-print-function ${FUNCNAME} "${@}"
20
21 - local path=${1}
22 - [[ ${path} ]] || die "${FUNCNAME}: no path given"
23 -
24 - mkdir -p "${path}/usr/bin" || die
25 + mkdir -p "${ED}/usr/bin" || die
26 local f
27 while IFS= read -r -d '' f; do
28 local basename=${f##*/}
29 - debug-print "${FUNCNAME}: found executable at ${f#${path}/}"
30 + debug-print "${FUNCNAME}: found executable at ${f#${D%/}}"
31
32 local shebang
33 read -r shebang < "${f}"
34 @@ -437,15 +433,15 @@ _distutils-r1_wrap_scripts() {
35 mv "${f}" "${ED%/}/usr/bin/${newfn}" || die
36
37 debug-print "${FUNCNAME}: installing wrapper at /usr/bin/${basename}"
38 - _python_ln_rel "${path}${EPREFIX}"/usr/bin/python-exec \
39 - "${path}${EPREFIX}/usr/bin/${basename}" || die
40 + _python_ln_rel "${D}${EPREFIX}"/usr/bin/python-exec \
41 + "${ED%/}/usr/bin/${basename}" || die
42 else
43 debug-print "${FUNCNAME}: non-matching shebang: ${shebang}"
44
45 debug-print "${FUNCNAME}: moving to /usr/bin/${basename}"
46 mv "${f}" "${ED%/}/usr/bin/${basename}" || die
47 fi
48 - done < <(find "${path}/${PYTHON_SCRIPTDIR}" -type f -print0)
49 + done < <(find "${D%/}/${PYTHON_SCRIPTDIR}" -type f -print0)
50 }
51
52 # @FUNCTION: distutils-r1_python_install
53 @@ -491,7 +487,7 @@ distutils-r1_python_install() {
54 fi
55
56 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
57 - _distutils-r1_wrap_scripts "${D}"
58 + _distutils-r1_wrap_scripts
59 fi
60 }
61
62 --
63 1.8.3.2