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

Diff of /Sprout/ERDBLoader.pl

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

revision 1.6, Mon Jan 19 21:46:21 2009 UTC revision 1.8, Mon Mar 2 22:16:27 2009 UTC
# Line 76  Line 76 
76    
77  If specified, turns on tracing of SQL activity.  If specified, turns on tracing of SQL activity.
78    
79    =item clear
80    
81    If specified, existing load files will be recreated from sections if the sections
82    are present.
83    
84  =item background  =item background
85    
86  Save the standard and error output to files. The files will be created  Save the standard and error output to files. The files will be created
# Line 113  Line 118 
118  DBD during load, so that access to the database by other processes is not  DBD during load, so that access to the database by other processes is not
119  compromised.  compromised.
120    
121    =item loadDirectory
122    
123    Directoty containing the load files. This option allows you to request that
124    load files from another version of the NMPDR be used, which is useful when
125    creating a new NMPDR: we can yank in the data from the previous database while
126    waiting for the new load files to be generated.
127    
128  =back  =back
129    
130  =cut  =cut
# Line 120  Line 132 
132  # Get the command-line options and parameters.  # Get the command-line options and parameters.
133  my ($options, @parameters) = StandardSetup([qw(ERDBLoadGroup ERDB Stats) ],  my ($options, @parameters) = StandardSetup([qw(ERDBLoadGroup ERDB Stats) ],
134                                             {                                             {
135                                                  clear => ["", "overwrite existing load files if sections are present"],
136                                                sanityCheck => ["", "don't load, trace contents of first N load file records instead"],                                                sanityCheck => ["", "don't load, trace contents of first N load file records instead"],
137                                                trace => ["2", "tracing level"],                                                trace => ["2", "tracing level"],
138                                                keepSections => ["", "if specified, section files will not be deleted after being collated"],                                                keepSections => ["", "if specified, section files will not be deleted after being collated"],
139                                                phone => ["", "phone number (international format) to call when load finishes"],                                                phone => ["", "phone number (international format) to call when load finishes"],
140                                                DBD => ["", "if specified, the name of a DBD file in the FIG directory"],                                                DBD => ["", "if specified, the name of a DBD file in the FIG directory"],
141                                                  loadDirectory => ["", "if specified, an alternate directory containing the load files"],
142                                             },                                             },
143                                             "<database> <group1> <group2> ...",                                             "<database> <group1> <group2> ...",
144                                             @ARGV);                                             @ARGV);
# Line 142  Line 156 
156      my @realGroups = ERDBLoadGroup::ComputeGroups($erdb, \@groups);      my @realGroups = ERDBLoadGroup::ComputeGroups($erdb, \@groups);
157      # Get the source object and load directory for this database.      # Get the source object and load directory for this database.
158      my $source = $erdb->GetSourceObject();      my $source = $erdb->GetSourceObject();
159      my $directory = $erdb->LoadDirectory();  
160        my $directory = $options->{loadDirectory} || $erdb->LoadDirectory();
161      # Get the list of sections.      # Get the list of sections.
162      my @sectionList = $erdb->SectionList($source);      my @sectionList = $erdb->SectionList($source);
163      # Create a statistics object to track our progress.      # Create a statistics object to track our progress.
# Line 167  Line 182 
182              # Get the data file name.              # Get the data file name.
183              my $dataFile = ERDBGenerate::CreateFileName($table, undef, 'data', $directory);              my $dataFile = ERDBGenerate::CreateFileName($table, undef, 'data', $directory);
184              # Do we have it?              # Do we have it?
185              if (-f $dataFile) {              if (-f $dataFile && ! $options->{clear}) {
186                  # Yes. This is good news.                  # Yes. This is good news.
187                  $stats->Add('tables-found' => 1);                  $stats->Add('tables-found' => 1);
188                  Trace("Table file found for $table.") if T(3);                  Trace("Table file found for $table.") if T(3);
# Line 298  Line 313 
313      }      }
314  }  }
315    
316    =head2 Internal Methods
317    
318  =head3 CheckLoadFile  =head3 CheckLoadFile
319    
320      CheckLoadFile($erdb, $table, $fileName, $count);      CheckLoadFile($erdb, $table, $fileName, $count);

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.8

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3