IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23396


Ignore:
Timestamp:
Mar 18, 2009, 10:26:15 AM (17 years ago)
Author:
bills
Message:

remove -no-op option it doesn't make sense for this script
use disttool to manage the distRun

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/dist_component.pl

    r23295 r23396  
    4040my ($dist_id, $camera, $stage, $stage_id, $component, $path_base, $chip_path_base, $clean);
    4141my ($outroot, $run_state, $data_state, $magicked);
    42 my ($dbname, $save_temps, $verbose, $no_update, $no_op, $logfile);
     42my ($dbname, $save_temps, $verbose, $no_update, $logfile);
    4343
    4444GetOptions(
     
    5959           'verbose'        => \$verbose,    # Print stuff?
    6060           'no-update'      => \$no_update,  # Don't update the database?
    61            'no-op'          => \$no_op,      # Don't do any operations?
    6261           'logfile=s'      => \$logfile,
    6362           ) or pod2usage( 2 );
     
    10099}
    101100
    102 
    103101# create the output directories if it is not a nebulous path and it doesn't exist
    104102if (index($outroot, "neb://") != 0) {
     
    134132foreach my $file (@$file_list) {
    135133    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
    136141    push @base_list, $base;
    137     my $path = $ipprc->file_resolve($file);
    138142    symlink $path, "$tmpdir/$base";
    139143}
     
    181185    $command .= " -chip_mask $mask" if ($stage eq 'chip' and $mask);
    182186    $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);
    192192    }
    193193}
     
    207207    my $command = "tar -C $tmpdir -czhf $tarfile .";
    208208
    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);
    218214    }
    219215
     
    227223    $bytes = $finfo[7];
    228224
    229     if (!$save_temps) {
    230         # delete the temp directory and it's contents
    231         system "rm -r $tmpdir";
    232     }
     225    delete_tmpdir($tmpdir);
    233226}
    234227{
     
    342335    }
    343336
     337    delete_tmpdir();
     338
    344339    carp($msg);
    345340    exit $exit_code;
    346341}
    347342
     343sub delete_tmpdir {
     344    if (!$save_temps) {
     345        system "rm -r $tmpdir";
     346    }
     347}
     348
    348349__END__
Note: See TracChangeset for help on using the changeset viewer.