summaryrefslogtreecommitdiff
path: root/Master/bin/i386-linux/perltex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/bin/i386-linux/perltex')
-rwxr-xr-xMaster/bin/i386-linux/perltex29
1 files changed, 17 insertions, 12 deletions
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 {