X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fcomponents%2Flibrary%2Flibrarian.ml;h=9ffde2b87d0444c6d9ad012b4e26e9641d45a513;hb=f8392f63fab2a0b901f83cbf8c23e7b3c1dbd6ce;hp=7d159af2467a26cddfac6ef9e4863a42961db0d4;hpb=d8c17db3c787f3ea964bbcd3b27427ca44b356d0;p=helm.git diff --git a/matita/components/library/librarian.ml b/matita/components/library/librarian.ml index 7d159af24..9ffde2b87 100644 --- a/matita/components/library/librarian.ml +++ b/matita/components/library/librarian.ml @@ -23,6 +23,7 @@ * http://helm.cs.unibo.it/ *) +exception FileNotFound of string exception NoRootFor of string let absolutize path = @@ -80,17 +81,10 @@ let find_root_for ~include_paths file = let rec find_path_for file = try HExtlib.find_in include_paths file with Failure "find_in" -> - if Filename.check_suffix file ".ma" then begin - let mma = Filename.chop_suffix file ".ma" ^ ".mma" in - HLog.warn ("We look for: " ^ mma); - let path = find_path_for mma in - Filename.chop_suffix path ".mma" ^ ".ma" - end else begin - HLog.error ("We are in: " ^ Sys.getcwd ()); - HLog.error ("Unable to find: "^file^"\nPaths explored:"); - List.iter (fun x -> HLog.error (" - "^x)) include_paths; - raise (NoRootFor file) - end + HLog.error ("We are in: " ^ Sys.getcwd ()); + HLog.error ("Unable to find: "^file^"\nPaths explored:"); + List.iter (fun x -> HLog.error (" - "^x)) include_paths; + raise (FileNotFound file) in let path = find_path_for file in let path = absolutize path in @@ -135,7 +129,7 @@ let baseuri_of_script ~include_paths file = match l1, l2 with | h1::tl1,h2::tl2 when h1 = h2 -> substract tl1 tl2 | l,[] -> l - | _ -> raise (NoRootFor (file ^" "^path^" "^root)) + | _ -> assert false in let extra_buri = substract lpath lroot in let extra = String.concat "/" extra_buri in