[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Explicit interpreter paths considered harmful
From: |
Jim Meyering |
Subject: |
Re: Explicit interpreter paths considered harmful |
Date: |
Tue, 03 Nov 2009 09:18:56 +0100 |
Eric Blake wrote:
> Jim Meyering <jim <at> meyering.net> writes:
>
>> Rather than putting #!/usr/bin/perl on the first line,
>> start with a variant of what's recommended by "man perlrun" that
>> invokes the first "perl" program from your shell's search path.
>
> We should change the test to match. I also ran into a failure on cygwin,
> where
> apparently the new style creates .bak files (even though we are requesting -i
> without a suffix):
>
> | FAIL: test-update-copyright.sh (exit: 1)
> | ========================================
> |
> | --- - 2009-11-02 09:04:12.699584300 -0700
> | +++ update-copyright.test-ex-stderr 2009-11-02 09:04:12.652715900 -0700
> | @@ -1,2 +1,4 @@
> | update-copyright.test-ex.4: warning: FSF copyright statement not found
> | +update-copyright.test-ex.4.bak: warning: FSF copyright statement not found
> | update-copyright.test-ex.5: warning: FSF copyright statement not found
> | +update-copyright.test-ex.5.bak: warning: FSF copyright statement not found
>
> So here's what I'm thinking of pushing:
>
>>From 4148ce0ef79cd2eb741d2a22c1aa011d10129b2c Mon Sep 17 00:00:00 2001
> From: Eric Blake <address@hidden>
> Date: Mon, 2 Nov 2009 10:23:33 -0700
> Subject: [PATCH] test-update-copyright: update test to match script changes
>
> * tests/test-update-copyright.sh: Avoid hard-coding perl
> location. Don't update *.bak created by earlier runs.
>
> Signed-off-by: Eric Blake <address@hidden>
> ---
> ChangeLog | 6 ++++++
> tests/test-update-copyright.sh | 10 +++++++++-
> 2 files changed, 15 insertions(+), 1 deletions(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index 9014fcc..bcb47c0 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,9 @@
> +2009-11-02 Eric Blake <address@hidden>
> +
> + test-update-copyright: update test to match script changes
> + * tests/test-update-copyright.sh: Avoid hard-coding perl
> + location. Don't update *.bak created by earlier runs.
> +
> 2009-10-30 Eric Blake <address@hidden>
>
> vasnprintf: avoid compiler warnings
> diff --git a/tests/test-update-copyright.sh b/tests/test-update-copyright.sh
> index 24574b2..859c75d 100755
> --- a/tests/test-update-copyright.sh
> +++ b/tests/test-update-copyright.sh
> @@ -32,7 +32,12 @@ trap 'rm -f $TMP_BASE*' 0 1 2 3 15
>
> TMP=$TMP_BASE
> s=$TMP-script
> -printf '#!/usr/bin/perl -pi\ns/a/b/\n' > $s
> +cat <<\EOF > $s
> +eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" ${1+"$@"}'
> + & eval 'exec perl -wS -0777 -pi "$0" $argv:q'
There's no need for -0777 on those two lines.
Otherwise, looks fine.
Re: Explicit interpreter paths considered harmful, Eric Blake, 2009/11/02
- Re: Explicit interpreter paths considered harmful,
Jim Meyering <=