Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2248 - trunk/perfsonar-bundle

Subject: perfsonar development work

List archive

perfsonar: r2248 - trunk/perfsonar-bundle


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2248 - trunk/perfsonar-bundle
  • Date: Fri, 16 Mar 2007 17:20:01 -0400

Author: fernandes
Date: 2007-03-16 17:20:00 -0400 (Fri, 16 Mar 2007)
New Revision: 2248

Modified:
trunk/perfsonar-bundle/install.pl
Log:
Added -q switch enabling/disabling.
Last version also had some code in the wrong place



Modified: trunk/perfsonar-bundle/install.pl
===================================================================
--- trunk/perfsonar-bundle/install.pl 2007-03-16 16:15:44 UTC (rev 2247)
+++ trunk/perfsonar-bundle/install.pl 2007-03-16 21:20:00 UTC (rev 2248)
@@ -31,6 +31,7 @@
my @dirs;
my $modification = '';
my $isPerl = '';
+my $verbose = '';

my %serviceDisplayMap = (
RRDMA() => "RRD MA",
@@ -254,52 +255,45 @@
my $i;
my $serviceName;

- $menu = "\nI'I couldn't detect the type of the service you want \n";
- $menu .= "to modify. You'll need to do this manually: \n";
- $menu .= "Please choose a number [enter to exit]: ";
- while ($invalid){
- print $menu;
- $service = <STDIN>;
+ &getWebapps();

- &getWebapps();
+ &getServiceDir();

- &getServiceDir();
+ for my $key ( keys %serviceMap ) {
+ if ($serviceDir =~ /$serviceMap{$key}/){
+ $service = $key;
+ }
+ }

- for my $key ( keys %serviceMap ) {
- if ($serviceDir =~ /$serviceMap{$key}/){
- $service = $key;
- }
- }
+ if ($service){
+ &installDir();
+ }else {
+ $menu = "\nI couldn't detect the type of the service you want \n";
+ $menu .= "to modify. You'll need to do this manually: \n";
+ $menu .= "1. RRD-MA\n";
+ $menu .= "2. SQL-MA\n";
+ $menu .= "3. SSH/Telnet MP\n";
+ $menu .= "4. Commande Line MP\n";
+ $menu .= "Please choose a number [enter to exit]: ";
+ while ($invalid){
+ print $menu;
+ $service = <STDIN>;
+ chomp($service);

- if ($service){
- &installDir();
- }else {
- $menu = "\nI couldn't detect the type of the service you want
\n";
- $menu .= "to modify. You'll need to do this manually: \n";
- $menu .= "1. RRD-MA\n";
- $menu .= "2. SQL-MA\n";
- $menu .= "3. SSH/Telnet MP\n";
- $menu .= "4. Commande Line MP\n";
- $menu .= "Please choose a number [enter to exit]: ";
- while ($invalid){
- print $menu;
- $service = <STDIN>;
- chomp($service);
+ if ($service == ""){
+ exit;
+ }

- if ($service == ""){
- exit;
- }
-
- if (!($service =~ /^[1234]$/)){
- print "\nPlease type a valid number.\n\n";
- }else{
- $invalid = 0;
- }
+ if (!($service =~ /^[1234]$/)){
+ print "\nPlease type a valid number.\n\n";
+ }else{
+ $invalid = 0;
}
- &installDir();
}
+ &installDir();
}
}
+
sub getServiceDir() {
my $menu;
my $choice;
@@ -688,6 +682,10 @@
}

sub basic(){
+ my $verbose = '';
+ if ($service == SSH()){
+ $verbose = 'true';
+ }

print "\nStarting installation for service
$serviceDisplayMap{$service}...\n";
&action('pre-install');
@@ -702,12 +700,12 @@
}
}

- &action('configure');
+ &action('configure', $verbose);

if ($returnCode != 0){
&error();
if ($answer =~ /^y$/ or $answer =~ /^yes$/){
- &action('configure');
+ &action('configure', $verbose);
}
if ($returnCode != 0){
return;
@@ -753,14 +751,14 @@
}

sub advanced(){
-
my $menu = "\nAvailable actions: \n";
$menu .= "1. pre-install\n";
$menu .= "2. configure\n";
$menu .= "3. deploy\n";
$menu .= "4. test\n";
$menu .= "5. undeploy\n";
- $menu .= "6. restart script\n";
+ $menu .= "6. enable/disable verbose\n";
+ $menu .= "7. restart script\n";
$menu .= "0. exit\n";
$menu .= "Please choose a number: ";
print $menu;
@@ -769,14 +767,20 @@
chomp($choice);

switch ($choice){
- case 1 { print "\nExecuting action pre-install...\n\n";
&action('pre-install'); }
- case 2 { print "\nExecuting action configure...\n\n";
&action('configure'); }
- case 3 { print "\nExecuting action deploy...\n\n";
&action('deploy'); if (!$isPerl) { &copyConst(); } }
- case 4 { print "\nExecuting action test...\n\n";
&action('test'); }
- case 5 { print "\nExecuting action undeploy...\n\n";
&action('undeploy'); }
- case 6 { return; }
+ case 1 { print "\nExecuting action pre-install...\n\n";
&action('pre-install', $verbose); }
+ case 2 { print "\nExecuting action configure...\n\n";
&action('configure', $verbose); }
+ case 3 {
+ print "\nExecuting action deploy...\n\n";
&action('deploy', $verbose);
+ if (!$isPerl) { &copyConst(); }
+ }
+ case 4 { print "\nExecuting action test...\n\n";
&action('test', $verbose); }
+ case 5 { print "\nExecuting action undeploy...\n\n";
&action('undeploy', $verbose); }
+ case 6 {
+ if ($verbose) { $verbose = 0; print "\nVerbose
installation has been disabled.\n"; }
+ else { $verbose = 'true'; print "\nVerbose
installation has been enabled.\n"; }
+ }
+ case 7 { return; }
case 0 { exit; }
- case "" { exit; }
else { print "\nPlease type a valid option.\n"; }
}

@@ -786,8 +790,13 @@

sub action(){
my $target = shift(@_);
+ my $notQuiet = shift(@_);
if (!$isPerl){
- $returnCode = system "ant -q -f " . $installDir . "ant/build.xml " .
$target;
+ if ($notQuiet){
+ $returnCode = system "ant -f " . $installDir . "ant/build.xml "
. $target;
+ }else{
+ $returnCode = system "ant -q -f " . $installDir . "ant/build.xml
" . $target;
+ }
}else{
chdir($installDir);
$returnCode = system "perl ".$target;



  • perfsonar: r2248 - trunk/perfsonar-bundle, svnlog, 03/16/2007

Archive powered by MHonArc 2.6.16.

Top of Page