]>
Commit | Line | Data |
---|---|---|
a24be56b | 1 | const char* GetARversion(){ |
2 | //void GetARversion(){ | |
3 | // Returns AliRoot version extracted from what is found in the | |
4 | // $ALICE_ROOT/CVS/ directory | |
5 | // | |
6 | TString vAli; | |
7 | const char* vFile = gSystem->ExpandPathName("$ALICE_ROOT/CVS/Tag"); | |
8 | if(gSystem->AccessPathName(vFile)){ | |
9 | vAli="HEAD"; | |
10 | }else{ | |
11 | TFile *fv= TFile::Open("$ALICE_ROOT/CVS/Tag?filetype=raw","READ"); | |
12 | Int_t size = fv->GetSize(); | |
13 | char *buf = new Char_t[size]; | |
14 | memset(buf, '\0', size); | |
15 | fv->Seek(0); | |
16 | if ( fv->ReadBuffer(buf, size) ) { | |
17 | Warning("GetARversion.C","Error reading AliRoot version from file to buffer!"); | |
18 | vAli=""; | |
19 | } | |
20 | vAli = buf; | |
21 | if(vAli.Contains('\n')) vAli.Remove(vAli.First('\n')); | |
22 | if(vAli.Contains('v')) vAli.Remove(0,vAli.First('v')); | |
23 | } | |
24 | delete vFile; | |
25 | return vAli.Data(); | |
26 | } | |
27 |