Index: /trunk/ippScripts/scripts/publish_file.pl
===================================================================
--- /trunk/ippScripts/scripts/publish_file.pl	(revision 35162)
+++ /trunk/ippScripts/scripts/publish_file.pl	(revision 35163)
@@ -92,4 +92,6 @@
 
 my $comment;                    # Comment for exposure
+my $exp_name_1;                    # Name of exposure 1
+my $exp_name_2;                    # Name of exposure 2
 if ($stage eq 'camera') {
     my $command =  "camtool -processedexp -cam_id $stage_id";
@@ -168,5 +170,5 @@
     my %negative;               # Data for negative diff detections
     foreach my $comp ( @$components ) {
-	my $path_base = $comp->{path_base}; # Base name for file
+        my $path_base = $comp->{path_base}; # Base name for file
         if (!$need_magic and $comp->{magicked}) {
             # This client is authorized to receive uncensored detections
@@ -178,4 +180,6 @@
         print "Warning: mis-matched comments\n" if defined $comment and $comment ne $comp->{comment};
         $comment = $comp->{comment} unless defined $comment;
+        $exp_name_1 = $comp->{exp_name_1} unless defined $exp_name_1;
+        $exp_name_2 = $comp->{exp_name_2} unless defined $exp_name_2;
 
         (carp "Bad zpt_obs or exp_time for component" and next) if not defined $comp->{zpt_obs} or not defined $comp->{exp_time};
@@ -192,49 +196,49 @@
         &my_die("input file does not exist: $filename", $pub_id, $PS_EXIT_SYS_ERROR) if !$ipprc->file_exists($filename);
         my $resolved = $ipprc->file_resolve($filename);
-        
+
         &my_die("unable to resolve input file: $filename", $pub_id, $PS_EXIT_SYS_ERROR) if !$resolved;
 
         $filename = $resolved;
 
-	my $cam_id = $comp->{cam_id_1};
-	#print "Getting info from camera stage $cam_id\n";
-	my $cam_command =  "$camtool -processedexp -cam_id $cam_id";
-	$cam_command .= " -dbname $dbname" if defined $dbname;
-	my ( $cam_success, $cam_error_code, $cam_full_buf, $cam_stdout_buf, $cam_stderr_buf ) =
-	    run(command => $cam_command, verbose => $verbose);
-	&my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $cam_success;
-	my $cam_metadata = $mdcParser->parse(join "", @$cam_stdout_buf) or
-	    &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR);
-	my $cam_components = parse_md_list($cam_metadata) or
-	    &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR);
-	&my_die("More than one entry for cam_id $stage_id", $pub_id, $PS_EXIT_PROG_ERROR) if scalar @$cam_components > 1;
-	my $cam_comp = $$cam_components[0];
-
-	my $exp_id = $comp->{exp_id_1};
-	#print "Getting info from raw stage $exp_id\n";
-	my $reg_command =  "$regtool -processedimfile -exp_id $exp_id";
-	$reg_command .= " -dbname $dbname" if defined $dbname;
-	my ( $reg_success, $reg_error_code, $reg_full_buf, $reg_stdout_buf, $reg_stderr_buf ) =
-	    run(command => $reg_command, verbose => $verbose);
-	&my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $reg_success;
-	my $reg_metadata = $mdcParser->parse(join "", @$reg_stdout_buf) or
-	    &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR);
-	my $reg_components = parse_md_list($reg_metadata) or
-	    &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR);
-	my $reg_comp = $$reg_components[0];
-
-	# Now get the difftype value from diff->{diff_mode}
-	my $difftype = "";
-	if ($comp->{diff_mode} == 1) {
-	    $difftype = "WW";
-	} elsif ($comp->{diff_mode} == 2) {
-	    $difftype = "WS";
-	} elsif ($comp->{diff_mode} == 3) {
-	    $difftype = "SW"; # Not used yet
-	} elsif ($comp->{diff_mode} == 4) {
-	    $difftype = "SS";
-	} else {
-	    $difftype = "Unsupported diff_mode value: [" . $comp->{diff_mode} . "]";
-	}
+        my $cam_id = $comp->{cam_id_1};
+        #print "Getting info from camera stage $cam_id\n";
+        my $cam_command =  "$camtool -processedexp -cam_id $cam_id";
+        $cam_command .= " -dbname $dbname" if defined $dbname;
+        my ( $cam_success, $cam_error_code, $cam_full_buf, $cam_stdout_buf, $cam_stderr_buf ) =
+            run(command => $cam_command, verbose => $verbose);
+        &my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $cam_success;
+        my $cam_metadata = $mdcParser->parse(join "", @$cam_stdout_buf) or
+            &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR);
+        my $cam_components = parse_md_list($cam_metadata) or
+            &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR);
+        &my_die("More than one entry for cam_id $stage_id", $pub_id, $PS_EXIT_PROG_ERROR) if scalar @$cam_components > 1;
+        my $cam_comp = $$cam_components[0];
+
+        my $exp_id = $comp->{exp_id_1};
+        #print "Getting info from raw stage $exp_id\n";
+        my $reg_command =  "$regtool -processedimfile -exp_id $exp_id";
+        $reg_command .= " -dbname $dbname" if defined $dbname;
+        my ( $reg_success, $reg_error_code, $reg_full_buf, $reg_stdout_buf, $reg_stderr_buf ) =
+            run(command => $reg_command, verbose => $verbose);
+        &my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $reg_success;
+        my $reg_metadata = $mdcParser->parse(join "", @$reg_stdout_buf) or
+            &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR);
+        my $reg_components = parse_md_list($reg_metadata) or
+            &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR);
+        my $reg_comp = $$reg_components[0];
+
+        # Now get the difftype value from diff->{diff_mode}
+        my $difftype = "";
+        if ($comp->{diff_mode} == 1) {
+            $difftype = "WW";
+        } elsif ($comp->{diff_mode} == 2) {
+            $difftype = "WS";
+        } elsif ($comp->{diff_mode} == 3) {
+            $difftype = "SW"; # Not used yet
+        } elsif ($comp->{diff_mode} == 4) {
+            $difftype = "SS";
+        } else {
+            $difftype = "Unsupported diff_mode value: [" . $comp->{diff_mode} . "]";
+        }
 
         my $data = { zp => $zp,
@@ -250,12 +254,12 @@
                      output_format => $comp->{output_format},
                      direction => 1,
-		     comment => $reg_comp->{comment},
-		     obsmode => $reg_comp->{obs_mode},
-		     difftype => $difftype,
-		     sky => $cam_comp->{bg},
-		     shutoutc => $reg_comp->{dateobs},
+                     comment => $reg_comp->{comment},
+                     obsmode => $reg_comp->{obs_mode},
+                     difftype => $difftype,
+                     sky => $cam_comp->{bg},
+                     shutoutc => $reg_comp->{dateobs},
         };
 
