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