Changeset 18418


Ignore:
Timestamp:
01/27/09 11:52:58 (12 years ago)
Author:
kjdon
Message:

a few mods for gs3 mode. added site param so can use that instead of having to type in collectdir. don't copy macros folder for gs3mode. made a few param descriptions come from dictionary

File:
1 edited

Legend:

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

    r17751 r18418  
    7676    'reqd' => "no" },
    7777      { 'name' => "gs3mode",
    78     'desc' => "mkcol.gs3mode",
     78    'desc' => "{mkcol.gs3mode}",
    7979    'type' => "flag",
    8080    'reqd' => "no" },
    8181      { 'name' => "group",
    82     'desc' => "mkcol.group",
     82    'desc' => "{mkcol.group}",
    8383    'type' => "flag",
    8484    'reqd' => "no" },
    8585      { 'name' => "collectdir",
    8686    'desc' => "{mkcol.collectdir}",
     87    'type' => "string",
     88    'reqd' => "no" }, # For gs3, this collectdir must be provided.
     89      { 'name' => "site",
     90    'desc' => "{mkcol.site}",
    8791    'type' => "string",
    8892    'reqd' => "no" }, # For gs3, this collectdir must be provided.
     
    136140
    137141# options
    138 my ($creator, $optionfile, $maintainer, $gs3mode, $group, $collectdir, $public,
     142my ($creator, $optionfile, $maintainer, $gs3mode, $group, $collectdir, $site,
     143    $public,
    139144    $title, $about, $plugin, $quiet, $language, $win31compat, $gli);
    140145
     
    172177    foreach my $file (@files)
    173178    {
     179    # don't want macros folder for gs3mode
     180    next if ($gs3mode && $file =~ /^macros$/);
    174181    my $thisfile = &util::filename_cat ($modeldir, $file);
    175182
     
    382389    $cdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $collection);
    383390      }else {
    384         &gsprintf(STDOUT, "{mkcol.no_collectdir}\n");
    385         die "In gs3mode, '-collectdir <directory>' must be specified.\n";
     391      if (defined $site && $site =~ /\w/) {
     392          die "GSDL3HOME not set\n" unless defined $ENV{'GSDL3HOME'};
     393
     394          $cdir  = &util::filename_cat($ENV{'GSDL3HOME'}, "sites", $site, "collect");
     395          if (!-d $cdir) {
     396          &gsprintf(STDOUT, "{mkcol.no_collectdir}\n", $cdir);
     397          die "\n";
     398          }
     399          $cdir = &util::filename_cat ($cdir, $collection);
     400      } else {
     401        &gsprintf(STDOUT, "{mkcol.no_collectdir_specified}\n");
     402        die "\n";
     403    }
    386404      }
    387405    }
Note: See TracChangeset for help on using the changeset viewer.