-let helm_dir = Hashtbl.find vars "helm_dir";;
-let dtd_dir = Hashtbl.find vars "dtd_dir";;
-let servers_file = Hashtbl.find vars "servers_file";;
-let uris_dbm = Hashtbl.find vars "uris_dbm";;
-let dest = Hashtbl.find vars "dest";;
-let indexname = Hashtbl.find vars "indexname";;
-let tmpdir = Hashtbl.find vars "tmpdir";;
-let helm_dir = Hashtbl.find vars "helm_dir";;
-let getter_url = Hashtbl.find vars "getter_url";;
+(* try to read a configuration variable, given its name into the
+ * configuration.xml file and its name into the shell environment.
+ * The shell variable, if present, has precedence over configuration.xml
+ *)
+let read_configuration_var_env xml_name env_name =
+ try
+ try
+ Sys.getenv env_name
+ with
+ Not_found -> Hashtbl.find vars xml_name
+ with
+ Not_found ->
+ Printf.printf "Sorry, cannot find variable `%s', please check your configuration\n" xml_name ;
+ flush stdout ;
+ raise Not_found
+
+let read_configuration_var xml_name =
+ try
+ Hashtbl.find vars xml_name
+ with
+ Not_found ->
+ Printf.printf "Sorry, cannot find variable `%s', please check your configuration\n" xml_name ;
+ flush stdout ;
+ raise Not_found
+
+let helm_dir = read_configuration_var "helm_dir";;
+let dtd_dir = read_configuration_var "dtd_dir";;
+let style_dir = read_configuration_var_env "style_dir" "HELM_STYLE_DIR";;
+let servers_file = read_configuration_var "servers_file";;
+let uris_dbm = read_configuration_var "uris_dbm";;
+let dest = read_configuration_var "dest";;
+let indexname = read_configuration_var "indexname";;
+let tmp_dir = read_configuration_var "tmp_dir"
+let helm_dir = read_configuration_var "helm_dir";;
+let getter_url = read_configuration_var_env "getter_url" "HELM_GETTER_URL";;
+let processor_url = read_configuration_var_env "processor_url" "HELM_PROCESSOR_URL";;