[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.31, Sun Jun 25 07:34:46 2006 UTC revision 1.36, Sun Jul 30 01:19:37 2006 UTC
# Line 266  Line 266 
266    
267  Loads B<SynonymGroup> and B<IsSynonymGroupFor>.  Loads B<SynonymGroup> and B<IsSynonymGroupFor>.
268    
269    =item Family
270    
271    Loads B<Family> and B<ContainsFeature>.
272    
273  =item *  =item *
274    
275  Loads all of the above tables.  Loads all of the above tables.
# Line 294  Line 298 
298    
299  =item user  =item user
300    
301  Suffix to use for trace, output, and error files created in  Suffix to use for trace, output, and error files created.
302    
303  =item dbLoad  =item dbLoad
304    
# Line 328  Line 332 
332    
333  Trace SQL statements.  Trace SQL statements.
334    
335    =item phone
336    
337    Phone number to message when the load finishes.
338    
339  =back  =back
340    
341  =cut  =cut
# Line 354  Line 362 
362                                                loadOnly => [0, "load the database from previously generated files"],                                                loadOnly => [0, "load the database from previously generated files"],
363                                                primaryOnly => [0, "only process the group's main entity"],                                                primaryOnly => [0, "only process the group's main entity"],
364                                                resume => [0, "resume a complete load starting with the first group specified in the parameter list"],                                                resume => [0, "resume a complete load starting with the first group specified in the parameter list"],
365                                                  phone => ["", "phone number (international format) to call when load finishes"],
366                                              },                                              },
367                                              "<group1> <group2> ...",                                              "<group1> <group2> ...",
368                                              @ARGV);                                              @ARGV);
# Line 378  Line 387 
387  if ($resume && @parameters > 1) {  if ($resume && @parameters > 1) {
388      Confess("If resume=1, only one load group can be specified.");      Confess("If resume=1, only one load group can be specified.");
389  } elsif (! @parameters) {  } elsif (! @parameters) {
390      Confess("No load groups were specified.");      Trace("No load groups were specified.") if T(0);
391  }  }
392    # Set a variable to contain return type information.
393    my $rtype;
394    # Insure we catch errors.
395    eval {
396  # Process the parameters.  # Process the parameters.
397  for my $group (@parameters) {  for my $group (@parameters) {
398      Trace("Processing load group $group.") if T(2);      Trace("Processing load group $group.") if T(2);
# Line 433  Line 446 
446          $group = ResumeCheck($resume, $group);          $group = ResumeCheck($resume, $group);
447      }      }
448  }  }
449    };
450    if ($@) {
451        Trace("Load failed with error: $@") if T(0);
452        $rtype = "error";
453    } else {
454  Trace("Load complete.") if T(2);  Trace("Load complete.") if T(2);
455        $rtype = "no error";
456    }
457    if ($options->{phone}) {
458        my $msgID = Tracer::SendSMS($options->{phone}, "Sprout load terminated with $rtype.");
459        if ($msgID) {
460            Trace("Phone message sent with ID $msgID.") if T(2);
461        } else {
462            Trace("Phone message not sent.") if T(2);
463        }
464    }
465    
466  # If the resume flag is set, return "*", else return "".  # If the resume flag is set, return "*", else return "".
467  sub ResumeCheck {  sub ResumeCheck {

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.36

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3