[LON-CAPA-cvs] cvs: doc /loncapafiles sanitycheck.piml
albertel
lon-capa-cvs@mail.lon-capa.org
Sun, 10 Dec 2006 23:23:55 -0000
albertel Sun Dec 10 18:23:55 2006 EDT
Modified files:
/doc/loncapafiles sanitycheck.piml
Log:
- sanitycheck now alllows - ans . in domains and host ids
Index: doc/loncapafiles/sanitycheck.piml
diff -u doc/loncapafiles/sanitycheck.piml:1.21 doc/loncapafiles/sanitycheck.piml:1.22
--- doc/loncapafiles/sanitycheck.piml:1.21 Thu Oct 5 14:20:23 2006
+++ doc/loncapafiles/sanitycheck.piml Sun Dec 10 18:23:55 2006
@@ -2,7 +2,7 @@
"http://lpml.sourceforge.net/DTD/piml.dtd">
<!-- sanitycheck.piml -->
-<!-- $Id: sanitycheck.piml,v 1.21 2006/10/05 18:20:23 raeburn Exp $ -->
+<!-- $Id: sanitycheck.piml,v 1.22 2006/12/10 23:23:55 albertel Exp $ -->
<!--
@@ -150,36 +150,39 @@
my $dbug=0;
my $sbug=0;
my $fbug=0;
+my %line;
+my $line=0;
while (<IN>) {
+ $line++;
next if (/^(\#|\s*$)/);
if (/\S/) {
- $rbug=1 if /\r/;
+ if (/\r/) { $rbug=1; push(@{$line{'r'}},$line); }
my @a=split(/\:/,$_);
- $dbug=1 if $a[0]=~/\W/;
- $dbug=1 if $a[0]=~/\_/;
- $dbug=1 if $a[1]=~/\_/;
- $dbug=1 if $a[1]=~/\W/;
- $fbug=1 if (@a<4 || @a>5);
+ if ($a[0]=~/[^\w\-.]/ ||
+ $a[1]=~/[^\w\-.]/ ||
+ $a[0]=~/\_/ ||
+ $a[1]=~/\_/ ) { $dbug=1; push(@{$line{'d'}},$line); }
+ if (@a<4 || @a>5) { $fbug=1; push(@{$line{'f'}},$line); }
my $expr='\s.+$';
- $sbug=1 if ($a[0] =~ /$expr/ ||
- $a[1] =~ /$expr/ ||
- $a[2] =~ /$expr/ ||
- $a[3] =~ /$expr/ )
+ if ($a[0] =~ /$expr/ ||
+ $a[1] =~ /$expr/ ||
+ $a[2] =~ /$expr/ ||
+ $a[3] =~ /$expr/ ) { $sbug=1; push(@{$line{'s'}},$line); }
;
}
}
close IN;
if ($rbug) {
- print "**** ERROR **** <TARGET /> is DOS-formatted\n";
+ print "**** ERROR **** <TARGET /> is DOS-formatted (lines ".join(', ',@{$line{'r'}}).")\n";
}
if ($dbug) {
- print "**** ERROR **** <TARGET /> has invalid host id or domain id\n";
+ print "**** ERROR **** <TARGET /> has invalid host id or domain id (lines ".join(', ',@{$line{'d'}}).")\n";
}
if ($fbug) {
- print "**** ERROR **** <TARGET /> is lacking 4 or 5 columns for every row\n";
+ print "**** ERROR **** <TARGET /> is lacking 4 or 5 columns for every row (lines ".join(', ',@{$line{'f'}}).")\n";
}
if ($sbug) {
- print "**** ERROR **** <TARGET /> has illegal whitespace character\n";
+ print "**** ERROR **** <TARGET /> has illegal whitespace character (lines ".join(', ',@{$line{'s'}}).")\n";
}
</file>
<file>