IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16552


Ignore:
Timestamp:
Feb 19, 2008, 3:57:03 PM (18 years ago)
Author:
eugene
Message:

added no_update, no_op modes

File:
1 edited

Legend:

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

    r16490 r16552  
    2323
    2424# Parse the command-line arguments
    25 my ($camera, $telescope, $workdir, $reduction, $dvo_db, $tess_id, $end_stage, $label, $dbname, $help);
     25my ($camera, $telescope, $workdir, $reduction, $dvo_db, $tess_id, $end_stage, $label, $dbname, $no_update, $no_op, $help);
    2626GetOptions('camera|i=s'     => \$camera, # user-supplied camera name
    2727           'telescope|t=s'  => \$telescope, # user-supplied telescope name
     
    3232           'end_stage=s'    => \$end_stage, # stop processing at this step
    3333           'label=s'        => \$label,     # stop processing at this step
    34            'dbname|d=s'     => \$dbname, # Database name
    35            'help'           => \$help # give help listing
     34           'dbname|d=s'     => \$dbname,    # Database name
     35           'no-update'      => \$no_update, # Update the database?
     36           'no-op'          => \$no_op,     # Don't do any operations?
     37           'help'           => \$help       # give help listing
    3638           ) or pod2usage( 2 );
    3739
     
    9597$command_exp .= " -dbname $dbname"       if defined $dbname;
    9698
    97 my ( $success_exp, $error_code_exp, $full_buf_exp, $stdout_buf_exp, $stderr_buf_exp ) =
    98     run( command => $command_exp, verbose => 1 );
    99 die "Unable to inject $exp_name: $error_code_exp\n" if not $success_exp;
     99my $exp_id = 0;
     100unless ($no_op) {
     101    my ( $success_exp, $error_code_exp, $full_buf_exp, $stdout_buf_exp, $stderr_buf_exp ) =
     102        run( command => $command_exp, verbose => 1 );
     103    die "Unable to inject $exp_name: $error_code_exp\n" if not $success_exp;
    100104
    101 my @line = split(/\s+/, $$stdout_buf_exp[0]); # The output line, containing the exposure tag
    102 my $exp_id = $line[2];  # The exposure tag
     105    my @line = split(/\s+/, $$stdout_buf_exp[0]); # The output line, containing the exposure tag
     106    $exp_id = $line[2]; # The exposure tag
     107} else {
     108    print "skipping command: $command_exp\n";
     109}
    103110
    104111# now inject the imfiles one at a time
     
    117124    $command_imfile .= " -dbname $dbname" if defined ($dbname);
    118125   
    119     my ( $success_imfile, $error_code_imfile, $full_buf_imfile, $stdout_buf_imfile, $stderr_buf_imfile ) = run( command => $command_imfile, verbose => 1 );
    120     die "Unable to inject $exp_name imfile: $error_code_imfile\n" if not $success_imfile;
     126    unless ($no_op) {
     127        my ( $success_imfile, $error_code_imfile, $full_buf_imfile, $stdout_buf_imfile, $stderr_buf_imfile ) = run( command => $command_imfile, verbose => 1 );
     128        die "Unable to inject $exp_name imfile: $error_code_imfile\n" if not $success_imfile;
     129    } else {
     130        print "skipping command: $command_imfile\n";
     131    }
    121132}
    122133
     
    127138$command_update .= " -dbname $dbname" if defined ($dbname);
    128139
    129 my ( $success_update, $error_code_update, $full_buf_update, $stdout_buf_update, $stderr_buf_update ) = run( command => $command_update, verbose => 1 );
    130 die "Unable to update $exp_name: $error_code_update\n" if not $success_update;
     140unless ($no_update) {
     141    my ( $success_update, $error_code_update, $full_buf_update, $stdout_buf_update, $stderr_buf_update ) = run( command => $command_update, verbose => 1 );
     142    die "Unable to update $exp_name: $error_code_update\n" if not $success_update;
     143} else {
     144    print "skipping command: $command_update\n";
     145}
    131146
    132147exit 0;
Note: See TracChangeset for help on using the changeset viewer.