Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH python-r1 8/8] Use find instead of hard-coded path list when looking for scripts.
Date: Sat, 27 Oct 2012 11:05:46
Message-Id: 1351335771-3618-8-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH python-r1 1/8] python_export: support obtaining site-packages directory. by "Michał Górny"
1 ---
2 gx86/eclass/distutils-r1.eclass | 13 ++++++-------
3 1 file changed, 6 insertions(+), 7 deletions(-)
4
5 diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass
6 index bab7dbc..e0df9f6 100644
7 --- a/gx86/eclass/distutils-r1.eclass
8 +++ b/gx86/eclass/distutils-r1.eclass
9 @@ -256,15 +256,14 @@ distutils-r1_python_install_all() {
10 local EPYTHON
11 python_export_best EPYTHON
12
13 - for f in "${D}"/{bin,sbin,usr/bin,usr/sbin,games/bin}/*-"${EPYTHON}"; do
14 - if [[ -x ${f} ]]; then
15 - debug-print "${FUNCNAME}: found executable at ${f#${D}/}"
16 + local f
17 + while IFS= read -r -d '' f; do
18 + debug-print "${FUNCNAME}: found executable at ${f#${D}/}"
19
20 - local wrapf=${f%-${EPYTHON}}
21 + local wrapf=${f%-${EPYTHON}}
22
23 - _python_ln_rel "${ED}"/usr/bin/python-exec "${wrapf}" || die
24 - fi
25 - done
26 + _python_ln_rel "${ED}"/usr/bin/python-exec "${wrapf}" || die
27 + done < <(find "${D}" -type f -executable -name "*-${EPYTHON}" -print0)
28 }
29
30 # @FUNCTION: distutils-r1_run_phase
31 --
32 1.7.12.4