ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Gerben Wierda" <Gerben.Wierda@rna.nl>
Subject: Re: Re: [OS X TeX] TeX run : 8
Date: Wed, 2 Mar 2005 16:33:54 +0100 (CET)	[thread overview]
Message-ID: <4566.159.46.248.230.1109777634.squirrel@159.46.248.230> (raw)
In-Reply-To: <4225D3CE.3030307@wxs.nl>

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

  parent reply	other threads:[~2005-03-02 15:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-02 13:24 Steffen Wolfrum
2005-03-02 13:31 ` Gerben Wierda
2005-03-02 14:55   ` Hans Hagen
2005-03-02 15:18     ` Taco Hoekwater
2005-03-02 15:33     ` Gerben Wierda [this message]
2005-03-02 16:43       ` Hans Hagen
2005-03-02 14:50 ` Hans Hagen
2005-03-03  7:28 ` Hans Hagen
  -- strict thread matches above, loose matches on Subject: below --
2005-03-02 19:08 Steffen Wolfrum
2005-03-02 16:03 Steffen Wolfrum
2005-03-02 16:47 ` Hans Hagen
2005-03-02 15:57 Steffen Wolfrum
2005-03-02 16:45 ` Hans Hagen
2005-03-02 11:59 Steffen Wolfrum
2005-03-02 12:31 ` Hans Hagen
2005-03-02 12:35 ` Hans Hagen
2005-03-02 11:04 Steffen Wolfrum
2005-03-02 11:32 ` Hans Hagen
2005-03-01 17:24 Steffen Wolfrum
2005-03-02 11:28 ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4566.159.46.248.230.1109777634.squirrel@159.46.248.230 \
    --to=gerben.wierda@rna.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).