File:  [LON-CAPA] / doc / loncapafiles / sanitycheck.piml
Revision 1.4: download - view: text, annotated - select for diffs
Thu Aug 15 15:41:57 2002 UTC (21 years, 8 months ago) by harris41
Branches: MAIN
CVS tags: HEAD
adding in piml dtd line

    1: <!DOCTYPE piml PUBLIC "-//TUX/DTD piml 1.0 Final//EN" 
    2: 	"http://lpml.sourceforge.net/DTD/piml.dtd">
    3: <!-- sanitycheck.piml -->
    4: <!-- Scott Harrison -->
    5: 
    6: <!-- $Id: sanitycheck.piml,v 1.4 2002/08/15 15:41:57 harris41 Exp $ -->
    7: 
    8: <!--
    9: 
   10: This file is part of the LearningOnline Network with CAPA (LON-CAPA).
   11: 
   12: LON-CAPA is free software; you can redistribute it and/or modify
   13: it under the terms of the GNU General Public License as published by
   14: the Free Software Foundation; either version 2 of the License, or
   15: (at your option) any later version.
   16: 
   17: LON-CAPA is distributed in the hope that it will be useful,
   18: but WITHOUT ANY WARRANTY; without even the implied warranty of
   19: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   20: GNU General Public License for more details.
   21: 
   22: You should have received a copy of the GNU General Public License
   23: along with LON-CAPA; if not, write to the Free Software
   24: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   25: 
   26: /home/httpd/html/adm/gpl.txt
   27: 
   28: http://www.lon-capa.org/
   29: 
   30: -->
   31: 
   32: <piml>
   33: <targetroot>/</targetroot>
   34: <files>
   35: <file>
   36: <target dist='default'>/etc/httpd/conf/loncapa.conf</target>
   37: <perlscript mode='fg'>
   38: open IN, "&lt;<TARGET />";
   39: my $hbug=-1;
   40: my $dbug=-1;
   41: while (&lt;IN&gt;) {
   42:  if (/PerlSetVar\s+lonHostID\s+(\S+)/) {
   43:   my $v=$1;
   44:   $hbug=0;
   45:   $hbug=1 if $v=~/\W/;
   46:   $hbug=1 if $v=~/\_/;
   47:  }
   48:  if (/PerlSetVar\s+lonDefDomain\s+(\S+)/) {
   49:   my $v=$1;
   50:   $dbug=0;
   51:   $dbug=1 if $v=~/\W/;
   52:   $dbug=1 if $v=~/\_/;
   53:  }
   54: }
   55: if ($hbug) {
   56:   print "**** ERROR **** <TARGET /> has invalid lonHostID\n";
   57: }
   58: if ($dbug) {
   59:   print "**** ERROR **** <TARGET /> has invalid lonDefDomain\n";
   60: }
   61: </perlscript>
   62: </file>
   63: <file>
   64: <target dist='default'>/home/httpd/lonTabs/hosts.tab</target>
   65: open IN, "&lt;<TARGET />";
   66: my $rbug=0;
   67: my $dbug=0;
   68: my $sbug=0;
   69: my $fbug=0;
   70: while (&lt;IN&gt;) {
   71:  if (/\S/) {
   72:   $rbug=1 if /\r/;
   73:   my @a=split(/\:/,$_);
   74:   $dbug=1 if $a[0]=~/\W/;
   75:   $dbug=1 if $a[0]=~/\_/;
   76:   $dbug=1 if $a[1]=~/\_/;
   77:   $dbug=1 if $a[1]=~/\W/;
   78:   $fbug=1 if (@a<5 || @a>6);
   79:   my $expr='\s.+$';
   80:   $sbug=1 if ($a[0] =~ /$expr/ ||
   81: 	      $a[1] =~ /$expr/ ||
   82: 	      $a[2] =~ /$expr/ ||
   83: 	      $a[3] =~ /$expr/ ||
   84: 	      $a[4] =~ /$expr/ )
   85: ;
   86:  }
   87: }
   88: close IN;
   89: if ($rbug) {
   90:   print "**** ERROR **** <TARGET /> is DOS-formatted\n";
   91: }
   92: if ($dbug) {
   93:   print "**** ERROR **** <TARGET /> has invalid host id or domain id\n";
   94: }
   95: if ($fbug) {
   96:   print "**** ERROR **** <TARGET /> is lacking 5 or 6 columns for every row\n";
   97: }
   98: if ($sbug) {
   99:   print "**** ERROR **** <TARGET /> has illegal whitespace character\n";
  100: }
  101: </file>
  102: <file>
  103: <target dist='default'>/home/httpd/lonTabs/spare.tab</target>
  104: open IN, "&lt;<TARGET />";
  105: my $rbug=0;
  106: my $dbug=0;
  107: my $sbug=0;
  108: while (&lt;IN&gt;) {
  109:  if (/\S/) {
  110:   $rbug=1 if /\r/;
  111:   $dbug=1 if $_=~/\W.*\n$/;
  112:   $dbug=1 if $_=~/\_/;
  113:   $sbug=1 if /\s.+$/;
  114:  }
  115: }
  116: close IN;
  117: if ($rbug) {
  118:   print "**** ERROR **** <TARGET /> is DOS-formatted\n";
  119: }
  120: if ($dbug) {
  121:   print "**** ERROR **** <TARGET /> has invalid host id\n";
  122: }
  123: if ($sbug) {
  124:   print "**** ERROR **** <TARGET /> has illegal whitespace character\n";
  125: }
  126: </file>
  127: </files>
  128: </piml>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>