Index: /trunk/pstamp/scripts/pstamp_checkdependent.pl
===================================================================
--- /trunk/pstamp/scripts/pstamp_checkdependent.pl	(revision 30631)
+++ /trunk/pstamp/scripts/pstamp_checkdependent.pl	(revision 30632)
@@ -193,12 +193,15 @@
 
     if (!$job_fault and ($stage eq 'chip')) {
-        # should only get here with data_state 'full' and perhaps destreaking not done
-        my_die ("Unexpected state for ${stage}Run $stage_id $state", $PS_EXIT_PROG_ERROR)
-            if $it->{data_state} ne 'full';
-
-        # chip processing is done, start destreaking.
-        my @chips;
-        push @chips, $it->{class_id};
-        $job_fault = check_states_magicDSRun($stage, $stage_id, \@chips, $rlabel, $need_magic, $it->{raw_magicked}, $it->{magic_ds_id}, $it->{dsRun_state});
+        # what about "error_cleaned" ?
+        if (! ($it->{data_state} =~ /cleaned/) ) {
+            # should only get here with data_state 'full' and perhaps destreaking not done
+            my_die ("Unexpected state for ${stage}Run $stage_id $state", $PS_EXIT_PROG_ERROR)
+                if $it->{data_state} ne 'full';
+
+            # chip processing is done, start destreaking.
+            my @chips;
+            push @chips, $it->{class_id};
+            $job_fault = check_states_magicDSRun($stage, $stage_id, \@chips, $rlabel, $need_magic, $it->{raw_magicked}, $it->{magic_ds_id}, $it->{dsRun_state});
+        }
     }
 
@@ -245,4 +248,8 @@
             # caller will fault the jobs
             return $error_code;
+        } elsif ($chip->{dsRun_state} eq 'failed_revert') {
+            # XXX: revert failures are rarely fixed. give up but say it's just not available not GONE 
+            print "magicDSRun.state = $dsRun_state for chipRun $stage_id is in state failed_revert cannot update\n";
+            return $PSTAMP_NOT_AVAILABLE;
         } elsif (($chip->{data_state} ne 'update') and ($chip->{data_state} ne 'full')) {
 
