freeside/FS/FS cust_bill.pm,1.41.2.48,1.41.2.49
ivan
ivan at pouncequick.420.am
Wed May 26 03:38:48 PDT 2004
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory pouncequick:/tmp/cvs-serv27468
Modified Files:
Tag: FREESIDE_1_4_BRANCH
cust_bill.pm
Log Message:
better error checking/reporting for latex setup problems
Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.41.2.48
retrieving revision 1.41.2.49
diff -u -d -r1.41.2.48 -r1.41.2.49
--- cust_bill.pm 14 May 2004 12:25:48 -0000 1.41.2.48
+++ cust_bill.pm 26 May 2004 10:38:45 -0000 1.41.2.49
@@ -1535,13 +1535,16 @@
my $file = $self->print_latex(@_);
- #error checking!!
- system('pslatex', "$file.tex");
- system('pslatex', "$file.tex");
- system('dvips', '-q', '-t', 'letter', "$file.dvi", '-o', "$file.ps" );
+ system("pslatex $file.tex >/dev/null 2>&1") == 0
+ or die "pslatex failed: $!";
+ system("pslatex $file.tex >/dev/null 2>&1") == 0
+ or die "pslatex failed: $!";
+
+ system('dvips', '-q', '-t', 'letter', "$file.dvi", '-o', "$file.ps" ) == 0
+ or die "dbips failed: $!";
open(POSTSCRIPT, "<$file.ps")
- or die "can't open $file.ps (probable error in LaTeX template): $!\n";
+ or die "can't open $file.ps: $! (error in LaTeX template?)\n";
unlink("$file.dvi", "$file.log", "$file.aux", "$file.ps", "$file.tex");
@@ -1576,15 +1579,21 @@
#system('pdflatex', "$file.tex");
#! LaTeX Error: Unknown graphics extension: .eps.
- #error checking!!
- system('pslatex', "$file.tex");
- system('pslatex', "$file.tex");
+ system("pslatex $file.tex >/dev/null 2>&1") == 0
+ or die "pslatex failed: $!";
+ system("pslatex $file.tex >/dev/null 2>&1") == 0
+ or die "pslatex failed: $!";
#system('dvipdf', "$file.dvi", "$file.pdf" );
- system("dvips -q -t letter -f $file.dvi | gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$file.pdf -c save pop -");
+ system(
+ "dvips -q -t letter -f $file.dvi ".
+ "| gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$file.pdf ".
+ " -c save pop -"
+ ) == 0
+ or die "dvips failed: $!";
open(PDF, "<$file.pdf")
- or die "can't open $file.pdf (probably error in LaTeX tempalte: $!\n";
+ or die "can't open $file.pdf: $! (error in LaTeX template?)\n";
unlink("$file.dvi", "$file.log", "$file.aux", "$file.pdf", "$file.tex");
More information about the freeside-commits
mailing list