Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a --no-checksums option to disable checksum checks

  • Loading branch information...
commit 4f14bbc0856243e8f2c376fbad213754bac5dd6e 1 parent a895849
@samoht samoht authored
View
2  src/globals.ml.in
@@ -24,7 +24,7 @@ let verbose = ref (
)
let base_packages = ref true
-
+let verify_checksums = ref true
let yes = ref false
let version = "@PACKAGE_VERSION@"
View
1  src/opam.ml
@@ -58,6 +58,7 @@ let global_args = [
Printf.sprintf " Set the 'make' program used when compiling packages (default is %s)" !Globals.makecmd;
"--root" , Arg.Set_string Globals.root_path,
(Printf.sprintf " Change root path (default is %s)" Globals.default_opam_path);
+ "--no-checksums", Arg.Clear Globals.verify_checksums, " Do not verify checksums on download";
]
let parse_args fn () =
View
2  src/repo/curl.ml
@@ -156,7 +156,7 @@ module B = struct
with Not_found ->
()
end;
- if not (is_up_to_date state local_file) then
+ if !Globals.verify_checksums && not (is_up_to_date state local_file) then
Run.internal_error "Wrong checksum for %s" (Filename.to_string remote_file);
Result local_file
end
View
2  src/repositories.ml
@@ -90,7 +90,7 @@ let download_file k nv f c =
| None -> true
| Some c -> Filename.digest file = c in
let rename file =
- if not (check file) then
+ if !Globals.verify_checksums && not (check file) then
Globals.error_and_exit "Wrong checksum for %s (waiting for %s, got %s)"
(Filename.to_string file)
(match c with Some c -> c | None -> "<none>")
Please sign in to comment.
Something went wrong with that request. Please try again.