Index: trunk/pstamp/scripts/pstamp_check_dependents.pl
===================================================================
--- trunk/pstamp/scripts/pstamp_check_dependents.pl	(revision 26242)
+++ trunk/pstamp/scripts/pstamp_check_dependents.pl	(revision 26289)
@@ -25,5 +25,5 @@
 use PS::IPP::PStamp::Job qw( :standard );
 
-my ( $dep_id, $dep_state, $stage, $stage_id, $imagedb, $rlabel, $no_magic, $dbname, $dbserver);
+my ( $dep_id, $dep_state, $stage, $stage_id, $imagedb, $no_magic, $dbname, $dbserver);
 my ( $no_update, $verbose, $save_temps, $logfile);
 
@@ -34,5 +34,4 @@
            'stage_id=s'     => \$stage_id,
 	   'imagedb=s'      => \$imagedb,
-	   'rlabel=s'       => \$rlabel,
 	   'no-magic=s'     => \$no_magic,
 	   'dbname=s'       => \$dbname,
@@ -46,6 +45,6 @@
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
 
-die "--dep_id --state --stage --stage_id --imagedb and --rlabel are requried \n"
-    if !$dep_id or !$dep_state or !$stage or !$stage_id or !$imagedb or !$rlabel;
+die "--dep_id --state --stage --stage_id and --imagedb are requried \n"
+    if !$dep_id or !$dep_state or !$stage or !$stage_id or !$imagedb;
 
 my $ipprc = PS::IPP::Config->new(); # IPP Configuration
@@ -103,13 +102,11 @@
     } else {
 
-        # XXX: TODO set label to the "standard" update value
-
         # don't update if in runs are in state goto_cleaned, wait for clean to finish
         if ($state eq "cleaned") {
-            runcommand("$chiptool -dbname $imagedb -chip_id $stage_id -updaterun -set_state update");
-        }
-
-        # don't update yet if magicDSRuns are in state goto_purged, wait for purge to finish
-        if ($magic_ds_state eq "purged") {
+            runcommand("$chiptool -dbname $imagedb -chip_id $stage_id -updaterun -set_state update -set_label update");
+        }
+
+        # don't update yet if magicDSRuns are in state goto_cleaned, wait for purge to finish
+        if ($magic_ds_state eq "cleaned") {
             my $magic_ds_id = $run_state->{magic_ds_id};
             runcommand("$magicdstool -dbname $imagedb -magic_ds_id $magic_ds_id -updaterun -set_state new");
@@ -145,18 +142,16 @@
     } else {
 
-        # XXX: TODO set label to the "standard" update value
-
         # don't update if in runs are in state goto_cleaned, wait for clean to finish
         if ($state eq 'cleaned') {
-            runcommand("$warptool -dbname $imagedb -warp_id $stage_id -updaterun -set_state update");
+            runcommand("$warptool -dbname $imagedb -warp_id $stage_id -updaterun -set_state update -set_label update");
         }
 
         if ($chip_state eq 'cleaned') {
             my $chip_id = $run_state->{chip_id};
-            runcommand("$chiptool -dbname $imagedb -chip_id $chip_id -updaterun -set_state update");
-        }
-
-        # don't update yet if magicDSRuns are in state goto_purged, wait for purge to finish
-        if ($magic_ds_state eq 'purged') {
+            runcommand("$chiptool -dbname $imagedb -chip_id $chip_id -updaterun -set_state update -set_label update");
+        }
+
+        # don't update yet if magicDSRuns are in state goto_cleaned, wait for purge to finish
+        if ($magic_ds_state eq 'cleaned') {
             my $magic_ds_id = $run_state->{magic_ds_id};
             runcommand("$magicdstool -dbname $imagedb -magic_ds_id $magic_ds_id -updaterun -set_state new");
@@ -190,7 +185,9 @@
         }
         return join "", @$stdout_buf if defined wantarray();
+        return $success;
     } else {
         print STDERR "skipping $command\n";
     }
+    return 1;
 }
 
Index: trunk/pstamp/scripts/pstamp_finish.pl
===================================================================
--- trunk/pstamp/scripts/pstamp_finish.pl	(revision 26242)
+++ trunk/pstamp/scripts/pstamp_finish.pl	(revision 26289)
@@ -315,11 +315,15 @@
     my $comment = $row->{COMMENT};
     $comment = "null" if !$comment;
-    my $label = $row->{LABEL};
-    $label = "null" if !$label;
+    my $data_group = $row->{DATA_GROUP};
+    if (!defined $data_group) {
+        # XXX: backwards compatibility hook. Remove "soon".
+        $data_group = $row->{LABEL};
+    }
+    $data_group = "null" if !$data_group;
 
     # This is ugly, error prone and hard to change.
     # Create a results file module and provide a list of the names (we have the data in the columns)
     my $rowinfo = "$row->{PROJECT}|$row->{JOB_TYPE}|$row->{REQ_TYPE}|$row->{IMG_TYPE}|";
-    $rowinfo   .= "$row->{ID}|$tess_id|$component|$label|$row->{OPTION_MASK}|$row->{MJD_MIN}|$row->{MJD_MAX}|";
+    $rowinfo   .= "$row->{ID}|$tess_id|$component|$data_group|$row->{OPTION_MASK}|$row->{MJD_MIN}|$row->{MJD_MAX}|";
     $rowinfo   .= "$row->{REQFILT}|$row->{COORD_MASK}|$row->{CENTER_X}|$row->{CENTER_Y}|";
     $rowinfo   .= "$row->{WIDTH}|$row->{HEIGHT}|";
