From 32c710c9f3b95a3b32e462fd9032ffd96de82957 Mon Sep 17 00:00:00 2001 From: allen Date: Thu, 16 Dec 1999 07:50:21 +0000 Subject: Report errors in CST at end of script git-svn-id: http://svn.cactuscode.org/flesh/trunk@1193 17b73243-c579-4c4c-a9d2-2d5706c11dac --- lib/sbin/CST | 4 +++- lib/sbin/CSTUtils.pl | 35 ++++++++++++++++++++++++++++------- 2 files changed, 31 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/sbin/CST b/lib/sbin/CST index d56ba7fa..b04e3cf1 100644 --- a/lib/sbin/CST +++ b/lib/sbin/CST @@ -6,7 +6,7 @@ # @desc # Parses the the configuration files for thorns. # @enddesc -# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/sbin/CST,v 1.34 1999-11-06 10:40:42 allen Exp $ +# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/sbin/CST,v 1.35 1999-12-16 07:50:21 allen Exp $ #@@*/ # Global parameter to track the number of errors from the CST @@ -14,6 +14,7 @@ # is zero. $CST_errors = 0; +$error_string = ""; ########################################################################## # Parse the command line @@ -162,6 +163,7 @@ if ($CST_errors) print "There $comment1 during execution of the CST\n"; print "$comment2 must be corrected before compilation can proceed\n"; print "------------------------------------------------------\n\n"; + &CST_PrintErrors; exit(1); } diff --git a/lib/sbin/CSTUtils.pl b/lib/sbin/CSTUtils.pl index ea83787f..17528123 100644 --- a/lib/sbin/CSTUtils.pl +++ b/lib/sbin/CSTUtils.pl @@ -11,20 +11,22 @@ sub CST_error { - my($level,$mess,$line,$file) = @_; + my($level,$mess,$line,$file,$error) = @_; if ($full_warnings) { if ($level == 0) { $CST_errors++; - print STDERR "CST error in $file (at $line)\n"; - print STDERR " -> $mess\n"; + $error = "CST error in $file (at $line)\n -> $mess\n"; + print STDERR $error; + $error_string .= $error; } else { - print STDERR "CST warning in $file (at $line)\n"; - print STDERR " -> $mess\n"; + $error = "CST warning in $file (at $line)\n -> $mess\n"; + print STDERR $error; + $error_string .= $error; } } else @@ -32,17 +34,36 @@ sub CST_error if ($level == 0) { $CST_errors++; - print STDERR "CST error $CST_errors:\n -> $mess\n"; + $error = "CST error $CST_errors:\n -> $mess\n"; + print STDERR $error; + $error_string .= $error; } else { - print STDERR "CST warning:\n -> $mess\n"; + $error = "CST warning:\n -> $mess\n"; + print STDERR $error; + $error_string .= $error; } } return; } +#/*@@ +# @routine CST_PrintErrors +# @date 5 December 1999 +# @author Gabrielle Allen +# @desc +# Print all the errors and warnings from the CST +# @enddesc +# @version $Id$ +#@@*/ + +sub CST_PrintErrors +{ + print $error_string; +} + #/*@@ # @routine read_file -- cgit v1.2.3