IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 5, 2008, 11:47:19 AM (19 years ago)
Author:
Paul Price
Message:

Added verbose flags to scripts.

File:
1 edited

Legend:

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

    r16196 r16308  
    3737use Pod::Usage qw( pod2usage );
    3838
    39 my ($cache, $exp_id, $tmp_class_id, $tmp_exp_name, $uri, $dbname, $no_update, $no_op);
     39my ($cache, $exp_id, $tmp_class_id, $tmp_exp_name, $uri, $dbname, $berbose, $no_update, $no_op);
    4040GetOptions(
    4141    'caches'           => \$cache,
     
    4545    'uri|u=s'          => \$uri,
    4646    'dbname|d=s'       => \$dbname,# Database name
     47    'verbose'          => \$verbose,   # Print to stdout
    4748    'no-update'        => \$no_update,
    4849    'no-op'            => \$no_op,
     
    130131
    131132my $now_time = localtime();
    132 printf STDERR "\nstarting ppStats: %s\n", $now_time;
     133printf STDERR "\nstarting ppStats: %s\n", $now_time if $verbose;
    133134
    134135# Run ppStats on the input file
     
    137138    my $command = "$ppStats $uri -recipe PPSTATS $RECIPE -level"; # Command to run ppStats
    138139    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    139         cache_run(command => $command, verbose => 1);
     140        cache_run(command => $command, verbose => $verbose);
    140141    unless ($success) {
    141142        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    157158
    158159$now_time = localtime();
    159 printf STDERR "\ndone with ppStats: %s\n", $now_time;
     160printf STDERR "\ndone with ppStats: %s\n", $now_time if $verbose;
    160161
    161162# we require at a minimum: -telescope, -inst, -filelevel, -class_id, -exp_type
     
    175176
    176177$now_time = localtime();
    177 printf STDERR "\nrunning regtool update: %s\n", $now_time;
     178printf STDERR "\nrunning regtool update: %s\n", $now_time if $verbose;
    178179
    179180# Push the results into the database
    180181unless ($no_update) {
    181182    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    182         run(command => $command, verbose => 1);
     183        run(command => $command, verbose => $verbose);
    183184    unless ($success) {
    184185        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    191192
    192193$now_time = localtime();
    193 printf STDERR "\ndone with regtool update: %s\n", $now_time;
     194printf STDERR "\ndone with regtool update: %s\n", $now_time if $verbose;
    194195
    195196sub cache_run
Note: See TracChangeset for help on using the changeset viewer.