diff options
author | 2000-11-29 13:55:40 +0000 | |
---|---|---|
committer | 2000-11-29 13:55:40 +0000 | |
commit | 3401245dbadb9e6e7aedc03c64afc3fbe7d190d1 (patch) | |
tree | 6e34f3cedb01c8bb973d43f38d39c3b56e311f5d /library | |
parent | 9591a484ae0e316b879f812591f457bf6edc68b2 (diff) |
load_path_entry structure simplified; field relative_subdir renamed to coq_dirpa
th; add_path now checks for directory existence
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@1024 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'library')
-rw-r--r-- | library/library.ml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/library/library.ml b/library/library.ml index abdce3482..f2468d32d 100644 --- a/library/library.ml +++ b/library/library.ml @@ -20,8 +20,11 @@ let add_load_path_entry lpe = load_path := lpe :: !load_path let add_path dir coq_dirpath = if coq_dirpath = [] then anomaly "add_path: empty path in library"; Nametab.push_library_root (List.hd coq_dirpath); - add_load_path_entry - { directory = dir; root_dir = dir; relative_subdir = coq_dirpath } + if (Unix.stat dir).Unix.st_kind = Unix.S_DIR then + add_load_path_entry + { directory = dir; coq_dirpath = coq_dirpath } + else + error (dir ^ " is not an existant directory") let remove_path dir = load_path := List.filter (fun lpe -> lpe.directory <> dir) !load_path @@ -164,7 +167,7 @@ let rec load_module_from s f = List.iter (load_mandatory_module s) m.module_deps; Global.import m.module_compiled_env; load_objects m.module_declarations; - let sp = Names.make_path lpe.relative_subdir (id_of_string s) CCI in + let sp = Names.make_path lpe.coq_dirpath (id_of_string s) CCI in Nametab.push_module sp m.module_nametab; modules_table := Stringmap.add s m !modules_table; m |