[tex-live] epstopdf does not propagate exit code
Reinhard Kotucha
reinhard.kotucha at web.de
Mon Sep 14 01:30:49 CEST 2009
On 13 September 2009 Heiko Oberdiek wrote:
> On Sun, Sep 13, 2009 at 10:32:37PM +0200, Reinhard Kotucha wrote:
>
>> On 13 September 2009 T T wrote:
>>
>> > I've noticed that epstopdf utility does not propagate exit code from
>> > ghostscript (WinXP), so I can't detect GS failure. Any chance to fix
>> > that?
>>
>> This is a known problem and I sent Gerben a patch already. He said
>> that he was on leave and will reply later. No other response so far.
>>
>> Here is the patch I sent him:
>>
>> --- epstopdf.pl 2009-07-20 02:59:05.000000000 +0200
>> +++ epstopdf.pl-new 2009-08-25 22:58:06.000000000 +0200
>> @@ -427,5 +427,6 @@
>> close(IN);
>> print OUT "\ngrestore\n" if $BBCorrected;
>> close(OUT);
>> +exit ($?/256) if $?;
>> warning "BoundingBox not found" unless $BBCorrected;
>> debug "Ready.";
>>
>>
>> The Perl variable $? contains a 16 bit number, the most significant
>> byte contains the exit code. Thus the division by 256.
>
> And ghostscript could be aborted by a signal (the lower 8 bits),
> example, see pdfcrop.
I'm not sure if signal handlers always work reliably on Windows. And
they probably behave differently on MSYS.
However, I looked into pdfcrop and found:
$GS = "gswin32c" if $^O =~ /cygwin/i;
This is wrong. Cygwin provides its own Ghostscript which is called "gs".
I didn't check your other scripts.
Regards,
Reinhard
--
----------------------------------------------------------------------------
Reinhard Kotucha Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------
More information about the tex-live
mailing list