summaryrefslogtreecommitdiff
path: root/lib/sbin/ThornGuide.pl
diff options
context:
space:
mode:
authorrideout <rideout@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-12-15 22:45:29 +0000
committerrideout <rideout@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-12-15 22:45:29 +0000
commitdb717b76f385cd616e52935af5af5f13cb58eaf1 (patch)
tree6eb5b0a92bc37455d18719d5c4b7d1741bcc576d /lib/sbin/ThornGuide.pl
parent0c19fc1411c01e5c7399d3c9e2db7fe7f58df053 (diff)
&Read_New_Thorn_Doc no longer returns 0 if the \title{} field is empty.
Add a number of comments and debugging statements... Fixes CactusEinstein/1342, CactusPUGH/1341, and CactusExternal/1340. May also fix major issue of Cactus/1343. Alleviates much of Cactus/1344. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3044 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/ThornGuide.pl')
-rw-r--r--lib/sbin/ThornGuide.pl30
1 files changed, 20 insertions, 10 deletions
diff --git a/lib/sbin/ThornGuide.pl b/lib/sbin/ThornGuide.pl
index 7c945666..a624b82c 100644
--- a/lib/sbin/ThornGuide.pl
+++ b/lib/sbin/ThornGuide.pl
@@ -1,7 +1,9 @@
-#!/usr/local/bin/perl
+#!/usr/local/bin/perl
use strict;
use vars qw($h $help $cctk_home $thornlist $directory $outdir $verbose $debug $outfile $tocdepth);
+#$debug = 1;
+
#/*@@
# @file ThornGuide.pl
# @date Sun Mar 3 19:05:41 CET 2002
@@ -129,7 +131,7 @@ my $counter = 1;
# lets go through, one arrangement at a time
foreach my $arrangement (sort keys %arrangements)
{
- print "\n$arrangement" if ($debug);
+ print "\nWorking through arrangement $arrangement..." if ($debug);
# starts a new latex chapter of name $arrangement, with a chapter counter of $counter
&Start_Arr($arrangement, $counter);
@@ -141,13 +143,14 @@ foreach my $arrangement (sort keys %arrangements)
# now each THORN in the given arrangement
foreach my $thorn (sort @{$arrangements{$arrangement}})
{
- print "\n\t$thorn" if ($debug);
+ print "\t$thorn:\n" if ($debug);
# try to parse out the "NEW" format of latex documentation
- my $contents = &Read_New_Thorn_Doc($arrangements_dir, $arrangement, $thorn);
+ my $contents = &Read_New_Thorn_Doc($arrangements_dir, $arrangement, $thorn);
# we could not sucessfully parse the "NEW" format, try the old format
if (! $contents) {
+ print "\nError reading thornguide in new format... Trying old format.\n" if ($debug);
$contents = &Read_Thorn_Doc($arrangements_dir, $arrangement, $thorn);
}
@@ -207,12 +210,18 @@ sub Read_New_Thorn_Doc
my $date = "";
my $cnts = "";
- open (DOC, "<$pathandfile") || print STDERR "\nCould not find documentation in $path";
+ open (DOC, "<$pathandfile") or print "\nCould not find documentation in $pathandfile: $!\n";
-
while (<DOC>) # loop through thorn doc.
{
- if (/\\title\{(.*?(?:.*?\{.*?[^\{].*?\}.*?)?(?:.*?\{.*?[^\{].*?\}.*?)?(?:.*?\{.*?[^\{].*?\}.*?)?(?:.*?\{.*?[^\{].*?\}.*?)?(?:.*?\{.*?[^\{].*?\}.*?)?.*?)\}/) { $title = $1; if ($title !~ /\w/) { close DOC; return 0;} }
+ print "processing: $_" if $debug;
+ if (/\\title\{(.*?(?:.*?\{.*?[^\{].*?\}.*?)?(?:.*?\{.*?[^\{].*?\}.*?)?(?:.*?\{.*?[^\{].*?\}.*?)?(?:.*?\{.*?[^\{].*?\}.*?)?(?:.*?\{.*?[^\{].*?\}.*?)?.*?)\}/) {
+ $title = $1;
+ if ($title !~ /\w/) {
+ print 'ThornGuide.pl Warning: \title{} does not contain any word characters.\n';
+ #close DOC; return 0;
+ }
+ }
if (/\\author\{(.*?(?:.*?\{.*?[^\{].*?\}.*?)?(?:.*?\{.*?[^\{].*?\}.*?)?(?:.*?\{.*?[^\{].*?\}.*?)?(?:.*?\{.*?[^\{].*?\}.*?)?(?:.*?\{.*?[^\{].*?\}.*?)?.*?)\}/) { $author = $1;}
if (/\\date\{(.*?(?:.*?\{.*?[^\{].*?\}.*?)?(?:.*?\{.*?[^\{].*?\}.*?)?(?:.*?\{.*?[^\{].*?\}.*?)?(?:.*?\{.*?[^\{].*?\}.*?)?(?:.*?\{.*?[^\{].*?\}.*?)?.*?)\}/) { $date = $1; $date =~ s/.*Date:(.*?)\$\s*?\$/$1/; }
if (/^% START CACTUS THORNGUIDE\s*$/) {
@@ -248,8 +257,10 @@ sub Read_New_Thorn_Doc
$contents .= "\n\\include{" . ThornUtils::ToLower("${arrangement}_${thorn}_inter") . "\}\n";
$contents .= "\n\\include{${arrangement}_${thorn}_schedule}\n";
- # if it never started reading, then we print some error message
+ # If it never started reading, then return 0.
+ # (It is probably an older documentation.doc.)
if (! $start) {
+ print "ThornGuide.pl Error: % START CACTUS THORNGUIDE\\s*\$ not found\n" if $debug;
close DOC; return 0;
}
@@ -316,7 +327,7 @@ sub Read_Thorn_Doc
my $date = "";
my $cnts = "";
- open (DOC, "<$pathandfile") || print STDERR "\nCould not find documentation in $path";
+ open (DOC, "<$pathandfile") or print "\nCould not find documentation in $pathandfile: $!\n";
while (<DOC>) # loop through thorn doc.
{
@@ -627,4 +638,3 @@ print OUT <<EOC;
%%%%%%%%%%%%%%%%%%%%%%%
EOC
}
-