Re: [PATCH] scripts: Switch to more portable Perl shebang

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08.05.2017 00:48, Masahiro Yamada wrote:
> 2017-05-08 5:37 GMT+09:00 Kamil Rytarowski <n54@xxxxxxx>:
>> On 07.05.2017 22:22, Joe Perches wrote:
>>> On Sun, 2017-05-07 at 22:14 +0200, Kamil Rytarowski wrote:
>>>> On 07.05.2017 19:01, Joe Perches wrote:
>>>>> On Sun, 2017-05-07 at 16:56 +0200, Kamil Rytarowski wrote:
>>>>>> The default NetBSD package manager is pkgsrc and it installs Perl
>>>>>> along other third party programs under custom and configurable prefix.
>>>>>> The default prefix for binary prebuilt packages is /usr/pkg, and the
>>>>>> Perl executable lands in /usr/pkg/bin/perl.
>>>>>>
>>>>>> This change switches "/usr/bin/perl" to "/usr/bin/env perl" as it's
>>>>>> the most portable solution that should work for almost everybody.
>>>>>> Perl's executable is detected automatically.
>>>>>>
>>>>>> This change switches -w option passed to the executable with more
>>>>>> modern "use warnings;" approach. There is no functional change to the
>>>>>> default behavior.
>>>>>
>>>>> Functionality would then depend on user $PATH.
>>>>
>>>> Yes.
>>>>
>>>>> Better?  <shrug>
>>>>
>>>> Correct.
>>>>
>>>> In pkgsrc we have automatic scripts to adjust shebangs for scripting
>>>> languages (Perl, Python, Bash etc). But in this case I build the Linux
>>>> kernel out of the pkgsrc context on my NetBSD workstation.
>>>>
>>>> Exactly the same change has been accepted in qemu, currently it's
>>>> waiting to be merged with master. from the "-trival" branch.
>>>>
>>>> In my case I won't be enforced to keep fixing it manually every time I
>>>> sync with HEAD. Another point is that the Linux version of this script
>>>> is model and projects fork it, and we need to keep adjusting it downstream.
>>>>
>>>>>
>>>>> For the perl "-w", adding "use warnings;" instead of
>>>>> "-w" seems sensible enough.  Is any build environment
>>>>> using a perl version below 5.6?
>>>>>
>>>>
>>>> 5.6 was released in 2003.
>>>
>>> I know a person using 5.8 (cough: Andrew Morton), but 5.6
>>> really is quite old.
>>>
>>
>> It was just decided to depend on GNU Make 3.81 (released 2010).
> 
> I think 3.81 was released in 2006
> and 3.82 in 2010.
> 

You are right about the dates, I feel corrected.

The original sentence still stands.

I noted that "use warnings;" was already present, just in case someone
would be worried about portability of it:

scripts/headerdep.pl:use warnings;

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux