perfsonar-dev - perfsonar: r2582 - trunk/perfsonar-bundle
Subject: perfsonar development work
List archive
- From:
- To:
- Subject: perfsonar: r2582 - trunk/perfsonar-bundle
- Date: Tue, 31 Jul 2007 00:15:41 -0400
Author: fernandes
Date: 2007-07-31 00:15:41 -0400 (Tue, 31 Jul 2007)
New Revision: 2582
Modified:
trunk/perfsonar-bundle/install.pl
Log:
New version of the installer script with some dependency check.
Modified: trunk/perfsonar-bundle/install.pl
===================================================================
--- trunk/perfsonar-bundle/install.pl 2007-07-27 15:02:19 UTC (rev 2581)
+++ trunk/perfsonar-bundle/install.pl 2007-07-31 04:15:41 UTC (rev 2582)
@@ -6,6 +6,15 @@
package perfsonar;
use strict;
+
+my $error;
+&checkDeps();
+
+if($error){
+ print "Please fix the dependencies problems and then try again.\n";
+ exit;
+}
+
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $req =
@@ -1035,3 +1044,45 @@
chdir($installDir);
}
}
+
+sub checkDeps {
+ if(!(exists($ENV{'JAVA_HOME'}))){
+ &depError("Dependency failure: In order for the installer to work
correctly you need to set the JAVA_HOME enviroment variable.\n");
+ }else{
+ open(JAVA, "$ENV{'JAVA_HOME'}/bin/java -version 2>&1 |")
+ or &depError("Dependency failure: JAVA_HOME enviroment variable
doesn't seem to be valid, couldn't execute java.\n");
+
+ if(!$error){
+ my $java = <JAVA>;
+ if(!($java =~ /\"1\.[56]/)){
+ &depError("Dependency failure: Java needs to be version 1.5
or newer.\n");
+ }
+
+ open(ANT, "ant -version |") or &depError("Dependency failure:
apache ant must be in the user execution path.\n");
+ my $ant = <ANT>;
+ if(!($ant =~ /version 1\.6/)){
+ &depError("Dependency failure: Apache ant needs to be
version 1.6 or newer.\n");
+ }
+ close(ANT);
+
+ }
+ close(JAVA);
+ }
+
+ if(system("wget -V > /dev/null") != 0){
+ &depError("Dependency failure: wget must be in the user execution
path.\n");
+ }
+
+ eval {
+ require LWP;
+ };
+ if ($@) {
+ &depError("Dependency failure: couldn't locate perl LWP module.\n");
+ }
+
+}
+sub depError(){
+ print @_;
+ $error = 1;
+}
+
- perfsonar: r2582 - trunk/perfsonar-bundle, svnlog, 07/31/2007
Archive powered by MHonArc 2.6.16.