Index: trunk/pstamp/scripts/pstamp_checkdependent.pl
===================================================================
--- trunk/pstamp/scripts/pstamp_checkdependent.pl	(revision 27917)
+++ trunk/pstamp/scripts/pstamp_checkdependent.pl	(revision 27921)
@@ -21,4 +21,9 @@
 use Carp;
 
+# XXX: put this in a module somewhere
+my $IPP_DIFF_MODE_WARP_WARP   = 1;
+my $IPP_DIFF_MODE_WARP_STACK  = 2;
+my $IPP_DIFF_MODE_STACK_WARP  = 3;
+my $IPP_DIFF_MODE_STACK_STACK = 4;
 
 my ($dep_id, $stage, $stage_id, $component, $imagedb, $rlabel, $need_magic);
@@ -103,7 +108,16 @@
 # Got "it"
 
+my $magic_ok = 0;
+if ($stage eq 'diff') {
+    if ($it->{diff_mode} == $IPP_DIFF_MODE_STACK_STACK) {
+        # stack stack diffs don't need magic, but since the warps need to have the chips destreaked
+        # in order to be processed se set need_magic in the database for all runs
+        # Now the diffs themselves don't need to be destreaked so
+        $magic_ok = 1;
+    }
+}
 my $status = 0;
 if (($it->{state} eq 'full') or ($it->{state} eq 'update') and ($whole_run or ($it->{data_state} eq 'full'))
-        and (!$need_magic or $it->{magicked} > 0)) {
+        and (!$need_magic or $magic_ok or $it->{magicked} > 0)) {
 
     # This Dependency is satisfied. All done!
@@ -359,12 +373,7 @@
         my $skycell_id = $skycell->{skycell_id};
 
-        # XXX: put this in a module somewhere
-        my $IPP_DIFF_MODE_WARP_WARP   = 1;
-        my $IPP_DIFF_MODE_WARP_STACK  = 2;
-        my $IPP_DIFF_MODE_STACK_WARP  = 3;
-        my $IPP_DIFF_MODE_STACK_STACK = 4;
         if ($diff_mode == $IPP_DIFF_MODE_WARP_STACK ) {
             # check the state of the template stack
-            my $command = "$stacktool -sumkskyfile -stack_id $skycell->{stack2}";
+            my $command = "$stacktool -sumskyfile -stack_id $skycell->{stack2}";
             my $stack = runToolAndParseExpectOne($command, $verbose);
             my_die("failed to find stackSumSkyfile for stack_id $skycell->{stack2}", $PS_EXIT_UNKNOWN_ERROR) if !$stack;
@@ -416,5 +425,5 @@
         } elsif ($diff_mode == $IPP_DIFF_MODE_STACK_STACK ) {
             # check the state of the input stack
-            my $command = "$stacktool -sumkskyfile -stack_id $skycell->{stack2}";
+            my $command = "$stacktool -sumskyfile -stack_id $skycell->{stack2}";
             my $stack1 = runToolAndParseExpectOne($command, $verbose);
             my_die("failed to find stackSumSkyfile for stack_id $skycell->{stack2}", $PS_EXIT_UNKNOWN_ERROR) if !$stack1;
@@ -427,5 +436,5 @@
             }
             # check the state of the template stack
-            $command = "$stacktool -sumkskyfile -stack_id $skycell->{stack2}";
+            $command = "$stacktool -sumskyfile -stack_id $skycell->{stack2}";
             my $stack2 = runToolAndParseExpectOne($command, $verbose);
             my_die("failed to find stackSumSkyfile for stack_id $skycell->{stack2}", $PS_EXIT_UNKNOWN_ERROR) if !$stack2;
@@ -441,5 +450,5 @@
         } elsif ($diff_mode == $IPP_DIFF_MODE_STACK_WARP ) {
             # check the state of the input stack
-            my $command = "$stacktool -sumkskyfile -stack_id $skycell->{stack1}";
+            my $command = "$stacktool -sumskyfile -stack_id $skycell->{stack1}";
             my $stack = runToolAndParseExpectOne($command, $verbose);
             my_die("failed to find stackSumSkyfile for stack_id $skycell->{stack1}", $PS_EXIT_UNKNOWN_ERROR) if !$stack;
