Displaying 8 results from an estimated 8 matches for "guessedarch".
2017 Nov 13
0
[PATCH v12 1/3] builder: change arch type to distinguish guesses
Change Index.arch to the type (Arch of string | GuessedArch of string).
In a future commit, the index parser will allow arch not to be set
for some cases. Thus arch value will be guessed by inspecting the
image. However we need to distinguish between a set value and a guessed
one. Using this new type will help it:
match arch with
| Arch s -...
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 Nov 21
0
[PATCH v13 1/3] builder: change arch type to distinguish guesses
Change Index.arch to the type (Arch of string | GuessedArch of string).
In a future commit, the index parser will allow arch not to be set
for some cases. Thus arch value will be guessed by inspecting the
image. However we need to distinguish between a set value and a guessed
one. Using this new type will help it:
match arch with
| Arch s -...
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 Nov 13
0
[PATCH v12 2/3] builder: add a template parameter to get_index
...; 1 then (
+ eprintf (f_"%s: no ‘arch’ entry for %s and failed to guess it\n") prog n;
+ corrupt_file ()
+ );
+ let inspected_arch = g#inspect_get_arch (Array.get roots 0) in
+ g#close();
+ Index.GuessedArch inspected_arch
+ else (
+ eprintf (f_"%s: no ‘arch’ entry for ‘%s’\n") prog n;
+ corrupt_file ()
+ ) in
let signature_uri =
try Some (make_absolute_uri (List.assoc ("sig", None) fields))...
2017 Nov 21
0
[PATCH v13 2/3] builder: add a template parameter to get_index
...; 1 then (
+ eprintf (f_"%s: no ‘arch’ entry for %s and failed to guess it\n") prog n;
+ corrupt_file ()
+ );
+ let inspected_arch = g#inspect_get_arch (Array.get roots 0) in
+ g#close();
+ Index.GuessedArch inspected_arch
+ else (
+ eprintf (f_"%s: no ‘arch’ entry for ‘%s’\n") prog n;
+ corrupt_file ()
+ ) in
let signature_uri =
try Some (make_absolute_uri (List.assoc ("sig", None) fields))...
2017 Nov 13
0
[PATCH v12 3/3] New tool: virt-builder-repository
...tf "%s%dsp%d" distro major minor
+ | "ubuntu" ->
+ sprintf "%s%d.%02d" distro major minor
+ | _ (* Any other combination. *) ->
+ sprintf "%s%d.%d" distro major minor
+
+let cmp a b =
+ let string_of_arch = function Index.Arch s -> s | Index.GuessedArch s -> s in
+ (string_of_arch a) = (string_of_arch b)
+
+let has_entry id arch index =
+ List.exists (
+ fun (item_id, { Index.arch = item_arch }) ->
+ item_id = id && (cmp item_arch arch)
+ ) index
+
+let process_image acc_entries filename repo tmprepo index interactive
+...
2017 Nov 14
1
Re: [PATCH v12 3/3] New tool: virt-builder-repository
...+ error (f_"‘xz’ command failed");
> + outimg
> +
> +let get_mime_type filepath =
> + let file_cmd = "file --mime-type --brief " ^ (quote filepath) in
Don't need parens.
> +let cmp a b =
> + let string_of_arch = function Index.Arch s -> s | Index.GuessedArch s -> s in
> + (string_of_arch a) = (string_of_arch b)
You don't need parens here.
If you define Index.string_of_arch in the earlier then you can remove
the definition of string_of_arch here as well.
> +
> +let has_entry id arch index =
> + List.exists (
> + fun (item_i...