Changeset 25940 for trunk/ippScripts/scripts/receive_file.pl
- Timestamp:
- Oct 26, 2009, 1:44:40 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/receive_file.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/receive_file.pl
r24894 r25940 136 136 $command .= " -dbname $dbname" if defined $dbname; 137 137 138 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 139 run(command => $command, verbose => $verbose); 140 &my_die( "Unable to update fileset $fileset_id to\n", $file_id, $PS_EXIT_UNKNOWN_ERROR) unless $success; 138 unless ($no_update) { 139 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 140 run(command => $command, verbose => $verbose); 141 &my_die( "Unable to update fileset $fileset_id to\n", $file_id, $PS_EXIT_UNKNOWN_ERROR) unless $success; 142 } else { 143 print STDERR "skipping $command\n"; 144 } 141 145 142 146 } elsif ($component eq "dbinfo") { … … 164 168 # we are very strict about the format of the file 165 169 # 166 # First comes the data for the Run 167 # Next is the data for each component 170 # First comes the dbversion metadata 171 # Next comes the data for the Run 172 # Next is the data for each component and other associated tables 168 173 # The component_id (class_id, skycell_id) must come before any of the paths that we edit 169 174 170 # The first line tells us the run type. From this we get the stage 171 # 172 my $line = $lines[0]; 173 my ($runType, $multi) = split " ", $line; 174 &my_die( "unexpected first line found in $filename: $line\n", $file_id, $PS_EXIT_UNKNOWN_ERROR) 175 if !$runType or ($multi ne 'MULTI'); 175 my $runType = findRunType(\@lines); 176 176 177 177 my $stage; … … 215 215 $component_dir = $components->{$current_component}; 216 216 } 217 foreach $line (@lines) {217 foreach my $line (@lines) { 218 218 my $out_line = $line; 219 219 … … 492 492 return $new_path; 493 493 } 494 sub findRunType { 495 my $lines = shift; 496 my $runType; 497 my ($firstWord, $multi) = split " ", $lines->[0]; 498 &my_die( "unexpected first line found in $filename: $lines->[0]\n", 499 $file_id, $PS_EXIT_UNKNOWN_ERROR) if ($firstWord ne 'dbversion') or ($multi ne 'MULTI'); 500 501 my $dbversionDone = 0; 502 foreach my $line (@$lines) { 503 # skip blank lines 504 next if !$line or $line eq "\n"; 505 506 ($firstWord, $multi) = split " ", $line; 507 if ($dbversionDone) { 508 # The first non blank line after the dbversion tells us the run type. 509 # From this we get the stage 510 &my_die( "unexpected line found in $filename: $line\n", 511 $file_id, $PS_EXIT_UNKNOWN_ERROR) if !$firstWord or !$multi or ($multi ne 'MULTI'); 512 513 $runType = $firstWord; 514 last; 515 } else { 516 if ($firstWord and $firstWord eq 'END') { 517 # we're past the dbversion file now 518 $dbversionDone = 1; 519 } 520 } 521 } 522 &my_die( "failed to determine run type from $filename", 523 $file_id, $PS_EXIT_UNKNOWN_ERROR) if !$runType; 524 525 return $runType; 526 } 494 527 495 528 sub my_die
Note:
See TracChangeset
for help on using the changeset viewer.
