search for: selected_cli_item

Displaying 12 results from an estimated 12 matches for "selected_cli_item".

2016 Jan 14
2
[PATCH 1/2] builder: move os-version search in own function
...deletions(-) diff --git a/builder/builder.ml b/builder/builder.ml index 9c26573..ec9919f 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -75,6 +75,30 @@ let remove_duplicates index = false ) index +(* Look for the specified os-version, resolving it as alias first. *) +let selected_cli_item cmdline index = + let arg = + (* Try to resolve the alias. *) + try + let item = + List.find ( + fun (name, { Index.aliases = aliases }) -> + match aliases with + | None -> false + | Some l -> List.mem cmdline.arg l + ) in...
2016 Jan 14
0
[PATCH 2/2] builder: allow a specific template for --list
...| `List -> (* --list *) + let sources, index = + match cmdline.arg with + | "" -> sources, index (* no template -> all the available ones *) + | arg -> (* just the specified template *) + let item = selected_cli_item cmdline index in + [], [item] in List_entries.list_entries ~list_format:cmdline.list_format ~sources index; exit 0 diff --git a/builder/cmdline.ml b/builder/cmdline.ml index a077289..f872bd4 100644 --- a/builder/cmdline.ml +++ b/builder/cmdline.ml @@ -239,9 +239,10 @@ read...
2017 Oct 27
0
[PATCH v11 3/8] builder: change arch type to (string, string option) maybe.
...list_entries.ml | 16 +++++++++++++--- builder/simplestreams_parser.ml | 2 +- 9 files changed, 52 insertions(+), 15 deletions(-) diff --git a/builder/builder.ml b/builder/builder.ml index 3f7c79bc9..519cdbc79 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -94,7 +94,10 @@ let selected_cli_item cmdline index = let item = try List.find ( fun (name, { Index.arch = a }) -> - name = arg && cmdline.arch = normalize_arch a + match a with + | Either a + | Or Some a -> name = arg && cmdline.arch = normalize_arch a + | Or None...
2017 Nov 21
0
[PATCH v13 1/3] builder: change arch type to distinguish guesses
...+-- builder/list_entries.ml | 6 +++--- builder/simplestreams_parser.ml | 2 +- 9 files changed, 31 insertions(+), 18 deletions(-) diff --git a/builder/builder.ml b/builder/builder.ml index 3f7c79bc9..41c0a4ccc 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -94,7 +94,7 @@ let selected_cli_item cmdline index = let item = try List.find ( fun (name, { Index.arch = a }) -> - name = arg && cmdline.arch = normalize_arch a + name = arg && cmdline.arch = normalize_arch (Index.string_of_arch a) ) index with Not_found -> error (f_...
2017 Nov 13
0
[PATCH v12 1/3] builder: change arch type to distinguish guesses
...der/list_entries.ml | 13 ++++++++++--- builder/simplestreams_parser.ml | 2 +- 9 files changed, 44 insertions(+), 16 deletions(-) diff --git a/builder/builder.ml b/builder/builder.ml index 3f7c79bc9..8a950cd8f 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -94,7 +94,9 @@ let selected_cli_item cmdline index = let item = try List.find ( fun (name, { Index.arch = a }) -> - name = arg && cmdline.arch = normalize_arch a + match a with + | Index.Arch a + | Index.GuessedArch a -> name = arg && cmdline.arch = normalize_arch a...
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 04
0
[PATCH 2/9] ocaml: Replace pattern matching { field = field } with { field }.
...Hashtbl.add nseen id revision ) index; List.filter ( - fun (name, { Index.arch = arch; revision = revision }) -> + fun (name, { Index.arch ; revision }) -> let id = name, arch in try let rev = Hashtbl.find nseen (name, arch) in @@ -84,7 +84,7 @@ let selected_cli_item cmdline index = try let item = List.find ( - fun (name, { Index.aliases = aliases }) -> + fun (name, { Index.aliases }) -> match aliases with | None -> false | Some l -> List.mem cmdline.arg l @@ -232,11 +232,...
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 Oct 04
11
[PATCH 0/9] build: Require OCaml >= 4.02.
Per my previous email: https://www.redhat.com/archives/libguestfs/2017-September/msg00203.html I'd like to talk about requiring a more modern version of the OCaml compiler. These commits show some of the code changes which would be possible with OCaml >= 3.12 [which it turns out we already require by accident] and also with OCaml >= 4.02. The latter is my favoured option. Rich.
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
15
[PATCH v4 0/9] Introducing virt-builder-repository
Hi all, Here is a v4 of my series. It includes the changes according to Pino and Richard's comments. However, the perrorf/debug problem is addressed differently: instead of adding an implementation for the internal function names when building for mllib, I redefine these macros. Obviously this is not perfect, but at least easier to understand. Pino's comment about the Notes regex
2017 Apr 04
1
[PATCH] Use Unicode single quotes ‘’ in place of short single quoted strings throughout.
...put. Just set the exit code +Don’t produce any output. Just set the exit code (see L</EXIT STATUS> below). =item B<--uuid> diff --git a/builder/builder.ml b/builder/builder.ml index e59c763b2..95f32edaf 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -96,7 +96,7 @@ let selected_cli_item cmdline index = name = arg && cmdline.arch = normalize_arch a ) index with Not_found -> - error (f_"cannot find os-version '%s' with architecture '%s'.\nUse --list to list available guest types.") + error (f_"cannot find os-vers...