Ignore:
Timestamp:
2008-07-09T13:12:15+12:00 (16 years ago)
Author:
davidb
Message:

Introduction of 'collecthome' which parallels 'gsdlhome' to allow the toplevel collect folder to be outside of the gsdlhome area

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/src/colservr/colservrconfig.cpp

    r15458 r16310  
    4444// collect_cfg_read reads collect.cfg returning true on success.
    4545bool collect_cfg_read (collectserver &cserver, const text_t &gsdlhome,
    46                const text_t &collection) {
    47   text_t filename = filename_cat (gsdlhome, "collect");
    48   filename = filename_cat (filename, collection);
    49   filename = filename_cat (filename, "custom");
    50   filename = filename_cat (filename, collection);
    51   filename = filename_cat (filename, "etc");
    52   filename = filename_cat (filename, "custom.cfg");
     46               const text_t& collecthome,
     47               const text_t &collection)
     48{
     49  text_t filename = filename_cat (collecthome, collection);
     50  filename = filename_cat (filename, "custom",collection,"etc","custom.cfg");
    5351
    5452  if (!file_exists (filename)) {
    55     filename = filename_cat (gsdlhome, "collect");
    56     filename = filename_cat (filename, collection);
    57     filename = filename_cat (filename, "etc");
    58     filename = filename_cat (filename, "collect.cfg");
     53    filename = filename_cat (collecthome, collection, "etc", "collect.cfg");
    5954
    6055    if (!file_exists (filename)) {
    61       filename = filename_cat (gsdlhome, "etc");
    62       filename = filename_cat (filename, "collect.cfg");
     56      filename = filename_cat (gsdlhome, "etc", "collect.cfg");
    6357      if (!file_exists (filename)) return false;
    6458    }
     
    6660
    6761  return cserver.read_configfile(filename);
    68   /*
    69   // read in the collection configuration file
    70   text_t key;
    71   text_tarray cfgline;
    72   char *cstr = filename.getcstr();
    73   ifstream confin (cstr);
    74   delete []cstr;
    75 
    76   if (confin) {
    77     while (read_cfg_line(confin, cfgline) >= 0) {
    78       if (cfgline.size () >= 2) {
    79     key = cfgline[0];
    80     cfgline.erase(cfgline.begin());
    81 
    82     // configure the collection server
    83     cserver.configure (key, cfgline);
    84       }
    85     }
    86     confin.close ();
    87     return true;
    88   }
    89   return false;
    90   */
    9162}
    9263
     
    9465// build_cfg_read reads build.cfg and returns true on success.
    9566bool build_cfg_read (collectserver &cserver, const text_t &gsdlhome,
     67             const text_t& collecthome,
    9668             const text_t &collection) {
    97   text_t filename = filename_cat (gsdlhome, "collect");
    98   filename = filename_cat (filename, collection);
    99   filename = filename_cat (filename, "index");
     69  text_t filename = filename_cat (collecthome, collection,"index","build.cfg");
    10070
    101   filename = filename_cat (filename, "build.cfg");
    10271  if (!file_exists (filename)) {
    103     filename = filename_cat (gsdlhome, "index");
    104     filename = filename_cat (filename, "build.cfg");
     72    filename = filename_cat (gsdlhome, "index", "build.cfg");
    10573    if (!file_exists (filename)) return false;
    10674  }
     
    10876  return cserver.read_configfile(filename);
    10977
    110   /*
    111   // read in the build configuration file
    112   text_t key;
    113   text_tarray cfgline;
    114   char *cstr = filename.getcstr();
    115   ifstream confin (cstr);
    116   delete []cstr;
    117 
    118   if (confin) {
    119     while (read_cfg_line(confin, cfgline) >= 0) {
    120       if (cfgline.size () >= 2) {
    121     key = cfgline[0];
    122     cfgline.erase(cfgline.begin());
    123 
    124     // configure the collection server
    125     cserver.configure (key, cfgline);
    126       }
    127     }
    128     confin.close ();
    129     return true;
    130   }
    131   return false;
    132   */
    13378}
Note: See TracChangeset for help on using the changeset viewer.