Changeset 26567 for main/trunk/greenstone2/perllib/colcfg.pm
- Timestamp:
- 2012-12-10T16:37:21+13:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/colcfg.pm
r25677 r26567 261 261 262 262 # method to check for filename of collect.cfg, and gs mode. 263 sub get_collect_cfg_name {263 sub get_collect_cfg_name_old { 264 264 my ($out) = @_; 265 265 … … 288 288 (&gsprintf($out, "{common.cannot_find_cfg_file}\n", $configfilename) && die); 289 289 } 290 291 # method to check for filename of collect.cfg 292 # needs to be given gs_version, since we can have a GS2 collection ported into 293 # GS3 which could potentially have collect.cfg AND collectionConfig.xml 294 # in which case the older version of this subroutine (get_collect_cfg_name_old) 295 # will return the wrong answer for the gs version we're using. 296 sub get_collect_cfg_name { 297 my ($out, $gs_version) = @_; 298 299 # First check if there's a 300 # gsdl/collect/COLLECTION/custom/COLLECTION/etc/custom.cfg file. This 301 # customization was added for DLC by Stefan, 30/6/2007. 302 my $configfilename; 303 304 if($gs_version eq "gs2") { 305 $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "custom", $ENV{'GSDLCOLLECTION'}, "etc", "custom.cfg"); 306 307 if (-e $configfilename) { 308 return $configfilename; 309 } 310 } 311 312 # Check if there is a collectionConfig.xml file if it's gs3 313 if($gs_version eq "gs3") { 314 $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collectionConfig.xml"); 315 if (-e $configfilename) { 316 return $configfilename; 317 } 318 } 319 320 # Check if there is a collect.cfg file in the usual place for gs2. 321 if($gs_version eq "gs2") { 322 $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg"); 323 if (-e $configfilename) { 324 return $configfilename; 325 } 326 } 327 328 # Error. No collection configuration file. 329 (&gsprintf($out, "{common.cannot_find_cfg_file}\n", $configfilename) && die); 330 } 331 290 332 291 333
Note:
See TracChangeset
for help on using the changeset viewer.