Changeset 8539 for trunk/MagicSoft


Ignore:
Timestamp:
05/25/07 13:48:15 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8538 r8539  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2007/05/25 Thomas Bretz
     22
     23   * callisto.cc, star.cc:
     24     - removed obsolete check whether config file exists
     25
     26   * sponde.cc:
     27     - aded check for validity of config file (returns 0xfe if not)
     28
     29   * mbase/MEnv.[h,cc]:
     30     - removed obsolete fName workaround
     31     - made sure that also ~ paths are correctly expanded and used
     32
     33   * mjobs/MJob.cc:
     34     - one more sanity check if MEnv is not valid
     35
     36
    2037
    2138 2007/05/22 Daniel Hoehne
  • trunk/MagicSoft/Mars/callisto.cc

    r8518 r8539  
    261261        return 3;
    262262
    263     if (gSystem->AccessPathName(kConfig, kFileExists))
    264     {
    265         gLog << err << "Sorry, config file '" << kConfig << "' doesn't exist." << endl;
    266         return 4;
    267     }
    268 
    269263    if (kDebugMem)
    270264        TObject::SetObjectStat(kTRUE);
  • trunk/MagicSoft/Mars/mbase/MEnv.cc

    r8240 r8539  
    1818!   Author(s): Thomas Bretz  2/2005 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2005
     20!   Copyright: MAGIC Software Development, 2000-2007
    2121!
    2222!
     
    5151//---------------------------------------------------------------------------
    5252//
    53 // (Default) constructor. If the given file cannot be accessed the data
    54 // member fName is set to "" which can then be checked by IsValid()
    55 //
    56 MEnv::MEnv(const char *name) : TEnv(name), fName(name)
     53// (Default) constructor. If the given file cannot be accessed SetRcName("")
     54// is called which can then be checked by IsValid()
     55//
     56MEnv::MEnv(const char *name) : TEnv(name)
    5757{
    5858    fChecked.SetOwner();
    5959
    60     if (fName.IsNull())
     60    if (!IsValid())
    6161        return;
    6262
     
    6565
    6666    if (gSystem->AccessPathName(fname, kFileExists))
    67         fName = "";
     67        fname = "";
     68
     69    SetRcName(fname);
     70
     71    if (GetEntries()<=0 && !fname.IsNull() && fname!=name)
     72        ReadFile(fname, kEnvLocal);;
     73}
     74
     75//---------------------------------------------------------------------------
     76//
     77// Return the total number of entries in the table
     78//
     79Int_t MEnv::GetEntries() const
     80{
     81    if (!GetTable())
     82        return -1;
     83
     84    return GetTable()->GetEntries();
    6885}
    6986
     
    123140{
    124141    MEnv *env = new MEnv("/dev/null");
    125     env->fName = fName;
     142    env->SetRcName(GetRcName());
    126143    env->AddEnv(*this);
    127144    return env;
     
    836853    int i=0;
    837854    gLog << inf << flush;
    838     gLog.Separator("Untouched Resources");
     855
     856    TString sep = "Untouched Resources - ";
     857    sep += GetRcName();
     858    gLog.Separator(sep);
    839859    TIter Next(GetTable());
    840860    TObject *o=0;
  • trunk/MagicSoft/Mars/mbase/MEnv.h

    r8384 r8539  
    2121    TOrdCollection fChecked;
    2222
    23     TString fName; // A workaround!
    24 
    2523    TString Compile(TString str, const char *post) const;
    2624
     
    2826    MEnv(const char *name="");
    2927
    30     Bool_t      IsValid() const { return !fName.IsNull(); }
     28    Bool_t      IsValid() const { return !TString(GetRcName()).IsNull(); }
    3129
    3230    TObject    *Clone(const char *newname="") const;
     
    3432    Bool_t      Touch(const char *name) { return !TString(GetValue(name, "")).IsNull(); }
    3533
     34    Int_t       GetEntries() const;
     35
    3636    Int_t       GetValue(const char *name, Int_t dflt);
    3737    Double_t    GetValue(const char *name, Double_t dflt);
    3838    const char *GetValue(const char *name, const char *dflt);
    3939
    40     const char *GetName() const { return fName; }
     40    const char *GetName() const { return GetRcName(); }
    4141
    4242    Int_t       GetColor(const char *name, Int_t dftl);
  • trunk/MagicSoft/Mars/mjobs/MJob.cc

    r8518 r8539  
    8383    ClearEnv();
    8484
    85     const Bool_t fileexist = !gSystem->AccessPathName(env, kFileExists);
    86     if (!fileexist)
    87     {
    88         *fLog << err << "ERROR - Resource file '" << env << "' not found... no resources applied." << endl;
    89         return kFALSE;
    90     }
    91 
    9285    fEnv = new MEnv(env);
    9386    SetBit(kIsOwner);
     87
     88    if (!fEnv->IsValid())
     89    {
     90        ClearEnv();
     91        return kFALSE;
     92    }
    9493
    9594    fEnvPrefix = prefix;
  • trunk/MagicSoft/Mars/star.cc

    r8434 r8539  
    160160        return 2;
    161161
    162     if (gSystem->AccessPathName(kConfig, kFileExists))
    163     {
    164         gLog << err << "Sorry, config file '" << kConfig << "' doesn't exist." << endl;
    165         return 2;
    166     }
    167 
    168162    //
    169163    // Setup sequence and check its validity
Note: See TracChangeset for help on using the changeset viewer.