Index: trunk/pstamp/scripts/pstamp_checkdependent.pl
===================================================================
--- trunk/pstamp/scripts/pstamp_checkdependent.pl	(revision 29429)
+++ trunk/pstamp/scripts/pstamp_checkdependent.pl	(revision 29561)
@@ -197,5 +197,7 @@
     if (!$job_fault and ($stage eq 'chip')) {
         # chip processing is done, start destreaking.
-        $job_fault = check_states_magicDSRun($stage, $stage_id, $rlabel, $need_magic, $it->{raw_magicked}, $it->{dsRun_state});
+        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});
     }
     if ($job_fault) {
@@ -217,8 +219,13 @@
     my $dsRun_state;
     my $raw_all_magicked = 1; # this gets cleared if any of the inputs aren't destreaked
+    my @chips;
+    my $magic_ds_id;
     if (!$whole_run) {
         foreach my $chip (@$metadatas) {
             $dsRun_state = $chip->{dsRun_state};
             $raw_all_magicked &= ($chip->{raw_magicked} > 0);
+            $magic_ds_id = $chip->{magic_ds_id};
+
+            push @chips, $chip->{class_id};
 
             if (($chip->{state} =~ /error/) or ($chip->{state} =~ /purged/) or ($chip->{state} =~ /scrubbed/)) {
@@ -273,5 +280,5 @@
     }
 
-    my $status = check_states_magicDSRun('chip', $chip_id, $rlabel, $need_magic, $raw_all_magicked, $dsRun_state);
+    my $status = check_states_magicDSRun('chip', $chip_id, \@chips, $rlabel, $need_magic, $raw_all_magicked, $magic_ds_id, $dsRun_state);
 
     return $status;
@@ -633,11 +640,13 @@
     my $stage = shift;
     my $stage_id = shift;
+    my $components = shift;
     my $rlabel  = shift;
     my $need_magic = shift;
     my $input_magicked = shift;
+    my $magic_ds_id = shift;
     my $dsRun_state = shift;
 
     # XXX: this code assumes that destreaking is handled at the chip stage
-    my_die ("check_states_magicDSRun only works for stage chip", $PS_EXIT_PROG_ERROR) if $stage ne 'chip';
+    my_die ("check_states_magicDSRun only implemented for chip stage", $PS_EXIT_PROG_ERROR) if $stage ne 'chip';
 
     # if called from check_states_warp dsRun_state is unknown. Go find it.
@@ -654,16 +663,18 @@
             print "No magicDSRun for chipRun $stage_id and magic is required\n";
             faultJobs('stop', undef, undef, $PSTAMP_NOT_DESTREAKED);
-        } elsif ($dsRun_state eq 'cleaned') {
-            my $command = "$magicdstool -updaterun -set_state new -stage $stage -stage_id $stage_id";
-            $command .= " -set_label $rlabel" if $rlabel;
-            if (!$no_update) {
-                my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-                    run(command => $command, verbose => $verbose);
-                unless ($success) {
-                    my_die("failed to set destreak run to 'new' for ${stage}Run $stage_id",
-                        $PS_EXIT_UNKNOWN_ERROR);
+        } elsif (($dsRun_state eq 'cleaned') or ($dsRun_state eq 'update')) {
+            foreach my $c (@$components) {
+                my $command = "$magicdstool -setfiletoupdate -magic_ds_id $magic_ds_id -component $c";
+                $command .= " -set_label $rlabel" if $rlabel;
+                if (!$no_update) {
+                    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+                        run(command => $command, verbose => $verbose);
+                    unless ($success) {
+                        my_die("failed to set destreaked component to 'update' for ${stage}Run $stage_id $c",
+                            $PS_EXIT_UNKNOWN_ERROR);
+                    }
+                } else {
+                    print "skipping $command\n";
                 }
-            } else {
-                print "skipping $command\n";
             }
         } elsif ($dsRun_state eq 'failed_revert') {
Index: trunk/pstamp/scripts/pstamp_get_image_job.pl
===================================================================
--- trunk/pstamp/scripts/pstamp_get_image_job.pl	(revision 29429)
+++ trunk/pstamp/scripts/pstamp_get_image_job.pl	(revision 29561)
@@ -105,4 +105,7 @@
     $command .= " --prefix $prefix";
     $command .= " --magicked" if $magicked;
+    # DANGER DANGER do not commit next line
+#    $command .= " --no_magic";
+    # DANGER DANGER do not commit last line
     $command .= " --dbname $dbname" if $dbname;
     $command .= " --verbose" if $verbose;
Index: trunk/pstamp/scripts/pstamp_server_status
===================================================================
--- trunk/pstamp/scripts/pstamp_server_status	(revision 29429)
+++ trunk/pstamp/scripts/pstamp_server_status	(revision 29561)
@@ -57,5 +57,6 @@
     $error_code = (($error_code >> 8) or 1);
     if ($error_code == 12) {
-        print "Postage Stamp Server is not running\n";
+        #print "Postage Stamp Server is not running\n";
+        print "Postage Stamp Server will be down for maintenance until approximately 0400 UTC October 26\n";
         exit 0;
     }
