57 fVersion =
"v5-16-00";
58 fPlatform =
"Linux-i686";
59 fAliEnMainPackageDir =
"/alice/packages";
60 fInstallationDirectory =
"/var/tmp/alien/packages";
61 fPostInstallCommand =
"post_install";
65 Info (
"TAlienPackage",
66 "\tPackage=%s Version=%s Platform=%s Installdir=%s AlienInstalldir=%s PostInstall=%s",
67 fName.Data (), fVersion.Data (), fPlatform.Data (),
68 fInstallationDirectory.Data (), fAliEnMainPackageDir.Data (),
69 fPostInstallCommand.Data ());
74 fInstallList =
new TList ();
76 fPackages =
new TList ();
79 fPackages->SetOwner (
kFALSE);
87 const char *installationdirectory) :
88 fInstallList (0), fPackages (0), fDebugLevel (0)
102 Info (
"TAlienPackage",
103 "\tPackage=%s Version=%s Platform=%s Installdir=%s AlienInstalldir=%s PostInstall=%s",
104 name, version, platform, installationdirectory,
124 Info (
"~TAlienPackage",
"\tDestr: Package=%s Version=%s Platform=%s",
136 Info (
"Install",
"\t\tInstalling Package=%s Version=%s Platform=%s",
148 gSystem->
Exec(
Form(
"mkdir -p %s/%s/%s/%s ; touch %s/%s/%s/%s/.safeguard",
163 Form (
"%s/%s/%s/.alienEnvironment %s/%s/%s ",
175 (
"test -e %s/%s/%s/%s/.safeguard && rm -rf %s/%s/%s",
209 Info (
"CheckDirectories",
"\t%s/%s exists.", s.
Data (), name.
Data ());
214 Info (
"CheckDirectories",
"\t%s/%s exist.", s.
Data (), version.
Data ());
225 Error (
"CheckDirectories",
"\t%s/%s does not exist.", s.
Data (), version.
Data ());
228 Info (
"CheckDirectories",
"\t%s/%s exists.", s.
Data (), name.
Data ());
254 (
"showTagValue -z %s/%s/%s PackageDef",
258 if (post_install.IsNull () ==
kTRUE) {
261 "\tNo post install procedure defined in AliEn.");
267 "\tDownloading PostInstall for Package=%s Version=%s",
273 Error (
"PostInstall",
"\tCannot download the PostInstall script %s!", post_install.Data ());
286 "\tExecuted PostInstall for Package=%s Version=%s ", name.
Data (),
304 TAlienPackage *
package = (TAlienPackage *) fPackages->At (j);
305 fullline += package->GetEnable ();
311 Info(
"Exec",
"\t\tExecuting Package=%s Version=%s \"%s\"",
fName.
Data (),
331 if (strDep.IsNull () ==
kTRUE) {
333 Info (
"CheckDepencencies",
"\tFound no dependencies ... ");
340 TObjArray *strDeps = strDep.Tokenize (
",");
343 Info (
"CheckDepencencies",
"\tFound %d dependencies ... ",
352 Info (
"CheckDependencies",
"\t[%d] Dep. Package=%s", i,
362 TString strObjPackage, strObjVersion;
366 Warning(
"CheckDepencencies",
"version string not found for j=%d (%s)", j, strObj->
GetName());
370 Warning(
"CheckDepencencies",
"package string not found for j=%d (%s)", j, strObj->
GetName());
375 Info (
"CheckDepencencies",
"\t[%d] Name=%s Version=%s", j,
376 strObjPackage.
Data(), strObjVersion.
Data());
390 Info (
"InstallSinglePackage",
"\t%s %s", name.
Data (), version.
Data ());
410 Warning (
"InstallSinglePackage",
411 "\tPackage=%s exists in /%s directory.",
413 Warning (
"InstallSinglePackage",
414 "\tYou might use function UnInstall() before Enable(), or do ReInstall() !!!!");
423 Info (
"InstallSinglePackage",
"\tCopying from alien://%s to %s ",
424 s1.Data (), s5.
Data ());
429 Error (
"InstallSinglePackage",
"\tCouldn't create directory %s !",
435 Error (
"InstallSinglePackage",
"\tCouldn't copy alien://%s -> %s",
436 s1.Data (), s5.
Data ());
441 Info (
"InstallSinglePackage",
"\tEntering directory %s ", s7.
Data ());
444 Error (
"InstallSinglePackage",
"\tCannot change into directory %s",
450 Info (
"InstallSinglePackage",
"\tUnpacking the package %s ...",
456 Info (
"InstallSinglePackage",
"\tUnpacking the package %s DONE ...",
462 Info (
"InstallSinglePackage",
463 "\tCopying PostInstall alien://%s/%s -> %s", s6.
Data (),
467 Error (
"InstallSinglePackage",
468 "\tPostInstall procedure failed for package %s failed!",
483 Info (
"InstallAllPackages",
"\tPackage=%s Version=%s",
fName.
Data (),
487 TAlienPackage *
package = (TAlienPackage *) fPackages->At (j);
488 if (package && (package !=
this))
501 Info (
"InstallAllPackages",
"\tPackage=%s Version=%s",
519 if (!newpackage->
Enable ()) {
const char * GetName() const
Returns name of object.
virtual Int_t GetEntries() const
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
TString fInstallationDirectory
Collectable string class.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
TString fPostInstallCommand
Bool_t Enable()
Install/enable an AliEn package on the local computer.
virtual const char * GetFileName(UInt_t) const
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
const char * GetEnable()
Return shell command to enable package.
TString fAliEnMainPackageDir
virtual ~TAlienPackage()
Destructor.
ClassImp(TAlienPackage) TAlienPackage
Default constructor of a AliEn package constructing a ROOT:v5-16-00 for Linux-i686.
Bool_t UnInstall()
Uninstall a package e.g. remove it from the local disk.
TString GetPlatform() const
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
virtual Bool_t Cp(const char *dst, Bool_t progressbar=kTRUE, UInt_t buffersize=1000000)
Allows to copy this file to the dst URL.
const char * Data() const
static TGrid * Connect(const char *grid, const char *uid=0, const char *pw=0, const char *options=0)
void Info(const char *location, const char *msgfmt,...)
std::vector< std::vector< double > > Data
void Error(const char *location, const char *msgfmt,...)
Bool_t PostInstall(TString name, TString version)
Execute post_install procedure for a package.
TString GetString() const
R__EXTERN TSystem * gSystem
char * Form(const char *fmt,...)
virtual Int_t Exec(const char *shellcmd)
Execute a command.
void Warning(const char *location, const char *msgfmt,...)
Bool_t InstallSinglePackage(TString name, TString version, Bool_t isDep=kFALSE)
Install a single package.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
virtual const char * GetKey(UInt_t, const char *) const
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.
Int_t GetEntries() const
Return the number of objects in array (i.e.
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Mother of all ROOT objects.
virtual void Add(TObject *obj)
virtual TGridResult * Ls(const char *="", Option_t *="", Bool_t=kFALSE)
Bool_t CheckDirectories(TString name, TString version)
Check the name and version directory of package/version given.
TObject * At(Int_t idx) const
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 TGridResult * Command(const char *, Bool_t=kFALSE, UInt_t=2)
TString GetAliEnMainPackageDir() const