Changeset 130 for trunk/gsdl/bin/script/gettext.pl
- Timestamp:
- 1999-02-02T22:47:47+13:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/gettext.pl
r117 r130 13 13 use plugin; 14 14 use colcfg; 15 use util; 15 16 16 17 sub print_usage { 17 18 print STDERR "\n usage: $0 collection-name\n"; 18 19 print STDERR " options:\n"; 20 print STDERR " -archivedir directory Where the archives live\n"; 19 21 print STDERR " -index index The index to output\n\n"; 20 22 } … … 26 28 27 29 if (!parsargv::parse(\@ARGV, 30 'archivedir/.*/', \$archivedir, 28 31 'index/.*/section:text', \$index, 29 32 'mode/.*/text', \$mode)) { … … 33 36 34 37 # get and check the collection name 35 ($collection) = @ARGV; 36 37 if (!defined($collection)) { 38 if (($collection = &util::use_collection(@ARGV)) eq "") { 38 39 &print_usage(); 39 40 die "\n"; … … 41 42 42 43 # get the list of plugins for this collection 43 @plugins = ("RecPlug", "HTMLPlug", "TXTPlug"); 44 if (-e "$ENV{'GSDLHOME'}/collect/$collection/etc/collect.cfg") { 45 $collectcfg = &colcfg::read_collect_cfg ("$ENV{'GSDLHOME'}/collect/$collection/etc/collect.cfg"); 44 @plugins = (); 45 $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc/collect.cfg"); 46 if (-e $configfilename) { 47 $collectcfg = &colcfg::read_collect_cfg ($configfilename); 46 48 if (defined $collectcfg->{'plugins'}) { 47 49 @plugins = @{$collectcfg->{'plugins'}}; 48 50 } 51 if (defined $collectcfg->{'archivedir'} && $archivedir eq "") { 52 $archivedir = $collectcfg->{'archivedir'}; 53 } 54 } else { 55 die "Couldn't find the configuration file $configfilename\n"; 49 56 } 50 57 58 # fill in the default archives directories if none 59 # was supplied, turn all \ into / and remove trailing / 60 $archivedir = "$ENV{'GSDLCOLLECTDIR'}/archives" if $archivedir eq ""; 61 $archivedir =~ s/[\\\/]+/\//g; 62 $archivedir =~ s/\/$//; 51 63 52 64 # load all the plugins … … 60 72 # if a buildproc class has been created for this collection, use it 61 73 # otherwise, use the mg buildproc 74 # if a builder class has been created for this collection, use it 75 # otherwise, use the mg builder 76 # load up the document processor for building 77 # if a buildproc class has been created for this collection, use it 78 # otherwise, use the mg buildproc 62 79 my ($buildprocdir, $buildproctype); 63 if (-e "$ENV{'GSDL HOME'}/collect/$collection/perllib/${collection}buildproc.pm") {64 $buildprocdir = "$ENV{'GSDL HOME'}/collect/$collection/perllib";80 if (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/${collection}buildproc.pm") { 81 $buildprocdir = "$ENV{'GSDLCOLLECTDIR'}/perllib"; 65 82 $buildproctype = "${collection}buildproc"; 66 83 } else { … … 70 87 require "$buildprocdir/$buildproctype.pm"; 71 88 72 my $source_dir = "$ENV{'GSDLHOME'}/collect/$collection/archives";73 my $build_dir = "$ENV{'GSDLHOME'}/collect/$collection/building";74 my $verbosity = 1;75 76 89 eval("\$buildproc = new $buildproctype(\$collection, " . 77 "\$ source_dir, \$build_dir, \$verbosity)");90 "\$archivedir, \"\$ENV{'GSDLCOLLECTDIR'}/building\", 1)"); 78 91 die "$@" if $@; 79 92 … … 86 99 87 100 # process the import directory 88 &plugin::read ($pluginfo, $ source_dir,101 &plugin::read ($pluginfo, $archivedir, 89 102 "", {}, $buildproc); 90 103
Note:
See TracChangeset
for help on using the changeset viewer.