Changeset 15019
- Timestamp:
- 2008-02-27T17:09:21+13:00 (16 years ago)
- Location:
- gsdl/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/bin/script/mkcol.pl
r14565 r15019 79 79 'type' => "flag", 80 80 'reqd' => "no" }, 81 { 'name' => "group", 82 'desc' => "mkcol.group", 83 'type' => "flag", 84 'reqd' => "no" }, 81 85 { 'name' => "collectdir", 82 86 'desc' => "{mkcol.collectdir}", … … 112 116 'desc' => "{mkcol.win31compat}", 113 117 'type' => "enum", 114 'deft' => " true",118 'deft' => "false", 115 119 'list' => $win31compat_list, 116 120 'reqd' => "no" }, … … 132 136 133 137 # options 134 my ($creator, $optionfile, $maintainer, $gs3mode, $ collectdir, $public,138 my ($creator, $optionfile, $maintainer, $gs3mode, $group, $collectdir, $public, 135 139 $title, $about, $plugin, $quiet, $language, $win31compat, $gli); 136 140 137 141 #other variables 138 my ($collection, $capcollection, $pluginstring, @plugin); 142 my ($collection, $capcollection, 143 $collection_tail, $capcollection_tail, 144 $pluginstring, @plugin); 139 145 140 146 &main(); … … 174 180 } else { 175 181 176 # There are only two configuration files in modelcol directory:177 # collect.cfg and collectionConfig.xml.178 # If it is gs2, copy collect.cfg file; if gs3, copy collectionConfig.xml.179 if ( ($gs3 && $file =~ /collect\.cfg/) || (!$gs3 && $file =~ /collectionConfig\.xml/) ) {180 181 next;182 }183 182 my $destfile = $file; 184 183 $destfile =~ s/^modelcol/$collection/; 185 184 $destfile =~ s/^MODELCOL/$capcollection/; 185 186 # There are three configuration files in modelcol directory: 187 # collect.cfg, group.cfg and collectionConfig.xml. 188 # If it is gs2, copy relevant collect.cfg or group.cfg file; if gs3, copy collectionConfig.xml. 189 190 if ($gs3) { 191 if ($group) { 192 &gsprintf(STDERR,"{common.group_not_valid_in_gs3}\n"); 193 } 194 else { 195 next if ($file =~ m/(collect|group)\.cfg/); 196 } 197 } 198 else { 199 # Greenstone 2 200 if ($group) { 201 next if ($file =~ m/collect\.cfg/); 202 203 # If get to here: input file = group.cfg 204 # => want output file = collect.cfg 205 $destfile =~ s/group\.cfg/collect\.cfg/; 206 } 207 else { 208 next if ($file =~ m/collect\.cfg/); 209 } 210 211 } 212 213 186 214 &gsprintf(STDOUT, "{mkcol.doing_replacements}\n", $destfile) 187 215 unless $quiet; … … 194 222 195 223 while (defined (my $line = <INFILE>)) { 196 $line =~ s/\*\*collection\*\*/$collection /g;197 $line =~ s/\*\*COLLECTION\*\*/$capcollection /g;224 $line =~ s/\*\*collection\*\*/$collection_tail/g; 225 $line =~ s/\*\*COLLECTION\*\*/$capcollection_tail/g; 198 226 $line =~ s/\*\*creator\*\*/$creator/g; 199 227 $line =~ s/\*\*maintainer\*\*/$maintainer/g; … … 290 318 # get and check the collection name 291 319 ($collection) = @ARGV; 320 321 # get capitalised version of the collection 322 $capcollection = $collection; 323 $capcollection =~ tr/a-z/A-Z/; 324 325 $collection_tail = &util::get_dirsep_tail($collection); 326 $capcollection_tail = &util::get_dirsep_tail($capcollection); 327 328 292 329 if (!defined($collection)) { 293 330 &gsprintf(STDOUT, "{mkcol.no_colname}\n"); … … 296 333 } 297 334 298 if (($win31compat eq "true") && (length($collection )) > 8) {335 if (($win31compat eq "true") && (length($collection_tail)) > 8) { 299 336 &gsprintf(STDOUT, "{mkcol.long_colname}\n"); 300 337 die "\n"; … … 306 343 } 307 344 308 if ($collection eq "CVS") {345 if ($collection_tail eq "CVS") { 309 346 &gsprintf(STDOUT, "{mkcol.bad_name_cvs}\n"); 347 die "\n"; 348 } 349 350 if ($collection_tail eq ".svn") { 351 &gsprintf(STDOUT, "{mkcol.bad_name_svn}\n"); 310 352 die "\n"; 311 353 } … … 318 360 319 361 if (!defined($title) || $title eq "") { 320 $title = $collection; 321 } 322 323 # get capitalised version of the collection 324 $capcollection = $collection; 325 $capcollection =~ tr/a-z/A-Z/; 362 $title = $collection_tail; 363 } 364 326 365 327 366 # get the strings to include. -
gsdl/trunk/perllib/strings.properties
r14997 r15019 346 346 mkcol.bad_name_cvs:ERROR: No collection can be named CVS as this may interfere with directories created by the CVS versioning system. 347 347 348 mkcol.bad_name_svn:ERROR: No collection can be named .svn as this may interfere with directories created by the SVN versioning system. 349 348 350 mkcol.bad_name_modelcol:ERROR: No collection can be named modelcol as this is the name of the model collection. 349 351
Note:
See TracChangeset
for help on using the changeset viewer.