Re: git-instaweb portability issue (maybe?)

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

 



On Fri, Jun 13, 2008 at 08:32:20AM -0700, Jakub Narebski wrote:
> Luciano Rocha <luciano@xxxxxxxxxxx> writes:
> > On Fri, Jun 13, 2008 at 10:39:11AM -0400, Denis Bueno wrote:
> >> On Fri, Jun 13, 2008 at 10:21, Luciano Rocha <luciano@xxxxxxxxxxx> wrote:
> >>>
> >>> Try changing the following line instead:
> >>>        "$PERL" -p -e "$script" "$1.tmp" > "$1"
> >>> to
> >>>        $PERL -p -e "$script" "$1.tmp" > "$1"
> >>>
> >>> about line 6121 of the git-instaweb script.
> >> 
> >> This is line 6033 for me; however, this change makes it work!  (I
> >> verified my changing this line; trying it; then changing it back to
> >> the double-quotes version, and verifying it breaks.)
> >> 
> >> Why?
> > 
> > "$PERL" means the content of the variable is used as the command to
> > execute.
> > 
> > $PERL, on the other hand, goes through a round of word splitting, that
> > in your case results in the command "/usr/bin/env", with the arguments
> > "perl", "-p", ...
> > 
> > Thus, if it is possible to use /usr/bin/env, the current "$PERL"
> > incantation is incorrect.
> 
> The problem is with trying to ensure that both
> 
>    /path/with spaces/perl
> 
> and
> 
>    /usr/bin/env perl
> 
> work, as they require different rules wrt. splitting on whitespace...

Oh. Then it gets ugly. Can't just "perl" be used? Instead of
"/usr/bin/env perl"?

Otherwise...
if [ -x "$PERL" ]; then
	"$PERL" ...
else
	$PERL ...
fi

-- 
Luciano Rocha <luciano@xxxxxxxxxxx>
Eurotux Informática, S.A. <http://www.eurotux.com/>

Attachment: pgpfWgwKCVZSl.pgp
Description: PGP signature


[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]

  Powered by Linux