Changeset 1427
- Timestamp:
- 2000-08-20T20:32:08+12:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/mkcol.pl
r1423 r1427 37 37 38 38 use parsargv; 39 use util; 39 40 40 41 sub print_usage { … … 81 82 foreach $file (@files) 82 83 { 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); 85 88 86 89 } else { … … 88 91 $destfile =~ s/^\modelcol/$collection/; 89 92 $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"; 96 100 97 101 while (defined ($line = <INFILE>)) { … … 142 146 # load default plugins if none were on command line 143 147 if (!scalar(@plugin)) { 144 @plugin = ( GMLPlug,TEXTPlug,HTMLPlug,EMAILPlug,ArcPlug,RecPlug);148 @plugin = (ZIPPlug,GMLPlug,TEXTPlug,HTMLPlug,EMAILPlug,ArcPlug,RecPlug); 145 149 } 146 150 … … 148 152 ($collection) = @ARGV; 149 153 if (!defined($collection)) { 154 print STDERR "no collection name was specified\n"; 150 155 &print_usage(); 151 156 die "\n"; … … 206 211 } 207 212 213 $mdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", "modelcol"); 214 $cdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $collection); 215 208 216 # make sure the model collection exists 209 die "Cannot find the model collection $ENV{'GSDLHOME'}/collect/modelcol" unless 210 (-d "$ENV{'GSDLHOME'}/collect/modelcol"); 217 die "Cannot find the model collection $mdir" unless (-d $mdir); 211 218 212 219 # make sure this collection does not already exist 213 if (-e "$ENV{'GSDLHOME'}/collect/$collection") {220 if (-e $cdir) { 214 221 print STDERR "This collection already exists\n"; 215 222 die "\n"; … … 218 225 219 226 # 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 227 print STDERR "Creating the collection $collection\n"; 228 &traverse_dir ($mdir, $cdir); 229 print STDERR "The new collection is in $cdir.\n"; 230 231
Note:
See TracChangeset
for help on using the changeset viewer.