Discussion:
[tex-k] epstopdf possible bug: exits immediatly when called from ruby
Jean Krohn
2010-08-02 14:57:54 UTC
Permalink
Dear all,

I am emailing tex-k at tug.org as it is the bug report address in the epstopdf man
page.

When called from a ruby script, epstopdf exits without doing anything, which I
assume is not the desired behaviour.
This seems to be due to somewhere in the first three lines, as replacing them
with a simple '#!/usr/bin/env perl' gives the desired behaviour:

eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
if 0;
use strict;

The shell session below illustrates the problem:

% epstopdf --version
epstopdf ($Id: epstopdf.pl 16244 2009-11-30 01:36:08Z karl $) 2.12
Copyright 2009 Karl Berry et al.
Copyright 2002-2009 Gerben Wierda et al.
Copyright 1998-2001 Sebastian Rahtz et al.
License RBSD: Revised BSD <http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
% ruby -e "system('epstopdf --version')"
% ruby -e "system('ls --version')"
ls (GNU coreutils) 8.5
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Richard M. Stallman and David MacKenzie.


Is this an epstopdf issue, or a problem with ruby?

Regards,

Jean Krohn
Karl Berry
2010-08-03 23:24:30 UTC
Permalink
Hi Jean,

Thanks for the report.

When called from a ruby script, epstopdf exits without doing anything,

I can't say I'm exactly surprised. I tried to search for other
occurrences of people finding that magic Perl first line failing with
Ruby, but had no success.

a simple '#!/usr/bin/env perl' gives the desired behaviour:

Probably the change I'll make in the next release.

Thanks,
K
Karl Berry
2012-05-20 20:55:02 UTC
Permalink
Hi Jean,

Back on this mail from almost two years ago.

Date: Mon, 2 Aug 2010 15:57:54 +0100
From: Jean Krohn <jb.krohn at gmail.com>
To: tex-k at tug.org

When called from a ruby script, epstopdf exits without doing anything[...]
with a simple '#!/usr/bin/env perl' gives the desired behaviour:

eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
if 0;
use strict;

According to http://osdir.com/ml/lang.ruby.general/2002-06/msg01388.html
aka ruby-bugs:PR#315, Ruby simply refuses to execute anything that does
not start with #!. I (rather belatedly) changed epstopdf, since we
already rely on #!/usr/bin/env perl for most of our other scripts.
I'll upload it to CTAN soon.

Thanks,
Karl

Loading...