X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Finterface%2Fgetter.ml;h=d79409c8933f8181e432f1b1d5b6ff73d84a2f71;hb=refs%2Ftags%2FV6-2;hp=21c1901a183722c4b2ac040964827f7353c4e06f;hpb=4e9a9c5ddfe635b338c2abf30f1e918d861e104d;p=helm.git diff --git a/helm/interface/getter.ml b/helm/interface/getter.ml index 21c1901a1..d79409c89 100644 --- a/helm/interface/getter.ml +++ b/helm/interface/getter.ml @@ -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 *)