[Rant-cafe] Ubuntu / Mac OS X difference
Stefan Lang
langstefan at gmx.at
Fri Jun 15 11:04:51 EDT 2007
On Freitag, 15. Juni 2007, you wrote:
> On Fri, 2007-06-15 at 15:08 +0200, Stefan Lang wrote:
> > Compare it to ENV["PATH"] in irb, and also try
> >
> > require "rant/rantlib"
> > Rant::Env.find_bin "epstopdf" # returns full path if found
>
> Path and everything are OK. I have, however, found an angle on the
> problem...
>
> It looks like it might be that this might be some shoddy porting by
> teTeX. epsftopdf is a Perl script -- sad but... :-) The Ubuntu
> version starts with:
>
> #!/usr/bin/env perl
>
> and everything seems fine. However the Mac OS X version starts:
>
> eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec
> perl -S $0 $argv:q'
> if 0;
>
> and fails to run when executed by Ruby via it's system functions.
This looks like a shell trampoline and explains why
system "epstopdf", "..."
fails, since it doesn't run the command in a subshell, but
directly invokes the epstopdf program. OTOH, system with one
argument, i.e.
system "epstopdf ..."
_should_ run the command in a subshell and thus the trampoline
should work. That's weird.
I suggest you try to either explicetely invoke a subshell or
directly the perl interpreter, i.e. in the Rantfile:
sys "sh", "-c", "epstopdf", "...", "..."
or
sys "perl", "epstopdf", "...", "..."
-----------------------------------------------------------
I've tried the trampoline on my Linux box now, and it doesn't
work with Ruby's system but works when directly invoked
from the shell. Both of the solutions I've given above work
with the trampoline.
Stefan
More information about the Rant-cafe
mailing list