RE: [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl

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

 



> -----Original Message-----
> From: git-owner@xxxxxxxxxxxxxxx [mailto:git-owner@xxxxxxxxxxxxxxx] On
> Behalf Of Ævar Arnfjörð Bjarmason
> Sent: den 21 maj 2010 17:01
> To: git@xxxxxxxxxxxxxxx
> Cc: Junio C Hamano; Ævar Arnfjörð Bjarmason
> Subject: [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl
> 
> Change the Perl Git utilities to use #!/usr/bin/env perl as a shebang
> instead of #!/usr/bin/perl. This makes e.g. git-send-email work if
> your personal perl has Net::SMTP::SSL, but your system perl doesn't.
> 
> This only affects shebangs in the uninstalled source tree. On
> installation shebangs will still be munged to PERL_PATH, which is
> currently /usr/bin/perl by default.
> 
> With this change all the code in Git that uses a shebang now uses
> /usr/bin/env, except those things that use /bin/sh and /bin/bash. All
> the Python code already used it, and some of the Perl code.
> 
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
> ---
> 
> This should probably have been a series, not an individual patch since
> it depends on <1274453455-1941-1-git-send-email-avarab@xxxxxxxxx> to
> apply. However the two are functionally independent. I can alter this
> one so that it applies to the current master on request, but I'm
> guessing the "perl libs: perl -w + use warnings is redundant" patch is
> wanted anyway.
> 
>  Documentation/build-docdep.perl             |    2 +-
>  Documentation/cat-texi.perl                 |    2 +-
>  Documentation/cmd-list.perl                 |    2 +-
>  Documentation/fix-texi.perl                 |    2 +-
>  compat/vcbuild/scripts/clink.pl             |    2 +-
>  compat/vcbuild/scripts/lib.pl               |    2 +-
>  contrib/blameview/blameview.perl            |    2 +-
>  contrib/buildsystems/engine.pl              |    2 +-
>  contrib/buildsystems/generate               |    2 +-
>  contrib/buildsystems/parse.pl               |    2 +-
>  contrib/continuous/cidaemon                 |    2 +-
>  contrib/continuous/post-receive-cinotify    |    2 +-
>  contrib/examples/git-remote.perl            |    2 +-
>  contrib/examples/git-rerere.perl            |    2 +-
>  contrib/examples/git-svnimport.perl         |    2 +-
>  contrib/fast-import/git-import.perl         |    2 +-
>  contrib/fast-import/import-directories.perl |    2 +-
>  contrib/fast-import/import-tars.perl        |    2 +-
>  contrib/hooks/setgitperms.perl              |    2 +-
>  contrib/hooks/update-paranoid               |    2 +-
>  contrib/stats/mailmap.pl                    |    2 +-
>  contrib/stats/packinfo.pl                   |    2 +-
>  git-add--interactive.perl                   |    2 +-
>  git-archimport.perl                         |    2 +-
>  git-cvsexportcommit.perl                    |    2 +-
>  git-cvsimport.perl                          |    2 +-
>  git-cvsserver.perl                          |    2 +-
>  git-send-email.perl                         |    2 +-
>  gitweb/gitweb.perl                          |    2 +-
>  t/gitweb-lib.sh                             |    2 +-
>  t/t7006/test-terminal.perl                  |    2 +-
>  t/t9138-git-svn-authors-prog.sh             |    2 +-
>  t/t9700/test.pl                             |    2 +-
>  33 files changed, 33 insertions(+), 33 deletions(-)
> 
> diff --git a/Documentation/build-docdep.perl b/Documentation/build-
> docdep.perl
> index ba4205e..dc50f21 100755
> --- a/Documentation/build-docdep.perl
> +++ b/Documentation/build-docdep.perl
> @@ -1,4 +1,4 @@
> -#!/usr/bin/perl
> +#!/usr/bin/env perl
> 
>  my %include = ();
>  my %included = ();
> diff --git a/Documentation/cat-texi.perl b/Documentation/cat-texi.perl
> index 828ec62..d96d2f1 100755
> --- a/Documentation/cat-texi.perl
> +++ b/Documentation/cat-texi.perl
> @@ -1,4 +1,4 @@
> -#!/usr/bin/perl -w
> +#!/usr/bin/env perl -w

This does not work. You cannot give arguments to an application 
started via /usr/bin/env; it will interprete everything after 
/usr/bin/env as the application name and fail with:

/usr/bin/env: perl -w: No such file or directory

//Peter

��.n��������+%������w��{.n��������n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�m


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]