Changeset 16552
- Timestamp:
- Feb 19, 2008, 3:57:03 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/ipp_inject_fileset.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/ipp_inject_fileset.pl
r16490 r16552 23 23 24 24 # Parse the command-line arguments 25 my ($camera, $telescope, $workdir, $reduction, $dvo_db, $tess_id, $end_stage, $label, $dbname, $ help);25 my ($camera, $telescope, $workdir, $reduction, $dvo_db, $tess_id, $end_stage, $label, $dbname, $no_update, $no_op, $help); 26 26 GetOptions('camera|i=s' => \$camera, # user-supplied camera name 27 27 'telescope|t=s' => \$telescope, # user-supplied telescope name … … 32 32 'end_stage=s' => \$end_stage, # stop processing at this step 33 33 '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 36 38 ) or pod2usage( 2 ); 37 39 … … 95 97 $command_exp .= " -dbname $dbname" if defined $dbname; 96 98 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; 99 my $exp_id = 0; 100 unless ($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; 100 104 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 } 103 110 104 111 # now inject the imfiles one at a time … … 117 124 $command_imfile .= " -dbname $dbname" if defined ($dbname); 118 125 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 } 121 132 } 122 133 … … 127 138 $command_update .= " -dbname $dbname" if defined ($dbname); 128 139 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; 140 unless ($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 } 131 146 132 147 exit 0;
Note:
See TracChangeset
for help on using the changeset viewer.
