search for: csum_ref

Displaying 20 results from an estimated 22 matches for "csum_ref".

2017 Feb 07
1
Re: [PATCH v2 1/7] mllib: factorize code to add Checksum.get_checksum function
...29085 100644 > --- a/mllib/checksums.ml > +++ b/mllib/checksums.ml > @@ -45,14 +45,13 @@ let of_string csum_type csum_value = > | "sha512" -> SHA512 csum_value > | _ -> invalid_arg csum_type > > -let verify_checksum csum ?tar filename = > - let prog, csum_ref = > +let do_compute_checksum csum ?tar filename = > + let prog = > match csum with > - | SHA1 c -> "sha1sum", c > - | SHA256 c -> "sha256sum", c > - | SHA512 c -> "sha512sum", c > + | SHA1 _ -> "sha1sum" >...
2017 Jan 03
0
[PATCH 2/5] mllib: factorize code to add Checksum.get_checksum function
...ml b/mllib/checksums.ml index dfa8c3ae7..3efc764b9 100644 --- a/mllib/checksums.ml +++ b/mllib/checksums.ml @@ -45,23 +45,21 @@ let of_string csum_type csum_value = | "sha512" -> SHA512 csum_value | _ -> invalid_arg csum_type -let verify_checksum csum filename = - let prog, csum_ref = - match csum with - | SHA1 c -> "sha1sum", c - | SHA256 c -> "sha256sum", c - | SHA512 c -> "sha512sum", c - in - +let get_checksum csum filename = + let prog = (string_of_csum_t csum) ^ "sum" in let cmd = sprintf "%s %s"...
2017 Feb 07
0
[PATCH v2 1/7] mllib: factorize code to add Checksum.get_checksum function
...mllib/checksums.ml index 1009e131c..bee829085 100644 --- a/mllib/checksums.ml +++ b/mllib/checksums.ml @@ -45,14 +45,13 @@ let of_string csum_type csum_value = | "sha512" -> SHA512 csum_value | _ -> invalid_arg csum_type -let verify_checksum csum ?tar filename = - let prog, csum_ref = +let do_compute_checksum csum ?tar filename = + let prog = match csum with - | SHA1 c -> "sha1sum", c - | SHA256 c -> "sha256sum", c - | SHA512 c -> "sha512sum", c + | SHA1 _ -> "sha1sum" + | SHA256 _ -> "sha256sum&q...
2016 Sep 30
6
[PATCH 0/4] Consolidate Checksums as common code
Hi, this small series moves the OCaml Checksums module from virt-builder to mllib, adding more features to use it also for v2v. Thanks, Pino Toscano (4): mllib: move Checksums from builder mllib, builder: add and use Checksums.of_string mllib: add SHA1 support in Checksums v2v: -i ova: use Checksums builder/Makefile.am | 2 -- builder/builder.ml | 6 +++-
2016 Sep 30
0
[PATCH 1/4] mllib: move Checksums from builder
...- -type csum_t = -| SHA256 of string -| SHA512 of string - -let string_of_csum_t = function - | SHA256 _ -> "sha256" - | SHA512 _ -> "sha512" - -let string_of_csum = function - | SHA256 c -> c - | SHA512 c -> c - -let verify_checksum csum filename = - let prog, csum_ref = - match csum with - | SHA256 c -> "sha256sum", c - | SHA512 c -> "sha512sum", c - in - - let cmd = sprintf "%s %s" prog (quote filename) in - let lines = external_command cmd in - match lines with - | [] -> - error (f_"%s did not return...
2017 Feb 10
0
[PATCH v3 01/10] mllib: factorize code to add Checksum.get_checksum function
...mllib/checksums.ml index 1009e131c..000214703 100644 --- a/mllib/checksums.ml +++ b/mllib/checksums.ml @@ -45,14 +45,14 @@ let of_string csum_type csum_value = | "sha512" -> SHA512 csum_value | _ -> invalid_arg csum_type -let verify_checksum csum ?tar filename = - let prog, csum_ref = - match csum with - | SHA1 c -> "sha1sum", c - | SHA256 c -> "sha256sum", c - | SHA512 c -> "sha512sum", c +let compute_checksum csum_type ?tar filename = + let prog = + match csum_type with + | "sha1" -> "sha1sum" +...
2015 Jul 28
0
[PATCH 02/10] builder: create and use a new Checksums module
...*) + +open Common_gettext.Gettext +open Common_utils + +open Utils + +open Printf + +type csum_t = +| SHA512 of string + +let string_of_csum_t = function + | SHA512 _ -> "sha512" + +let string_of_csum = function + | SHA512 c -> c + +let verify_checksum csum filename = + let prog, csum_ref = + match csum with + | SHA512 c -> "sha512sum", c + in + + let cmd = sprintf "%s %s" prog (quote filename) in + if verbose () then printf "%s\n%!" cmd; + let lines = external_command cmd in + match lines with + | [] -> + error (f_"%s did not...
2015 Jul 28
0
[PATCH 04/10] builder: internally use a list of checksums for indexes
...-> (* Old-style: detached signature. *) let sigfile = match entry with diff --git a/builder/checksums.ml b/builder/checksums.ml index 25b3328..5663832 100644 --- a/builder/checksums.ml +++ b/builder/checksums.ml @@ -53,3 +53,6 @@ let verify_checksum csum filename = if csum_ref <> csum_actual then error (f_"%s checksum of template did not match the expected checksum!\n found checksum: %s\n expected checksum: %s\nTry:\n - Use the '-v' option and look for earlier error messages.\n - Delete the cache: virt-builder --delete-cache\n - Check no one h...
2015 Jul 28
19
[PATCH 00/10] RFC: builder: first support for Simple Streams metadata
Hi, this series adds a basic support for Simple Streams v1.0 metadata files. This makes it possible to create a repository .conf files with [cirros] uri=http://download.cirros-cloud.net format=simplestreams to read the latest version of each CirrOS image. TODO items: - a bit more testing: listing and creating images works, so the current metadata is correct - handle revisions, so newer
2015 Jul 28
0
[PATCH 03/10] builder: add SHA256 support in Checksums
...type csum_t = +| SHA256 of string | SHA512 of string let string_of_csum_t = function + | SHA256 _ -> "sha256" | SHA512 _ -> "sha512" let string_of_csum = function + | SHA256 c -> c | SHA512 c -> c let verify_checksum csum filename = let prog, csum_ref = match csum with + | SHA256 c -> "sha256sum", c | SHA512 c -> "sha512sum", c in diff --git a/builder/checksums.mli b/builder/checksums.mli index 6833879..4dc9dc0 100644 --- a/builder/checksums.mli +++ b/builder/checksums.mli @@ -17,6 +17,7 @@ *) typ...
2016 Nov 04
0
[PATCH 1/5] mllib: compute checksum of file inside tar
...--- a/mllib/checksums.ml +++ b/mllib/checksums.ml @@ -45,7 +45,7 @@ let of_string csum_type csum_value = | "sha512" -> SHA512 csum_value | _ -> invalid_arg csum_type -let verify_checksum csum filename = +let verify_checksum csum ?(tar = "") filename = let prog, csum_ref = match csum with | SHA1 c -> "sha1sum", c @@ -53,7 +53,13 @@ let verify_checksum csum filename = | SHA512 c -> "sha512sum", c in - let cmd = sprintf "%s %s" prog (Filename.quote filename) in + let cmd = + if tar = "" then +...
2016 Nov 12
0
[PATCH v2 1/5] mllib: compute checksum of file inside tar
....0907499 100644 --- a/mllib/checksums.ml +++ b/mllib/checksums.ml @@ -45,7 +45,7 @@ let of_string csum_type csum_value = | "sha512" -> SHA512 csum_value | _ -> invalid_arg csum_type -let verify_checksum csum filename = +let verify_checksum csum ?(tar) filename = let prog, csum_ref = match csum with | SHA1 c -> "sha1sum", c @@ -53,7 +53,14 @@ let verify_checksum csum filename = | SHA512 c -> "sha512sum", c in - let cmd = sprintf "%s %s" prog (Filename.quote filename) in + let cmd = + match tar with + | None ->...
2016 Dec 07
0
[PATCH v3 1/6] mllib: compute checksum of file inside tar
...a..a6c995b 100644 --- a/mllib/checksums.ml +++ b/mllib/checksums.ml @@ -45,7 +45,7 @@ let of_string csum_type csum_value = | "sha512" -> SHA512 csum_value | _ -> invalid_arg csum_type -let verify_checksum csum filename = +let verify_checksum csum ?tar filename = let prog, csum_ref = match csum with | SHA1 c -> "sha1sum", c @@ -53,7 +53,14 @@ let verify_checksum csum filename = | SHA512 c -> "sha512sum", c in - let cmd = sprintf "%s %s" prog (Filename.quote filename) in + let cmd = + match tar with + | None ->...
2017 Feb 07
11
[PATCH v2 0/7] Introducing virt-builder-repository
Hi all, Here is a new version of the virt-builder-repository series taking care of Pino's comments. It has also been rebased on recent master. Cédric Bosdonnat (7): mllib: factorize code to add Checksum.get_checksum function Move xml and xpath_helpers OCAML code to mllib mllib: expose libosinfo DB reading functions in mllib builder: rename docs test script builder: add
2017 Jan 03
13
[PATCH 0/5] Introducing virt-builder-repository
Hi all, I wanted to provide an easy way to create or update a virt-builder repository out of a folder of template disk image files. This is what virt-builder-repository aims at. Some of the data are computed from the image file, others are asked the user or extracted from an existing index file. So far, virt-builder-repository doesn't run libguestfs on each image to extract the architecture,
2016 Nov 04
10
[PATCH 0/5] Import directly from OVA tar archive if possible
This is still a draft, not ready for commit yet. But feedback is welcomed. This series is related to the problem of inefficient import of OVA files. The needed enhancements of QEMU was merged into the codebase and should be available in QEMU 2.8. From there we can use 'size' and 'offset' options in raw driver to tell QEMU to use only subset of a file as an image. The first three
2015 Oct 06
0
[PATCH 5/5] mllib: Replace various ad hoc string_* functions with String.*
.../checksums.ml @@ -49,7 +49,7 @@ let verify_checksum csum filename = | [] -> error (f_"%s did not return any output") prog | line :: _ -> - let csum_actual = fst (string_split " " line) in + let csum_actual = fst (String.split " " line) in if csum_ref <> csum_actual then error (f_"%s checksum of template did not match the expected checksum!\n found checksum: %s\n expected checksum: %s\nTry:\n - Use the '-v' option and look for earlier error messages.\n - Delete the cache: virt-builder --delete-cache\n - Check no one h...
2016 Dec 07
12
[PATCH v3 0/6] Import directly from OVA tar archive if possible
v3: Addressed Pino's comments, namely: - input_ova.ml - untar takes list of paths - renamed untar_partial to untar_metadata - replaced uggly regex with nsplit - tests - test changes are part of the main commit - renamed test-data/guestfs-hashsums.sh to test-data/test-utils.sh - renamed qemu_version to qemu_is_version and moved it to test-data/test-utils.sh - normalize paths
2016 Nov 12
9
[PATCH v2 0/5] Import directly from OVA tar archive if possible
This series is related to the problem of inefficient import of OVA files. The needed enhancements of QEMU were merged into the codebase and should be available in QEMU 2.8. From there we can use 'size' and 'offset' options in raw driver to tell QEMU to use only subset of a file as an image. The patch set is more or less complete. The only outstanding issue is the missing detection
2015 Oct 06
10
[PATCH 0/5] mllib: Hide bad String functions and miscellaneous refactoring.
Hide/prevent the use of bad string functions like String.lowercase. These are replaced by safe functions that won't break UTF-8 strings. Other miscellaneous refactoring. Rich.