Permalink
Browse files

Item38: Make use of sandbox

git-svn-id: http://svn.foswiki.org/trunk/GenPDFLatexAddOn@742 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information...
OlivierRaginel OlivierRaginel
OlivierRaginel authored and OlivierRaginel committed Nov 16, 2008
1 parent b131b68 commit 9fbed548b7587bc7914a32c7ed97582ade8f94f3
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/TWiki/Contrib/GenPDFLatex.pm
@@ -208,7 +208,6 @@ sub genfile() {
# create a temporary working directory
my $WDIR = File::Temp::tempdir();
`chmod a+rwx $WDIR` if ($debug);
my $latexfile = $WDIR.'/lmp_content.tex';
@@ -235,8 +234,13 @@ sub genfile() {
my $flag = 0;
my $ret = "";
do {
$ret = `$pdflatex -interaction=nonstopmode $texrel`;
$ret .= `$bibtex $base` if ($tex =~ m/\\bibliography\{/);
my $sandbox = $TWiki::sharedSandbox || $TWiki::sandbox;
my ($result, $code) = $sandbox->sysCommand( "$pdflatex -interaction=nonstopmode $texrel" );
$ret = $result;
if( $tex =~ m/\\bibliography\{/ ) {
($result, $code) = $sandbox->sysCommand( "$bibtex $base" );
$ret .= $result;
}
$flag++ unless ($ret =~ m/Warning.*?Rerun/i);
} while ($flag < 2);

0 comments on commit 9fbed54

Please sign in to comment.