summaryrefslogtreecommitdiff
path: root/Master/bin/i386-linux/perltex
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2007-12-12 08:04:29 +0000
committerNorbert Preining <preining@logic.at>2007-12-12 08:04:29 +0000
commit5b8032cb4ddc1d209cdd00c675f0c1c170b80f02 (patch)
tree0d76052c1032f37e7f2a212bdfed53b54a606d86 /Master/bin/i386-linux/perltex
parentda4daf1b676263905e7f04bb64e9878508c1ee97 (diff)
update perltex script
git-svn-id: svn://tug.org/texlive/trunk@5763 c570f23f-e606-0410-a88d-b1316a301751
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 {