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

general improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.