Permalink
Browse files

rename src/file.ml into src/opamFile.ml

 Since a lot of modules are now part of a library, they should be renamed to
avoid clashes. I propose to use OpamXXX instead of XXX, from now on. Since
I already get a clash for File, I just renamed it for now, but this should
be done for all modules in opam-lib.
  • Loading branch information...
1 parent 3b79db8 commit b3781166e162ce3c2c47eef333ae279ac2e09f40 @lefessan lefessan committed Sep 27, 2012
View
@@ -21,7 +21,7 @@ begin library "opam-lib"
"lexer.mll"
"linelexer.mll"
"parser.mly"
- "file.ml"
+ "opamFile.ml"
"path.ml"
"repositories.ml"
]
View
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
View
@@ -147,7 +147,7 @@ module G = struct
let repo_index t = t / "repo" // "index"
let available_aliases t =
- let l = List.map fst (File.Aliases.safe_read (aliases t)) in
+ let l = List.map fst (OpamFile.Aliases.safe_read (aliases t)) in
Alias.Set.of_list l
end
View
@@ -47,7 +47,7 @@ let make_state ~download_index remote_path =
) else
local_index_file in
let remote_local, local_remote, local_files, file_permissions, file_digests =
- let urls = File.Urls_txt.read index in
+ let urls = OpamFile.Urls_txt.read index in
let remote_local, local_remote, locals, perms, digests =
Remote_file.Set.fold (fun r (rl, lr, locals, perms, digests) ->
let base = Remote_file.base r in
@@ -209,7 +209,7 @@ let make_urls_txt local_repo =
@ Filename.list (Path.R.archives_dir local_repo)
@ Filename.list (Path.R.compilers_dir local_repo)
)) in
- File.Urls_txt.write local_index_file index;
+ OpamFile.Urls_txt.write local_index_file index;
index
let make_index_tar_gz local_repo =
View
@@ -45,7 +45,7 @@ module B = struct
let check_file file =
let local_repo = Path.R.cwd () in
- let updates = File.Filenames.read (updates local_repo) in
+ let updates = OpamFile.Filenames.read (updates local_repo) in
if Filename.Set.mem file updates then
Result file
else if Filename.exists file then
@@ -56,7 +56,7 @@ module B = struct
let init address =
let local_repo = Path.R.cwd () in
git_init address;
- File.Filenames.write (updates local_repo) (Filename.Set.empty)
+ OpamFile.Filenames.write (updates local_repo) (Filename.Set.empty)
let download_archive address nv =
let local_repo = Path.R.cwd () in
@@ -88,7 +88,7 @@ module B = struct
let local_repo = Path.R.cwd () in
let local_path = Dirname.cwd () in
match check_updates local_path remote_address with
- | Some f -> File.Filenames.write (updates local_repo) f; f
+ | Some f -> OpamFile.Filenames.write (updates local_repo) f; f
| None ->
Globals.error_and_exit
"The repository %s is not initialized correctly"
View
@@ -52,7 +52,7 @@ let init r =
let root = Path.R.create r in
let module B = (val find_backend r: BACKEND) in
Dirname.mkdir (Path.R.root root);
- File.Repo_config.write (Path.R.config root) r;
+ OpamFile.Repo_config.write (Path.R.config root) r;
Dirname.mkdir (Path.R.packages_dir root);
Dirname.mkdir (Path.R.archives_dir root);
Dirname.mkdir (Path.R.compilers_dir root);
@@ -145,12 +145,12 @@ let make_archive ?(gener_digest = false) nv =
let extract_dir = extract_root / NV.to_string nv in
if Filename.exists url_f then (
- let url_file = File.URL.read url_f in
- let checksum = File.URL.checksum url_file in
- let kind = match File.URL.kind url_file with
- | None -> kind_of_url (File.URL.url url_file)
+ let url_file = OpamFile.URL.read url_f in
+ let checksum = OpamFile.URL.checksum url_file in
+ let kind = match OpamFile.URL.kind url_file with
+ | None -> kind_of_url (OpamFile.URL.url url_file)
| Some k -> k in
- let url = File.URL.url url_file in
+ let url = OpamFile.URL.url url_file in
log "downloading %s:%s" url kind;
match Dirname.in_dir local_dir (fun () -> download_one ~gener_digest kind nv url checksum) with
@@ -166,7 +166,7 @@ let make_archive ?(gener_digest = false) nv =
(Filename.to_string local_archive) c digest (Filename.to_string url_f);
| _ -> ();
end;
- File.URL.write url_f (File.URL.with_checksum url_file digest);
+ OpamFile.URL.write url_f (OpamFile.URL.with_checksum url_file digest);
);
log "extracting %s to %s"
(Filename.to_string local_archive)
@@ -255,12 +255,12 @@ let update r =
let cached_packages = Path.R.available_tmp local_repo in
let updated_cached_packages = NV.Set.filter (fun nv ->
let url_f = Path.R.url local_repo nv in
- let url = File.URL.read url_f in
- let kind = match File.URL.kind url with
- | None -> kind_of_url (File.URL.url url)
+ let url = OpamFile.URL.read url_f in
+ let kind = match OpamFile.URL.kind url with
+ | None -> kind_of_url (OpamFile.URL.url url)
| Some k -> k in
- let checksum = File.URL.checksum url in
- let url = File.URL.url url in
+ let checksum = OpamFile.URL.checksum url in
+ let url = OpamFile.URL.url url in
log "updating %s:%s" url kind;
match Dirname.in_dir local_dir (fun () -> download_one kind nv url checksum) with
| Not_available -> Globals.error_and_exit "Cannot get %s" url
@@ -269,4 +269,4 @@ let update r =
) cached_packages in
let updated = NV.Set.union updated_packages updated_cached_packages in
- File.Updated.write (Path.R.updated local_repo) updated
+ OpamFile.Updated.write (Path.R.updated local_repo) updated
@@ -19,9 +19,9 @@ let () = Arg.parse spec ano usage
let packages = NV.Set.of_list (List.map NV.of_string !packages)
let installed () =
- let config = File.Config.read (Path.G.config (Path.G.create ())) in
- let version = File.Config.ocaml_version config in
- let installed = File.Installed.read (Path.C.installed (Path.C.create version)) in
+ let config = OpamFile.Config.read (Path.G.config (Path.G.create ())) in
+ let version = OpamFile.Config.ocaml_version config in
+ let installed = OpamFile.Installed.read (Path.C.installed (Path.C.create version)) in
NV.Set.filter (fun nv -> N.to_string (NV.name nv) <> Globals.default_package) installed
let () =
@@ -64,7 +64,7 @@ let () =
(* Read urls.txt *)
log "Reading urls.txt";
let local_index_file = Filename.of_string "urls.txt" in
- let old_index = File.Urls_txt.safe_read local_index_file in
+ let old_index = OpamFile.Urls_txt.safe_read local_index_file in
let new_index = Curl.make_urls_txt local_repo in
let to_remove = Remote_file.Set.diff old_index new_index in
@@ -77,9 +77,9 @@ let () =
let nv = NV.create n v in
let opam_f = Path.R.opam local_repo nv in
if Filename.exists opam_f then (
- let opam = File.OPAM.read opam_f in
- let deps = File.OPAM.depends opam in
- let depopts = File.OPAM.depopts opam in
+ let opam = OpamFile.OPAM.read opam_f in
+ let deps = OpamFile.OPAM.depends opam in
+ let depopts = OpamFile.OPAM.depopts opam in
List.fold_left (fun accu l ->
List.fold_left (fun accu ((n,_),_) ->
N.Set.add (N.of_string n) accu
@@ -1,7 +1,7 @@
(* Script to check that a given repository is well-typed (or well-parsed) *)
open Types
open Printf
-open File
+open OpamFile
let () =
let usage = Printf.sprintf "Usage: %s" Sys.argv.(0) in
View
@@ -473,7 +473,7 @@ struct
let options = {
Debian.Debcudf.default_options with
Debian.Debcudf.extras_opt = [
- File.OPAM.s_depopts, (File.OPAM.s_depopts, `String None)
+ OpamFile.OPAM.s_depopts, (OpamFile.OPAM.s_depopts, `String None)
]
} in
Debian.Debcudf.tocudf ~options table pkg
@@ -514,7 +514,7 @@ struct
file.ml when we create the debian package. It could make sense
to do it here. *)
let extended_dependencies table pkg =
- let opt = File.OPAM.s_depopts in
+ let opt = OpamFile.OPAM.s_depopts in
if List.mem_assoc opt pkg.Cudf.pkg_extra then
match List.assoc opt pkg.Cudf.pkg_extra with
| `String s ->

0 comments on commit b378116

Please sign in to comment.