Changeset 843 for trunk


Ignore:
Timestamp:
1999-12-13T17:34:19+13:00 (24 years ago)
Author:
davidb
Message:

general improvements

Location:
trunk/gsdl/bin/script
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/import.pl

    r814 r843  
    5555    print STDERR "                          directory -- use with care\n";
    5656    print STDERR "   -gzip                  Use gzip to compress resulting gml documents\n";
    57     print STDERR "   -debug                 Print imported text to STDOUT\n";
    58     print STDERR "   -maxdocs number        Maximum number of documents to import\n\n";
     57    print STDERR "   -maxdocs number        Maximum number of documents to import\n";
     58    print STDERR "   -groupsize number      Number of GML documents to group into one file\n";
     59    print STDERR "   -debug                 Print imported text to STDOUT\n\n";
    5960}
    6061
     
    7273             'removeold', \$removeold,
    7374             'gzip', \$gzip,
     75             'groupsize/\d+/1', \$groupsize,
    7476             'debug', \$debug,
    7577             'maxdocs/^\-?\d+/-1', \$maxdocs)) {
     
    8688    die "\n";
    8789    }
     90
     91    # dynamically load 'docsave' module so it can pick up on a collection
     92    # specific docsave.pm is specified.
     93
     94    unshift (@INC, "$ENV{'GSDLCOLLECTDIR'}/perllib");
     95    require docsave;
     96
    8897
    8998    # get the list of plugins for this collection
     
    128137    die "\n";
    129138    }
    130    
     139   
    131140    # remove the old contents of the archives directory if needed
    132141    if ($removeold && -e $archivedir) {
     
    136145    &util::rm_r ($archivedir);
    137146    }
    138 
     147   
    139148    # read the archive information file
    140149    if (!$debug) {
     
    144153
    145154    # create a docsave object to process the documents
    146     $processor = new docsave ($collection, $archive_info, $verbosity, $gzip);
     155    $processor = new docsave ($collection, $archive_info, $verbosity, $gzip, $groupsize);
    147156    $processor->setarchivedir ($archivedir);
    148157    } else {
     
    150159    }
    151160
     161    &plugin::begin($pluginfo, $importdir, $processor, $maxdocs);
     162
    152163    # process the import directory
    153     &plugin::read ($pluginfo, $importdir,
    154            "", {}, $processor, $maxdocs);
     164    &plugin::read ($pluginfo, $importdir, "", {}, $processor, $maxdocs);
    155165   
     166    &plugin::end($pluginfo);
     167
     168    $processor->close_file_output();
     169
    156170    # write out the archive information file
    157171    if (!$debug) {
     
    159173    }
    160174}
     175
     176
     177
     178
     179
  • trunk/gsdl/bin/script/mkcol.pl

    r797 r843  
    4747#    print STDERR "   -index type         The indexes which should be made\n";
    4848#    print STDERR "   -indextext name     The index description\n";
    49 #    print STDERR "   -defaultindex type  The index to use if no others are supplied\n\n";
     49#    print STDERR "   -defaultindex type  The index to use if no others are supplied\n";
     50
     51    print STDERR "   -title text         The title for the collection\n";
     52    print STDERR "   -about text         The about text for the collection\n";
     53    print STDERR "   -plugins list       Space separated list of perl plugin modules to use\n";
     54    print STDERR "   -refine   list      Space separated list of perl plugin modules to use\n";
     55
     56
    5057}
    5158
     
    5663
    5764    if (!(-e $coldir)) {
    58     if (!mkdir ($coldir, 0775)) {
     65
     66    my $store_umask = umask(0002);
     67    my $mkdir_ok = mkdir ($coldir, 0777);
     68    umask($store_umask);
     69
     70    if (!$mkdir_ok)
     71    {
    5972        die "$!";
    6073    }
     
    91104        $line =~ s/\*\*indexestext\*\*/$indexestextstr/g;
    92105        $line =~ s/\*\*defaultindex\*\*/$defaultindex/g;
     106        $line =~ s/\*\*title\*\*/$title/g;
     107        $line =~ s/\*\*about\*\*/$about/g;
     108        $line =~ s/\*\*plugins\*\*/$plugins/g;
     109        $line =~ s/\*\*refine\*\*/$refine/g;
    93110
    94111        print OUTFILE $line;
     
    112129               'index/.*/document:all', \@indexes,
    113130               'indextext/\.*/Terms must appear within the same document', \@indexestext,
    114                'defaultindex/.*/document:all', \$defaultindex
     131               'defaultindex/.*/document:all', \$defaultindex,
     132               'title/.+/', \$title,
     133               'about/.+/', \$about,
     134               'plugins/.+/GMLPlug TEXTPlug ArcPlug RecPlug/', \$plugins,
     135               'refine/.+/', \$refine
    115136               )) {
    116137    &print_usage();
     
    157178$beta = "true" unless defined $beta;
    158179
     180
     181if (!defined($title) || $title eq "") {
     182    $title = $collection;
     183}
     184
    159185# get capitalised version of the collection
    160186$capcollection = $collection;
     
    186212print STDERR "\n\nThe new collection is in $ENV{'GSDLHOME'}/collect/$collection.\n\n";
    187213
     214
Note: See TracChangeset for help on using the changeset viewer.