Changeset 18603 for gsdl/trunk/bin/script/mkcol.pl
- Timestamp:
- 2009-03-02T12:58:04+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/bin/script/mkcol.pl
r18418 r18603 154 154 sub traverse_dir 155 155 { 156 my ($modeldir, $coldir , $gs3) = @_;156 my ($modeldir, $coldir) = @_; 157 157 my ($newfile, @filetext); 158 158 … … 177 177 foreach my $file (@files) 178 178 { 179 # don't want macros folder for gs3mode 180 next if ($gs3mode && $file =~ /^macros$/); 179 if ($file =~ /^macros$/) { 180 181 # don't want macros folder for gs3mode 182 next if $gs3mode; 183 } 184 if ($file =~ /^import$/) { 185 # don't want import for group 186 next if $group; 187 } 188 181 189 my $thisfile = &util::filename_cat ($modeldir, $file); 182 190 183 191 if (-d $thisfile) { 184 192 my $colfiledir = &util::filename_cat ($coldir, $file); 185 traverse_dir ($thisfile, $colfiledir , $gs3);193 traverse_dir ($thisfile, $colfiledir); 186 194 187 195 } else { 196 197 next if ($file =~ /~$/); 188 198 189 199 my $destfile = $file; … … 194 204 # collect.cfg, group.cfg and collectionConfig.xml. 195 205 # If it is gs2, copy relevant collect.cfg or group.cfg file; if gs3, copy collectionConfig.xml. 196 197 if ($gs3) { 198 if ($group) { 199 &gsprintf(STDERR,"{common.group_not_valid_in_gs3}\n"); 200 } 201 else { 202 next if ($file =~ m/(collect|group)\.cfg/); 203 } 206 207 if ($file =~ /^collect\.cfg$/) { 208 next if ($gs3mode || $group); 204 209 } 205 else { 206 # Greenstone 2 207 if ($group) { 208 next if ($file =~ m/collect\.cfg/); 209 210 # If get to here: input file = group.cfg 211 # => want output file = collect.cfg 212 $destfile =~ s/group\.cfg/collect\.cfg/; 213 } 214 else { 215 next if ($file =~ m/group\.cfg/); 216 } 217 210 elsif ($file =~ /^group\.cfg$/) { 211 next unless $group; 212 $destfile =~ s/group\.cfg/collect\.cfg/; 218 213 } 219 220 214 elsif ($file =~ /^collectionConfig\.xml$/) { 215 next unless $gs3mode; 216 } 217 221 218 &gsprintf(STDOUT, "{mkcol.doing_replacements}\n", $destfile) 222 219 unless $quiet; … … 236 233 $line =~ s/\*\*title\*\*/$title/g; 237 234 $line =~ s/\*\*about\*\*/$about/g; 238 if (!$gs3 ) {235 if (!$gs3mode) { 239 236 $line =~ s/\*\*plugins\*\*/$pluginstring/g; 240 237 } … … 370 367 } 371 368 369 if ($gs3mode && $group) { 370 &gsprintf(STDERR,"{mkcol.group_not_valid_in_gs3}\n"); 371 die "\n"; 372 } 372 373 373 374 # get the strings to include. … … 418 419 unless $quiet; 419 420 420 &traverse_dir ($mdir, $cdir , $gs3mode);421 &traverse_dir ($mdir, $cdir); 421 422 &gsprintf(STDOUT, "\n{mkcol.success}\n", $cdir) 422 423 unless $quiet;
Note:
See TracChangeset
for help on using the changeset viewer.