]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/interface/getter.ml
Some Requires were missing. Same checks still missing in configure.in
[helm.git] / helm / interface / getter.ml
index 39af104ccb3e38de26d64ec5e500d1e84cea7627..a72db448bf7b70df3971b27e37a48dfa9e79c95d 100644 (file)
@@ -20,7 +20,7 @@ module MapOfStrings = Map.Make(OrderedStrings);;
 
 let read_index url =
  let module C = Configuration in
-  if Sys.command ("wget -c -P " ^ C.tmpdir ^ " " ^ url ^ "/\"" ^
+  if Sys.command ("helm_wget " ^ C.tmpdir ^ " " ^ url ^ "/\"" ^
    C.indexname ^ "\"") <> 0
   then
    raise (ErrorGetting url) ;
@@ -56,6 +56,8 @@ let rec mk_urls_of_uris =
          uris map
 ;;
 
+exception PerlGetterNotResponding;;
+
 let update () =
  let module C = Configuration in
   let fd = open_in C.servers_file in
@@ -72,7 +74,11 @@ let update () =
        Dbm.opendbm C.uris_dbm [Dbm.Dbm_wronly ; Dbm.Dbm_create] 0o660
       in
        MapOfStrings.iter (fun uri url -> Dbm.add dbm uri url) urls_of_uris ;
-       Dbm.close dbm
+       Dbm.close dbm ;
+       (* Inform also the Perl-getter *)
+       if Sys.command ("wget -O /dev/null http://localhost:8081/update") <> 0
+       then
+        raise PerlGetterNotResponding ;
 ;;
 
 (* url_of_uri : uri -> url *)
@@ -102,7 +108,7 @@ let get_file uri =
     begin
      let url = url_of_uri uri in
       (*CSC: use -q for quiet mode *)
-      if Sys.command ("wget -c -P " ^ dir ^ " \"" ^ url ^"\"") <> 0
+      if Sys.command ("helm_wget " ^ dir ^ " \"" ^ url ^"\"") <> 0
       then
        raise (ErrorGetting url) ;
     end ;