[Bio] / Sprout / LoadSproutTables.pl Repository:
ViewVC logotype

Diff of /Sprout/LoadSproutTables.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.19, Mon Jan 30 21:52:29 2006 UTC revision 1.21, Mon Feb 13 09:45:07 2006 UTC
# Line 221  Line 221 
221    
222  # Get the command-line parameters and options.  # Get the command-line parameters and options.
223  my ($options, @parameters) = StandardSetup(['SproutLoad', 'ERDBLoad', 'Stats',  my ($options, @parameters) = StandardSetup(['SproutLoad', 'ERDBLoad', 'Stats',
224                                              'ERDB', 'Load'],                                              'ERDB', 'Load', 'Sprout'],
225                                              { geneFile => ["", "name of the genome list file"],                                              { geneFile => ["", "name of the genome list file"],
226                                                subsysFile => ["", "name of the trusted subsystem file"],                                                subsysFile => ["", "name of the trusted subsystem file"],
227                                                dbLoad => [0, "load the database from generated files"],                                                dbLoad => [0, "load the database from generated files"],
# Line 238  Line 238 
238  if ($options->{dbCreate}) {  if ($options->{dbCreate}) {
239      # Here we want to drop and re-create the database.      # Here we want to drop and re-create the database.
240      my $db = $FIG_Config::sproutDB;      my $db = $FIG_Config::sproutDB;
241      if ($FIG_Config::dbms eq "Pg") {      DBKernel::CreateDB($db);
         my $dbport = $FIG_Config::dbport;  
         my $dbuser = $FIG_Config::dbuser;  
         Trace("Dropping old database (failure is okay).") if T(2);  
         system("dropdb -p $dbport -U $dbuser $db");  
         Trace("Creating new database.") if T(2);  
         &FIG::run("createdb -p $dbport -U $dbuser $db");  
     } elsif ($FIG_Config::dbms eq "mysql") {  
         Trace("Dropping old database (failure is okay).") if T(2);  
         system("mysqladmin -u $FIG_Config::dbuser -p drop $db");  
         &FIG::run("mysqladmin -u $FIG_Config::dbuser -p create $db");  
         Trace("Creating new database.") if T(2);  
     }  
242  }  }
243  # Create the sprout loader object. Note that the Sprout object does not  # Create the sprout loader object. Note that the Sprout object does not
244  # open the database unless the "dbLoad" option is turned on.  # open the database unless the "dbLoad" option is turned on.

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.21

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3