Gentoo Archives: gentoo-dev

From: James Le Cuirot <chewi@g.o>
To: gentoo-dev <gentoo-dev@l.g.o>
Cc: James Le Cuirot <chewi@g.o>
Subject: [gentoo-dev] [PATCH 06/12] python-utils-r1.eclass: Don't die in python_fix_shebang if all fixed
Date: Thu, 03 Jan 2019 21:42:29
Message-Id: 20190103213924.22835-7-chewi@gentoo.org
In Reply to: [gentoo-dev] [PATCH] Eclass changes for cross-compiling Python modules by James Le Cuirot
1 Shebangs may need fixing on prefix systems or when cross-building but
2 not at other times.
3
4 Signed-off-by: James Le Cuirot <chewi@g.o>
5 ---
6 eclass/python-utils-r1.eclass | 8 ++------
7 1 file changed, 2 insertions(+), 6 deletions(-)
8
9 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
10 index 19cfaf2798ab..91e457f3cf14 100644
11 --- a/eclass/python-utils-r1.eclass
12 +++ b/eclass/python-utils-r1.eclass
13 @@ -1328,16 +1328,12 @@ python_fix_shebang() {
14 fi
15 done < <(find -H "${path}" -type f -print0 || die)
16
17 - if [[ ! ${any_fixed} ]]; then
18 + if [[ ! ${any_fixed} && ! ${any_correct} ]]; then
19 local cmd=eerror
20 [[ ${EAPI:-0} == [012345] ]] && cmd=eqawarn
21
22 "${cmd}" "QA warning: ${FUNCNAME}, ${path#${D%/}} did not match any fixable files."
23 - if [[ ${any_correct} ]]; then
24 - "${cmd}" "All files have ${EPYTHON} shebang already."
25 - else
26 - "${cmd}" "There are no Python files in specified directory."
27 - fi
28 + "${cmd}" "There are no Python files in specified directory."
29
30 [[ ${cmd} == eerror ]] && die "${FUNCNAME} did not match any fixable files (QA warning fatal in EAPI ${EAPI})"
31 fi
32 --
33 2.19.2

Replies