[PVFS2-CVS] commit by robl in pvfs2-1/maint: pvfs2latexwrapper.pl
CVS commit program
cvs at parl.clemson.edu
Mon Mar 29 15:23:35 EST 2004
Update of /projects/cvsroot/pvfs2-1/maint
In directory acid:/tmp/cvs-serv5504
Modified Files:
pvfs2latexwrapper.pl
Log Message:
out-of-tree building fixed for pvfs2-guide (and any other file that
uses \input{} )
Index: pvfs2latexwrapper.pl
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/maint/pvfs2latexwrapper.pl,v
diff -u -w -p -u -r1.2 -r1.3
--- pvfs2latexwrapper.pl 20 Mar 2003 21:32:10 -0000 1.2
+++ pvfs2latexwrapper.pl 29 Mar 2004 20:23:35 -0000 1.3
@@ -38,6 +38,7 @@ $startdir = cwd();
$indir = dirname($inputpath);
$infile = basename($inputpath);
$outdir = dirname($outputpath);
+ at auxfiles = ();
# $outfile = basename($outputpath);
chdir "$indir";
@@ -47,9 +48,29 @@ chdir "$outdir";
$outdir = cwd();
if ($outdir ne $indir) {
+ my @info = ();
+
symlink $indir."/".$infile, $infile;
symlink $indir."/figs", "figs";
+ # ok, here's a bit of a mess: some LaTeX files include other files. try to
+ # handle it:
+
+ open FILE, $infile;
+ while (<FILE>) {
+ if (/\\input/) {
+ # external .tex files are referenced by
+ # \input{foo.tex}
+ # so pull out the 'foo.tex' part and make a symlink
+ s/\\input\{(.*)\}/$1/;
+ chomp;
+ symlink $indir."/".$_, $_;
+ push @auxfiles, $_;
+ }
+ }
+ close FILE;
+
+
system "latex $infile";
system "latex $infile"; # once more to get figures correct
system "latex $infile"; # and sometimes it takes a *third* pass
@@ -57,6 +78,10 @@ if ($outdir ne $indir) {
# Note: leaving the "figs" link there; helps in ps/pdf build.
# unlink $infile, "figs";
unlink $infile;
+ # clean up all the extra flies linked because of \input{} calls
+ foreach $link (@auxfiles) {
+ unlink $link;
+ }
}
else {
system "latex $infile";
More information about the PVFS2-CVS
mailing list