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-v2vAfter 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.
Richard W.M. Jones
2014-Aug-24 10:34 UTC
Re: [Libguestfs] [PATCH] v2v: adding input -i ova
On Sun, Aug 24, 2014 at 01:20:46PM +0300, Shahar Havivi wrote:> 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)The patch you sent me compiles fine here. What's the error that you see? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
On 24.08.14 11:34, Richard W.M. Jones wrote:> On Sun, Aug 24, 2014 at 01:20:46PM +0300, Shahar Havivi wrote: > > 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) > > The patch you sent me compiles fine here. What's the error that you > see?The compilation is fine, but the condition in line 88 (input_ova.ml) is true: if hash <> sha1 then then I added the commandl in line 80: (sha1 : string); and I get this error: Warning 10: this expression should have type unit.> > Rich. > > -- > Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones > Read my programming and virtualization blog: http://rwmj.wordpress.com > Fedora Windows cross-compiler. Compile Windows programs, test, and > build Windows installers. Over 100 libraries supported. > http://fedoraproject.org/wiki/MinGW