Changeset 23396
- Timestamp:
- Mar 18, 2009, 10:26:15 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/dist_component.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/dist_component.pl
r23295 r23396 40 40 my ($dist_id, $camera, $stage, $stage_id, $component, $path_base, $chip_path_base, $clean); 41 41 my ($outroot, $run_state, $data_state, $magicked); 42 my ($dbname, $save_temps, $verbose, $no_update, $ no_op, $logfile);42 my ($dbname, $save_temps, $verbose, $no_update, $logfile); 43 43 44 44 GetOptions( … … 59 59 'verbose' => \$verbose, # Print stuff? 60 60 'no-update' => \$no_update, # Don't update the database? 61 'no-op' => \$no_op, # Don't do any operations?62 61 'logfile=s' => \$logfile, 63 62 ) or pod2usage( 2 ); … … 100 99 } 101 100 102 103 101 # create the output directories if it is not a nebulous path and it doesn't exist 104 102 if (index($outroot, "neb://") != 0) { … … 134 132 foreach my $file (@$file_list) { 135 133 my $base = basename($file); 134 my $path = $ipprc->file_resolve($file); 135 # if file is not found, just skip it. 136 # This is not always the right thing to do. 137 # For example if warpSkyfile is ignored, there won't be many of the data products 138 # the new config dump will only list the files actually produced. 139 next if !$path; 140 136 141 push @base_list, $base; 137 my $path = $ipprc->file_resolve($file);138 142 symlink $path, "$tmpdir/$base"; 139 143 } … … 181 185 $command .= " -chip_mask $mask" if ($stage eq 'chip' and $mask); 182 186 $command .= " -weight $variance" if $variance; 183 unless (defined $no_op) { 184 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 185 run(command => $command, verbose => $verbose); 186 unless ($success) { 187 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 188 &my_die("Unable to perform $command: $error_code", $dist_id, $component, $error_code); 189 } 190 } else { 191 print "skipping command $command\n"; 187 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 188 run(command => $command, verbose => $verbose); 189 unless ($success) { 190 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 191 &my_die("Unable to perform $command: $error_code", $dist_id, $component, $error_code); 192 192 } 193 193 } … … 207 207 my $command = "tar -C $tmpdir -czhf $tarfile ."; 208 208 209 unless (defined $no_op) { 210 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 211 run(command => $command, verbose => $verbose); 212 unless ($success) { 213 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 214 &my_die("Unable to perform $command: $error_code", $dist_id, $component, $error_code); 215 } 216 } else { 217 print "skipping command $command\n"; 209 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 210 run(command => $command, verbose => $verbose); 211 unless ($success) { 212 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 213 &my_die("Unable to perform $command: $error_code", $dist_id, $component, $error_code); 218 214 } 219 215 … … 227 223 $bytes = $finfo[7]; 228 224 229 if (!$save_temps) { 230 # delete the temp directory and it's contents 231 system "rm -r $tmpdir"; 232 } 225 delete_tmpdir($tmpdir); 233 226 } 234 227 { … … 342 335 } 343 336 337 delete_tmpdir(); 338 344 339 carp($msg); 345 340 exit $exit_code; 346 341 } 347 342 343 sub delete_tmpdir { 344 if (!$save_temps) { 345 system "rm -r $tmpdir"; 346 } 347 } 348 348 349 __END__
Note:
See TracChangeset
for help on using the changeset viewer.
