Index: trunk/DataStoreServer/scripts/dsprodtool
===================================================================
--- trunk/DataStoreServer/scripts/dsprodtool	(revision 16877)
+++ trunk/DataStoreServer/scripts/dsprodtool	(revision 17885)
@@ -29,14 +29,8 @@
 my $description;
 
-my $ps0;
-my $ps1;
-my $ps2;
-my $ps3;
-my $ps4;
-my $ps5;
-my $ps6;
-my $ps7;
-
-my $ds_dir;
+my ($ps0, $ps1, $ps2, $ps3, $ps4, $ps5, $ps6, $ps7);
+
+my $dsroot;
+my $dbname;
 
 my $add;
@@ -60,5 +54,7 @@
 	'ps5=s'		=>	\$ps5,
 	'ps6=s'		=>	\$ps6,
-	'ps7=s'		=>	\$ps7
+	'ps7=s'		=>	\$ps7,
+        'dbname=s'      =>      \$dbname,
+        'dsroot=s'      =>      \$dsroot,
 ) or pod2usage(2);
 
@@ -81,5 +77,4 @@
 }
 
-
 #
 # lookup the location of the Data Store
@@ -88,14 +83,14 @@
 my $ipprc =  PS::IPP::Config->new(); # IPP Configuration
 my $siteConfig = $ipprc->{_siteConfig};
-if (!$ds_dir) {
-    $ds_dir = metadataLookupStr($ipprc->{_siteConfig}, 'PSTAMP_DATA_STORE_ROOT');
-    if (!$ds_dir) {
+if (!$dsroot) {
+    $dsroot = metadataLookupStr($ipprc->{_siteConfig}, 'DATA_STORE_ROOT');
+    if (!$dsroot) {
         die("Data Store root directory not set");
     }
 }
 
-my $root_index_script = "$ds_dir/index.txt";
+my $root_index_script = "$dsroot/index.txt";
 if (!stat($root_index_script)) {
-    $err .= "Data Store not found at '$ds_dir'.\n"
+    $err .= "Data Store not found at '$dsroot'.\n"
 }
 
@@ -105,5 +100,5 @@
 
 my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER');
-my $dbname   = metadataLookupStr($siteConfig, 'DBNAME');
+$dbname      = metadataLookupStr($siteConfig, 'DBNAME') unless defined $dbname;
 my $dbuser   = metadataLookupStr($siteConfig, 'DBUSER');
 my $dbpass   = metadataLookupStr($siteConfig, 'DBPASSWORD');
@@ -115,5 +110,5 @@
 
 
-my $product_dir = "$ds_dir/$product";
+my $product_dir = "$dsroot/$product";
 my $index_script_name = "$product_dir/index.txt";
 
