summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2004-05-26 10:36:06 +0000
committerivan <ivan>2004-05-26 10:36:06 +0000
commit9c7e761f0c45bf2085a4486269e8d70b9f87cde2 (patch)
tree049bb8616879c8b32d4025fd61ff18a6d13822e0 /FS
parentc37aa003cc514cde5058ba3d94b0b1a133807579 (diff)
better error checking/reporting for latex setup problems
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_bill.pm29
1 files changed, 19 insertions, 10 deletions
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 367e1bc5e..4cfc59d10 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -1138,13 +1138,16 @@ sub print_ps {
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");
@@ -1179,15 +1182,21 @@ sub print_pdf {
#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");