IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33197


Ignore:
Timestamp:
Feb 2, 2012, 9:43:52 AM (14 years ago)
Author:
bills
Message:

better messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/repair_bad_instance

    r33196 r33197  
    1010use PS::IPP::Metadata::Config;
    1111use PS::IPP::Config 1.01 qw( :standard );
     12use File::Basename;
    1213
    1314my $dbname = 'gpc1';
     
    1617my ( $exp_id,
    1718     $class_id,
    18      $pretend,
    1919     $repair_lost,
    2020     $go,
     
    2828           'repair|r'       => \$go,
    2929           'repair-lost|l'  => \$repair_lost,
    30            'pretend'        => \$pretend,
    3130) or pod2usage( 2 );
    3231
     
    3534 #           -exitval => 3)
    3635unless (defined $exp_id and defined $class_id ) {
    37     print STDERR "Usage: $0 --exp_id <exp_id> --class_id <class_id> [--repair]\n";
     36    my $prog = basename($0);
     37    print STDERR "Usage:\n\t$prog --exp_id <exp_id> --class_id <class_id> [--repair --repair-lost]\n";
    3838    exit 1;
    3939}
    40 
    41 $pretend = "" if !$pretend;
    42 
    43 # print "supplied parameters: $exp_id $class_id $pretend\n";
    4440
    4541my $ipprc =  PS::IPP::Config->new();
     
    9793    }
    9894} else {
    99     print "No good instances of $uri found. To fix run:\n";
    10095    my $cmd = "regtool -dbname $dbname -updateprocessedimfile -set_ignored -exp_id $exp_id -class_id $class_id\n";
    101     print "$cmd\n";
     96    print "No good instances of $uri found. ";
     97    if ($repair_lost) {
     98        print "Executing: ";
     99    } else {
     100        print "To fix run:\n";
     101    }
     102    print "\t$cmd\n";
    102103    if ($repair_lost) {
    103104        $fixed = 1;
Note: See TracChangeset for help on using the changeset viewer.