Changeset 1427 for trunk


Ignore:
Timestamp:
2000-08-20T20:32:08+12:00 (24 years ago)
Author:
sjboddie
Message:

Tidied up mkcol.pl slightly - now uses filename_cat everywhere to prevent
weird looking (though perfectly functional) filenames showing up in windows

  • Also added ZIPPlug to new collections by default
File:
1 edited

Legend:

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

    r1423 r1427  
    3737
    3838use parsargv;
     39use util;
    3940
    4041sub print_usage {
     
    8182    foreach $file (@files)
    8283    {
    83     if (-d "$modeldir/$file") {
    84         traverse_dir ("$modeldir/$file", "$coldir/$file");
     84    my $thisfile = &util::filename_cat ($modeldir, $file);
     85    if (-d $thisfile) {
     86        my $colfiledir = &util::filename_cat ($coldir, $file);
     87        traverse_dir ($thisfile, $colfiledir);
    8588
    8689    } else {
     
    8891        $destfile =~ s/^\modelcol/$collection/;
    8992        $destfile =~ s/^\MODELCOL/$capcollection/;
    90 
    91         print STDERR "doing replacements for $modeldir/$file\n";
    92         open (INFILE, "$modeldir/$file") ||
    93         die "Can't read file $modeldir/$file";
    94         open (OUTFILE, ">$coldir/$destfile") ||
    95         die "Can't create file $coldir/destfile";
     93        $destfile = &util::filename_cat ($coldir, $destfile);
     94
     95        print STDERR "doing replacements for $thisfile\n";
     96        open (INFILE, $thisfile) ||
     97        die "Can't read file $thisfile";
     98        open (OUTFILE, ">$destfile") ||
     99        die "Can't create file $destfile";
    96100
    97101        while (defined ($line = <INFILE>)) {
     
    142146# load default plugins if none were on command line   
    143147if (!scalar(@plugin)) {
    144     @plugin = (GMLPlug,TEXTPlug,HTMLPlug,EMAILPlug,ArcPlug,RecPlug);
     148    @plugin = (ZIPPlug,GMLPlug,TEXTPlug,HTMLPlug,EMAILPlug,ArcPlug,RecPlug);
    145149}
    146150
     
    148152($collection) = @ARGV;
    149153if (!defined($collection)) {
     154    print STDERR "no collection name was specified\n";
    150155    &print_usage();
    151156    die "\n";
     
    206211}
    207212
     213$mdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", "modelcol");
     214$cdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $collection);
     215
    208216# make sure the model collection exists
    209 die "Cannot find the model collection $ENV{'GSDLHOME'}/collect/modelcol" unless
    210     (-d "$ENV{'GSDLHOME'}/collect/modelcol");
     217die "Cannot find the model collection $mdir" unless (-d $mdir);
    211218
    212219# make sure this collection does not already exist
    213 if (-e "$ENV{'GSDLHOME'}/collect/$collection") {
     220if (-e $cdir) {
    214221    print STDERR "This collection already exists\n";
    215222    die "\n";
     
    218225
    219226# start creating the collection
    220 print STDERR "Creating the collection $collection\n\n";
    221 &traverse_dir ("$ENV{'GSDLHOME'}/collect/modelcol", "$ENV{'GSDLHOME'}/collect/$collection");
    222 print STDERR "\n\nThe new collection is in $ENV{'GSDLHOME'}/collect/$collection.\n\n";
    223 
    224 
     227print STDERR "Creating the collection $collection\n";
     228&traverse_dir ($mdir, $cdir);
     229print STDERR "The new collection is in $cdir.\n";
     230
     231
Note: See TracChangeset for help on using the changeset viewer.