On Fri, 2019-01-04 at 13:10 -0500, Mike Gilbert wrote: > On Fri, Jan 4, 2019 at 10:55 AM Michał Górny <[email protected]> wrote: > > > > On Thu, 2019-01-03 at 21:39 +0000, James Le Cuirot wrote: > > > Shebangs may need fixing on prefix systems or when cross-building but > > > not at other times. > > > > > > Signed-off-by: James Le Cuirot <[email protected]> > > > --- > > > eclass/python-utils-r1.eclass | 8 ++------ > > > 1 file changed, 2 insertions(+), 6 deletions(-) > > > > > > diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass > > > index 19cfaf2798ab..91e457f3cf14 100644 > > > --- a/eclass/python-utils-r1.eclass > > > +++ b/eclass/python-utils-r1.eclass > > > @@ -1328,16 +1328,12 @@ python_fix_shebang() { > > > fi > > > done < <(find -H "${path}" -type f -print0 || die) > > > > > > - if [[ ! ${any_fixed} ]]; then > > > + if [[ ! ${any_fixed} && ! ${any_correct} ]]; then > > > local cmd=eerror > > > [[ ${EAPI:-0} == [012345] ]] && cmd=eqawarn > > > > > > "${cmd}" "QA warning: ${FUNCNAME}, ${path#${D%/}} > > > did not match any fixable files." > > > - if [[ ${any_correct} ]]; then > > > - "${cmd}" "All files have ${EPYTHON} shebang > > > already." > > > - else > > > - "${cmd}" "There are no Python files in > > > specified directory." > > > - fi > > > + "${cmd}" "There are no Python files in specified > > > directory." > > > > > > [[ ${cmd} == eerror ]] && die "${FUNCNAME} did not > > > match any fixable files (QA warning fatal in EAPI ${EAPI})" > > > fi > > > > Sounds like you're introducing breakage, then abusing a function to fix > > your breakage, then killing a useful diagnostic because you've just > > broken it. > > I'm unable to make sense of what you are trying to say here. Is there > something wrong with this patch, or are you making a general comment > on the patch series? >
Original usage: rewrite 'python' to 'pythonX.Y', etc. on static files. Throws an error if you try to use for files that have correct shebang already. Now: 1. Due to PYTHON override, generated files frequently have wrong shebangs. 2. python_fix_shebang is modified to fix this -- orthogonal behavior is introduced. 3. Now diagnostic on files with correct shebang is gone because it conflicts with the orthogonal behavior added here. -- Best regards, Michał Górny
signature.asc
Description: This is a digitally signed message part
