Re: [patch] fix test-update-copyright when perl is not in /usr/bin/perl
From:
Eric Blake
Subject:
Re: [patch] fix test-update-copyright when perl is not in /usr/bin/perl
Date:
Mon, 14 Sep 2009 14:35:57 +0000 (UTC)
User-agent:
Loom/3.14 (http://gmane.org/)
Christophe LYON <christophe.lyon <at> st.com> writes:
>
> Hello,
>
> Here is a small patch to make "make check" PASS when a suitable perl is
> not in /usr/bin. (without this, I had update-copyright.sh FAIL, while my
> system has fairly recent perl installed, but not in /usr/bin)
>
> TMP=$TMP_BASE
> s=$TMP-script
> -printf '#!/usr/bin/perl -pi\ns/a/b/\n' > $s
> +printf '#!/usr/bin/env perl -pi\ns/a/b/\n' > $s
This won't work; on some OS, #! lines provide exactly one argument to the
interpreter, but you are now trying to pass 2. Rather, the perl script needs
to be refactored so that it enables the behavior indicated by -pi after the
fact. And in the case of update-copyright, this already needs to be done in
order to support --help handling, per GNU Coding Standards.
--
Eric Blake