builder: Rename cmdline 'ops' field.

In OCaml 3.12, type inference was not as smart and could not use local
information to disambiguate same-named fields in different structures.
The easiest fix for this is just to rename the field so it doesn't
have the same name as a field in the Customize_cmdline.ops struct.
This commit is contained in:
Richard W.M. Jones
2016-08-26 07:34:02 -04:00
parent 2c69865a70
commit 619905ac5d
3 changed files with 6 additions and 5 deletions

View File

@@ -665,7 +665,7 @@ let main () =
error (f_"no guest operating systems or multiboot OS found in this disk image\nThis is a failure of the source repository. Use -v for more information.")
in
Customize_run.run g root cmdline.ops;
Customize_run.run g root cmdline.customize_ops;
(* Collect some stats about the final output file.
* Notes:

View File

@@ -40,13 +40,13 @@ type cmdline = {
cache : string option;
check_signature : bool;
curl : string;
customize_ops : Customize_cmdline.ops;
delete_on_failure : bool;
format : string option;
gpg : string;
list_format : List_entries.format;
memsize : int option;
network : bool;
ops : Customize_cmdline.ops;
output : string option;
size : int64 option;
smp : int option;
@@ -307,7 +307,7 @@ read the man page virt-builder(1).
(* If user didn't elect any root password, that means we set a random
* root password.
*)
let ops =
let customize_ops =
let has_set_root_password = List.exists (
function `RootPassword _ -> true | _ -> false
) ops.ops in
@@ -320,9 +320,10 @@ read the man page virt-builder(1).
{ mode = mode; arg = arg;
arch = arch; attach = attach; cache = cache;
check_signature = check_signature; curl = curl;
customize_ops = customize_ops;
delete_on_failure = delete_on_failure; format = format;
gpg = gpg; list_format = list_format; memsize = memsize;
network = network; ops = ops; output = output;
network = network; output = output;
size = size; smp = smp; sources = sources; sync = sync;
warn_if_partition = warn_if_partition;
}

View File

@@ -27,13 +27,13 @@ type cmdline = {
cache : string option;
check_signature : bool;
curl : string;
customize_ops : Customize_cmdline.ops;
delete_on_failure : bool;
format : string option;
gpg : string;
list_format : List_entries.format;
memsize : int option;
network : bool;
ops : Customize_cmdline.ops;
output : string option;
size : int64 option;
smp : int option;