Index: trunk/ippScripts/scripts/chip_imfile.pl
===================================================================
--- trunk/ippScripts/scripts/chip_imfile.pl	(revision 24396)
+++ trunk/ippScripts/scripts/chip_imfile.pl	(revision 24520)
@@ -149,41 +149,51 @@
 
     # apply the 'tiltystreak' operation, if desired
-    my $applyTiltyStreak = metadataLookupBool($recipeData, 'APPLY.TILTYSTREAK');
-    if ($applyTiltyStreak) {
-
-	my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf);
-
-	# XXX make these optional (must be built by psbuild as well...)
-	my $funpack = can_run('funpack') or &my_die ("Can't find funpack", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
-	my $tiltystreak = can_run('tiltystreak') or &my_die ("Can't find tiltystreak", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
-
-	# create an temporary output file:
-	my ($tempFile, $tempName) = tempfile( "/tmp/chip.$exp_id.$class_id.tmp.XXXX", UNLINK => !$save_temps );
-
-	print "uri: $uri\n";
-
-	# get the UNIX version of the (possible) neb: or path: filename
-	my $uriReal = $ipprc->file_resolve( $uri );
-
-	print "uriReal: $uriReal\n";
-
-	# unpack the data (is a NOP if not compressed)
-	$command = "$funpack -S $uriReal > $tempName";
-	( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
-	unless ($success) {
-	    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	    &my_die("Unable to perform funpack: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
+    my $tiltystreakApply = metadataLookupBool($recipeData, 'TILTYSTREAK.APPLY');
+    if ($tiltystreakApply) {
+
+	my $tiltystreakByClass = metadataLookupMD($recipeData, 'TILTYSTREAK.BY.CLASS');
+	my $tiltystreakClassApply = metadataLookupBool($tiltystreakByClass, 'APPLY.$class_id');
+	if ($tiltystreakClassApply) {
+
+	    my $tiltystreakClassOptions = metadataLookupStr($tiltystreakByClass, 'OPTIONS.$class_id');
+	    if ($tiltystreakClassOptions eq "none") {
+		$tiltystreakClassOptions = "";
+	    }
+
+	    my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf);
+
+	    # XXX make these optional (must be built by psbuild as well...)
+	    my $funpack = can_run('funpack') or &my_die ("Can't find funpack", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
+	    my $tiltystreak = can_run('tiltystreak') or &my_die ("Can't find tiltystreak", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
+
+	    # create an temporary output file:
+	    my ($tempFile, $tempName) = tempfile( "/tmp/chip.$exp_id.$class_id.tmp.XXXX", UNLINK => !$save_temps );
+
+	    print "uri: $uri\n";
+
+	    # get the UNIX version of the (possible) neb: or path: filename
+	    my $uriReal = $ipprc->file_resolve( $uri );
+
+	    print "uriReal: $uriReal\n";
+
+	    # unpack the data (is a NOP if not compressed)
+	    $command = "$funpack -S $uriReal > $tempName";
+	    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform funpack: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
+	    }
+
+	    # run tiltystreak
+	    $command = "$tiltystreak $tempName $tiltystreakClassOptions";
+	    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform tiltystreak: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
+	    }
+
+	    # supply the output file as the new input file
+	    $uri = $tempName;
 	}
-
-	# run tiltystreak
-	$command = "$tiltystreak $tempName";
-	( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
-	unless ($success) {
-	    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	    &my_die("Unable to perform tiltystreak: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
-	}
-
-	# supply the output file as the new input file
-	$uri = $tempName;
     }
 
