]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/interface/getter.ml
This commit was manufactured by cvs2svn to create tag 'V6-2'.
[helm.git] / helm / interface / getter.ml
index 21c1901a183722c4b2ac040964827f7353c4e06f..d79409c8933f8181e432f1b1d5b6ff73d84a2f71 100644 (file)
@@ -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 *)
@@ -115,8 +121,8 @@ let get uri =
  let module U = UriManager in
   get_file
    (U.uri_of_string
-    (Str.replace_first (Str.regexp "\.ann$") ""
-     (Str.replace_first (Str.regexp "\.types$") "" (U.string_of_uri uri))))
+    (Str.replace_first (Str.regexp "\.types$") ""
+     (Str.replace_first (Str.regexp "\.ann$") "" (U.string_of_uri uri))))
 ;;
 
 (* get_ann : uri -> filename *)