diff options
author | Jacques-Pascal Deplaix <jp.deplaix@gmail.com> | 2017-12-21 11:58:14 +0000 |
---|---|---|
committer | Jacques-Pascal Deplaix <jp.deplaix@gmail.com> | 2017-12-23 18:54:55 +0000 |
commit | 569347abdd64ddd20d3fe8b9ac712d566ccf8ea9 (patch) | |
tree | 9c3cf031f080a4de81d85394ea45f64f0de9a5c7 | |
parent | dea75d74c222c25f6aa6c38506ac7a51b339e9c6 (diff) |
Replace md5sum/md5 calls by an OCaml program
-rw-r--r-- | Makefile.checker | 5 | ||||
-rw-r--r-- | configure.ml | 9 | ||||
-rw-r--r-- | tools/md5sum.ml | 10 |
3 files changed, 12 insertions, 12 deletions
diff --git a/Makefile.checker b/Makefile.checker index 7e0f58875..98b4e7d83 100644 --- a/Makefile.checker +++ b/Makefile.checker @@ -77,9 +77,8 @@ checker/%.cmx: checker/%.ml md5chk: $(SHOW)'MD5SUM cic.mli' - $(HIDE)v=`tr -d "\r" < checker/cic.mli | $(MD5SUM) | sed -n -e 's/ .*//' -e '/^/p'`; \ - if grep -q "$$v" checker/values.ml; \ - then true; else echo "Error: outdated checker/values.ml: $$v" >&2; false; fi + $(HIDE)if grep -q `$(OCAML) tools/md5sum.ml checker/cic.mli` checker/values.ml; \ + then true; else echo "Error: outdated checker/values.ml"; false; fi .PHONY: md5chk diff --git a/configure.ml b/configure.ml index 06aa5e766..8feec4e1e 100644 --- a/configure.ml +++ b/configure.ml @@ -865,13 +865,6 @@ let strip = if strip = "" then "strip" else strip end -(** * md5sum command *) - -let md5sum = - select_command "Don’t know how to compute MD5 checksums…" [ - "md5sum", [], [ "--version" ]; - "md5", ["-q"], [ "-s" ; "''" ]; - ] (** * Documentation : do we have latex, hevea, ... *) @@ -1251,8 +1244,6 @@ let write_makefile f = pr "# Unix systems and profiling: true\n"; pr "# Unix systems and no profiling: strip\n"; pr "STRIP=%s\n\n" strip; - pr "#the command md5sum\n"; - pr "MD5SUM=%s\n\n" md5sum; pr "# LablGTK\n"; pr "COQIDEINCLUDES=%s\n\n" !lablgtkincludes; pr "# CoqIde (no/byte/opt)\n"; diff --git a/tools/md5sum.ml b/tools/md5sum.ml new file mode 100644 index 000000000..d6cac9377 --- /dev/null +++ b/tools/md5sum.ml @@ -0,0 +1,10 @@ +let () = + match Sys.argv with + | [|_; file|] -> + let md5 = Digest.to_hex (Digest.file file) in + print_endline (md5 ^ " " ^ file) + | _ -> + prerr_endline "Error: This program needs exactly one parameter."; + prerr_endline "Usage: ocaml md5sum.ml [FILE]"; + prerr_endline "Print MD5 (128-bit) checksum."; + exit 1 |