Displaying 20 results from an estimated 25 matches for "list_entries_json".
2014 May 26
2
[PATCH] builder: support aliases for images (RHBZ#1098718).
...)
+ | Some l -> printf "%-24s %s\n" (s_"Aliases:")
+ (String.concat Index_parser.list_separator l);
+ );
let notes = Languages.find_notes langs notes in
(match notes with
| notes :: _ ->
@@ -116,6 +122,15 @@ and list_entries_json ~sources index =
| None -> ()
| Some n ->
printf " \"%s\": \"%Ld\",\n" key n in
+ let json_optional_printf_stringlist key = function
+ | None -> ()
+ | Some l ->
+ printf " \"%s\": [" key;
+ iteri...
2014 Jan 22
1
[PATCH] builder: small code simplification
...t remove extra match statements.
---
builder/list_entries.ml | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/builder/list_entries.ml b/builder/list_entries.ml
index 742e43b..0d3d9b2 100644
--- a/builder/list_entries.ml
+++ b/builder/list_entries.ml
@@ -98,13 +98,11 @@ and list_entries_json ~sources index =
| c -> String.make 1 c)
done;
!res in
- let json_optional_printf_string key value =
- match value with
+ let json_optional_printf_string key = function
| None -> ()
| Some str ->
printf " \"%s\": \"%s\",\...
2016 Jul 18
0
[PATCH 3/3] builder: improve the handling of list formats
...-> Short
+ | "long" -> Long
+ | "json" -> Json
+ | fmt -> invalid_arg fmt
+
let rec list_entries ~list_format ~sources index =
match list_format with
- | `Short -> list_entries_short index
- | `Long -> list_entries_long ~sources index
- | `Json -> list_entries_json ~sources index
+ | Short -> list_entries_short index
+ | Long -> list_entries_long ~sources index
+ | Json -> list_entries_json ~sources index
and list_entries_short index =
List.iter (
diff --git a/builder/list_entries.mli b/builder/list_entries.mli
index a3f35d3..008b906 100644...
2014 Feb 24
2
[PATCH] builder: add a mandatory 'arch' key in index files
..._"Full name:") name;
);
+ printf "%-24s %s\n" (s_"Architecture:") arch;
printf "%-24s %s\n" (s_"Minimum/default size:") (human_size size);
(match compressed_size with
| None -> ()
@@ -168,6 +170,7 @@ and list_entries_json ~sources index =
printf " \"templates\": [\n";
iteri (
fun i (name, { Index_parser.printable_name = printable_name;
+ arch = arch;
size = size;
compressed_size = compressed_size;
notes = no...
2016 Jul 18
4
[PATCH 1/3] mllib: Getopt: point to man page as additional help
On error, point also to the man page of the current tool in addition to
'$TOOL --help'.
---
mllib/getopt-c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mllib/getopt-c.c b/mllib/getopt-c.c
index bf40f91..3efd5d3 100644
--- a/mllib/getopt-c.c
+++ b/mllib/getopt-c.c
@@ -69,8 +69,8 @@ cleanup_option_list (void *ptr)
static void __attribute__((noreturn))
2014 Jan 16
0
[PATCH 3/3] builder: add a JSON output for --list
...s.ml
index 97ab201..7369e6c 100644
--- a/builder/list_entries.ml
+++ b/builder/list_entries.ml
@@ -25,6 +25,7 @@ let rec list_entries ~list_format ~sources index =
match list_format with
| `Short -> list_entries_short index
| `Long -> 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 &...
2014 Oct 31
4
[PATCH] builder: move the gpgkey_type type from Sigchecker to Utils
...| Utils.No_Key -> ()
+ | Utils.Fingerprint fp ->
printf (f_"Fingerprint: %s\n") fp;
- | Sigchecker.KeyFile kf ->
+ | Utils.KeyFile kf ->
printf (f_"Key: %s\n") kf;
);
printf "\n"
@@ -103,10 +103,10 @@ and list_entries_json ~sources index =
let item = [ "uri", JSON.String source ] in
let item =
match key with
- | Sigchecker.No_Key -> item
- | Sigchecker.Fingerprint fp ->
+ | Utils.No_Key -> item
+ | Utils.Fingerprint fp ->...
2014 Jan 22
2
[PATCH] builder: read all the available notes from the index
...tch notes with
- | None -> ()
- | Some notes ->
+ | ("", notes) :: _ ->
printf "\n";
printf (f_"Notes:\n\n%s\n") notes
+ | _ -> ()
);
printf "\n"
)
@@ -108,6 +108,10 @@ and list_entries_json ~sources index =
| None -> ()
| Some n ->
printf " \"%s\": \"%Ld\",\n" key n in
+ let print_notes = function
+ | ("", notes) :: _ ->
+ printf " \"notes\": \"%s\",\n" (json_string_escape no...
2014 Oct 31
0
[PATCH] builder: pass Sources.source objects directly
...fun { Sources.uri; gpgkey } ->
+ printf (f_"Source URI: %s\n") uri;
+ (match gpgkey with
| Utils.No_Key -> ()
| Utils.Fingerprint fp ->
printf (f_"Fingerprint: %s\n") fp;
@@ -99,10 +99,10 @@ and list_entries_long ~sources index =
and list_entries_json ~sources index =
let json_sources =
List.map (
- fun (source, key, proxy) ->
- let item = [ "uri", JSON.String source ] in
+ fun { Sources.uri; gpgkey } ->
+ let item = [ "uri", JSON.String uri ] in
let item =
- match key w...
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 Oct 10
0
[PATCH 3/3] builder: use the JSON module
...$(top_builddir)/mllib/uRI.cmx \
$(top_builddir)/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.l...
2017 Oct 27
0
[PATCH v11 3/8] builder: change arch type to (string, string option) maybe.
...itecture:") arch
+ | Or None -> ();
printf "%-24s %s\n" (s_"Minimum/default size:") (human_size size);
Option.may (fun size ->
printf "%-24s %s\n" (s_"Download size:") (human_size size)
@@ -116,7 +122,11 @@ and list_entries_json ~sources index =
match printable_name with
| None -> item
| Some str -> ("full-name", JSON.String str) :: item in
- let item = ("arch", JSON.String arch) :: item in
+ let item =
+ match arch with
+ | Either a...
2017 Nov 21
0
[PATCH v13 1/3] builder: change arch type to distinguish guesses
...t;Architecture:") (Index.string_of_arch arch);
printf "%-24s %s\n" (s_"Minimum/default size:") (human_size size);
Option.may (fun size ->
printf "%-24s %s\n" (s_"Download size:") (human_size size)
@@ -116,7 +116,7 @@ and list_entries_json ~sources index =
match printable_name with
| None -> item
| Some str -> ("full-name", JSON.String str) :: item in
- let item = ("arch", JSON.String arch) :: item in
+ let item = ("arch", JSON.String (Index.string_of_...
2017 Nov 13
0
[PATCH v12 1/3] builder: change arch type to distinguish guesses
...24s %s\n" (s_"Architecture:") arch;
printf "%-24s %s\n" (s_"Minimum/default size:") (human_size size);
Option.may (fun size ->
printf "%-24s %s\n" (s_"Download size:") (human_size size)
@@ -116,7 +120,10 @@ and list_entries_json ~sources index =
match printable_name with
| None -> item
| Some str -> ("full-name", JSON.String str) :: item in
- let item = ("arch", JSON.String arch) :: item in
+ let item =
+ match arch with
+ | Index.Ar...
2014 Jan 30
2
[PATCH] builder: output translated notes
...[] -> acc
+ ) [] langs in
+ (match List.rev notes with
+ | notes :: _ ->
printf "\n";
printf (f_"Notes:\n\n%s\n") notes
- | _ :: _
| [] -> ()
);
printf "\n"
@@ -108,10 +139,20 @@ and list_entries_json ~sources index =
| Some n ->
printf " \"%s\": \"%Ld\",\n" key n in
let print_notes = function
- | ("", notes) :: _ ->
- printf " \"notes\": \"%s\",\n" (json_string_escape notes)
- | _ :: _
-...
2015 Jul 28
0
[PATCH 06/10] builder: split Index_parser.index in an own module
...index =
) sources;
List.iter (
- fun (name, { Index_parser.printable_name = printable_name;
+ fun (name, { Index.printable_name = printable_name;
arch = arch;
size = size;
compressed_size = compressed_size;
@@ -112,7 +112,7 @@ and list_entries_json ~sources index =
) sources in
let json_templates =
List.map (
- fun (name, { Index_parser.printable_name = printable_name;
+ fun (name, { Index.printable_name = printable_name;
arch = arch;
size = size;
compressed_si...
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
2017 Oct 04
0
[PATCH 2/9] ocaml: Replace pattern matching { field = field } with { field }.
...+ notes; aliases; hidden }) ->
if not hidden then (
printf "%-24s %s\n" "os-version:" name;
may (printf "%-24s %s\n" (s_"Full name:")) printable_name;
@@ -107,7 +100,7 @@ and list_entries_long ~sources index =
and list_entries_json ~sources index =
let json_sources =
List.map (
- fun { Sources.uri = uri; gpgkey = gpgkey } ->
+ fun { Sources.uri; gpgkey } ->
let item = [ "uri", JSON.String uri ] in
let item =
match gpgkey with
@@ -120,14 +113,8 @@ and list_entries_...
2018 Aug 20
6
[PATCH 0/4] mltools: JSON unification
An evolution of:
https://www.redhat.com/archives/libguestfs/2018-August/msg00155.html
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 +