Index: branches/eam_branch_20080121/ippTasks/summit.copy.pro
===================================================================
--- branches/eam_branch_20080121/ippTasks/summit.copy.pro	(revision 16175)
+++ branches/eam_branch_20080121/ippTasks/summit.copy.pro	(revision 16176)
@@ -19,10 +19,10 @@
 # XXX not sure how to handle the .N value if we need to use more than one
 if ($NEBULOUS)
- $workdir_default  = neb://
- $workdir_template = neb://
- $volume_default  = ipp004-v0
- $volume_template = @HOST@-v0
+ $default_host     = ipp004
+ $workdir_template = neb:///@HOST@-v0
+ $default_volume   = ipp004-v0
+ $volume_template  = 
 else
- $workdir_default  = /data/ipp004.0/
+ $default_host     = ipp004
  $workdir_template = /data/@HOST@.0/
 end
@@ -278,4 +278,7 @@
         book getword pzPendingImfile $pageName camera -var $CAMERA
 
+        set.host.by.camera $CAMERA $CLASS_ID
+        host        anyhost
+
         # 2007-08-30T05:09:59Z
         substr $DATEOBS 0 4 YEAR
@@ -284,21 +287,22 @@
 
         # we need to set the workdir based on 1) nebulous or not? 2) chip/host relationship
-        # this function uses workdir_template, workdir_default, volume_template, volume_default,
+        # this function uses workdir_template, default_host, volume_template, volume_default,
         # it sets workdir and volume
-       	set.workdir.by.camera $CAMERA $CLASS_ID
+       	set.workdir.by.camera $CAMERA $CLASS_ID $workdir_template $default_host workdir_base
+       	set.volume.by.camera $CAMERA $CLASS_ID $volume_template $default_volume volume
 
         # figure out filename
-	# XXXX this filename needs to use nebulous names
-        $FILENAME = $workdir/$CAMERA/$YEAR/$MONTH/$DAY/$EXP_NAME/$EXP_NAME.$CLASS_ID.fits
-        $FILEROOT = $workdir_template/$CAMERA/$YEAR/$MONTH/$DAY
+	# XXX may need to use sprintf here
+        $FILENAME = $workdir_base/$CAMERA/$YEAR$MONTH$DAY/$EXP_NAME/$EXP_NAME.$CLASS_ID.fits
+        $workdir = $workdir_template/$CAMERA/$YEAR$MONTH$DAY
+	# workdir examples:
+	# file://data/@HOST@.0/gpc1/20080130
+	# neb://gpc1/20080130 (need to supply volname?, or are we re-defining this each time?)
 
         book setword pzPendingImfile $pageName filename $FILENAME
-
-        set.host.by.camera $CAMERA $CLASS_ID
-        host        anyhost
 
         # store the pageName with this job
         options $pageName
-        options $FILEROOT
+        options $workdir
 
         $run = dsget --uri $URI --filename $FILENAME --bytes $BYTES 
@@ -330,6 +334,10 @@
         # these are functions of (at least) EXP_TYPE and SURVEY_ID, both of which should come from the data store
 
+	# we saved the workdir so we can pass it to pztool
+	$workdir = $options:1
+
 	# update the database with the success
-        $run = pztool -copydone -exp_name $EXP_NAME -inst $CAMERA -telescope $TELESCOPE -class $CLASS -class_id $CLASS_ID -uri $FILENAME -workdir $options:1
+	# for the moment, let's not propagate these
+        $run = pztool -copydone -exp_name $EXP_NAME -inst $CAMERA -telescope $TELESCOPE -class $CLASS -class_id $CLASS_ID -uri $FILENAME -workdir $workdir -end_stage reg
 	# tess_id, dvodb, workdir, end_stage
 
