Changeset 24520
- Timestamp:
- Jun 19, 2009, 3:27:21 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/chip_imfile.pl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/chip_imfile.pl
r24396 r24520 149 149 150 150 # apply the 'tiltystreak' operation, if desired 151 my $applyTiltyStreak = metadataLookupBool($recipeData, 'APPLY.TILTYSTREAK'); 152 if ($applyTiltyStreak) { 153 154 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf); 155 156 # XXX make these optional (must be built by psbuild as well...) 157 my $funpack = can_run('funpack') or &my_die ("Can't find funpack", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 158 my $tiltystreak = can_run('tiltystreak') or &my_die ("Can't find tiltystreak", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 159 160 # create an temporary output file: 161 my ($tempFile, $tempName) = tempfile( "/tmp/chip.$exp_id.$class_id.tmp.XXXX", UNLINK => !$save_temps ); 162 163 print "uri: $uri\n"; 164 165 # get the UNIX version of the (possible) neb: or path: filename 166 my $uriReal = $ipprc->file_resolve( $uri ); 167 168 print "uriReal: $uriReal\n"; 169 170 # unpack the data (is a NOP if not compressed) 171 $command = "$funpack -S $uriReal > $tempName"; 172 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 173 unless ($success) { 174 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 175 &my_die("Unable to perform funpack: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 151 my $tiltystreakApply = metadataLookupBool($recipeData, 'TILTYSTREAK.APPLY'); 152 if ($tiltystreakApply) { 153 154 my $tiltystreakByClass = metadataLookupMD($recipeData, 'TILTYSTREAK.BY.CLASS'); 155 my $tiltystreakClassApply = metadataLookupBool($tiltystreakByClass, 'APPLY.$class_id'); 156 if ($tiltystreakClassApply) { 157 158 my $tiltystreakClassOptions = metadataLookupStr($tiltystreakByClass, 'OPTIONS.$class_id'); 159 if ($tiltystreakClassOptions eq "none") { 160 $tiltystreakClassOptions = ""; 161 } 162 163 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf); 164 165 # XXX make these optional (must be built by psbuild as well...) 166 my $funpack = can_run('funpack') or &my_die ("Can't find funpack", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 167 my $tiltystreak = can_run('tiltystreak') or &my_die ("Can't find tiltystreak", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 168 169 # create an temporary output file: 170 my ($tempFile, $tempName) = tempfile( "/tmp/chip.$exp_id.$class_id.tmp.XXXX", UNLINK => !$save_temps ); 171 172 print "uri: $uri\n"; 173 174 # get the UNIX version of the (possible) neb: or path: filename 175 my $uriReal = $ipprc->file_resolve( $uri ); 176 177 print "uriReal: $uriReal\n"; 178 179 # unpack the data (is a NOP if not compressed) 180 $command = "$funpack -S $uriReal > $tempName"; 181 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 182 unless ($success) { 183 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 184 &my_die("Unable to perform funpack: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 185 } 186 187 # run tiltystreak 188 $command = "$tiltystreak $tempName $tiltystreakClassOptions"; 189 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 190 unless ($success) { 191 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 192 &my_die("Unable to perform tiltystreak: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 193 } 194 195 # supply the output file as the new input file 196 $uri = $tempName; 176 197 } 177 178 # run tiltystreak179 $command = "$tiltystreak $tempName";180 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);181 unless ($success) {182 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);183 &my_die("Unable to perform tiltystreak: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);184 }185 186 # supply the output file as the new input file187 $uri = $tempName;188 198 } 189 199
Note:
See TracChangeset
for help on using the changeset viewer.
