Change shebang to /usr/bin/env/perl#847
Conversation
On certain machines, when run directly, all scripts would default to use the perl interpreter located in /usr/bin. This can cause problems on machines where perl is located in a different path, or where multiple perl instances are present on a system (such as on Mac when using homebrew). This commit updates the shebang, the line which starting with #! indicating the interpreter to use when running a file, from /usr/bin/perl to /usr/bin/env perl. This makes sure not to hard-code the perl path to /usr/bin, but to instead search $PATH for the appropriate file.
|
hmm... any security implications? i'll have to look into that.
…On Jul 8, 2017 12:23 PM, "Tom Wiesing" ***@***.***> wrote:
On certain machines, when run directly, all scripts would default to use
the perl interpreter located in /usr/bin. This can cause problems on
machines where perl is located in a different path, or where multiple
perl instances are present on a system (such as on Mac when using
homebrew).
This PR updates the shebang, the line which starting with #!
indicating the interpreter to use when running a file, from
/usr/bin/perl to /usr/bin/env perl. This makes sure not to hard-code the
perl path to /usr/bin, but to instead search $PATH for the appropriate
file.
------------------------------
You can view, comment on, or merge this pull request online at:
#847
Commit Summary
- Change shebang to /usr/bin/env/perl
File Changes
- *M* bin/latexml
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-0> (2)
- *M* bin/latexmlc
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-1> (2)
- *M* bin/latexmlfind
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-2> (2)
- *M* bin/latexmlmath
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-3> (2)
- *M* bin/latexmlpost
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-4> (2)
- *M* doc/makemanual
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-5> (2)
- *M* doc/makesite
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-6> (2)
- *M* doc/manual/genpods
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-7> (2)
- *M* doc/manual/genschema
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-8> (2)
- *M* release/checkinst
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-9> (2)
- *M* tools/cluster
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-10> (2)
- *M* tools/genencoded
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-11> (2)
- *M* tools/genfontmap
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-12> (2)
- *M* tools/kwalitee
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-13> (2)
- *M* tools/latexmllint
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-14> (2)
- *M* tools/maketests
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-15> (2)
- *M* tools/pre-commit
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-16> (2)
- *M* tools/symbolscan
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-17> (2)
- *M* tools/texscan
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-18> (2)
- *M* tools/xtest
<https://github.com/brucemiller/LaTeXML/pull/847/files#diff-19> (2)
Patch Links:
- https://github.com/brucemiller/LaTeXML/pull/847.patch
- https://github.com/brucemiller/LaTeXML/pull/847.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#847>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC1blMbVPwe698jLZ_4EWwCey9h_XLSiks5sL60XgaJpZM4ORy6s>
.
|
|
Tom's change looks to be the best practice: But why did travis fail? |
|
Travis failed because the env form does not allow passing arguments, such as |
|
As can be seen in the wisdom in the unix stackexchange comment i shared, the |
|
I can update the PR accordingly, which should fix the Travis Tests.
…On July 8, 2017 2:59:10 PM EDT, Deyan Ginev ***@***.***> wrote:
As can be seen in the wisdom in the unix stackexchange comment i
shared, the `-w` can be upgraded to an explicit `use warnings;` in each
of the executables, which solves the travis failure. Personally I am
happy either way, I have used both forms in the past and my setups are
simple ("standard"?) enough to work with either form.
|
It turns out that some /usr/bin/env implementations do not support passing parameters to the interporeter. This caused problems, in particular causing the Travis Tests to fail. After a suggestion from @dginev, this commit fixes the issue by removing the -w flag from all shebang lines and instead adding a 'use warnings;' where neccessary.
|
For the record, there is a slight downside to this: If you run Just so you know... |
On certain machines, when run directly, all scripts would default to use
the perl interpreter located in /usr/bin. This can cause problems on
machines where perl is located in a different path, or where multiple
perl instances are present on a system (such as on Mac when using
homebrew).
This PR updates the shebang, the line which starting with #!
indicating the interpreter to use when running a file, from
/usr/bin/perl to /usr/bin/env perl. This makes sure not to hard-code the
perl path to /usr/bin, but to instead search $PATH for the appropriate
file.