Index: trunk/pstamp/scripts/pstamp_dorequest.pl
===================================================================
--- trunk/pstamp/scripts/pstamp_dorequest.pl	(revision 16283)
+++ trunk/pstamp/scripts/pstamp_dorequest.pl	(revision 16358)
@@ -1,8 +1,8 @@
 #!/bin/env perl
 ###
-### pstampdo_req.pl
+### pstamp_dorequest.pl
 ###
-###     Run the jobs for a given request
-###     This is intended for running outside pantasks environment
+###     Excecute the jobs for a given request.
+###     Note: This is intended for testing outside of pantasks environment
 ###
 
@@ -16,5 +16,5 @@
 my $request_id = $ARGV[0];
 
-my $verbosity = 1;
+my $verbosity = 0;
 
 use Sys::Hostname;
@@ -77,6 +77,5 @@
     foreach my $job (@$jobs) {
         if ($job->{req_id} == $request_id) {
-            # there must be a better way to do this
-            print STDERR "adding $job->{job_id} to the list\n";
+            # print STDERR "adding $job->{job_id} to the list\n";
             $psjobs[@psjobs] = $job;
         }
@@ -85,6 +84,6 @@
 
 if (! @psjobs) {
+    # TODO: is this always an error, what if the job is no longer pending?
     print STDERR "no pending postage stamp jobs for request $request_id found\n";
-    # TODO: is this always an error, what if the job is no longer pending?
     exit 1;
 }
@@ -103,4 +102,13 @@
 # Update the state of the request
 #
+{
+    ## TODO: what about request status
+    my $command = "$pstamptool -processedreq -req_id $request_id -state stop"; 
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $command, verbose => $verbosity);
+    unless ($success) {
+        die("Unable to perform pstamptool -processedreq: $error_code");
+    }
+}
 
 exit 0;
