]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/FORWARD/trains/Helper.C
Various fixes
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / trains / Helper.C
index b46b7a285dc7503eb88a3d5e4efa96ac5a7f40d3..c46471e589191dd7de1049a175ee0a8338e527d0 100644 (file)
@@ -306,7 +306,8 @@ struct Helper
       gSystem->Load("libProof");
       gSystem->Load("libProofPlayer");
     }
-    gROOT->LoadMacro(Form("%s.C+",cl.Data()));
+    // Always recompile and with debug symbols 
+    gROOT->LoadMacro(Form("%s.C++g",cl.Data()));
     Long_t ptr = gROOT->ProcessLine(Form("new %s(\"%s\", %d);", 
                                         cl.Data(), url.GetUrl(), verbose));
     if (verbose > 3) gSystem->RedirectOutput(0);
@@ -408,9 +409,17 @@ protected:
     if (!path.BeginsWith("/")) path.Prepend("../");
     if (gSystem->AccessPathName(path.Data())) { 
       // File not accessible
-      Warning("Helper::LoadSource", "File %s not accessible", path.Data());
+      Warning("Helper::AuxFile", "File %s not accessible", path.Data());
       return false;
     }
+    TString base(gSystem->BaseName(path.Data()));
+    if (gSystem->AccessPathName(base.Data()) == 0) { 
+      // File or link exists - remove it 
+      if (gSystem->Unlink(base) != 0) { 
+       Error("Helper::AuxFile", "Failed to remove old %s", base.Data());
+       return false;
+      }
+    }
     gSystem->Exec(Form("ln -s %s .", path.Data()));
     return true;
   }