/[webpac-proto]/test_config.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /test_config.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Sun Jun 16 19:39:42 2002 UTC (16 years, 10 months ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +14 -1 lines
File MIME type: text/plain
fix here, fix there. removed unused code, more configuration
checks

1 #!/usr/bin/perl
2 #
3 # test configuration files
4
5 require "./common.pm";
6
7 # check mps_header
8 require "./search/config.pm";
9
10 my %mps;
11 foreach (split(/\n/,$common::mps_header)) {
12 if (/^F /) {
13 my (undef,$fld,$desc,undef) = split(/ /,$_,4);
14 die "fix 'common.pm' field $fld in mps_header is not in *SearchFieldNames" if (!grep(/$fld/,@main::NormalSearchFieldNames) && !grep(/$fld/,@main::AdvancedSearchFieldNames));
15 $mps{$fld} = $desc;
16 }
17 }
18
19 ## check search/config.pm
20 foreach (@default::FieldDisplayOrder) {
21 die "fix 'search/config.pm' field $_ in FieldDisplayOrder is not in FieldNames" if (! $default::FieldNames{$_});
22 }
23 foreach (keys %default::FieldNames) {
24 die "fix 'search/config.pm' field $_ in FieldNames but not in FieldDisplayOrder" if (! grep(/$_/,@default::FieldDisplayOrder));
25 }
26 foreach (@default::Separator) {
27 die "fix 'search/config.pm' field $_ in Separator is not in FieldNames" if (! $default::FieldNames{$_});
28 }
29 foreach (@main::NormalSearchFieldNames) {
30 die "fix 'search/config.pm' or 'common.pm' field $_ from NormalSearchFieldNames not in mps_header" if (! $mps{$_});
31 }
32 foreach (@main::AdvancedSearchFieldNames) {
33 die "fix 'search/config.pm' or 'common.pm' field $_ from AdvancedSearchFieldNames not in mps_header" if (! $mps{$_});
34 }
35
36

  ViewVC Help
Powered by ViewVC 1.1.26