1 | # reads in a collection configuration file
|
---|
2 |
|
---|
3 | package colcfg;
|
---|
4 |
|
---|
5 | use 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 | # {'indexes'}->array of strings
|
---|
16 | # {'defaultindex'}->string
|
---|
17 | # {'plugins'}->array of strings
|
---|
18 |
|
---|
19 | sub read_collect_cfg {
|
---|
20 | my ($filename) = @_;
|
---|
21 |
|
---|
22 | return &cfgread::read_cfg_file ($filename,
|
---|
23 | '^(creator|public|beta|key|defaultindex)$',
|
---|
24 | '^(maintainer|indexes|plugins)$');
|
---|
25 | }
|
---|
26 |
|
---|
27 | sub write_collect_cfg {
|
---|
28 | my ($filename, $data) = @_;
|
---|
29 |
|
---|
30 | &cfgread::write_cfg_file($filename, $data,
|
---|
31 | '^(creator|public|beta|key|defaultindex)$',
|
---|
32 | '^(maintainer|indexes|plugins)$');
|
---|
33 | }
|
---|
34 |
|
---|
35 |
|
---|
36 | # the build configuration file data is stored in the form
|
---|
37 | #
|
---|
38 | # {'builddate'}->string
|
---|
39 | # {'metadata'}->array of strings
|
---|
40 | # {'languages'}->array of strings
|
---|
41 | # {'numdocs'}->string
|
---|
42 | # {'numwords'}->string
|
---|
43 | # {'numbytes'}->string
|
---|
44 |
|
---|
45 | sub read_build_cfg {
|
---|
46 | my ($filename) = @_;
|
---|
47 |
|
---|
48 | return &cfgread::read_cfg_file ($filename,
|
---|
49 | '^(builddate|numdocs|numwords|numbytes)$',
|
---|
50 | '^(metadata|languages)$');
|
---|
51 | }
|
---|
52 |
|
---|
53 | sub write_build_cfg {
|
---|
54 | my ($filename, $data) = @_;
|
---|
55 |
|
---|
56 | &cfgread::write_cfg_file($filename, $data,
|
---|
57 | '^(builddate|numdocs|numwords|numbytes)$',
|
---|
58 | '^(metadata|languages)$');
|
---|
59 | }
|
---|
60 |
|
---|
61 |
|
---|
62 | 1;
|
---|