Changeset 16910


Ignore:
Timestamp:
2008-08-20T10:32:33+12:00 (16 years ago)
Author:
davidb
Message:

Setting up of enviroment variables in its init() method now moved to gsdltools as useful for other parts as well. The init() method now calls gsdltools::set_gsdk_env_vars(..)

Location:
gsdl/trunk/runtime-src/src/recpt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/runtime-src/src/recpt/wizardaction.cpp

    r16310 r16910  
    5858  recpt = NULL;
    5959  disabled = true;
    60   gsdlosc = NULL;
    61   gsdlhomec = NULL;
    62   pathc = NULL;
    6360
    6461  macro_prefix = "";
     
    6663
    6764wizardaction::~wizardaction () {
    68   if (gsdlosc != NULL) delete []gsdlosc;
    69   if (gsdlhomec != NULL) delete []gsdlhomec;
    70   if (pathc != NULL) delete []pathc;
    7165}
    7266
     
    8882bool wizardaction::init (ostream & /*logout*/) {
    8983
    90   // set up GSDLOS, GSDLHOME and PATH environment variables
    91   text_t gsdlos, path;
    92   unsigned int path_separator = ':';
    93 #if defined (__WIN32__)
    94   gsdlos = "windows";
    95   path_separator = ';';
    96 
    97   path = filename_cat (gsdlhome, "bin", "windows", "perl", "bin;");
    98 
    99 #else
    100   struct utsname *buf = new struct utsname();
    101   int i = uname (buf);
    102   if (i == -1) gsdlos = "linux"; // uname failed
    103   else gsdlos.setcstr (buf->sysname);
    104   delete buf;
    105   lc (gsdlos);
    106 #endif
    107 
    108   pathc = getenv ("PATH");
    109   path += filename_cat (gsdlhome, "bin", gsdlos);
    110   path.push_back (path_separator);
    111   path += filename_cat (gsdlhome, "bin", "script");
    112   if (pathc != NULL) {
    113     path.push_back (path_separator);
    114     path += pathc;
    115   }
    116   path = "PATH=" + path;
    117 
    118   gsdlos = "GSDLOS=" + gsdlos;
    119   text_t setgsdlhome = "GSDLHOME=" + gsdlhome;
    120 
    121   // these will be cleaned up in the destructor
    122   gsdlosc = gsdlos.getcstr();
    123   gsdlhomec = setgsdlhome.getcstr();
    124   pathc = path.getcstr();
    125  
    126   putenv (gsdlosc);
    127   putenv (gsdlhomec);
    128   putenv (pathc);
    129 
    130   return true;
     84  return set_gsdl_env_vars(gsdlhome);
    13185}
    13286
  • gsdl/trunk/runtime-src/src/recpt/wizardaction.h

    r11998 r16910  
    5858  bool disabled;
    5959  receptionist *recpt;
    60   char *gsdlosc;
    61   char *gsdlhomec;
    62   char *pathc;
    6360
    6461  text_t macro_prefix;
Note: See TracChangeset for help on using the changeset viewer.