Re: [PATCH] Use env to find python

Michał Górny <[email protected]>
Newsgroups gmane.linux.gentoo.portage.devel
Organization Gentoo
Message-ID <[email protected]>
On Tue, 2020-06-16 at 15:19 -0400, Mike Gilbert wrote:
> On Tue, Jun 16, 2020 at 1:55 PM Zac Medico <[email protected]> wrote:
> > On 6/16/20 10:46 AM, Mike Gilbert wrote:
> > > On Tue, Jun 16, 2020 at 1:45 PM Mike Gilbert <[email protected]> wrote:
> > > > On Mon, Jun 15, 2020 at 9:39 AM Sid Spry <[email protected]> wrote:
> > > > > On Mon, Jun 15, 2020, at 2:36 AM, Ulrich Mueller wrote:
> > > > > > But we know that it is in /usr/bin, so why add yet another indirection?
> > > > > > 
> > > > > > Attachments:
> > > > > > * signature.asc
> > > > > 
> > > > > Ah, sorry -- I forgot to note this here. If you wish to support prefix it is possible it may not be in /usr/bin. Granted I am not sure if the prefix stage3 I was using is old enough to be broken in some way, but adding this would prevent future breakage.
> > > > 
> > > > The portage ebuild and the python distutils module already take care
> > > > of updating shebangs at install time.
> > > 
> > > I suppose your patch might be useful if you are trying to run portage
> > > from a git checkout on a prefix system.
> > > 
> > 
> > So, given that the ebuild updates shebangs automatically, should't we
> > optimize the default shebangs to be as flexible as possible?
> 
> Yes, that makes sense.
> 
> However, we should test to make sure that distutils is smart enough to
> parse that "/usr/bin/env -S python" string and replace it with
> version-specific python shebang.
> 

'/usr/bin/env python' (with no extra options) is the portable shebang.

-- 
Best regards,
Michał Górny
signature.asc (application/pgp-signature, 618 B)
-----BEGIN PGP SIGNATURE-----

iQGTBAABCgB9FiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAl7pMlhfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM3
NkE4NDUwOTQwOThEMjhDQzhCMjZDNTYzOUFEQUUyMzI5RTI0MEUACgkQY5ra4jKe
JA4n2AgArdAjFnsgn2MO9sn75ogLXpS9p2R4kvckLLNT+JHBonW+BivLtJkhcHZZ
SJBo1r3TxR++qTRt4HTywchioCFdT5YhXVBXq2AifYMP1ppi8g9FAow5e7O/7svC
fbV8oa+7CbF8bkExrXVgsqfLpJgGZ24ZXWl+fKM+GpuKTFWi1HTsIAZDMxIOjjRg
yYRM34By8YziTM282qO52A8/rDXy3in/vgcSA2fTYkTgHu56MFfRWcZtcqENCaDN
GLbjulsx24TpbZc5KORcQ9uKPgd0qdn8EDHJgglNEzAiLqX/eqGFpAVNsGZqzaZX
FDM5G2aWfpZnhM2pHkcLsTowggV3OQ==
=cFiK
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.