On 21.08.14 15:26, Richard W.M. Jones wrote:
On Thu, Aug 21, 2014 at 03:22:27PM +0100, Richard W.M. Jones wrote:
Might be easier to use:
Or even easier and not using awk ...
let cmd = sprintf "sha1sum %s" (quote (dir // file)) in
...
(match out with | [] -> error (f_"no output from sha1sum command, see previous errors") | [line] ->
let hash, _ = string_split " " line in if hash <> sha1 then (etc)
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v After applying the patch I have a logical error at the check: if hash <> sha1 then
its looks like the sha1 is not a string but a unit let sha1 = Str.matched_group 2 line in (sha1 : string); Do you have an idea why? (attached the new patch) Shahar.