Changeset 42733
- Timestamp:
- Nov 6, 2024, 5:19:39 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-ops-20220906/ippScripts/scripts/dist_bundle.pl
r40823 r42733 25 25 26 26 my $ipprc = PS::IPP::Config->new(); # IPP configuration 27 28 # we can record the location an appropriate magic.mdc file for the file command 29 my $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"); 27 32 28 33 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 75 80 my $file_cmd = can_run('file') or (warn "can't find program file" and $missing_tools = 1); 76 81 my $zcat = can_run('zcat') or (warn "can't find program zcat" and $missing_tools = 1); 82 my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1); 77 83 if ($missing_tools) { 78 84 warn("Can't find required tools."); … … 81 87 82 88 # Parse the command-line arguments 83 my ($camera, $stage, $ stage_id, $component, $path_base, $chip_path_base, $alt_path_base, $clean, $exp_type);89 my ($camera, $stage, $class_id, $stage_id, $component, $path_base, $chip_path_base, $alt_path_base, $clean, $exp_type); 84 90 my ($outroot, $run_state, $data_state, $magicked, $no_magic, $poor_quality, $results_file, $prefix); 85 91 my ($dbname, $save_temps, $verbose, $no_update, $logfile); … … 131 137 } 132 138 139 # Determine the value of a "good" burntool run. 140 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 141 142 my $config_cmd = "$ppConfigDump -camera $camera -get-key BURNTOOL.STATE.GOOD"; 143 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 144 run ( command => $config_cmd, verbose => $verbose); 145 unless ($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 150 my $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 153 my $burntoolStateGood = 999; 154 foreach my $cfg (@$recipeData) { 155 if ($cfg->{name} eq 'BURNTOOL.STATE.GOOD') { 156 $burntoolStateGood = $cfg->{value}; 157 } 158 } 159 if ($burntoolStateGood == 999) { 160 &my_die("Failed to determine BURNTOOL.STATE.GOOD", $burntoolStateGood, $class_id, 0, $PS_EXIT_SYS_ERROR); 161 } 162 163 133 164 $ipprc->redirect_output($logfile) if $logfile; 134 165 … … 144 175 # note: We my_die in get_file_list if something goes wrong. 145 176 146 my $file_list = get_file_list($stage, $component, $path_base, $clean, $num_sky_inputs );177 my $file_list = get_file_list($stage, $component, $path_base, $clean, $num_sky_inputs,$burntoolStateGood); 147 178 148 179 if (($stage ne 'raw') and ($stage ne 'fake') and ($stage ne 'stack_summary') and !$poor_quality) { … … 555 586 my $clean = shift; 556 587 my $num_sky_inputs = shift; 588 my $bt_state_good = shift; 557 589 558 590 my @file_list; … … 576 608 my %burntool_table; 577 609 $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 } 579 616 push @file_list, \%burntool_table; 580 617 } … … 647 684 my $mdc_compressed; 648 685 { 649 my $command = "$file_cmd $resolved"; 686 my $command = "$file_cmd -m $file_magic $resolved"; 687 # my $command = "$file_cmd $resolved"; 650 688 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 651 689 run(command => $command, verbose => $verbose);
Note:
See TracChangeset
for help on using the changeset viewer.
