IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 18, 2010, 12:49:05 PM (16 years ago)
Author:
eugene
Message:

merging changes from trunk into branches/pap

Location:
branches/pap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pap

  • branches/pap/ippScripts/scripts/ipp_cleanup.pl

    r27638 r28003  
    1414use File::Spec;
    1515use PS::IPP::Config 1.01 qw( :standard );
    16 use PS::IPP::Metadata::List qw( parse_md_list );
    1716use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
    1817use Pod::Usage qw( pod2usage );
     
    108107    }
    109108
    110     my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     109    # extract the metadata for the files into a hash list
     110    $imfiles = $mdcParser->parse_list(join "", @$stdout_buf) or
    111111        &my_die("Unable to parse metadata config doc", "chip", $stage_id, $PS_EXIT_PROG_ERROR);
    112 
    113     # extract the metadata for the files into a hash list
    114     $imfiles = parse_md_list($metadata) or
    115         &my_die("Unable to parse metadata list", "chip", $stage_id, $PS_EXIT_PROG_ERROR);
    116112
    117113    # loop over all of the imfiles, determine the path_base and class_id for each
     
    196192            # Tell magicdstool that we've cleaned up this data, so it needs to do the same if it needs to do the same.
    197193            my $magicdstool = can_run('magicdstool') or die "Can't find magicdstool";
    198             $command = "$magicdstool -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned -state full";
     194            $command = "$magicdstool -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned -set_label goto_cleaned";
    199195            $command .= " -dbname $dbname" if defined $dbname;
    200196            ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    249245        &my_die("Unable to perform camtool: $error_code", "camera", $stage_id, $error_code);
    250246    }
    251     my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     247    $exps = $mdcParser->parse_list(join "", @$stdout_buf) or
    252248        &my_die("Unable to parse metadata config doc", "camera", $stage_id, $PS_EXIT_PROG_ERROR);
    253 
    254     $exps = parse_md_list($metadata) or
    255         &my_die("Unable to parse metadata list", "camera", $stage_id, $PS_EXIT_PROG_ERROR);
    256249
    257250    my $n_exps = @$exps;
     
    316309        # Tell magicdstool that we've cleaned up this data, so it needs to do the same if it needs to do the same.
    317310        my $magicdstool = can_run('magicdstool') or die "Can't find magicdstool";
    318         $command = "$magicdstool -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned -state full";
     311        $command = "$magicdstool -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned -set_label goto_cleaned";
    319312        $command .= " -dbname $dbname" if defined $dbname;
    320313        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    375368        exit(0);
    376369    }
    377     my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     370    $skyfiles = $mdcParser->parse_list(join "", @$stdout_buf) or
    378371        &my_die("Unable to parse metadata config doc", "warp", $stage_id, $PS_EXIT_PROG_ERROR);
    379 
    380     $skyfiles = parse_md_list($metadata) or
    381         &my_die("Unable to parse metadata list", "warp", $stage_id, $PS_EXIT_PROG_ERROR);
    382372
    383373    my @files = ();
     
    457447            # Tell magicdstool that we've cleaned up this data, so it needs to do the same if it needs to do the same.
    458448            my $magicdstool = can_run('magicdstool') or die "Can't find magicdstool";
    459             $command = "$magicdstool -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned -state full";
     449            $command = "$magicdstool -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned -set_label goto_cleaned";
    460450            $command .= " -dbname $dbname" if defined $dbname;
    461451            ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    515505    }
    516506
    517     my $metadata = $mdcParser->parse(join "", @{ $stdout_buf }) or
     507    $skyfiles = $mdcParser->parse_list(join "", @{ $stdout_buf }) or
    518508        &my_die("Unable to parse metadata config doc", "stack", $stage_id, $PS_EXIT_PROG_ERROR);
    519 
    520     $skyfiles = parse_md_list($metadata) or
    521         &my_die("Unable to parse metadata list", "stack", $stage_id, $PS_EXIT_PROG_ERROR);
    522509
    523510    my @files = ();
     
    594581            # Tell magicdstool that we've cleaned up this data, so it needs to do the same if it needs to do the same.
    595582            my $magicdstool = can_run('magicdstool') or die "Can't find magicdstool";
    596             $command = "$magicdstool -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned -state full";
     583            $command = "$magicdstool -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned -set_label goto_cleaned";
    597584            $command .= " -dbname $dbname" if defined $dbname;
    598585            ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    652639    }
    653640
    654     my $metadata = $mdcParser->parse(join "", @{ $stdout_buf }) or
     641    $skyfiles = $mdcParser->parse_list(join "", @{ $stdout_buf }) or
    655642        &my_die("Unable to parse metadata config doc", "diff", $stage_id, $PS_EXIT_PROG_ERROR);
    656 
    657     $skyfiles = parse_md_list($metadata) or
    658         &my_die("Unable to parse metadata list", "diff", $stage_id, $PS_EXIT_PROG_ERROR);
    659643
    660644    my @files = ();
     
    747731            # Tell magicdstool that we've cleaned up this data, so it needs to do the same if it needs to do the same.
    748732            my $magicdstool = can_run('magicdstool') or die "Can't find magicdstool";
    749             $command = "$magicdstool -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned -state full";
     733            $command = "$magicdstool -stage $stage -stage_id $stage_id -updaterun -set_state goto_cleaned -set_label goto_cleaned";
    750734            $command .= " -dbname $dbname" if defined $dbname;
    751735            ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    806790    }
    807791
    808     my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     792    # extract the metadata for the files into a hash list
     793    $imfiles = $mdcParser->parse_list(join "", @$stdout_buf) or
    809794        &my_die("Unable to parse metadata config doc", "fake", $stage_id, $PS_EXIT_PROG_ERROR);
    810 
    811     # extract the metadata for the files into a hash list
    812     $imfiles = parse_md_list($metadata) or
    813         &my_die("Unable to parse metadata list", "fake", $stage_id, $PS_EXIT_PROG_ERROR);
    814795
    815796    # loop over all of the imfiles, determine the path_base and class_id for each
     
    927908
    928909
    929         $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     910        # extract the metadata for the files into a hash list
     911        $imfiles = $mdcParser->parse_list(join "", @$stdout_buf) or
    930912        &my_die("Unable to parse metadata config doc", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
    931 
    932         # extract the metadata for the files into a hash list
    933         $imfiles = parse_md_list($metadata) or
    934             &my_die("Unable to parse metadata list", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
    935913    }
    936914    # loop over all of the imfiles, determine the path_base and class_id for each
     
    1013991    }
    1014992    if (@$stdout_buf != 0) {
    1015         $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     993        my $exps = $mdcParser->parse_list(join "", @$stdout_buf) or
    1016994            &my_die("Unable to parse metadata config doc", "$stage (detProcessedExp)", $stage_id, $PS_EXIT_PROG_ERROR);
    1017         my $exps = parse_md_list($metadata) or
    1018             &my_die("Unable to parse metadata list", "$stage (detProcessedExp)", $stage_id, $PS_EXIT_PROG_ERROR);
    1019995
    1020996        foreach my $exp (@$exps) {
     
    10681044    # if there are no detResidImfiles (@$stdout_buf == 0), then silently exit.
    10691045    if (@$stdout_buf != 0) {
    1070         $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     1046        # extract the metadata for the files into a hash list
     1047        $imfiles = $mdcParser->parse_list(join "", @$stdout_buf) or
    10711048            &my_die("Unable to parse metadata config doc", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
    1072 
    1073         # extract the metadata for the files into a hash list
    1074         $imfiles = parse_md_list($metadata) or
    1075             &my_die("Unable to parse metadata list", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
    10761049    }
    10771050    # loop over all of the imfiles, determine the path_base and class_id for each
     
    11561129    }
    11571130    if (@$stdout_buf != 0) {
    1158         $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     1131        my $exps = $mdcParser->parse_list(join "", @$stdout_buf) or
    11591132            &my_die("Unable to parse metadata config doc", "$stage (detResidExp)", $stage_id, $PS_EXIT_PROG_ERROR);
    1160         my $exps = parse_md_list($metadata) or
    1161             &my_die("Unable to parse metadata list", "$stage (detResidExp)", $stage_id, $PS_EXIT_PROG_ERROR);
    11621133
    11631134        foreach my $exp (@$exps) {
     
    12021173        &my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
    12031174    }
    1204     my $metadata = $mdcParser->parse(join "", @{ $stdout_buf }) or
     1175    $stacks = $mdcParser->parse_list(join "", @{ $stdout_buf }) or
    12051176        &my_die("Unable to parse metadata config doc", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
    1206 
    1207     $stacks = parse_md_list($metadata) or
    1208         &my_die("Unable to parse metadata list", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
    12091177
    12101178    my @files = ();
     
    12861254    }
    12871255    if (@$stdout_buf != 0) {
    1288         $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     1256        my $exps = $mdcParser->parse_list(join "", @$stdout_buf) or
    12891257            &my_die("Unable to parse metadata config doc", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
    1290         my $exps = parse_md_list($metadata) or
    1291             &my_die("Unable to parse metadata list", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
    12921258
    12931259        foreach my $exp (@$exps) {
     
    13271293        &my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
    13281294    }
    1329     my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     1295    my $exps = $mdcParser->parse_list(join "", @$stdout_buf) or
    13301296        &my_die("Unable to parse metadata config doc", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
    1331 
    1332     my $exps = parse_md_list($metadata) or
    1333         &my_die("Unable to parse metadata list", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
    13341297
    13351298    foreach my $exp (@$exps) {
     
    13801343    }
    13811344    if (@$stdout_buf != 0) {
    1382         $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     1345        $exps = $mdcParser->parse_list(join "", @$stdout_buf) or
    13831346            &my_die("Unable to parse metadata config doc", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
    1384         $exps = parse_md_list($metadata) or
    1385             &my_die("Unable to parse metadata list", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
    13861347
    13871348        foreach my $exp (@$exps) {
     
    14251386        &my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
    14261387    }
    1427     my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     1388    $exps = $mdcParser->parse_list(join "", @$stdout_buf) or
    14281389        &my_die("Unable to parse metadata config doc", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
    1429 
    1430     $exps = parse_md_list($metadata) or
    1431         &my_die("Unable to parse metadata list", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
    14321390
    14331391    foreach my $exp (@$exps) {
     
    15111469    }
    15121470    if (@$stdout_buf != 0) {
    1513         $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     1471        $exps = $mdcParser->parse_list(join "", @$stdout_buf) or
    15141472            &my_die("Unable to parse metadata config doc", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
    1515         $exps = parse_md_list($metadata) or
    1516             &my_die("Unable to parse metadata list", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
    15171473
    15181474        foreach my $exp (@$exps) {
     
    15591515        exit 0;
    15601516    }
    1561     my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     1517    $exps = $mdcParser->parse_list(join "", @$stdout_buf) or
    15621518        &my_die("Unable to parse metadata config doc", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
    1563 
    1564     $exps = parse_md_list($metadata) or
    1565         &my_die("Unable to parse metadata list", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
    15661519
    15671520    foreach my $exp (@$exps) {
     
    16431596    }
    16441597    if (@$stdout_buf != 0) {
    1645         $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     1598        $exps = $mdcParser->parse_list(join "", @$stdout_buf) or
    16461599            &my_die("Unable to parse metadata config doc", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
    1647         $exps = parse_md_list($metadata) or
    1648             &my_die("Unable to parse metadata list", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
    16491600
    16501601        foreach my $exp (@$exps) {
Note: See TracChangeset for help on using the changeset viewer.