Index: trunk/DataStoreServer/web/cgi/dsgetindex
===================================================================
--- trunk/DataStoreServer/web/cgi/dsgetindex	(revision 16955)
+++ trunk/DataStoreServer/web/cgi/dsgetindex	(revision 17381)
@@ -5,7 +5,8 @@
 # The only required argument is the REQUEST_URI.
 # The number of elements in the URI tell us whether we are listing
-# the root, a product, or a fileset.
-#
-# if a second argument -html is provided, the output is in HTML
+# the data store root, a product, or a fileset.
+#
+# if a second argument -html is provided, the output is in HTML format
+# otherwise plain text is used
 #
 # The only thing specific to the ipp used here is the exit codes.
@@ -16,15 +17,7 @@
 use CGI ':standard';
 use IPC::Cmd 0.36 qw( can_run run );
-use PS::IPP::Config qw($PS_EXIT_SUCCESS
-		       $PS_EXIT_UNKNOWN_ERROR
-		       $PS_EXIT_SYS_ERROR
-		       $PS_EXIT_CONFIG_ERROR
-		       $PS_EXIT_PROG_ERROR
-		       $PS_EXIT_DATA_ERROR
-		       $PS_EXIT_TIMEOUT_ERROR
-		       metadataLookupStr
-		       metadataLookupBool
-		       caturi
-		       );
+
+my $PS_EXIT_CONFIG_ERROR = 3;
+my $PS_EXIT_DATA_ERROR = 5;
 
 my $uri = shift;
@@ -34,4 +27,8 @@
     exit ($PS_EXIT_CONFIG_ERROR);
 }
+
+my $DS_ROOT = $ENV{DS_ROOT};
+
+die("DS_ROOT not found in the environment") unless defined($DS_ROOT);
 
 my @path;
@@ -59,5 +56,5 @@
     # there is no file on the url
 
-    print STDERR "html mode\n";
+    # print STDERR "html mode\n";
 
     ($directories, $query_str) = split/\?/, $uri;
@@ -96,4 +93,5 @@
 
 if (@dirs) {
+    # XXX need to output an error page
     warn("unexpected extra directories: @dirs in uri: $uri");
     exit ($PS_EXIT_CONFIG_ERROR);
@@ -167,5 +165,5 @@
 # XXX:
 # quick hacky pretty printer
-# Stolen Eric's mock up
+# Stolen from Eric's Data Store mock up
 #
 
@@ -174,10 +172,8 @@
 
     print header('text/html', '200 OK');
-    print start_html('Datastore');
+    print start_html('Data Store');
 
 	# get free space
-        # XXX: need to configure DS_DIR
-        my $DS_DIR = '/var/www/html/ds/dsroot';
-	my $ref = df($DS_DIR);
+	my $ref = df($DS_ROOT);
 	printf '<p>Free space: %.2fG (%.1f%%)</p>',
 		$ref->{bfree}/(1024*1024),
