source: trunk/Mars/macros/tar.C@ 18679

Last change on this file since 18679 was 5189, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 2.0 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2004
21!
22!
23\* ======================================================================== */
24
25///////////////////////////////////////////////////////////////////////////
26//
27// tar.C
28// =====
29//
30// Service script. used to create the tar archive for an release. It makes
31// sure that the correct files are included and the name of the archive is
32// the name of the current directory (+.tar.gz)
33//
34///////////////////////////////////////////////////////////////////////////
35void tar()
36{
37 TString dir = gSystem->pwd();
38
39 Int_t slash = dir.Last('/');
40
41 TString name = &dir[slash+1];
42
43 if (!gSystem->AccessPathName("../"+name+".tar"))
44 {
45 cout << "File '../" << name << ".tar' existing." << endl;
46 return;
47 }
48
49 if (!gSystem->AccessPathName("../"+name+".tar.gz"))
50 {
51 cout << "File '../" << name << ".tar.gz' existing." << endl;
52 return;
53 }
54
55 gSystem->cd("..");
56
57 TString cmd = "tar cvf "+name+".tar --exclude=Makefile.depend --exclude=Root --exclude=Tag --exclude=mtemp "+name+"/.rootrc "+name+"/*";
58
59 cout << "Executing: " << cmd << endl;
60
61 gSystem->Exec(cmd);
62 gSystem->Exec("gzip -9 "+name+".tar");
63
64 gSystem->cd(name);
65}
Note: See TracBrowser for help on using the repository browser.