Gerben Wierda wrote:
- How do you check that they are the same? (cmp command?) - How does texexec check if another run is needed?
texexec calls texutil which converts a tui file into a tuo file (in the process it sorts indexes and such); when a job is aborted (or has errors) no tuo file is generated (saves an additional later run after a fix); copied from texexec:
use File::Compare;
sub RunTeXutil { my $StopRunning; my $JobName = shift; unlink "$JobName.tup"; rename "$JobName.tuo", "$JobName.tup"; print " sorting and checking : running texutil\n"; my $TcXSwitch = ''; if ( $TcXPath ne '' ) { $TcXSwitch = "--tcxpath=$TcXPath" } RunPerlScript( $TeXUtil, "--ref --ij --high $TcXPath $JobName" );
Lines like these make my eyebrows go up though it might not be th eproblem at hand. What if $JobName contains whitespace? This stuff must run on Win and Unix so shall escapes and quoting is not the same on both sides. From the perlfunc man page: exec LIST The exec() function executes a system command AND NEVER RETURNS. Use the system() function if you want it to return. If there is more than one argument in LIST, or if LIST is an array with more than one value, calls execvp(3) with the arguments in LIST. If there is only one scalar argument, the argument is checked for shell metacharacters. If there are any, the entire argument is passed to /bin/sh -c for parsing. If there are none, the argument is split into words and passed directly to execvp(), which is more efficient. Note: exec() (and system(0) do not flush your output buffer, so you may need to set $| to avoid lost output. I am not at my system right now, but executing stuff is a bit tricky to get the same on Win and Unix. And given that the argument contains multiple arguments for texutil, I suspect it is the one-argument version of system() (which does shell interpretation) that is eventually used. Better circumvent this and use the LIST version which is almost guaranteed to be the same on both OS's.
if ( -e "$JobName.tuo" ) { CheckPositions($JobName); $StopRunning = !compare( "$JobName.tup", "$JobName.tuo" ); } else { $StopRunning = 1; } # otherwise potential loop if ( !$StopRunning ) { print "\n utility file analysis : another run needed\n"; } return $StopRunning; }
maybe some file permissions problem?
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context