- Timestamp:
- Jan 29, 2010, 10:52:03 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091201/ippScripts/scripts/chip_imfile.pl
r25555 r26722 53 53 'reduction=s' => \$reduction, # Reduction class 54 54 'run-state=s' => \$run_state, # current state of the run (new, update) 55 'magicked '=> \$magicked, # magicked state of input file55 'magicked=s' => \$magicked, # magicked state of input file 56 56 'deburned=s' => \$deburned, # does deburned image exist? 57 57 'threads=s' => \$threads, # Number of threads to use for ppImage … … 134 134 $command = "$ppConfigDump -camera $camera -dump-recipe PPIMAGE -recipe PPIMAGE $recipe_ppImage -"; 135 135 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 136 run(command => $command, verbose => $verbose);136 run(command => $command, verbose => 0); 137 137 unless ($success) { 138 138 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 146 146 147 147 if ($useDeburnedImage) { 148 my $useBestBurntool = metadataLookupBool($recipeData, 'USE.BEST.BURNTOOL');149 150 ## Check that we have required programs:151 # print STDERR "Inside burntool loop!\n";152 my $regtool = can_run('regtool') or &my_die ("Can't find regtool", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);153 my $funpack = can_run('funpack') or &my_die ("Can't find funpack", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);154 my $burntool = can_run('burntool') or &my_die ("Can't find burntool", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);155 148 my $useBestBurntool = metadataLookupBool($recipeData, 'USE.BEST.BURNTOOL'); 149 150 ## Check that we have required programs: 151 # print STDERR "Inside burntool loop!\n"; 152 my $regtool = can_run('regtool') or &my_die ("Can't find regtool", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 153 my $funpack = can_run('funpack') or &my_die ("Can't find funpack", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 154 my $burntool = can_run('burntool') or &my_die ("Can't find burntool", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 155 156 156 ## Check the current burntool processing version: 157 157 my $regtool_state_cmd = "$regtool -processedimfile -exp_id $exp_id -class_id $class_id -limit 1"; … … 173 173 my $burntoolState = 999; 174 174 foreach my $regEntry (@$regData2) { 175 #print "$regEntry->{exp_id} $regEntry->{burntool_state}\n";175 print "$regEntry->{exp_id} $regEntry->{burntool_state}\n"; 176 176 177 177 if ($regEntry->{exp_id} == $exp_id) { … … 182 182 &my_die("Unable to find burntool_state in metadata", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 183 183 } 184 if ($burntoolState == 32767) {185 $burntoolState = 0;186 }184 if ($burntoolState == 32767) { 185 $burntoolState = 0; 186 } 187 187 188 188 ## Read camera config to get the current good burntool state : … … 190 190 my $camera_config_cmd = "$ppConfigDump -camera $camera -dump-camera -"; 191 191 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 192 run(command => $camera_config_cmd, verbose => $verbose);192 run(command => $camera_config_cmd, verbose => 0); 193 193 unless ($success) { 194 194 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 206 206 } 207 207 208 if (abs($burntoolState) != $burntoolStateGood) { 209 if ($useBestBurntool) { 210 &my_die("Image burntool version does not match current accepted version.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 211 } 212 else { 213 warn ("Image burntool version does not match current accepted version. Continuing as requested."); 214 # Internally pretend that we're at a good version. 215 if ($burntoolState < -10) { 216 $burntoolState = -1 * $burntoolStateGood; 217 } 218 elsif ($burntoolState > 10) { 219 $burntoolState = $burntoolStateGood; 220 } 221 elsif ($burntoolState == 0) { 222 # You've told me to use a deburned image, and that you don't care if it's the most recent. The database has told me 223 # that burntool has never been run on this image. We'll hope the database is wrong, but I don't really trust that. 224 warn ("burntool_state suggests no table will be found. This will likely crash."); 225 $burntoolState = -1 * $burntoolStateGood; 226 } 227 else { 228 &my_die("No valid burntool table will be found.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 229 } 230 } 231 } 208 print "burntool state vs burntoolStateGood : $burntoolState vs $burntoolStateGood\n"; 209 if (abs($burntoolState) != $burntoolStateGood) { 210 if ($useBestBurntool) { 211 &my_die("Image burntool version does not match current accepted version.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 212 } 213 else { 214 warn ("Image burntool version does not match current accepted version. Continuing as requested."); 215 # Internally pretend that we're at a good version. 216 if ($burntoolState < -10) { 217 $burntoolState = -1 * $burntoolStateGood; 218 } 219 elsif ($burntoolState > 10) { 220 $burntoolState = $burntoolStateGood; 221 } 222 elsif ($burntoolState == 0) { 223 # You've told me to use a deburned image, and that you don't care if it's the most recent. The database has told me 224 # that burntool has never been run on this image. We'll hope the database is wrong, but I don't really trust that. 225 warn ("burntool_state suggests no table will be found. This will likely crash."); 226 $burntoolState = -1 * $burntoolStateGood; 227 } 228 else { 229 &my_die("No valid burntool table will be found.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 230 } 231 } 232 } 232 233 233 234 ## We now know that we have an image that has been burntooled. … … 411 412 $command .= " -uri $outputImage"; 412 413 $command .= " -path_base $outroot"; 413 $command .= " -magicked " if $magicked;414 $command .= " -magicked $magicked" if $magicked; 414 415 $command .= " -hostname $host" if defined $host; 415 416 $command .= " -dbname $dbname" if defined $dbname;
Note:
See TracChangeset
for help on using the changeset viewer.
