Changeset 26567 for main/trunk/greenstone2/perllib
- Timestamp:
- 2012-12-10T16:37:21+13:00 (11 years ago)
- Location:
- main/trunk/greenstone2/perllib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/basebuilder.pm
r26094 r26567 86 86 87 87 # Read in the collection configuration file. 88 my ($colcfgname); 89 ($colcfgname, $gs_mode) = &colcfg::get_collect_cfg_name($outhandle); 88 if ((defined $site) && ($site ne "")) { # GS3 89 $gs_mode = "gs3"; 90 } 91 92 my $colcfgname = &colcfg::get_collect_cfg_name($outhandle, $gs_mode); 90 93 $self->{'collect_cfg'} = &colcfg::read_collection_cfg ($colcfgname, $gs_mode); 91 94 -
main/trunk/greenstone2/perllib/cgiactions/explodeaction.pm
r24071 r26567 91 91 92 92 # Read in the collection configuration file. 93 my ($config_filename, $gs_mode) = &colcfg::get_collect_cfg_name($out); 93 my $gs_mode = "gs2"; 94 if ((defined $site) && ($site ne "")) { # GS3 95 $gs_mode = "gs3"; 96 } 97 my $config_filename = &colcfg::get_collect_cfg_name($out, $gs_mode); 94 98 my $collectcfg = &colcfg::read_collection_cfg ($config_filename, $gs_mode); 95 99 -
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 -
main/trunk/greenstone2/perllib/inexport.pm
r26536 r26567 173 173 } 174 174 175 # set gs_ver ison 2/3175 # set gs_version 2/3 176 176 $self->{'gs_version'} = "2"; 177 177 if ((defined $site) && ($site ne "")) { … … 199 199 200 200 # Read in the collection configuration file. 201 my ($config_filename, $gs_mode) = &colcfg::get_collect_cfg_name($out); 201 my $gs_mode = "gs".$self->{'gs_version'}; #gs2 or gs3 202 my $config_filename = &colcfg::get_collect_cfg_name($out, $gs_mode); 202 203 my $collectcfg = &colcfg::read_collection_cfg ($config_filename, $gs_mode); 203 204
Note:
See TracChangeset
for help on using the changeset viewer.