Logo ROOT   6.10/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 #include "Rtypes.h"
16 #include "TList.h"
17 #include "TGrid.h"
18 
19 //////////////////////////////////////////////////////////////////////////
20 // //
21 // TAlienPackage //
22 // //
23 // Class providing package management functionality like the AliEn //
24 // Package Management System. //
25 // Allows to setup software packages on a local desktop like in the //
26 // GRID environment. //
27 // //
28 //////////////////////////////////////////////////////////////////////////
29 
31 
32 private:
33  TString fName; // package principal name
34  TString fVersion; // package version
35  TString fPlatform; // package platform
36  TString fInstallationDirectory; // installation directory
37  TString fAliEnMainPackageDir; // path to alien packages in the AliEn FC
38  TString fPostInstallCommand; // command to execute for postinstall
39  TString fEnableCommand; // command to enable the package
40  TList *fInstallList; // package list with names of dependency packages
41  TList *fPackages; // package list TPackage with this and dependency packages
42  Int_t fDebugLevel; // internal debug level
43  Bool_t fEnabled; // true if package is enabled for execution
44 
45  Bool_t PostInstall (TString name, TString version); // runs the postinstall procedure for this package
46  Bool_t InstallSinglePackage (TString name, TString version, Bool_t isDep = kFALSE); // installs the defined package without dependencies
47  Bool_t InstallAllPackages (); // installs the defined package + all dependency packages
48 
49  public:
50  TAlienPackage ();
51 
52  TAlienPackage(const char *name,
53  const char *version,
54  const char *platform,
55  const char *installationdirectory = "/var/tmp/alien/packages");
56 
57  virtual ~ TAlienPackage ();
58 
59  Bool_t Enable(); // install/enable the defined package
60  const char *GetEnable(); // return shell command to enable package
61  Bool_t Exec(const char *cmdline); // execute <cmd> with this package
62  Bool_t UnInstall(); // uninstall the defined package
63  Bool_t ReInstall(); // reinstall the defined package
64  Bool_t CheckDependencies(); // get all the dependencies of a package
65 
66  Bool_t IsDirectory(const char *dir1, const char *str); // check for <str> in GRID directory <dir1>
67  Bool_t CheckDirectories(TString name, TString version); // check that the defined package is existing as an alien package directory
68 
69  void SetName(const TString & theValue) { fName = theValue; }
70  // set the name of the package
71  TString GetName() const { return fName; }
72  // get the name of the package
73  void SetVersion(const TString & theValue) { fVersion = theValue; }
74  // set the version of the package
75  TString GetVersion() const { return fVersion; }
76  // get the version of the package
77  void SetPlatform(const TString & theValue) { fPlatform = theValue; }
78  // set the platform for the package
79  TString GetPlatform() const { return fPlatform; }
80  // get the platform for the package
81  void SetInstallationDirectory(const TString & theValue) { fInstallationDirectory = theValue; }
82  // set the installation directory
84  // get the installation directory
85  void SetAliEnMainPackageDir(const TString & theValue) { fAliEnMainPackageDir = theValue; }
86  // set the alien path to look for the named package
88  // get the alien path to look for the named package
89  void SetInstallList(TList * theValue) { fInstallList = theValue; }
90  // set the install(dependency) package list
91  TList *GetInstallList() const { return fInstallList; }
92  // get the install(dependency) package list;
93  void SetDebugLevel(Int_t & theValue) { fDebugLevel = theValue; }
94  // set the internal debug level
96  // get the internal debug level
97 
98  ClassDef (TAlienPackage, 0); // Alien package interface
99 };
100 
101 #endif
TString fVersion
Definition: TAlienPackage.h:34
TString GetVersion() const
Definition: TAlienPackage.h:75
TString fInstallationDirectory
Definition: TAlienPackage.h:36
void SetName(const TString &theValue)
Definition: TAlienPackage.h:69
TString fPostInstallCommand
Definition: TAlienPackage.h:38
Bool_t Enable()
Install/enable an AliEn package on the local computer.
TString GetAliEnMainPackageDir() const
Definition: TAlienPackage.h:87
Basic string class.
Definition: TString.h:129
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:37
Bool_t UnInstall()
Uninstall a package e.g. remove it from the local disk.
void SetVersion(const TString &theValue)
Definition: TAlienPackage.h:73
Int_t GetDebugLevel()
Definition: TAlienPackage.h:95
void SetDebugLevel(Int_t &theValue)
Definition: TAlienPackage.h:93
void SetAliEnMainPackageDir(const TString &theValue)
Definition: TAlienPackage.h:85
#define ClassDef(name, id)
Definition: Rtypes.h:297
void SetInstallationDirectory(const TString &theValue)
Definition: TAlienPackage.h:81
void SetPlatform(const TString &theValue)
Definition: TAlienPackage.h:77
A doubly linked list.
Definition: TList.h:43
Bool_t PostInstall(TString name, TString version)
Execute post_install procedure for a package.
TList * GetInstallList() const
Definition: TAlienPackage.h:91
TString GetPlatform() const
Definition: TAlienPackage.h:79
Bool_t InstallSinglePackage(TString name, TString version, Bool_t isDep=kFALSE)
Install a single package.
const Bool_t kFALSE
Definition: RtypesCore.h:92
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:39
TAlienPackage()
Default constructor of a AliEn package constructing a ROOT:v5-16-00 for Linux-i686.
TList * fInstallList
Definition: TAlienPackage.h:40
TList * fPackages
Definition: TAlienPackage.h:41
TString fPlatform
Definition: TAlienPackage.h:35
TString GetInstallationDirectory() const
Definition: TAlienPackage.h:83
Bool_t CheckDirectories(TString name, TString version)
Check the name and version directory of package/version given.
TString GetName() const
Definition: TAlienPackage.h:71
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.
virtual ~ TAlienPackage()
void SetInstallList(TList *theValue)
Definition: TAlienPackage.h:89