[MOBY-guts] biomoby commit

Eddie Kawas kawas at dev.open-bio.org
Fri Jun 20 18:57:49 UTC 2008


kawas
Fri Jun 20 14:57:49 EDT 2008
Update of /home/repository/moby/moby-live/Perl/MOBY-Server/bin/scripts
In directory dev.open-bio.org:/tmp/cvs-serv23276/Perl/MOBY-Server/bin/scripts

Modified Files:
	moby-s-install.pl 
Log Message:
removed the sub no_password
explicitly create the empty string for passwords

moby-live/Perl/MOBY-Server/bin/scripts moby-s-install.pl,1.9,1.10
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/bin/scripts/moby-s-install.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- /home/repository/moby/moby-live/Perl/MOBY-Server/bin/scripts/moby-s-install.pl	2008/06/20 15:53:52	1.9
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/bin/scripts/moby-s-install.pl	2008/06/20 18:57:49	1.10
@@ -35,11 +35,6 @@
 		my $s = join "", @_;
 		return qq|GRANT ALL ON $s TO ?\@'localhost' IDENTIFIED BY ? WITH GRANT OPTION|;
 	}
-	sub prepare_query_no_password { 
-		my $s = join "", @_;
-		return qq|GRANT ALL ON $s TO ?\@'localhost' WITH GRANT OPTION|;
-	}
-	
 	sub check_module {
 		eval "require $_[0]";
 		if ($@) {
@@ -385,13 +380,14 @@
 	  prompt_user_input( "What is your root mysql username?", "root" );
 	my $password =
 	  prompt_user_input( "What is your root mysql users' password?", "" );
+	$password = "" unless $password;
 	my $url  = prompt_user_input( "What is the mysql url?",    "localhost" );
 	my $port = prompt_user_input( "What is the mysql port #?", "3306" );
 
 	# prompt for a new user/password combo so that people cant determine the root password from MOBY::Config
 	my $moby_username = prompt_user_input( "What username (I will create it if it doesn't exist)\n  would you like to access your local db?", "moby_user" );
 	my $moby_password = prompt_user_input( "Please provide a password for '$moby_username': ", "" ); 
-
+	$moby_password = "" unless $moby_password;
 	#db names
 	say
 "\nPrompting for mysql table names. Use default names unless you know what you are doing!";
@@ -851,7 +847,7 @@
 	    and $m_namespace
 	    and $m_central,
 	    and $moby_username,
-	    and $moby_password;
+	    and ($moby_password || $moby_password eq "");
 
 	# check to see if mobycentral.config has been created in the conf
 	# directory first -> if so, parse it
@@ -985,13 +981,8 @@
 	    };
 		eval {
 			my $db = $dbsections{mobycentral} . ".*";
-			if ($moby_password) {
-				$dbh->do(prepare_query($db),undef,$moby_username,$moby_password)
-			  		|| say ("Could not give '$moby_username' access to $db - Error:\n$DBI::errstr");
-			} else {
-				$dbh->do(prepare_query_no_password($db),undef,$moby_username)
-			  		|| say ("Could not give '$moby_username' access to $db - Error:\n$DBI::errstr");
-			}
+			$dbh->do(prepare_query($db),undef,$moby_username,$moby_password)
+			  || say ("Could not give '$moby_username' access to $db - Error:\n$DBI::errstr");
 		};
 		die $! if $!;
 	    system( "mysql -h $url -P $port -u $username --password=$password "
@@ -1013,13 +1004,8 @@
 	    };
 	    eval {
 			my $db = $dbsections{mobyobject} . ".*"; 
-			if ($moby_password) {
-				$dbh->do(prepare_query($db),undef,$moby_username,$moby_password)
-			  		|| say ("Could not give '$moby_username' access to $db - Error:\n$DBI::errstr");
-			} else {
-				$dbh->do(prepare_query_no_password($db),undef,$moby_username)
-			  		|| say ("Could not give '$moby_username' access to $db - Error:\n$DBI::errstr");
-			}
+			$dbh->do(prepare_query($db),undef,$moby_username,$moby_password)
+			  || say ("Could not give '$moby_username' access to $db - Error:\n$DBI::errstr");
 		};
 	    system( "mysql -h $url -P $port -u $username --password=$password "
 		    . $dbsections{mobyobject}
@@ -1040,13 +1026,8 @@
 	    };
 	    eval {
 			my $db = $dbsections{mobyservice} . ".*"; 
-			if ($moby_password) {
-				$dbh->do(prepare_query($db),undef,$moby_username,$moby_password)
-			  		|| say ("Could not give '$moby_username' access to $db - Error:\n$DBI::errstr");
-			} else {
-				$dbh->do(prepare_query_no_password($db),undef,$moby_username)
-			  		|| say ("Could not give '$moby_username' access to $db - Error:\n$DBI::errstr");
-			}
+			$dbh->do(prepare_query($db),undef,$moby_username,$moby_password)
+			  || say ("Could not give '$moby_username' access to $db - Error:\n$DBI::errstr");
 		};
 	    system( "mysql -h $url -P $port -u $username --password=$password "
 		    . $dbsections{mobyservice}
@@ -1067,13 +1048,8 @@
 	    };
 	    eval {
 			my $db = $dbsections{mobynamespace} . ".*";  
-			if ($moby_password) {
-				$dbh->do(prepare_query($db),undef,$moby_username,$moby_password)
-			  		|| say ("Could not give '$moby_username' access to $db - Error:\n$DBI::errstr");
-			} else {
-				$dbh->do(prepare_query_no_password($db),undef,$moby_username)
-			  		|| say ("Could not give '$moby_username' access to $db - Error:\n$DBI::errstr");
-			}
+			$dbh->do(prepare_query($db),undef,$moby_username,$moby_password)
+			  || say ("Could not give '$moby_username' access to $db - Error:\n$DBI::errstr");
 		};
 	    system( "mysql -h $url -P $port -u $username --password=$password "
 		    . $dbsections{mobynamespace}
@@ -1094,13 +1070,8 @@
 	    };
 	    eval {
 			my $db = $dbsections{mobyrelationship} . ".*";  
-			if ($moby_password) {
-				$dbh->do(prepare_query($db),undef,$moby_username,$moby_password)
-			  		|| say ("Could not give '$moby_username' access to $db - Error:\n$DBI::errstr");
-			} else {
-				$dbh->do(prepare_query_no_password($db),undef,$moby_username)
-			  		|| say ("Could not give '$moby_username' access to $db - Error:\n$DBI::errstr");
-			}
+			$dbh->do(prepare_query($db),undef,$moby_username,$moby_password)
+			  || say ("Could not give '$moby_username' access to $db - Error:\n$DBI::errstr");
 		};
 	    system( "mysql -h $url -P $port -u $username --password=$password "
 		    . $dbsections{mobyrelationship}




More information about the MOBY-guts mailing list