search for: trailing_comma

Displaying 8 results from an estimated 8 matches for "trailing_comma".

2014 Oct 10
0
[PATCH 3/3] builder: use the JSON module
...ilddir)/mllib/mkdtemp-c.o \ diff --git a/builder/list_entries.ml b/builder/list_entries.ml index 1891679..2727c9f 100644 --- a/builder/list_entries.ml +++ b/builder/list_entries.ml @@ -97,92 +97,64 @@ and list_entries_long ~sources index = ) index and list_entries_json ~sources index = - let trailing_comma index size = - if index = size - 1 then "" else "," in - let json_string_of_bool b = - if b then "true" else "false" in - let json_string_escape str = - let res = ref "" in - for i = 0 to String.length str - 1 do - res := !res ^ (...
2014 May 26
2
[PATCH] builder: support aliases for images (RHBZ#1098718).
...uot;%s\": \"%Ld\",\n" key n in + let json_optional_printf_stringlist key = function + | None -> () + | Some l -> + printf " \"%s\": [" key; + iteri ( + fun i alias -> + printf " \"%s\"%s" alias (trailing_comma i (List.length l)) + ) l; + printf " ],\n" in let print_notes = function | [] -> () | notes -> @@ -156,6 +171,7 @@ and list_entries_json ~sources index = size = size; compressed_size = compressed_size;...
2014 Jan 16
0
[PATCH 3/3] builder: add a JSON output for --list
...ong -> list_entries_long ~sources index + | `Json -> list_entries_json ~sources index and list_entries_short index = List.iter ( @@ -78,3 +79,62 @@ and list_entries_long ~sources index = printf "\n" ) ) index + +and list_entries_json ~sources index = + let trailing_comma index size = + if index = size - 1 then "" else "," in + let json_string_of_bool b = + if b then "true" else "false" in + let json_string_escape str = + let res = ref "" in + for i = 0 to String.length str - 1 do + res := !res ^ (...
2014 Oct 10
4
[PATCH 1/3] Move JSON to mllib
Move the simple OCaml JSON writer to mllib, so that can be enhanced and used also outside v2v. --- mllib/JSON.ml | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ mllib/JSON.mli | 26 ++++++++++++++++++++++++++ mllib/Makefile.am | 5 ++++- po/POTFILES-ml | 2 +- v2v/JSON.ml | 53 ----------------------------------------------------- v2v/JSON.mli | 26
2014 Jan 16
5
[PATCH 0/3] Add JSON output for virt-builder
Hi, This small patch serie adds a JSON output for virt-builder. This way it is possible to parse the list of available templates, with no need to parse the unstructured and possibly changing short and long outputs of virt-builder. Pino Toscano (3): builder: small refactor of the list output builder: add --list-format builder: add a JSON output for --list builder/builder.ml
2014 Jan 22
2
[PATCH] builder: read all the available notes from the index
..." size; json_optional_printf_int64 "compressed-size" compressed_size; - json_optional_printf_string "notes" notes; + print_notes notes; printf " \"hidden\": %s\n" (json_string_of_bool hidden); printf " }%s\n" (trailing_comma i (List.length index)) ) index; -- 1.8.3.1
2014 Jan 30
2
[PATCH] builder: output translated notes
...gnotes) -> + let lang = + match lang with + | "" -> "C" + | x -> x in + printf " \"%s\": \"%s\"%s\n" + (json_string_escape lang) (json_string_escape langnotes) + (trailing_comma i (List.length notes)) + ) notes; + printf " },\n" in printf "{\n"; printf " \"version\": %d,\n" 1; diff --git a/builder/setlocale-c.c b/builder/setlocale-c.c new file mode 100644 index 0000000..e1ad75d --- /dev/null +++ b/builder/setloc...
2014 Feb 25
12
[PATCH 0/8] virt-builder: use .conf files for configuration
Hi, attached there is a serie of patches that completes the work on making virt-builder use .conf files, shipped in XDG directories, to configure all the available sources of indexes used. This also removes the hardcoded default location, replaced now with a configuration file (which may be not used at all). Thanks, Pino Toscano (8): builder: allow "no key" as key in Sigchecker