Index: trunk/pstamp/scripts/pstamp_request_file
===================================================================
--- trunk/pstamp/scripts/pstamp_request_file	(revision 26242)
+++ trunk/pstamp/scripts/pstamp_request_file	(revision 26289)
@@ -69,5 +69,5 @@
         { name => 'COMPONENT',  type => '64A', writetype => TSTRING },
 
-        { name => 'LABEL ',     type => '64A', writetype => TSTRING },
+        { name => 'DATA_GROUP ',type => '64A', writetype => TSTRING },
 
         { name => 'REQFILT',    type => '16A', writetype => TSTRING },
@@ -324,5 +324,5 @@
     print "  REQ_NAME EXTVER\n\n";
     print "REQUEST specification (1 or more lines). Format:\n\n";
-    print "  ROWNUM CENTER_X CENTER_Y WIDTH HEIGHT COORD_MASK JOB_TYPE OPTION_MASK PROJECT REQ_TYPE IMG_TYPE ID TESS_ID COMPONENT LABEL REQFILT MJD_MIN MJD_MAX | COMMENT\n\n";
+    print "  ROWNUM CENTER_X CENTER_Y WIDTH HEIGHT COORD_MASK JOB_TYPE OPTION_MASK PROJECT REQ_TYPE IMG_TYPE ID TESS_ID COMPONENT DATA_GROUP REQFILT MJD_MIN MJD_MAX | COMMENT\n\n";
 
     exit 0;
Index: trunk/pstamp/scripts/pstamp_results_file.pl
===================================================================
--- trunk/pstamp/scripts/pstamp_results_file.pl	(revision 26242)
+++ trunk/pstamp/scripts/pstamp_results_file.pl	(revision 26289)
@@ -90,5 +90,5 @@
         { name => 'TESS_ID',    type => '64A', writetype => TSTRING },    
         { name => 'COMPONENT',  type => '64A', writetype => TSTRING },    
-        { name => 'LABEL',      type => '64A', writetype => TSTRING },    
+        { name => 'DATA_GROUP', type => '64A', writetype => TSTRING },    
 
         # output parameters
Index: trunk/pstamp/scripts/pstampparse.pl
===================================================================
--- trunk/pstamp/scripts/pstampparse.pl	(revision 26242)
+++ trunk/pstamp/scripts/pstampparse.pl	(revision 26289)
@@ -193,5 +193,10 @@
     my $mjd_min = $row->{MJD_MIN};
     my $mjd_max = $row->{MJD_MAX};
-    my $label   = $row->{LABEL};
+    my $data_group = $row->{DATA_GROUP};
+    if (!defined $data_group) {
+        # backwards compatability hook
+        $data_group = $row->{LABEL};
+    }
+        
     my $x       = $row->{CENTER_X};
     my $y       = $row->{CENTER_Y};
@@ -272,5 +277,5 @@
     # request specification. An array reference is returned.
     $imageList = locate_images($ipprc, $image_db, $req_type, $stage, $id, $tess_id, $search_component,
-                $inverse, $need_magic, $x, $y, $mjd_min, $mjd_max, $filter, $label, $verbose);
+                $inverse, $need_magic, $x, $y, $mjd_min, $mjd_max, $filter, $data_group, $verbose);
 
     if (!$imageList or !@$imageList) {
@@ -424,5 +429,5 @@
                     # set up to queue an update run
                     queue_update_run(\$newState, \$fault, \$dep_id, $image->{image_db}, 
-                        $run_state, $stage, $image->{stage_id}, $need_magic, $image->{label});
+                        $run_state, $stage, $image->{stage_id}, $need_magic);
                 }
             }
@@ -548,5 +553,5 @@
                 # we collected a set of sky coordinates above.
                 # filter the images so that only those that contain the centers of the ROIs are processed
-                my $command = "$dvoImagesAtCoords $pointsListName";
+                my $command = "$dvoImagesAtCoords -coords $pointsListName";
                 if ($have_skycells) {
                     my $tess_id = $thisRun->[0]->{tess_id};
@@ -671,5 +676,5 @@
                     # set up to queue an update run
                     queue_update_run(\$newState, \$fault, \$dep_id, $image->{image_db}, 
-                        $run_state, $stage, $image->{stage_id}, $need_magic, $image->{label});
+                        $run_state, $stage, $image->{stage_id}, $need_magic);
                 }
             }
@@ -801,5 +806,5 @@
     return 0 if ($r1->{TESS_ID}  ne $r2->{TESS_ID});
     return 0 if ($r1->{REQFILT}  ne $r2->{REQFILT});
-    return 0 if ($r1->{LABEL}    ne $r2->{LABEL});
+    return 0 if ($r1->{DATA_GROUP}    ne $r2->{DATA_GROUP});
     return 0 if ($r1->{MJD_MIN}  ne $r2->{MJD_MAX});
     return 0 if ($r1->{MJD_MAX}  ne $r2->{MJD_MAX});
@@ -850,5 +855,5 @@
 sub queue_update_run 
 {
-    my ($r_jobState, $r_fault, $r_dep_id, $imagedb, $state, $stage, $stage_id, $need_magic, $label) = @_;
+    my ($r_jobState, $r_fault, $r_dep_id, $imagedb, $state, $stage, $stage_id, $need_magic) = @_;
 
     if (($state ne 'cleaned') and ($state ne 'update') and ($state ne 'goto_cleaned')) {
@@ -858,5 +863,4 @@
     my $dep_id;
     my $command = "$pstamptool -getdependent -stage $stage -stage_id $stage_id -imagedb $imagedb";
-    $command .= " -rlabel $label" if $label;
     $command .= " -no_magic" if !$need_magic;
     if (!$no_update) {
