Logo ROOT   6.07/09
Reference Guide
TAlienPackage.h
Go to the documentation of this file.
1 // @(#)root/alien:$Id$
2 // Author: Lucia Jancurova/Andreas-Joachim Peters 1/10/2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TAlienPackage
13 #define ROOT_TAlienPackage
14 
15 #ifndef ROOT_Rtypes
16 #include "Rtypes.h"
17 #endif
18 #ifndef ROOT_TList
19 #include "TList.h"
20 #endif
21 #ifndef ROOT_TGrid
22 #include "TGrid.h"
23 #endif
24 
25 //////////////////////////////////////////////////////////////////////////
26 // //
27 // TAlienPackage //
28 // //
29 // Class providing package management functionality like the AliEn //
30 // Package Management System. //
31 // Allows to setup software packages on a local desktop like in the //
32 // GRID environment. //
33 // //
34 //////////////////////////////////////////////////////////////////////////
35 
37 
38 private:
39  TString fName; // package principal name
40  TString fVersion; // package version
41  TString fPlatform; // package platform
42  TString fInstallationDirectory; // installation directory
43  TString fAliEnMainPackageDir; // path to alien packages in the AliEn FC
44  TString fPostInstallCommand; // command to execute for postinstall
45  TString fEnableCommand; // command to enable the package
46  TList *fInstallList; // package list with names of dependency packages
47  TList *fPackages; // package list TPackage with this and dependency packages
48  Int_t fDebugLevel; // internal debug level
49  Bool_t fEnabled; // true if package is enabled for execution
50 
51  Bool_t PostInstall (TString name, TString version); // runs the postinstall procedure for this package
52  Bool_t InstallSinglePackage (TString name, TString version, Bool_t isDep = kFALSE); // installs the defined package without dependencies
53  Bool_t InstallAllPackages (); // installs the defined package + all dependency packages
54 
55  public:
56  TAlienPackage ();
57 
58  TAlienPackage(const char *name,
59  const char *version,
60  const char *platform,
61  const char *installationdirectory = "/var/tmp/alien/packages");
62 
63  virtual ~ TAlienPackage ();
64 
65  Bool_t Enable(); // install/enable the defined package
66  const char *GetEnable(); // return shell command to enable package
67  Bool_t Exec(const char *cmdline); // execute <cmd> with this package
68  Bool_t UnInstall(); // uninstall the defined package
69  Bool_t ReInstall(); // reinstall the defined package
70  Bool_t CheckDependencies(); // get all the dependencies of a package
71 
72  Bool_t IsDirectory(const char *dir1, const char *str); // check for <str> in GRID directory <dir1>
73  Bool_t CheckDirectories(TString name, TString version); // check that the defined package is existing as an alien package directory
74 
75  void SetName(const TString & theValue) { fName = theValue; }
76  // set the name of the package
77  TString GetName() const { return fName; }
78  // get the name of the package
79  void SetVersion(const TString & theValue) { fVersion = theValue; }
80  // set the version of the package
81  TString GetVersion() const { return fVersion; }
82  // get the version of the package
83  void SetPlatform(const TString & theValue) { fPlatform = theValue; }
84  // set the platform for the package
85  TString GetPlatform() const { return fPlatform; }
86  // get the platform for the package
87  void SetInstallationDirectory(const TString & theValue) { fInstallationDirectory = theValue; }
88  // set the installation directory
90  // get the installation directory
91  void SetAliEnMainPackageDir(const TString & theValue) { fAliEnMainPackageDir = theValue; }
92  // set the alien path to look for the named package
94  // get the alien path to look for the named package
95  void SetInstallList(TList * theValue) { fInstallList = theValue; }
96  // set the install(dependency) package list
97  TList *GetInstallList() const { return fInstallList; }
98  // get the install(dependency) package list;
99  void SetDebugLevel(Int_t & theValue) { fDebugLevel = theValue; }
100  // set the internal debug level
102  // get the internal debug level
103 
104  ClassDef (TAlienPackage, 0); // Alien package interface
105 };
106 
107 #endif
TString fVersion
Definition: TAlienPackage.h:40
TString fInstallationDirectory
Definition: TAlienPackage.h:42
void SetName(const TString &theValue)
Definition: TAlienPackage.h:75
TString GetInstallationDirectory() const
Definition: TAlienPackage.h:89
TString fPostInstallCommand
Definition: TAlienPackage.h:44
Bool_t Enable()
Install/enable an AliEn package on the local computer.
Basic string class.
Definition: TString.h:137
const char * GetEnable()
Return shell command to enable package.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TString fAliEnMainPackageDir
Definition: TAlienPackage.h:43
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual ~TAlienPackage()
Destructor.
Bool_t UnInstall()
Uninstall a package e.g. remove it from the local disk.
TString GetPlatform() const
Definition: TAlienPackage.h:85
void SetVersion(const TString &theValue)
Definition: TAlienPackage.h:79
Int_t GetDebugLevel()
TString GetName() const
Definition: TAlienPackage.h:77
void SetDebugLevel(Int_t &theValue)
Definition: TAlienPackage.h:99
void SetAliEnMainPackageDir(const TString &theValue)
Definition: TAlienPackage.h:91
#define ClassDef(name, id)
Definition: Rtypes.h:254
void SetInstallationDirectory(const TString &theValue)
Definition: TAlienPackage.h:87
void SetPlatform(const TString &theValue)
Definition: TAlienPackage.h:83
A doubly linked list.
Definition: TList.h:47
Bool_t PostInstall(TString name, TString version)
Execute post_install procedure for a package.
Bool_t InstallSinglePackage(TString name, TString version, Bool_t isDep=kFALSE)
Install a single package.
TString GetVersion() const
Definition: TAlienPackage.h:81
TList * GetInstallList() const
Definition: TAlienPackage.h:97
Bool_t ReInstall()
Reinstalls a package e.g. uninstall + install.
Bool_t CheckDependencies()
Check the dependency packages of this package.
Bool_t InstallAllPackages()
Installs a package and all its direct dependencies.
TString fEnableCommand
Definition: TAlienPackage.h:45
TAlienPackage()
Default constructor of a AliEn package constructing a ROOT:v5-16-00 for Linux-i686.
TList * fInstallList
Definition: TAlienPackage.h:46
TList * fPackages
Definition: TAlienPackage.h:47
TString fPlatform
Definition: TAlienPackage.h:41
Bool_t CheckDirectories(TString name, TString version)
Check the name and version directory of package/version given.
Bool_t IsDirectory(const char *dir1, const char *str)
Check that <str> is listed in GRID directory <dir1>.
Bool_t Exec(const char *cmdline)
Execute package command.
char name[80]
Definition: TGX11.cxx:109
void SetInstallList(TList *theValue)
Definition: TAlienPackage.h:95
TString GetAliEnMainPackageDir() const
Definition: TAlienPackage.h:93