From 5b8032cb4ddc1d209cdd00c675f0c1c170b80f02 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 12 Dec 2007 08:04:29 +0000 Subject: update perltex script git-svn-id: svn://tug.org/texlive/trunk@5763 c570f23f-e606-0410-a88d-b1316a301751 --- Master/bin/i386-linux/perltex | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'Master/bin/i386-linux/perltex') diff --git a/Master/bin/i386-linux/perltex b/Master/bin/i386-linux/perltex index 52b14ef394f..9c85ef94500 100755 --- a/Master/bin/i386-linux/perltex +++ b/Master/bin/i386-linux/perltex @@ -44,9 +44,9 @@ use strict; my $latexprog; my $runsafely = 1; my @permittedops; +my $usepipe = 1; my $progname = basename $0; my $jobname = "texput"; -my @latexcmdline; my $toperl; my $fromperl; my $toflag; @@ -54,18 +54,22 @@ my $fromflag; my $doneflag; my $logfile; my $pipe; +my @latexcmdline; my $styfile; my @macroexpansions; my $sandbox = new Safe; my $sandbox_eval; my $latexpid; +my $pipestring = "\%\%\%\%\% Generated by $progname\n\\endinput\n"; $latexprog = $ENV{"PERLTEX"} || "latex"; Getopt::Long::Configure("require_order", "pass_through"); -GetOptions("help" => sub {pod2usage(-verbose => 1)}, - "latex=s" => \$latexprog, - "safe!" => \$runsafely, - "makesty" => sub {$styfile = "noperltex.sty"}, - "permit=s" => \@permittedops) || pod2usage(2); +GetOptions("help" => sub {pod2usage(-verbose => 1)}, + "latex=s" => \$latexprog, + "safe!" => \$runsafely, + "pipe!" => \$usepipe, + "synctext=s" => \$pipestring, + "makesty" => sub {$styfile = "noperltex.sty"}, + "permit=s" => \@permittedops) || pod2usage(2); @latexcmdline = @ARGV; my $firstcmd = 0; for ($firstcmd=0; $firstcmd<=$#latexcmdline; $firstcmd++) { @@ -106,10 +110,11 @@ open (LOGFILE, ">$logfile") || die "open(\"$logfile\"): $!\n"; if (defined $styfile) { open (STYFILE, ">$styfile") || die "open(\"$styfile\"): $!\n"; } -if (!eval {mkfifo($pipe, 0600)}) { +if (!$usepipe || !eval {mkfifo($pipe, 0600)}) { sysopen PIPE, $pipe, O_WRONLY|O_CREAT, 0755; - print PIPE "\\endinput\n"; + print PIPE $pipestring; close PIPE; + $usepipe = 0; } defined ($latexpid = fork) || die "fork: $!\n"; unshift @latexcmdline, $latexprog; @@ -230,16 +235,16 @@ while (1) { open (FROMFLAG, ">$fromflag") || die "open($fromflag): $!\n"; close FROMFLAG; if (open (PIPE, ">$pipe")) { -print PIPE "\\endinput\n"; -close PIPE; + print PIPE $pipestring; + close PIPE; } $awaitexists->($toperl); unlink $fromflag while -e $fromflag; open (DONEFLAG, ">$doneflag") || die "open($doneflag): $!\n"; close DONEFLAG; if (open (PIPE, ">$pipe")) { -print PIPE "\\endinput\n"; -close PIPE; + print PIPE $pipestring; + close PIPE; } } END { -- cgit v1.2.3