search for: rev_str

Displaying 20 results from an estimated 35 matches for "rev_str".

Did you mean: dev_str
2015 Aug 12
0
[PATCH 1/2] builder: add non-int revisions
...r.ml index adfa412..260af94 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -34,6 +34,13 @@ open Printf let () = Random.self_init () let remove_duplicates index = + let compare_revisions rev1 rev2 = + match rev1, rev2 with + | Rev_int n1, Rev_int n2 -> compare n1 n2 + | Rev_string s1, Rev_int n2 -> compare s1 (string_of_int n2) + | Rev_int n1, Rev_string s2 -> compare (string_of_int n1) s2 + | Rev_string s1, Rev_string s2 -> compare s1 s2 + in (* Fill an hash with the higher revision of the available * (name, arch) tuples, so it possible to ignore d...
2015 Aug 12
4
[PATCH 0/2 v2] RFC: builder: 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: - check the pasted metadata: listing and creating images works, so most of the current metadata is correct - possibly wait
2016 Dec 08
3
[PATCH 0/2] mllib: Add quote function to Common_utils module.
Doing this allows us to remove the Customize_utils module completely, since it becomes empty. Rich.
2015 Sep 07
5
[PATCH 0/4 v3] builder: 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. Thanks, Pino Toscano (4): builder: add non-int revisions builder: add simple libyajl binding build: expose HAVE_YAJL to automake
2017 Oct 27
0
[PATCH v11 4/8] builder: add Utils.get_image_infos function
....ml \ - yajl.ml \ paths.ml \ languages.ml \ cache.ml \ diff --git a/builder/utils.ml b/builder/utils.ml index acb6c2f4b..9fceee282 100644 --- a/builder/utils.ml +++ b/builder/utils.ml @@ -33,3 +33,9 @@ and revision = let string_of_revision = function | Rev_int n -> string_of_int n | Rev_string s -> s + +let get_image_infos filepath = + let qemuimg_cmd = "qemu-img info --output json " ^ (Std_utils.quote filepath) in + let lines = external_command qemuimg_cmd in + let line = String.concat "\n" lines in + Yajl.yajl_tree_parse line diff --git a/builder/utils.mli...
2017 Jan 03
0
[PATCH 5/5] Add a virt-builder-repository tool
...pr = sprintf "^%s/\\(.+\\)$" (Str.quote base) in + if Str.string_match (Str.regexp expr) absolute 0 then + Str.matched_group 1 absolute + else + absolute + +let increment_revision revision = + match revision with + | Utils.Rev_int n -> Utils.Rev_int (n + 1) + | Utils.Rev_string s -> + if Str.string_match (Str.regexp "^\\(.*[-._]\\)\\([0-9]+\\)$") s 0 then + let prefix = Str.matched_group 1 s in + let suffix = int_of_string (Str.matched_group 2 s) in + Utils.Rev_string (prefix ^ (string_of_int (suffix + 1))) + else + Utils.Rev_stri...
2017 Mar 07
0
[PATCH v4 9/9] Add a virt-builder-repository tool
...h to repository is allowed") + ) in + + { + gpg = gpg; + gpgkey = gpgkey; + interactive = interactive; + keep_unsigned = keep_unsigned; + repo = repo; + } + +let increment_revision revision = + match revision with + | Utils.Rev_int n -> Utils.Rev_int (n + 1) + | Utils.Rev_string s -> + if Str.string_match (Str.regexp "^\\(.*[-._]\\)\\([0-9]+\\)$") s 0 then + let prefix = Str.matched_group 1 s in + let suffix = int_of_string (Str.matched_group 2 s) in + Utils.Rev_string (prefix ^ (string_of_int (suffix + 1))) + else + Utils.Rev_stri...
2017 Mar 23
0
[PATCH v5 10/10] Add a virt-builder-repository tool
...h to repository is allowed") + ) in + + { + gpg = gpg; + gpgkey = gpgkey; + interactive = interactive; + keep_unsigned = keep_unsigned; + repo = repo; + } + +let increment_revision revision = + match revision with + | Utils.Rev_int n -> Utils.Rev_int (n + 1) + | Utils.Rev_string s -> + if Str.string_match (Str.regexp "^\\(.*[-._]\\)\\([0-9]+\\)$") s 0 then + let prefix = Str.matched_group 1 s in + let suffix = int_of_string (Str.matched_group 2 s) in + Utils.Rev_string (prefix ^ (string_of_int (suffix + 1))) + else + Utils.Rev_stri...
2017 Feb 10
0
[PATCH v3 10/10] Add a virt-builder-repository tool
...itory is allowed") + ) in + + { + gpg = gpg; + gpgkey = gpgkey; + interactive = interactive; + keep_unsigned = keep_unsigned; + repo = repo; + } + +let increment_revision revision = + match revision with + | Utils.Rev_int n -> Utils.Rev_int (n + 1) + | Utils.Rev_string s -> + if Str.string_match (Str.regexp "^\\(.*[-._]\\)\\([0-9]+\\)$") s 0 then + let prefix = Str.matched_group 1 s in + let suffix = int_of_string (Str.matched_group 2 s) in + Utils.Rev_string (prefix ^ (string_of_int (suffix + 1))) + else + Utils.Rev_stri...
2017 Apr 12
0
[PATCH v6 10/10] Add a virt-builder-repository tool
...;) in + + { + gpg = gpg; + gpgkey = gpgkey; + interactive = interactive; + keep_unsigned = keep_unsigned; + no_compression = no_compression; + repo = repo; + } + +let increment_revision revision = + match revision with + | Utils.Rev_int n -> Utils.Rev_int (n + 1) + | Utils.Rev_string s -> + if Str.string_match (Str.regexp "^\\(.*[-._]\\)\\([0-9]+\\)$") s 0 then + let prefix = Str.matched_group 1 s in + let suffix = int_of_string (Str.matched_group 2 s) in + Utils.Rev_string (prefix ^ (string_of_int (suffix + 1))) + else + Utils.Rev_stri...
2017 Jun 19
0
[PATCH v7 9/9] Add a virt-builder-repository tool
...ository is allowed") in + + { + gpg = gpg; + gpgkey = gpgkey; + interactive = interactive; + keep_unsigned = keep_unsigned; + no_compression = no_compression; + repo = repo; + } + +let increment_revision = function + | Utils.Rev_int n -> Utils.Rev_int (n + 1) + | Utils.Rev_string s -> + if Str.string_match (Str.regexp "^\\(.*[-._]\\)\\([0-9]+\\)$") s 0 then + let prefix = Str.matched_group 1 s in + let suffix = int_of_string (Str.matched_group 2 s) in + Utils.Rev_string (prefix ^ (string_of_int (suffix + 1))) + else + Utils.Rev_stri...
2017 Sep 12
0
[PATCH v8 7/7] Add a virt-builder-repository tool
...ository is allowed") in + + { + gpg = gpg; + gpgkey = gpgkey; + interactive = interactive; + keep_unsigned = keep_unsigned; + no_compression = no_compression; + repo = repo; + } + +let increment_revision = function + | Utils.Rev_int n -> Utils.Rev_int (n + 1) + | Utils.Rev_string s -> + if Str.string_match (Str.regexp "^\\(.*[-._]\\)\\([0-9]+\\)$") s 0 then + let prefix = Str.matched_group 1 s in + let suffix = int_of_string (Str.matched_group 2 s) in + Utils.Rev_string (prefix ^ (string_of_int (suffix + 1))) + else + Utils.Rev_stri...
2017 Apr 12
12
[PATCH v6 00/10] Add a virt-builder-repository tool
Hi all, Here is an updated version of that patch series. Diff to v5: * Apply Pino's comments * Fix indentation issues * Add a default value for arch in builder/index_parser.ml if template is set * Improved new images filtering: don't process image that didn't change. This has been uncovered by introduction of --no-compression Cédric Bosdonnat (10): lib/osinfo.c:
2017 Sep 12
10
[PATCH v8 0/7] virt-builder-repository tool
Hi all, Here is the latest iteration on the virt-builder-repository series. Diffs to previous version are: fixing things mentioned by Pino, integrate Pino's osinfo ocaml iterator and adding a check of the mime type to filter potential image files. Cédric Bosdonnat (6): builder: rename docs test script builder: add a template parameter to get_index builder: add Index.write_entry
2017 Oct 09
1
Re: [PATCH v11 6/6] New tool: virt-builder-repository
...OCaml lets you use multiline strings directly: | [] -> error (f_"Usage: virt-builder-repository /path/to/repo Use ‘/path/to/repo’ to point to the repository folder.") > +let increment_revision = function > + | Utils.Rev_int n -> Utils.Rev_int (n + 1) > + | Utils.Rev_string s -> Utils.Rev_int ((int_of_string s) + 1) You could probably put this little utility function into builder/utils.ml. > +let checksums_get_sha512 = function > + | None -> Checksums.SHA512 "" > + | Some csums -> > + try > + List.find ( > +...
2017 Mar 23
13
[PATCH v5 00/10] Introducing virt-builder-repository
Hi all, Here is the v5 of my patches series applying the latest comments from Pino. Cédric Bosdonnat (10): lib/osinfo.c: Extract xml processing into a callback lib: extract osinfo DB traversing API mllib: ocaml wrapper for lib/osinfo builder: rename docs test script builder: add a template parameter to get_index builder: add Index.write_entry function dib: move do_cp to
2017 Nov 13
0
[PATCH v12 3/3] New tool: virt-builder-repository
....xz' +test -e $test_data/fedora.img.xz +! test -e $test_data/fedora.img diff --git a/builder/utils.ml b/builder/utils.ml index d0e51a049..4cca4c21d 100644 --- a/builder/utils.ml +++ b/builder/utils.ml @@ -35,6 +35,10 @@ let string_of_revision = function | Rev_int n -> string_of_int n | Rev_string s -> s +let increment_revision = function + | Rev_int n -> Rev_int (n + 1) + | Rev_string s -> Rev_int ((int_of_string s) + 1) + let get_image_infos filepath = let qemuimg_cmd = "qemu-img info --output json " ^ quote filepath in let lines = external_command qemuimg_...
2017 Oct 27
15
[PATCH v11 0/8] virt-builder-repository
Hi all, Here is the latest version of the series. Diffs to v10: * Make Index.arch a (string, string option) maybe and use it to guess arch at parse time * Compute the image size at parse time when the template flag is set and the value is missing. * Add virt-repository_main slow test * Other fixes from Richard's comments Cédric Bosdonnat (7): Ignore builder/*.out and *.img
2015 Aug 12
0
[PATCH 2/2] builder: support Simple Streams v1.0 as index metadata
...256 c) + | ("sha512", Yajl_string c) -> Some (Checksums.SHA512 c) + | _ -> None + ) disk_item in + match checksums with + | [] -> None + | x -> Some x in + let revision = Rev_string rel in + let size = object_get_number "size" disk_item in + let aliases = Some [pubname;] in + + let entry = { Index.printable_name = printable_name; + osinfo = None; + file_uri = file_uri; +...
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,