PAR: includes from previously enabled PARfiles
[u/mrichter/AliRoot.git] / macros / DiffGeomBeforeTagging.C
index d73cd53..06c890e 100644 (file)
 #include <TGeoManager.h>
 #include <TString.h>
 #include <TInterpreter.h>
+#include "iostream"
+#include "fstream"
+using namespace std;
 #endif
 
-Bool_t DiffGeometry(const char* recipient, const char* cdbUri="local://$ALICE_ROOT/OCDB", const char* cfgFile="$ALICE_ROOT/macros/Config.C"){
+Bool_t DiffGeomBeforeTagging(const char* recipient, const char* cdbUri="local://$ALICE_ROOT/OCDB", const char* cfgFile="$ALICE_ROOT/macros/Config.C"){
        // Compare the geometry created in the current AliRoot with the one
        // in the OCDB directory of the current aliroot. If they differ,
         // warn the recipients to update the geometry in $ALICE_ROOT/OCDB
@@ -74,9 +77,9 @@ Bool_t DiffGeometry(const char* recipient, const char* cdbUri="local://$ALICE_RO
 
                // Get root and AliRoot versions
                const char* rootv = gROOT->GetVersion();
-               TString av(ALIROOT_SVN_BRANCH);
-               Int_t revnum = ALIROOT_SVN_REVISION;
-               Printf("root version: %s.  AliRoot %s, revision number %d",rootv,av.Data(),revnum);
+               TString av(ALIROOT_BRANCH);
+               TString revnum(ALIROOT_REVISION);
+               Printf("root version: %s.  AliRoot %s, revision number %s",rootv,av.Data(),revnum);
 
                // create and send mail
                TString subject(Form("AliRoot revision %d is about to be tagged and the geometry changed!",revnum));
@@ -109,8 +112,9 @@ Bool_t DiffGeometry(const char* recipient, const char* cdbUri="local://$ALICE_RO
                mailBody.close();
 
                Printf("Sending mail to \"%s\"",recipients.Data());
+               TString mailCommand("");
                 if(recipients.CountChar(',')==0){
-                        TString mailCommand = Form("mail -s \"%s\" %s < %s",
+                        mailCommand = Form("mail -s \"%s\" %s < %s",
                                         subject.Data(),
                                         recipients.Data(),
                                         bodyFileName.Data());
@@ -118,7 +122,7 @@ Bool_t DiffGeometry(const char* recipient, const char* cdbUri="local://$ALICE_RO
                         TString cc(recipients);
                         recipients.Remove(recipients.First(','));
                         cc.Replace(0,cc.First(',')+1,"");
-                        TString mailCommand = Form("mail -s \"%s\" -c %s %s < %s",
+                        mailCommand = Form("mail -s \"%s\" -c %s %s < %s",
                                         subject.Data(),
                                         cc.Data(),
                                         recipients.Data(),
@@ -126,8 +130,10 @@ Bool_t DiffGeometry(const char* recipient, const char* cdbUri="local://$ALICE_RO
                 }
 
                 Bool_t result = gSystem->Exec(mailCommand.Data());
+               return result;
         }else{
                 Printf("There are no changes between the geometry generated with current code and the one in the current OCDB.");
         }
+       return kTRUE;
 }