From b84c60ff48a21a62a08e636f32cf0df46dfbe45a Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Wed, 6 Jul 2005 15:49:32 +0000 Subject: [PATCH] - updated META dependencies (no more dbm, no more shell) - removed module Http_getter_map --- helm/ocaml/METAS/meta.helm-getter.src | 2 +- helm/ocaml/getter/Makefile | 5 +- helm/ocaml/getter/http_getter_map.ml | 112 -------------------------- helm/ocaml/getter/http_getter_map.mli | 41 ---------- 4 files changed, 3 insertions(+), 157 deletions(-) delete mode 100644 helm/ocaml/getter/http_getter_map.ml delete mode 100644 helm/ocaml/getter/http_getter_map.mli diff --git a/helm/ocaml/METAS/meta.helm-getter.src b/helm/ocaml/METAS/meta.helm-getter.src index cb6d0a0e9..8a7badf74 100644 --- a/helm/ocaml/METAS/meta.helm-getter.src +++ b/helm/ocaml/METAS/meta.helm-getter.src @@ -1,4 +1,4 @@ -requires="http dbm pcre shell zip helm-xml helm-logger helm-thread helm-urimanager helm-registry" +requires="http unix pcre zip helm-xml helm-logger helm-urimanager helm-registry" version="0.0.1" archive(byte)="getter.cma" archive(native)="getter.cmxa" diff --git a/helm/ocaml/getter/Makefile b/helm/ocaml/getter/Makefile index 8732c11ff..c6450d178 100644 --- a/helm/ocaml/getter/Makefile +++ b/helm/ocaml/getter/Makefile @@ -2,8 +2,8 @@ PACKAGE = getter REQUIRES = \ - http dbm pcre shell zip \ - helm-xml helm-thread helm-logger helm-urimanager helm-registry + http unix pcre zip \ + helm-xml helm-logger helm-urimanager helm-registry INTERFACE_FILES = \ http_getter_wget.mli \ @@ -13,7 +13,6 @@ INTERFACE_FILES = \ http_getter_env.mli \ http_getter_storage.mli \ http_getter_common.mli \ - http_getter_map.mli \ http_getter.mli \ $(NULL) diff --git a/helm/ocaml/getter/http_getter_map.ml b/helm/ocaml/getter/http_getter_map.ml deleted file mode 100644 index 7c411d831..000000000 --- a/helm/ocaml/getter/http_getter_map.ml +++ /dev/null @@ -1,112 +0,0 @@ -(* - * Copyright (C) 2003-2004: - * Stefano Zacchiroli - * for the HELM Team http://helm.cs.unibo.it/ - * - * This file is part of HELM, an Hypertextual, Electronic - * Library of Mathematics, developed at the Computer Science - * Department, University of Bologna, Italy. - * - * HELM is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * HELM is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with HELM; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - * - * For details, see the HELM World-Wide-Web page, - * http://helm.cs.unibo.it/ - *) - -open Http_getter_types - -class map dbname = - let perm = 420 in (* permission 644 in decimal notation *) - let open_dbm () = - Http_getter_misc.mkdir ~parents:true (Filename.dirname dbname); - Dbm.opendbm dbname [ Dbm.Dbm_rdwr; Dbm.Dbm_create ] perm - in - - object (self) - - inherit ThreadSafe.threadSafe - - val mutable db = open_dbm () - val index_RE = Pcre.regexp "^theory:/.*/index.theory$" - - (*initializer Gc.finalise Dbm.close db (* close db on GC *)*) - - (* Backward compatibility code to map - theory:/path/t.theory into theory:/path/t/index.theory - when cic:/path/t/ exists *) - method private normalize_key key = - if Pcre.pmatch ~rex:index_RE key && - (try ignore (Dbm.find db key); false with Not_found -> true) - then - (* we substitute /index.theory with .theory *) - String.sub key 0 (String.length key - 13) ^ ".theory" - else key - - method add key value = - self#doWriter (lazy ( - try - Dbm.add db key value - with Dbm.Dbm_error "Entry already exists" -> raise (Key_already_in key) - )) - - method replace key value = - self#doWriter (lazy ( - Dbm.replace db key value - )) - - method remove key = - self#doWriter (lazy ( - try - Dbm.remove db key - with Dbm.Dbm_error "dbm_delete" -> raise (Key_not_found key) - )) - - method resolve key = - self#doReader (lazy ( - try - Dbm.find db (self#normalize_key key) - with Not_found -> raise (Key_not_found key) - )) - - method iter (f: string -> string -> unit) = - self#doReader (lazy ( - Dbm.iter f db - )) - - method sync = - self#doWriter (lazy ( - Dbm.close db; - db <- open_dbm () - )) - - method clear = - self#doWriter (lazy ( - Dbm.close db; - List.iter - (fun ext -> - let file = dbname ^ ext in - if Sys.file_exists file then Sys.remove file) - [".dir"; ".pag"; ".db"]; - db <- open_dbm () - )) - - method close = - self#doWriter (lazy ( - Dbm.close db - )) - - end - diff --git a/helm/ocaml/getter/http_getter_map.mli b/helm/ocaml/getter/http_getter_map.mli deleted file mode 100644 index 3e4ac7ba4..000000000 --- a/helm/ocaml/getter/http_getter_map.mli +++ /dev/null @@ -1,41 +0,0 @@ -(* - * Copyright (C) 2003-2004: - * Stefano Zacchiroli - * for the HELM Team http://helm.cs.unibo.it/ - * - * This file is part of HELM, an Hypertextual, Electronic - * Library of Mathematics, developed at the Computer Science - * Department, University of Bologna, Italy. - * - * HELM is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * HELM is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with HELM; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. - * - * For details, see the HELM World-Wide-Web page, - * http://helm.cs.unibo.it/ - *) - -class map: - string -> - object - method add: string -> string -> unit - method replace: string -> string -> unit - method remove: string -> unit - method resolve: string -> string - method iter: (string -> string -> unit) -> unit - method sync: unit - method clear: unit - - method close: unit (* use with caution! *) - end -- 2.39.2