1 |
On Thu, 2019-01-03 at 21:39 +0000, James Le Cuirot wrote: |
2 |
> Shebangs may need fixing on prefix systems or when cross-building but |
3 |
> not at other times. |
4 |
> |
5 |
> Signed-off-by: James Le Cuirot <chewi@g.o> |
6 |
> --- |
7 |
> eclass/python-utils-r1.eclass | 8 ++------ |
8 |
> 1 file changed, 2 insertions(+), 6 deletions(-) |
9 |
> |
10 |
> diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass |
11 |
> index 19cfaf2798ab..91e457f3cf14 100644 |
12 |
> --- a/eclass/python-utils-r1.eclass |
13 |
> +++ b/eclass/python-utils-r1.eclass |
14 |
> @@ -1328,16 +1328,12 @@ python_fix_shebang() { |
15 |
> fi |
16 |
> done < <(find -H "${path}" -type f -print0 || die) |
17 |
> |
18 |
> - if [[ ! ${any_fixed} ]]; then |
19 |
> + if [[ ! ${any_fixed} && ! ${any_correct} ]]; then |
20 |
> local cmd=eerror |
21 |
> [[ ${EAPI:-0} == [012345] ]] && cmd=eqawarn |
22 |
> |
23 |
> "${cmd}" "QA warning: ${FUNCNAME}, ${path#${D%/}} did not match any fixable files." |
24 |
> - if [[ ${any_correct} ]]; then |
25 |
> - "${cmd}" "All files have ${EPYTHON} shebang already." |
26 |
> - else |
27 |
> - "${cmd}" "There are no Python files in specified directory." |
28 |
> - fi |
29 |
> + "${cmd}" "There are no Python files in specified directory." |
30 |
> |
31 |
> [[ ${cmd} == eerror ]] && die "${FUNCNAME} did not match any fixable files (QA warning fatal in EAPI ${EAPI})" |
32 |
> fi |
33 |
|
34 |
Sounds like you're introducing breakage, then abusing a function to fix |
35 |
your breakage, then killing a useful diagnostic because you've just |
36 |
broken it. |
37 |
|
38 |
-- |
39 |
Best regards, |
40 |
Michał Górny |