search for: string_of_revision

Displaying 20 results from an estimated 41 matches for "string_of_revision".

2015 Aug 12
0
[PATCH 1/2] builder: add non-int revisions
...cache.ml index e73bcfd..8b63a86 100644 --- a/builder/cache.ml +++ b/builder/cache.ml @@ -40,7 +40,7 @@ let create ~directory = } let cache_of_name t name arch revision = - t.directory // sprintf "%s.%s.%d" name arch revision + t.directory // sprintf "%s.%s.%s" name arch (string_of_revision revision) let is_cached t name arch revision = let filename = cache_of_name t name arch revision in diff --git a/builder/cache.mli b/builder/cache.mli index 7edc670..1ab8ede 100644 --- a/builder/cache.mli +++ b/builder/cache.mli @@ -27,16 +27,16 @@ type t val create : directory:string ->...
2017 Oct 27
0
[PATCH v11 4/8] builder: add Utils.get_image_infos function
...\ utils.ml \ pxzcat.ml \ setlocale.ml \ index.ml \ ini_reader.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 i...
2017 Nov 21
0
[PATCH v13 1/3] builder: change arch type to distinguish guesses
...~progress_bar ~proxy diff --git a/builder/cache.ml b/builder/cache.ml index dbd222fda..d2693b943 100644 --- a/builder/cache.ml +++ b/builder/cache.ml @@ -41,7 +41,9 @@ let create ~directory = } let cache_of_name t name arch revision = - t.directory // sprintf "%s.%s.%s" name arch (string_of_revision revision) + t.directory // sprintf "%s.%s.%s" name + (Index.string_of_arch arch) + (string_of_revision revision) let is_cached t name arch revision = let filename = cache_of_name t name arch revision in @@ -54,6...
2017 Feb 07
0
[PATCH v2 5/7] builder: add Index.write_entry function
...\n") signature_uri; + (match checksums with + | None -> () + | Some checksums -> + List.iter ( + fun c -> + fp "checksum[%s]=%s\n" + (Checksums.string_of_csum_t c) (Checksums.string_of_csum c) + ) checksums + ); + fp "revision=%s\n" (string_of_revision revision); + may (fp "format=%s\n") format; + fp "size=%Ld\n" size; + may (fp "compressed_size=%Ld\n") compressed_size; + may (fp "expand=%s\n") expand; + may (fp "lvexpand=%s\n") lvexpand; + List.iter ( + fun (lang, notes) -> + let...
2017 Feb 10
0
[PATCH v3 08/10] builder: add Index.write_entry function
...\n") signature_uri; + (match checksums with + | None -> () + | Some checksums -> + List.iter ( + fun c -> + fp "checksum[%s]=%s\n" + (Checksums.string_of_csum_t c) (Checksums.string_of_csum c) + ) checksums + ); + fp "revision=%s\n" (string_of_revision revision); + may (fp "format=%s\n") format; + fp "size=%Ld\n" size; + may (fp "compressed_size=%Ld\n") compressed_size; + may (fp "expand=%s\n") expand; + may (fp "lvexpand=%s\n") lvexpand; + List.iter ( + fun (lang, notes) -> + let...
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
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
2017 Mar 07
0
[PATCH v4 5/9] builder: add Index_parser.write_entry function
...\n") signature_uri; + (match checksums with + | None -> () + | Some checksums -> + List.iter ( + fun c -> + fp "checksum[%s]=%s\n" + (Checksums.string_of_csum_t c) (Checksums.string_of_csum c) + ) checksums + ); + fp "revision=%s\n" (string_of_revision revision); + may (fp "format=%s\n") format; + fp "size=%Ld\n" size; + may (fp "compressed_size=%Ld\n") compressed_size; + may (fp "expand=%s\n") expand; + may (fp "lvexpand=%s\n") lvexpand; + List.iter ( + fun (lang, notes) -> + let...
2017 Nov 21
5
[PATCH v13 0/3] virt-builder-repository
Hey there, Here is an update of the series. The changes: * Incorporate Richard's comments. Left out the with_openfile one since that leads to a double close. * Change the ask option return type to string (removing the option) since if the use doesn't input anything we're using the default, and the default is now a mandatory parameter. * Make sure there are items in the
2017 Sep 18
0
[PATCH v9 4/7] builder: add Index.write_entry function
...\n") signature_uri; + (match checksums with + | None -> () + | Some checksums -> + List.iter ( + fun c -> + fp "checksum[%s]=%s\n" + (Checksums.string_of_csum_t c) (Checksums.string_of_csum c) + ) checksums + ); + fp "revision=%s\n" (string_of_revision revision); + may (fp "format=%s\n") format; + fp "size=%Ld\n" size; + may (fp "compressed_size=%Ld\n") compressed_size; + may (fp "expand=%s\n") expand; + may (fp "lvexpand=%s\n") lvexpand; + + let format_notes notes = + String.concat &quot...
2017 Oct 27
0
[PATCH v11 6/8] builder: add Index.write_entry function
...\n") signature_uri; + (match checksums with + | None -> () + | Some checksums -> + List.iter ( + fun c -> + fp "checksum[%s]=%s\n" + (Checksums.string_of_csum_t c) (Checksums.string_of_csum c) + ) checksums + ); + fp "revision=%s\n" (string_of_revision revision); + Option.may (fp "format=%s\n") format; + fp "size=%Ld\n" size; + Option.may (fp "compressed_size=%Ld\n") compressed_size; + Option.may (fp "expand=%s\n") expand; + Option.may (fp "lvexpand=%s\n") lvexpand; + + let format_notes note...
2017 Oct 05
0
[PATCH v11 4/6] builder: add Index.write_entry function
...\n") signature_uri; + (match checksums with + | None -> () + | Some checksums -> + List.iter ( + fun c -> + fp "checksum[%s]=%s\n" + (Checksums.string_of_csum_t c) (Checksums.string_of_csum c) + ) checksums + ); + fp "revision=%s\n" (string_of_revision revision); + may (fp "format=%s\n") format; + fp "size=%Ld\n" size; + may (fp "compressed_size=%Ld\n") compressed_size; + may (fp "expand=%s\n") expand; + may (fp "lvexpand=%s\n") lvexpand; + + let format_notes notes = + String.concat &quot...
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.
2017 Nov 13
6
[PATCH v12 0/3] virt-builder-repository tool
Hi there! Here is the latest version of the series including Richard's comments. I also reworked the repository_main.ml code to avoid setting an empty entry if not found. Cédric Bosdonnat (3): builder: change arch type to distinguish guesses builder: add a template parameter to get_index New tool: virt-builder-repository .gitignore | 4 +
2017 Oct 27
0
[PATCH v11 3/8] builder: change arch type to (string, string option) maybe.
...e.ml +++ b/builder/cache.ml @@ -41,6 +41,11 @@ let create ~directory = } let cache_of_name t name arch revision = + let arch = + match arch with + | Either arch + | Or Some arch -> arch + | Or None -> "" in t.directory // sprintf "%s.%s.%s" name arch (string_of_revision revision) let is_cached t name arch revision = @@ -54,6 +59,11 @@ let print_item_status t ~header l = List.iter ( fun (name, arch, revision) -> let cached = is_cached t name arch revision in + let arch = + match arch with + | Either arch + | Or Some ar...
2017 Nov 13
0
[PATCH v12 1/3] builder: change arch type to distinguish guesses
...4 --- a/builder/cache.ml +++ b/builder/cache.ml @@ -41,6 +41,10 @@ let create ~directory = } let cache_of_name t name arch revision = + let arch = + match arch with + | Index.Arch arch + | Index.GuessedArch arch -> arch in t.directory // sprintf "%s.%s.%s" name arch (string_of_revision revision) let is_cached t name arch revision = @@ -54,6 +58,10 @@ let print_item_status t ~header l = List.iter ( fun (name, arch, revision) -> let cached = is_cached t name arch revision in + let arch = + match arch with + | Index.Arch arch + | Index....
2015 Nov 10
7
[PATCH 0/4]: mllib: Add 'may' function, and refactoring.
The 'may' function is a higher-order function (HOF) that replaces: match x with | None -> () | Some x -> f x with: may f x The idea comes from lablgtk (OCaml Gtk bindings) where it is widely used. If this change is clearer than previous code, then this could be used in many more places. However I previously steered clear from using HOFs like this because they can be
2017 Nov 14
1
Re: [PATCH v12 3/3] New tool: virt-builder-repository
...' 'file=fedora.img.xz' > +test -e $test_data/fedora.img.xz > +! test -e $test_data/fedora.img The test should ‘rm’ any temporary files it created after a successful run (but not on error paths). > --- a/builder/utils.mli > +++ b/builder/utils.mli > @@ -32,3 +32,6 @@ val string_of_revision : revision -> string > val get_image_infos : string -> Yajl.yajl_val > (** [get_image_infos path] Run qemu-img info on the image pointed at > path as YAJL tree. *) > + > +val increment_revision : revision -> revision > +(** Add one to the version number *) s/versi...
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 Nov 13
0
[PATCH v12 3/3] New tool: virt-builder-repository
...#39;revision=2' +assert_config 'fedora' 'file=fedora.img.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 "...