/[local]/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

Annotation of /test_config.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Sun Jun 16 19:39:42 2002 UTC (17 years, 2 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 dpavlin 1.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 dpavlin 1.2
10     my %mps;
11 dpavlin 1.1 foreach (split(/\n/,$common::mps_header)) {
12     if (/^F /) {
13 dpavlin 1.2 my (undef,$fld,$desc,undef) = split(/ /,$_,4);
14 dpavlin 1.1 die "fix 'common.pm' field $fld in mps_header is not in *SearchFieldNames" if (!grep(/$fld/,@main::NormalSearchFieldNames) && !grep(/$fld/,@main::AdvancedSearchFieldNames));
15 dpavlin 1.2 $mps{$fld} = $desc;
16 dpavlin 1.1 }
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 dpavlin 1.2 foreach (keys %default::FieldNames) {
24     die "fix 'search/config.pm' field $_ in FieldNames but not in FieldDisplayOrder" if (! grep(/$_/,@default::FieldDisplayOrder));
25     }
26 dpavlin 1.1 foreach (@default::Separator) {
27     die "fix 'search/config.pm' field $_ in Separator is not in FieldNames" if (! $default::FieldNames{$_});
28     }
29 dpavlin 1.2 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 dpavlin 1.1

  ViewVC Help
Powered by ViewVC 1.1.26