Dne 29.3.2017 v 15:52 Tomasz Kloczko napsal(a):
On Wed, 2017-03-29 at 12:26 +0000, Nikolai Kondrashov wrote:
> I would say using env in the shebang line is useful. Particularly for
> portability. As a developer, I wouldn't like removing it from my programs.
Portability is not an issue at all here in this exact discussed case because distribution
resources as long as they are packaged into
binary packages they are ALL *already ported resources*.
You can provide 100% functional source code not depending on env and still able to
produce resources to install with fixed location of
<interpreter>. This is not the rocket science.
> Moreover, if your PATH is compromised, you're most likely screwed.
Still .. if $PATH will be compromised removing using env decreases risk here because
removing using env attaches script to some fixed
<interpreter> path.
> I understand, that env use in scripts makes is inconvenient in some cases,
> but I think that RPM build procedure and Fedora practices need to be fixed
> instead.
So instead decreasing generally entropy you are proposing increase it .. by introduce
kind of JFDI :)
> The number of packages using env in scripts alone shows that it is a
> widespread and useful practice.
This is not about practice.
Generally using env comes from the time when when installing additional version of the
<interpreter> was only civilised way fulfilling
some needs without changing distribution resources.
Second typical past scenario was when distribution not been providing <interpreter>
and users have been installing it manually on top
of distribution in non arbitrary locations.
In other words always evn was more workaround than RightSolution(tm) and now it is part
of the legacy which can be removed cleanly.
Using env it is more *legacy badge* which needs to be dropped best in source code trees.
Producing patches and submitting them to source code maintainers will help get rid those
issues.
I can't imagine how you want to convince most of the Ruby developers,
who are typically using Mac with RVM or rbenv, to accept patch to change
shebang from "/usr/bin/env ruby" to "/usr/bin/ruby". I suppose the
situation is similar for Python with virtualenv ...
Actually if you searched packages for /usr/bin/env, I'd love to know the
ration to packages with /usr/bin/ruby (in my case). And you can exclude
the packages where the shebang is already modified from upstream.
Vít