TAlienPackage.h

Go to the documentation of this file.
00001 // @(#)root/alien:$Id: TAlienPackage.h 23863 2008-05-15 16:16:03Z rdm $
00002 // Author: Lucia Jancurova/Andreas-Joachim Peters 1/10/2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TAlienPackage
00013 #define ROOT_TAlienPackage
00014 
00015 #ifndef ROOT_Rtypes
00016 #include "Rtypes.h"
00017 #endif
00018 #ifndef ROOT_TList
00019 #include "TList.h"
00020 #endif
00021 #ifndef ROOT_TGrid
00022 #include "TGrid.h"
00023 #endif
00024 
00025 //////////////////////////////////////////////////////////////////////////
00026 //                                                                      //
00027 // TAlienPackage                                                        //
00028 //                                                                      //
00029 // Class providing package management functionality like the AliEn      //
00030 // Package Management System.                                           //
00031 // Allows to setup software packages on a local desktop like in the     //
00032 // GRID environment.                                                    //
00033 //                                                                      //
00034 //////////////////////////////////////////////////////////////////////////
00035 
00036 class TAlienPackage {
00037 
00038 private:
00039    TString fName;                   // package principal name
00040    TString fVersion;                // package version
00041    TString fPlatform;               // package platform
00042    TString fInstallationDirectory;  // installation directory
00043    TString fAliEnMainPackageDir;    // path to alien packages in the AliEn FC
00044    TString fPostInstallCommand;     // command to execute for postinstall
00045    TString fEnableCommand;          // command to enable the package
00046    TList  *fInstallList;            // package list with names of dependency packages
00047    TList  *fPackages;               // package list TPackage with this and dependency packages
00048    Int_t  fDebugLevel;              // internal debug level
00049    Bool_t fEnabled;                 // true if package is enabled for execution
00050 
00051    Bool_t PostInstall (TString name, TString version);                                 // runs the postinstall procedure for this package
00052    Bool_t InstallSinglePackage (TString name, TString version, Bool_t isDep = kFALSE); // installs the defined package without dependencies
00053    Bool_t InstallAllPackages (); // installs the defined package + all dependency packages
00054 
00055  public:
00056    TAlienPackage ();
00057 
00058    TAlienPackage(const char *name,
00059                  const char *version,
00060                  const char *platform,
00061                  const char *installationdirectory = "/var/tmp/alien/packages");
00062 
00063    virtual ~ TAlienPackage ();
00064 
00065    Bool_t Enable();            // install/enable the defined package
00066    const char *GetEnable();    // return shell command to enable package
00067    Bool_t Exec(const char *cmdline);  // execute <cmd> with this package
00068    Bool_t UnInstall();         // uninstall the defined package
00069    Bool_t ReInstall();         // reinstall the defined package
00070    Bool_t CheckDependencies(); // get all the dependencies of a package
00071 
00072    Bool_t IsDirectory(const char *dir1, const char *str);  // check for <str> in GRID directory <dir1>
00073    Bool_t CheckDirectories(TString name, TString version); // check that the defined package is existing as an alien package directory
00074 
00075    void SetName(const TString & theValue) { fName = theValue; }
00076    // set the name of the package
00077    TString GetName() const { return fName; }
00078    // get the name of the package
00079    void SetVersion(const TString & theValue) { fVersion = theValue; }
00080    // set the version of the package
00081    TString GetVersion() const { return fVersion; }
00082    // get the version of the package
00083    void SetPlatform(const TString & theValue) { fPlatform = theValue; }
00084    // set the platform for the package
00085    TString GetPlatform() const { return fPlatform; }
00086    // get the platform for the package
00087    void SetInstallationDirectory(const TString & theValue) { fInstallationDirectory = theValue; }
00088    // set the installation directory
00089    TString GetInstallationDirectory() const { return fInstallationDirectory; }
00090    // get the installation directory
00091    void SetAliEnMainPackageDir(const TString & theValue) { fAliEnMainPackageDir = theValue; }
00092    // set the alien path to look for the named package
00093    TString GetAliEnMainPackageDir() const { return fAliEnMainPackageDir; }
00094    // get the alien path to look for the named package
00095    void SetInstallList(TList * theValue) { fInstallList = theValue; }
00096    // set the install(dependency) package list
00097    TList *GetInstallList() const { return fInstallList; }
00098    // get the install(dependency) package list;
00099    void SetDebugLevel(Int_t & theValue) { fDebugLevel = theValue; }
00100    // set the internal debug level
00101    Int_t GetDebugLevel() { return fDebugLevel; }
00102    // get the internal debug level
00103 
00104    ClassDef (TAlienPackage, 0);   // Alien package interface
00105 };
00106 
00107 #endif

Generated on Tue Jul 5 14:45:28 2011 for ROOT_528-00b_version by  doxygen 1.5.1