Index: trunk/ippScripts/scripts/dist_make_fileset.pl
===================================================================
--- trunk/ippScripts/scripts/dist_make_fileset.pl	(revision 25432)
+++ trunk/ippScripts/scripts/dist_make_fileset.pl	(revision 25567)
@@ -39,5 +39,5 @@
 
 # Parse the command-line arguments
-my ($dist_id, $dist_dir, $target_id, $stage, $stage_id, $prod_id, $product_name, $ds_dbhost, $ds_dbname);
+my ($dist_id, $dist_dir, $target_id, $stage, $stage_id, $dest_id, $product_name, $ds_dbhost, $ds_dbname);
 my ($dbname, $save_temps, $verbose, $no_update, $logfile);
 
@@ -48,5 +48,5 @@
            'stage=s'        => \$stage,      # raw, chip, camera, fake, warp, stack, or diff
            'stage_id=s'     => \$stage_id,   # exp_id, chip_id, etc.
-           'prod_id=s'      => \$prod_id,    # id for the product
+           'dest_id=s'      => \$dest_id,    # id for the product
            'product_name=s' => \$product_name,  # location of the data store directory for this product
            'ds_dbhost=s'    => \$ds_dbhost,  # database host for the datastore database
@@ -60,5 +60,5 @@
 
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
-pod2usage( -msg => "Required options: --dist_id --dist_dir --target_id --stage --stage_id --prod_id --ds_dbhost --ds_dbname",
+pod2usage( -msg => "Required options: --dist_id --dist_dir --target_id --stage --stage_id --dest_id --ds_dbhost --ds_dbname",
            -exitval => 3) unless
     defined $dist_id and
@@ -67,5 +67,5 @@
     defined $stage and
     defined $stage_id and
-    defined $prod_id and
+    defined $dest_id and
     defined $product_name and
     defined $ds_dbhost and
@@ -79,7 +79,8 @@
 my $fs_tag = get_fileset_tag($ipprc, $stage, $stage_id, $dbname);
 
-&my_die("failed to lookup fileset tag", $dist_id, $prod_id, $PS_EXIT_UNKNOWN_ERROR) if !defined $fs_tag;
-
-my $fileset_name = "$fs_tag$stage.$stage_id.$dist_id.$prod_id";
+&my_die("failed to lookup fileset tag", $dist_id, $dest_id, $PS_EXIT_UNKNOWN_ERROR) if !defined $fs_tag;
+
+my $fileset_name = $fs_tag ? "$fs_tag." : "";
+$fileset_name .= "$stage.$stage_id.$dist_id.$dest_id";
 
 print "$fileset_name\n";
@@ -89,5 +90,5 @@
 my $dbinfo_file = "dbinfo.$stage.$stage_id.mdc";
 if (! -e "$dist_dir/$dbinfo_file" ) {
-    &my_die("dbinfo file for dist run $dbinfo_file not found", $dist_id, $prod_id, $PS_EXIT_UNKNOWN_ERROR);
+    &my_die("dbinfo file for dist run $dbinfo_file not found", $dist_id, $dest_id, $PS_EXIT_UNKNOWN_ERROR);
 }
 print "dbinfo file $dbinfo_file exists\n" if $verbose;
@@ -96,5 +97,5 @@
 my $dirinfo_file = "dirinfo.$stage.$stage_id.mdc";
 if (! -e "$dist_dir/$dirinfo_file" ) {
-    &my_die("dirinfo file for dist run $dirinfo_file not found", $dist_id, $prod_id, $PS_EXIT_UNKNOWN_ERROR);
+    &my_die("dirinfo file for dist run $dirinfo_file not found", $dist_id, $dest_id, $PS_EXIT_UNKNOWN_ERROR);
 }
 print "dirinfo file $dirinfo_file exists\n" if $verbose;
@@ -116,9 +117,9 @@
     unless ($success) {
         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-        &my_die("Unable to perform $command error_code: $error_code", $dist_id, $prod_id, $error_code);
+        &my_die("Unable to perform $command error_code: $error_code", $dist_id, $dest_id, $error_code);
     }
 
     my $metadata = $mdcParser->parse (join "", @$stdout_buf) or
-        &my_die("Unable to parse metadata config doc", $dist_id, $prod_id, $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to parse metadata config doc", $dist_id, $dest_id, $PS_EXIT_PROG_ERROR);
 
     $components = parse_md_list($metadata);
@@ -153,5 +154,7 @@
 
     # set the product specific columns in product list
-    $command .= " --ps0 $target_id --ps1 $stage --ps2 $stage_id --ps3 $fs_tag";
+    my $prod_col_3 = $fs_tag ? $fs_tag : "$stage.$stage_id";
+
+    $command .= " --ps0 $target_id --ps1 $stage --ps2 $stage_id --ps3 $prod_col_3";
 
     $command .= " --dbname $ds_dbname";    # XXX: notyet --dbhost $ds_dbhost
@@ -161,10 +164,10 @@
     unless ($success) {
         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-        &my_die("Unable to perform $command error_code: $error_code", $dist_id, $prod_id, $error_code);
+         &my_die("Unable to perform $command error_code: $error_code", $dist_id, $dest_id, $error_code);
     }
 }
 
 {
-    my $command = "$disttool -addfileset -dist_id $dist_id -prod_id $prod_id -name $fileset_name";
+    my $command = "$disttool -addfileset -dist_id $dist_id -dest_id $dest_id -name $fileset_name";
     $command .= " -dbname $dbname" if $dbname;
 
@@ -175,5 +178,5 @@
         # We need to have revertfileset check whether the fileset exists and do dsreg -del if it does
         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-        &my_die("Unable to perform $command error_code: $error_code", $dist_id, $prod_id, $error_code);
+        &my_die("Unable to perform $command error_code: $error_code", $dist_id, $dest_id, $error_code);
     }
 }
@@ -252,11 +255,11 @@
     my $msg = shift;
     my $dist_id = shift;
-    my $prod_id = shift;
+    my $dest_id = shift;
     my $fault = shift;
 
-    # TODO: disttool -adddsfileset -prod_id $prod_id -dist_id $dist_id -fault $fault
+    # TODO: disttool -adddsfileset -dest_id $dest_id -dist_id $dist_id -fault $fault
     print STDERR "$msg\n";
 
-    my $command = "$disttool -addfileset -dist_id $dist_id -prod_id $prod_id -fault $fault";
+    my $command = "$disttool -addfileset -dist_id $dist_id -dest_id $dest_id -fault $fault";
     $command .= " -dbname $dbname" if $dbname;
 
