Index: trunk/pstamp/scripts/dqueryparse.pl
===================================================================
--- trunk/pstamp/scripts/dqueryparse.pl	(revision 27859)
+++ trunk/pstamp/scripts/dqueryparse.pl	(revision 27874)
@@ -26,5 +26,5 @@
 
 my ($no_update, $imagedb, $label);
-my ($req_file, $req_id, $out_dir, $product, $mode, $dbname, $dbserver, $verbose, $save_temps);
+my ($req_file, $req_id, $outdir, $product, $mode, $dbname, $dbserver, $verbose, $save_temps);
 my ($job_id,$rownum); # stuff from the post-update world
 #
@@ -37,5 +37,5 @@
         'job_id=s'        =>      \$job_id,
         'rownum=s'        =>      \$rownum,
-        'out_dir=s'       =>      \$out_dir,
+        'outdir=s'       =>      \$outdir,
         'label=s'         =>      \$label,
         'product=s'       =>      \$product,
@@ -52,5 +52,5 @@
 if ($mode ne "list_uri") {
     die "req_id is required" if !$req_id;
-    die "out_dir is required" if !$out_dir;
+    die "outdir is required" if !$outdir;
     die "product is required" if !$product;
 }
@@ -80,7 +80,7 @@
 # Unless we're running as a job, write the parse arguments in case we need to rerun this parsing.
 if (!$job_id) {
-    my $argslist = "$out_dir/parse.args";
+    my $argslist = "$outdir/parse.args";
     open ARGSLIST, ">$argslist" or my_die("failed to open argslist file $argslist", $job_id, $PS_EXIT_UNKNOWN_ERROR);
-    print ARGSLIST "--label $label --mode $mode --req_id $req_id --product $product --out_dir $out_dir --file $req_file\n";
+    print ARGSLIST "--label $label --mode $mode --req_id $req_id --product $product --outdir $outdir --file $req_file\n";
     close ARGSLIST;
 }
@@ -105,17 +105,17 @@
 
 # Set up the workdir for this query.
-if (! -e $out_dir ) {
-    mkdir $out_dir or my_die("cannot create output directory $out_dir", $PS_EXIT_PROG_ERROR);
-} elsif (! -d $out_dir ) {
-    my_die ("output fileset directory $out_dir exists but is not a directory", $PS_EXIT_PROG_ERROR);
+if (! -e $outdir ) {
+    mkdir $outdir or my_die("cannot create output directory $outdir", $PS_EXIT_PROG_ERROR);
+} elsif (! -d $outdir ) {
+    my_die ("output fileset directory $outdir exists but is not a directory", $PS_EXIT_PROG_ERROR);
 }
 
 
 # Pass along the request file to the response generator.
-my $response_file = "$out_dir/${req_name}.dresponse.${req_id}.fits";
+my $response_file = "$outdir/${req_name}.dresponse.${req_id}.fits";
 my $fault;
 my $data_to_update = '';
 {
-    my $command = "$detectresponse --input $req_file --output $response_file --workdir $out_dir";
+    my $command = "$detectresponse --input $req_file --output $response_file --workdir $outdir";
     $command .= " --save-temps" if $save_temps;
     $command .= " --verbose" if $verbose;
@@ -137,5 +137,5 @@
 # for the completed work, and move the response to a standardized name.
 if ($fault == 0) {
-    my $command = "$pstamptool -addjob -req_id $req_id -outputBase $out_dir"; 
+    my $command = "$pstamptool -addjob -req_id $req_id -outputBase $outdir"; 
     $command .= " -job_type detect_query -state stop -fault 0";
     $command .= " -rownum 1";
@@ -147,5 +147,5 @@
         chomp $job_id;
         if ($job_id && -e $response_file) {
-            rename $response_file, "$out_dir/response${job_id}.fits";
+            rename $response_file, "$outdir/response${job_id}.fits";
         }
         $result = 0;
@@ -158,8 +158,8 @@
     # Failed to run correctly, which means that we need to queue a job and flag data for updating.
     # Get the dependency id for the data we're requesting be updated.
-    my $dep_id = queue_update_run($req_id,$job_id,$out_dir,$label,$data_to_update);
+    my $dep_id = queue_update_run($req_id,$job_id,$outdir,$label,$data_to_update);
 
     # Link this request to a job and link that job to any dependency
-    my $command = "$pstamptool -addjob -req_id $req_id -outputBase $out_dir"; 
+    my $command = "$pstamptool -addjob -req_id $req_id -outputBase $outdir"; 
     $command .= " -job_type detect_query -state run -fault 0";
     $command .= " -rownum 1";
@@ -174,5 +174,5 @@
         if ($job_id && -e $response_file) {
 	    # We shouldn't have a response file at this stage.
-            rename $response_file, "$out_dir/response${job_id}.fits";
+            rename $response_file, "$outdir/response${job_id}.fits";
         }
         $result = 0;
@@ -186,6 +186,6 @@
 # which will notice that we've inserted the stopped job and decide we're finished. Easy enough.
 {
-    my $command = "$pstamptool -updatereq -req_id $req_id -name $req_name -outProduct $product";
-    $command .= " -fault $result" if $result;
+    my $command = "$pstamptool -updatereq -req_id $req_id -set_name $req_name -set_outProduct $product";
+    $command .= " -set_fault $result" if $result;
 
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -201,5 +201,5 @@
 # If we have to queue an update run, do so and create a new dependent
 sub queue_update_run {
-    my ($req_id, $job_id, $out_dir, $label, $data_to_update) = @_;
+    my ($req_id, $job_id, $outdir, $label, $data_to_update) = @_;
 
     my ($state, $stage, $stage_id, $component, $need_magic, $imagedb) = split /\s+/, $data_to_update;
@@ -211,5 +211,5 @@
     my $dep_id;
     my $command = "$pstamptool -getdependent -stage $stage -stage_id $stage_id -imagedb $imagedb -component $component ";
-    $command .= " -outdir $out_dir";
+    $command .= " -outdir $outdir";
     $command .= " -need_magic" if $need_magic;
 
