Skip Menu |

This queue is for tickets about the Net-Appliance-Session CPAN distribution.

Report information
The Basics
Id: 107244
Status: resolved
Priority: 0/
Queue: Net-Appliance-Session

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc: SREZIC [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: 4.200000
Fixed in: (no value)



Subject: Unnecessary #!/usr/bin/env
ExtUtils::MakeMaker automatically corrects shell bangs to currently running interpreter. It's not necessary to call /usr/bin/env in the bin/nas' shell bang. See attached patch.
Subject: Net-Appliance-Session-4.200000-Do-not-use-usr-bin-env.patch
From 941ffea3b51d4e759ae4be5052166c1f9d5fefd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Tue, 22 Sep 2015 15:18:17 +0200 Subject: [PATCH] Do not use /usr/bin/env MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Petr Písař <ppisar@redhat.com> --- bin/nas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/nas b/bin/nas index 9a0bea0..094d749 100755 --- a/bin/nas +++ b/bin/nas @@ -1,4 +1,4 @@ -#!/usr/bin/env perl +#!perl use strict; use warnings FATAL => 'all'; -- 2.4.3
On Tue Sep 22 10:06:26 2015, ppisar wrote: Show quoted text
> ExtUtils::MakeMaker automatically corrects shell bangs to currently > running interpreter. It's not necessary to call /usr/bin/env in the > bin/nas' shell bang. See attached patch.
You are right, but this would make testing tricky? Can you please let me know what harm is done by the presence of /usr/bin/env so I understand, before making any change. Many thanks, -- regards, oliver.
On 2016-05-14 14:45:03, OLIVER wrote: Show quoted text
> On Tue Sep 22 10:06:26 2015, ppisar wrote:
> > ExtUtils::MakeMaker automatically corrects shell bangs to currently > > running interpreter. It's not necessary to call /usr/bin/env in the > > bin/nas' shell bang. See attached patch.
> > You are right, but this would make testing tricky? Can you please let > me know what harm is done by the presence of /usr/bin/env so I > understand, before making any change. >
If a user has multiple perls installed on his machine, then it's necessary to have the correct perl in the shebang. Currently calling the installed script may fail like this: $ /opt/perl-5.18.4/bin/nas Can't locate Net/Appliance/Session/Scripting.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /opt/perl-5.18.4/bin/nas line 6. BEGIN failed--compilation aborted at /opt/perl-5.18.4/bin/nas line 6. Putting just "#!perl" on top of the script is sufficient; EUMM will replace it with the correct path. Maybe in the future EUMM will also replace #!/usr/bin/env correctly, but this is yet discussed. Regards, Slaven
Thanks for taking the time to explain, this makes sense and I have applied the patch for the next release. On Sun May 15 16:30:08 2016, SREZIC wrote: Show quoted text
> On 2016-05-14 14:45:03, OLIVER wrote:
> > On Tue Sep 22 10:06:26 2015, ppisar wrote:
> > > ExtUtils::MakeMaker automatically corrects shell bangs to currently > > > running interpreter. It's not necessary to call /usr/bin/env in the > > > bin/nas' shell bang. See attached patch.
> > > > You are right, but this would make testing tricky? Can you please let > > me know what harm is done by the presence of /usr/bin/env so I > > understand, before making any change. > >
> > If a user has multiple perls installed on his machine, then it's > necessary to have the correct perl in the shebang. Currently calling > the installed script may fail like this: > > $ /opt/perl-5.18.4/bin/nas > Can't locate Net/Appliance/Session/Scripting.pm in @INC (@INC > contains: /etc/perl /usr/local/lib/perl/5.14.2 > /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 > /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at > /opt/perl-5.18.4/bin/nas line 6. > BEGIN failed--compilation aborted at /opt/perl-5.18.4/bin/nas line 6. > > Putting just "#!perl" on top of the script is sufficient; EUMM will > replace it with the correct path. Maybe in the future EUMM will also > replace #!/usr/bin/env correctly, but this is yet discussed. > > Regards, > Slaven
-- regards, oliver.