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

Last change on this file since 241 was 139, checked in by sjboddie, 25 years ago

Got building stuff to handle subcollections and language subcollections

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1# reads in a collection configuration file
2
3package colcfg;
4
5use cfgread;
6
7
8# the collection configuration file data is stored in the form
9#
10# {'creator'}->string
11# {'maintainer'}->array of strings
12# {'public'}->string
13# {'beta'}->string
14# {'key'}->string
15# {'languages'}->array of strings
16# {'subcollection'}->hash of key-value pairs
17# {'indexsubcollections'}->array of strings
18# {'indexes'}->array of strings
19# {'defaultindex'}->string
20# {'plugins'}->array of strings
21
22sub read_collect_cfg {
23 my ($filename) = @_;
24
25 return &cfgread::read_cfg_file ($filename,
26 '^(creator|public|beta|key|defaultindex|importdir|' .
27 'archivedir|cachedir|builddir|textindex|removeold)$',
28 '^(maintainer|languages|indexsubcollections|indexes|plugins)$',
29 '^(subcollection)$');
30}
31
32sub write_collect_cfg {
33 my ($filename, $data) = @_;
34
35 &cfgread::write_cfg_file($filename, $data,
36 '^(creator|public|beta|key|defaultindex|importdir|' .
37 'archivedir|cachedir|builddir|textindex|removeold)$',
38 '^(maintainer|languages|indexsubcollections|indexes|plugins)$',
39 '^(subcollection)$');
40}
41
42
43# the build configuration file data is stored in the form
44#
45# {'builddate'}->string
46# {'metadata'}->array of strings
47# {'languages'}->array of strings
48# {'numdocs'}->string
49# {'numwords'}->string
50# {'numbytes'}->string
51
52sub read_build_cfg {
53 my ($filename) = @_;
54
55 return &cfgread::read_cfg_file ($filename,
56 '^(builddate|numdocs|numwords|numbytes)$',
57 '^(metadata|languages)$');
58}
59
60sub write_build_cfg {
61 my ($filename, $data) = @_;
62
63 &cfgread::write_cfg_file($filename, $data,
64 '^(builddate|numdocs|numwords|numbytes)$',
65 '^(metadata|languages)$');
66}
67
68
691;
Note: See TracBrowser for help on using the repository browser.