IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42733


Ignore:
Timestamp:
Nov 6, 2024, 5:19:39 PM (21 months ago)
Author:
tdeboer
Message:

merging the dist_bundle.plchanges for IPP-2201

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-ops-20220906/ippScripts/scripts/dist_bundle.pl

    r40823 r42733  
    2525
    2626my $ipprc = PS::IPP::Config->new(); # IPP configuration
     27
     28# we can record the location an appropriate magic.mdc file for the file command
     29my $file_magic = "$ENV{PSCONFDIR}/$ENV{PSCONFIG}/etc/compress.mgc";
     30### TEST print "magic: $file_magic\n";
     31### TEST system ("file -m $file_magic o60523g0045o.2132764.wrp.2688740.skycell.1566.004.pswarp.mdc");
    2732
    2833use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
     
    7580my $file_cmd   = can_run('file') or (warn "can't find program file" and $missing_tools = 1);
    7681my $zcat   = can_run('zcat') or (warn "can't find program zcat" and $missing_tools = 1);
     82my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1);
    7783if ($missing_tools) {
    7884    warn("Can't find required tools.");
     
    8187
    8288# Parse the command-line arguments
    83 my ($camera, $stage, $stage_id, $component, $path_base, $chip_path_base, $alt_path_base, $clean, $exp_type);
     89my ($camera, $stage, $class_id, $stage_id, $component, $path_base, $chip_path_base, $alt_path_base, $clean, $exp_type);
    8490my ($outroot, $run_state, $data_state, $magicked, $no_magic, $poor_quality, $results_file, $prefix);
    8591my ($dbname, $save_temps, $verbose, $no_update, $logfile);
     
    131137}
    132138
     139# Determine the value of a "good" burntool run.
     140my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
     141
     142my $config_cmd = "$ppConfigDump -camera $camera -get-key BURNTOOL.STATE.GOOD";
     143my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     144    run ( command => $config_cmd, verbose => $verbose);
     145unless ($success) {
     146    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     147    &my_die("Unable to perform ppConfigDump: $error_code", 0, 0, $class_id, $PS_EXIT_SYS_ERROR);
     148}
     149
     150my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
     151    &my_die("Unable to parse metadata config doc", 0, 0, $class_id, $PS_EXIT_SYS_ERROR);
     152
     153my $burntoolStateGood = 999;
     154foreach my $cfg (@$recipeData) {
     155    if ($cfg->{name} eq 'BURNTOOL.STATE.GOOD') {
     156        $burntoolStateGood = $cfg->{value};
     157    }
     158}
     159if ($burntoolStateGood == 999) {
     160    &my_die("Failed to determine BURNTOOL.STATE.GOOD", $burntoolStateGood, $class_id, 0, $PS_EXIT_SYS_ERROR);
     161}
     162
     163
    133164$ipprc->redirect_output($logfile) if $logfile;
    134165
     
    144175# note: We my_die in get_file_list if something goes wrong.
    145176
    146 my $file_list = get_file_list($stage, $component, $path_base, $clean, $num_sky_inputs);
     177my $file_list = get_file_list($stage, $component, $path_base, $clean, $num_sky_inputs,$burntoolStateGood);
    147178
    148179if (($stage ne 'raw') and ($stage ne 'fake') and ($stage ne 'stack_summary') and !$poor_quality) {
     
    555586    my $clean = shift;
    556587    my $num_sky_inputs = shift;
     588    my $bt_state_good = shift;
    557589
    558590    my @file_list;
     
    576608                my %burntool_table;
    577609                $burntool_table{file_rule} = "BURNTOOL.TABLE";
    578                 $burntool_table{name} = "$path_base.burn.tbl";
     610               
     611                if($bt_state_good == 15) {
     612                    $burntool_table{name} = "$path_base.burn.v15.tbl"; 
     613                } else {
     614                    $burntool_table{name} = "$path_base.burn.tbl";             
     615                }               
    579616                push @file_list, \%burntool_table;
    580617            }
     
    647684    my $mdc_compressed;
    648685    {
    649         my $command = "$file_cmd $resolved";
     686        my $command = "$file_cmd -m $file_magic $resolved";
     687#        my $command = "$file_cmd $resolved";
    650688        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    651689            run(command => $command, verbose => $verbose);
Note: See TracChangeset for help on using the changeset viewer.