source: trunk/gsdl/perllib/colcfg.pm@ 1377

Last change on this file since 1377 was 1377, checked in by paynter, 24 years ago

Added "mirror interval N" command for use with update.pl

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1###########################################################################
2#
3# colcfg.pm --
4# A component of the Greenstone digital library software
5# from the New Zealand Digital Library Project at the
6# University of Waikato, New Zealand.
7#
8# Copyright (C) 1999 New Zealand Digital Library Project
9#
10# This program 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# This program 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 this program; if not, write to the Free Software
22# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23#
24###########################################################################
25
26# reads in a collection configuration file
27
28package colcfg;
29
30use cfgread;
31
32
33# the collection configuration file data is stored in the form
34#
35# {'creator'}->string
36# {'public'}->string
37# {'beta'}->string
38# {'defaultindex'}->string
39# {'importdir'}->string
40# {'archivedir'}->string
41# {'cachedir'}->string
42# {'builddir'}->string
43# {'removeold'}->string
44# {'textcompress'}->string
45
46# {'maintainer'}->array of strings
47# {'languages'}->array of strings
48# {'indexsubcollections'}->array of strings
49# {'indexes'}->array of strings
50# {'dontbuild'}->array of strings
51# {'dontgdbm'}->array of strings
52# {'mirror'}->array of strings
53
54# {'subcollection'}->hash of key-value pairs
55# {'collectionmeta'}->hash of key-value pairs
56
57# {'plugin'}->array of arrays of strings
58# {'classify'}->array of arrays of strings
59
60sub read_collect_cfg {
61 my ($filename) = @_;
62
63 return &cfgread::read_cfg_file ($filename,
64 q/^(creator|public|beta|defaultindex|importdir|/ .
65 q/archivedir|cachedir|builddir|removeold|textcompress)$/,
66 q/(maintainer|languages|indexsubcollections|/ .
67 q/indexes|dontbuild|dontgdbm|mirror)$/,
68 q/^(subcollection|collectionmeta)$/,
69 q/^(plugin|classify)$/);
70}
71
72sub write_collect_cfg {
73 my ($filename, $data) = @_;
74
75 &cfgread::write_cfg_file($filename, $data,
76 q/^(creator|public|beta|defaultindex|importdir|/ .
77 q/archivedir|cachedir|builddir|removeold|textcompress)$/,
78 q/^(maintainer|languages|indexsubcollections|/ .
79 q/indexes|dontbuild|dontgdbm)$/,
80 q/^(subcollection|collectionmeta)$/,
81 q/^(plugin|classify)$/);
82}
83
84
85# the build configuration file data is stored in the form
86#
87# {'builddate'}->string
88# {'buildtype'}->string
89# {'metadata'}->array of strings
90# {'languages'}->array of strings
91# {'numdocs'}->string
92# {'numwords'}->string
93# {'numbytes'}->string
94# {'indexfields'}->array of strings
95
96sub read_build_cfg {
97 my ($filename) = @_;
98
99 return &cfgread::read_cfg_file ($filename,
100 q/^(builddate|buildtype|numdocs|numwords|numbytes)$/,
101 q/^(metadata|languages|indexfields)$/);
102}
103
104sub write_build_cfg {
105 my ($filename, $data) = @_;
106
107 &cfgread::write_cfg_file($filename, $data,
108 q/^(builddate|numdocs|numwords|numbytes)$/,
109 q/^(metadata|languages)$/);
110}
111
112
1131;
Note: See TracBrowser for help on using the repository browser.