Changeset 16310 for gsdl/trunk/src/recpt/receptionist.cpp
- Timestamp:
- 2008-07-09T13:12:15+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/src/recpt/receptionist.cpp
r15589 r16310 52 52 void recptconf::clear () { 53 53 gsdlhome.clear(); 54 collecthome.clear(); 54 55 dbhome.clear(); 55 56 collectinfo.erase(collectinfo.begin(), collectinfo.end()); … … 222 223 if (configinfo.dbhome.empty()) configinfo.dbhome = cfgline[0]; 223 224 } 225 else if (key == "collecthome") configinfo.collecthome = cfgline[0]; 224 226 else if (key == "gdbmhome") configinfo.dbhome = cfgline[0]; 225 227 else if (key == "collection") { … … 231 233 } 232 234 233 } else if (key == "collectdir") configinfo.collectdir = cfgline[0]; 235 } 236 else if (key == "collectdir") configinfo.collectdir = cfgline[0]; 234 237 else if (key == "httpprefix") configinfo.httpprefix = cfgline[0]; 235 238 else if (key == "httpimg") configinfo.httpimg = cfgline[0]; … … 269 272 else if (key == "macroprecedence") configinfo.macroprecedence = cfgline[0]; 270 273 else if (key == "collectinfo") { 271 if (cfgline.size() >= 3) { 274 if (cfgline.size() == 3) { 275 // for backwards compatability with older collections that only use 276 // gsdlhome and dbhome 272 277 collectioninfo_t cinfo; 273 278 cinfo.gsdl_gsdlhome = cfgline[1]; 279 cinfo.gsdl_collecthome = filename_cat(cfgline[1],"collect"); 274 280 cinfo.gsdl_dbhome = cfgline[2]; 281 configinfo.collectinfo[cfgline[0]] = cinfo; 282 } 283 else if (cfgline.size() >= 4) { 284 collectioninfo_t cinfo; 285 cinfo.gsdl_gsdlhome = cfgline[1]; 286 cinfo.gsdl_collecthome = cfgline[2]; 287 cinfo.gsdl_dbhome = cfgline[3]; 275 288 configinfo.collectinfo[cfgline[0]] = cinfo; 276 289 } … … 427 440 428 441 // first configure collectdir 429 text_t thecollectdir = configinfo.gsdlhome;430 442 if (!configinfo.collection.empty()) { 443 431 444 // collection specific mode 445 446 text_t collectdir = configinfo.gsdlhome; 447 432 448 if (!configinfo.collectdir.empty()) { 433 449 // has already been configured 434 thecollectdir = configinfo.collectdir;450 collectdir = configinfo.collectdir; 435 451 } else { 452 436 453 // decide where collectdir is by searching for collect.cfg 437 454 // look in $GSDLHOME/collect/collection-name/etc/collect.cfg and 438 455 // then $GSDLHOME/etc/collect.cfg 439 thecollectdir = filename_cat (configinfo.gsdlhome, "collect");440 thecollectdir = filename_cat (thecollectdir, configinfo.collection);441 text_t filename = filename_cat ( thecollectdir, "etc");456 collectdir = filename_cat (configinfo.gsdlhome, "collect"); 457 collectdir = filename_cat (collectdir, configinfo.collection); 458 text_t filename = filename_cat (collectdir, "etc"); 442 459 filename = filename_cat (filename, "collect.cfg"); 443 444 if (!file_exists(filename)) thecollectdir = configinfo.gsdlhome; 445 } 446 } 447 configure("collectdir", thecollectdir); 460 461 if (!file_exists(filename)) collectdir = configinfo.gsdlhome; 462 } 463 464 configure("collectdir", collectdir); 465 466 } 467 else { 468 469 text_t collecthome; 470 if (configinfo.collecthome.empty()) { 471 collecthome = filename_cat(configinfo.gsdlhome,"collect"); 472 } 473 else { 474 collecthome = configinfo.collecthome; 475 } 476 477 configure("collecthome", collecthome); 478 479 // for backwards compatability collectdir set to gsdlhome 480 // (possible it could now be removed) 481 configure("collectdir", configinfo.gsdlhome); 482 } 483 448 484 449 485 // read in the macro files … … 824 860 collectname=args["c"]; 825 861 if (collectname != "") { 826 text_t collectdir=filename_cat(configinfo.gsdlhome,"collect"); 827 collectdir=filename_cat(collectdir,collectname); 862 863 text_t collecthome; 864 if (!configinfo.collecthome.empty()) { 865 collecthome = configinfo.collecthome; 866 } 867 else { 868 collecthome=filename_cat(configinfo.gsdlhome,"collect"); 869 } 870 text_t collectdir=filename_cat(collecthome,collectname); 871 828 872 text_t buildcfg=filename_cat(collectdir,"index"); 829 873 buildcfg=filename_cat(buildcfg,"build.cfg"); … … 1186 1230 1187 1231 text_t colmacrodir 1188 = filename_cat (configinfo. gsdlhome,"collect",collection, "macros");1232 = filename_cat (configinfo.collecthome,collection, "macros"); 1189 1233 1190 1234 if (directory_exists (colmacrodir)) {
Note:
See TracChangeset
for help on using the changeset viewer.