1 |
Do not use hardcoded paths. |
2 |
--- |
3 |
gx86/eclass/distutils-r1.eclass | 20 +++++++++----------- |
4 |
1 file changed, 9 insertions(+), 11 deletions(-) |
5 |
|
6 |
diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass |
7 |
index ee7dc83..0d8df87 100644 |
8 |
--- a/gx86/eclass/distutils-r1.eclass |
9 |
+++ b/gx86/eclass/distutils-r1.eclass |
10 |
@@ -255,20 +255,18 @@ _distutils-r1_rename_scripts() { |
11 |
|
12 |
local f |
13 |
# XXX: change this if we ever allow directories in bin/sbin |
14 |
- for f in "${D}"/{bin,sbin,usr/bin,usr/sbin}/*; do |
15 |
- if [[ -x ${f} ]]; then |
16 |
- debug-print "${FUNCNAME}: found executable at ${f#${D}/}" |
17 |
+ while IFS= read -r -d '' f; do |
18 |
+ debug-print "${FUNCNAME}: found executable at ${f#${D}/}" |
19 |
|
20 |
- if [[ "$(head -n 1 "${f}")" == '#!'*${EPYTHON}* ]] |
21 |
- then |
22 |
- debug-print "${FUNCNAME}: matching shebang: $(head -n 1 "${f}")" |
23 |
+ if [[ "$(head -n 1 "${f}")" == '#!'*${EPYTHON}* ]] |
24 |
+ then |
25 |
+ debug-print "${FUNCNAME}: matching shebang: $(head -n 1 "${f}")" |
26 |
|
27 |
- local newf=${f}-${EPYTHON} |
28 |
- debug-print "${FUNCNAME}: renamed to ${newf#${D}/}" |
29 |
- mv "${f}" "${newf}" || die |
30 |
- fi |
31 |
+ local newf=${f}-${EPYTHON} |
32 |
+ debug-print "${FUNCNAME}: renamed to ${newf#${D}/}" |
33 |
+ mv "${f}" "${newf}" || die |
34 |
fi |
35 |
- done |
36 |
+ done < <(find "${D}" -type f -executable -print0) |
37 |
} |
38 |
|
39 |
# @FUNCTION: distutils-r1_python_install |
40 |
-- |
41 |
1.8.0 |