From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0CB74138334 for ; Sat, 5 Jan 2019 21:38:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D3501E0B1C; Sat, 5 Jan 2019 21:38:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7490EE0B18 for ; Sat, 5 Jan 2019 21:38:23 +0000 (UTC) Received: from symphony.aura-online.co.uk (154.189.187.81.in-addr.arpa [81.187.189.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: chewi) by smtp.gentoo.org (Postfix) with ESMTPSA id 420AC335D03 for ; Sat, 5 Jan 2019 21:38:20 +0000 (UTC) Date: Sat, 5 Jan 2019 21:38:14 +0000 From: James Le Cuirot To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [PATCH 06/12] python-utils-r1.eclass: Don't die in python_fix_shebang if all fixed Message-ID: <20190105213814.6e916a5d@symphony.aura-online.co.uk> In-Reply-To: <1546626394.1895.14.camel@gentoo.org> References: <20190103213924.22835-1-chewi@gentoo.org> <20190103213924.22835-7-chewi@gentoo.org> <1546617317.1895.10.camel@gentoo.org> <1546626394.1895.14.camel@gentoo.org> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/Lu5XHF76w=VyrBgvAR.Jl_K"; protocol="application/pgp-signature" X-Archives-Salt: 8b9578e0-7634-43ef-a7aa-dc6a99ebde6b X-Archives-Hash: 83b78d1788c2b1d7c3375b856c1fe647 --Sig_/Lu5XHF76w=VyrBgvAR.Jl_K Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, 04 Jan 2019 19:26:34 +0100 Micha=C5=82 G=C3=B3rny wrote: > On Fri, 2019-01-04 at 13:10 -0500, Mike Gilbert wrote: > > On Fri, Jan 4, 2019 at 10:55 AM Micha=C5=82 G=C3=B3rny wrote: =20 > > >=20 > > > On Thu, 2019-01-03 at 21:39 +0000, James Le Cuirot wrote: =20 > > > > Shebangs may need fixing on prefix systems or when cross-building b= ut > > > > not at other times. > > > >=20 > > > > Signed-off-by: James Le Cuirot > > > > --- > > > > eclass/python-utils-r1.eclass | 8 ++------ > > > > 1 file changed, 2 insertions(+), 6 deletions(-) > > > >=20 > > > > 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) > > > >=20 > > > > - if [[ ! ${any_fixed} ]]; then > > > > + if [[ ! ${any_fixed} && ! ${any_correct} ]]; then > > > > local cmd=3Deerror > > > > [[ ${EAPI:-0} =3D=3D [012345] ]] && cmd=3Deqa= warn > > > >=20 > > > > "${cmd}" "QA warning: ${FUNCNAME}, ${path#${D= %/}} did not match any fixable files." > > > > - if [[ ${any_correct} ]]; then > > > > - "${cmd}" "All files have ${EPYTHON} s= hebang already." > > > > - else > > > > - "${cmd}" "There are no Python files i= n specified directory." > > > > - fi > > > > + "${cmd}" "There are no Python files in specif= ied directory." > > > >=20 > > > > [[ ${cmd} =3D=3D eerror ]] && die "${FUNCNAME= } did not match any fixable files (QA warning fatal in EAPI ${EAPI})" > > > > fi =20 > > >=20 > > > Sounds like you're introducing breakage, then abusing a function to f= ix > > > your breakage, then killing a useful diagnostic because you've just > > > broken it. =20 > >=20 > > 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? > > =20 >=20 > Original usage: rewrite 'python' to 'pythonX.Y', etc. on static files.=20 > Throws an error if you try to use for files that have correct shebang > already. >=20 > Now: >=20 > 1. Due to PYTHON override, generated files frequently have wrong > shebangs. >=20 > 2. python_fix_shebang is modified to fix this -- orthogonal behavior is > introduced. >=20 > 3. Now diagnostic on files with correct shebang is gone because it > conflicts with the orthogonal behavior added here. The diagnostic is a problem even without my changes. It's quite likely upstream could hardcode a shebang like #!/usr/bin/python2.7, which does not need to be modified on normal systems but does on prefixed systems.=20 What about hardcoding #!/usr/bin/python3.6? This would need correcting against 3.7 but would fall foul of the diagnostic when using 3.6. The cross-prefix issue where the shebang points to BROOT rather than EPREFIX could also already happen now. --=20 James Le Cuirot (chewi) Gentoo Linux Developer --Sig_/Lu5XHF76w=VyrBgvAR.Jl_K Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQKTBAEBCgB9FiEEUo3mvYaRpDkf2i7UIcYyEpxtfeQFAlwxI8ZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDUy OERFNkJEODY5MUE0MzkxRkRBMkVENDIxQzYzMjEyOUM2RDdERTQACgkQIcYyEpxt feRADQ/9FHnT9qjP0Hms8XtkEyNJ3U1UlCV5ri55JYvUlidyWxZFicVC3d+gUrwx a5Srs0mbPh28SUcwhSsK21UyZZvaaMUkDTQzrQzw8cVqxEbz39ELuBvt97riGcQe jHWGYxVjoCwEBFqFJijNDVsH5D4rtNLpcMWYJWfEAaageKwLKGJ2b4eJGfgD72YE OHQU2GULrEiyXC81qJ8ovt+ODqFk3N7OOvBadCXHEIV7T19tNteRvawHOd2Wl83w XpXkFA7SqWGv8kPDimv3IXMGW1orBEFm4fyx9XinF3krzegRH7jPHNy8TxuIp4MP 8bEADNOOJH8hf/VGpBxFlGKRmL+236uc6DdZeOc8/uTcACjrW2Tws4ub7QajtOsj XsLFIKu0p9jOpjcSXGuahG2rLTd1xsScjTkxcocBzeTLzEL/1FyMJTp7wgvH+R9n M6VpQhMs0QeAb3IYxZnv4cHdnTC8PJbtrVds/1C/T9DbCJ7n7Ui6oFoWZKVwTFXH MTn22NtzCuDhM6zQy/R+y26XVVixZXjiEFQ+4hEI3mMqgIEx6us1He3w8O9dysqv 7fLP7jN+6p+MY8fQAbwG/AW0kcbCs0QvPVJdMY5brnJo+xRtCc+426jZ6iYM4Ey8 M80OFhl0D7alc+pRDQTc8sr5cLILXo0o4zW35MYiAugNKRsMiJs= =SuhT -----END PGP SIGNATURE----- --Sig_/Lu5XHF76w=VyrBgvAR.Jl_K--