-	#warn("Checking for positive");
+        #warn("Checking for positive");
         diff_check(\%positive, $data, "positive");
 
@@ -288,12 +292,12 @@
                          diff_id => $comp->{diff_id},
                          direction => 0,
-			 comment => $reg_comp->{comment},
-			 obsmode => $reg_comp->{obs_mode},
-			 difftype => $difftype,
-			 sky => $cam_comp->{bg},
-			 shutoutc => $reg_comp->{dateobs},
+                         comment => $reg_comp->{comment},
+                         obsmode => $reg_comp->{obs_mode},
+                         difftype => $difftype,
+                         sky => $cam_comp->{bg},
+                         shutoutc => $reg_comp->{dateobs},
             };
 
-	    #warn("Checking for negative");
+            #warn("Checking for negative");
             diff_check(\%negative, $data, "negative");
 
@@ -326,4 +330,6 @@
     my $command = "$dsreg --add pub.$pub_id.$stage.$stage_id --copy --abspath --product $product --type $dsType --list $dsFileName";
     $command .= " --ps0 \"$comment\"" if defined $comment;
+    $command .= " --ps1 \"$exp_name_1\"" if defined $exp_name_1;
+    $command .= " --ps2 \"$exp_name_2\"" if defined $exp_name_2;
 
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
