Changeset 2287
- Timestamp:
- 2001-04-05T22:30:39+12:00 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/import.pl
r2268 r2287 48 48 49 49 sub print_usage { 50 print STDERR "\n usage: $0 [options] collection-name\n\n"; 50 print STDERR "\n"; 51 print STDERR "import.pl: Converts documents in collections -importdir directory into\n"; 52 print STDERR " gml documents which are written to the -archivedir directory.\n\n"; 53 print STDERR " usage: $0 [options] collection-name\n\n"; 51 54 print STDERR " options:\n"; 52 55 print STDERR " -verbosity number 0=none, 3=lots\n"; … … 65 68 print STDERR " building. This will be disabled if groupsize > 1\n"; 66 69 print STDERR " -debug Print imported text to STDOUT\n"; 70 print STDERR " -collectdir directory Collection directory (defaults to " . 71 &util::filename_cat ($ENV{'GSDLHOME'}, "collect") . ")\n"; 67 72 print STDERR " -out Filename or handle to print output status to.\n"; 68 73 print STDERR " The default is STDERR\n\n"; … … 75 80 $removeold, $gzip, $groupsize, $debug, $maxdocs, $collection, 76 81 $configfilename, $collectcfg, $pluginfo, $sortmeta, 77 $archive_info_filename, $archive_info, $processor, $out); 82 $archive_info_filename, $archive_info, $processor, 83 $out, $collectdir); 78 84 if (!parsargv::parse(\@ARGV, 79 85 'verbosity/\d+/2', \$verbosity, … … 87 93 'debug', \$debug, 88 94 'maxdocs/^\-?\d+/-1', \$maxdocs, 95 'collectdir/.*/', \$collectdir, 89 96 'out/.*/STDERR', \$out)) { 90 97 &print_usage(); … … 104 111 105 112 # get and check the collection name 106 if (($collection = &util::use_collection(@ARGV )) eq "") {113 if (($collection = &util::use_collection(@ARGV, $collectdir)) eq "") { 107 114 &print_usage(); 108 115 die "\n"; … … 126 133 # get the list of plugins for this collection 127 134 my $plugins = []; 128 $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc /collect.cfg");135 $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg"); 129 136 if (-e $configfilename) { 130 137 $collectcfg = &colcfg::read_collect_cfg ($configfilename); … … 152 159 # fill in the default import and archives directories if none 153 160 # were supplied, turn all \ into / and remove trailing / 154 $importdir = "$ENV{'GSDLCOLLECTDIR'}/import"if $importdir eq "";161 $importdir = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "import") if $importdir eq ""; 155 162 $importdir =~ s/[\\\/]+/\//g; 156 163 $importdir =~ s/\/$//; 157 $archivedir = "$ENV{'GSDLCOLLECTDIR'}/archives"if $archivedir eq "";164 $archivedir = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "archives") if $archivedir eq ""; 158 165 $archivedir =~ s/[\\\/]+/\//g; 159 166 $archivedir =~ s/\/$//; … … 193 200 &plugin::read ($pluginfo, $importdir, "", {}, $processor, $maxdocs); 194 201 195 &plugin::end($pluginfo, $processor);202 &plugin::end($pluginfo, $processor); 196 203 197 204 # write out the archive information file
Note:
See TracChangeset
for help on using the changeset viewer.