[Libguestfs] [PATCH v3 1/2] common: extract UTF-8 conversion function

2018-02-28 Thread Cédric Bosdonnat
libxml2-utils.c local_string_to_utf8() function could easily be reused in other places. This commit extracts it with a new parameter to allow giving the encoding of the input string and publishes it in guestfs-utils.h as guestfs_int_string_to_utf8() --- common/utils/guestfs-utils.h | 11 +++

[Libguestfs] [PATCH v3 2/2] inspector: rpm summary and description may not be utf-8

2018-02-28 Thread Cédric Bosdonnat
The application inspection code assumes the data in the RPM database are encoded in UTF-8. However this is not always the case. As a basic workaround, try to parse the string to UTF-8 and if that fails, try converting it from latin-1. --- inspector/expected-fedora.img.xml | 4

[Libguestfs] [PATCH v3 0/2] inspect: basic UTF-8 encoding for rpm

2018-02-28 Thread Cédric Bosdonnat
Diff to v2: * inlined local_string_to_utf8 Cédric Bosdonnat (2): common: extract UTF-8 conversion function inspector: rpm summary and description may not be utf-8 common/utils/guestfs-utils.h | 11 + common/utils/libxml2-utils.c | 69

[Libguestfs] [PATCH v2 1/2] common: extract UTF-8 conversion function

2018-02-15 Thread Cédric Bosdonnat
libxml2-utils.c local_string_to_utf8() function could easily be reused in other places. This commit extracts it with a new parameter to allow giving the encoding of the input string and publishes it in guestfs-utils.h as guestfs_int_string_to_utf8() --- common/utils/guestfs-utils.h | 1 +

[Libguestfs] [PATCH v2 2/2] inspector: rpm summary and description may not be utf-8

2018-02-15 Thread Cédric Bosdonnat
The application inspection code assumes the data in the RPM database are encoded in UTF-8. However this is not always the case. As a basic workaround, try to parse the string to UTF-8 and if that fails, try converting it from latin-1. --- inspector/expected-fedora.img.xml | 4

[Libguestfs] [PATCH v2 0/2] inspect: basic UTF-8 encoding for rpm

2018-02-15 Thread Cédric Bosdonnat
This needs Richard's patch: https://www.redhat.com/archives/libguestfs/2018-February/msg00099.html Diff to v1: * factorized the UTF-8 conversion functions * small style fixes Cédric Bosdonnat (2): common: extract UTF-8 conversion function inspector: rpm summary and description may

[Libguestfs] [PATCH] inspector: rpm summary and description may not be utf-8

2018-02-14 Thread Cédric Bosdonnat
The application inspection code assumes the data in the RPM database are encoded in UTF-8. However this is not always the case. As a basic workaround, try to parse the string to UTF-8 and if that fails, try converting it from latin-1. --- inspector/expected-fedora.img.xml | 4 ++

[Libguestfs] [PATCH v3 1/3] daemon: make sgdisk_info_extract_uuid_field more generic

2018-01-16 Thread Cédric Bosdonnat
Rename the sgdisk_info_extract_uuid_field to sgdisk_info_extract_field in order to reuse it for other field types. Just like its C ancestor, it now needs an extractor function to be passed as parameter. --- daemon/parted.ml | 22 -- 1 file changed, 12 insertions(+), 10

[Libguestfs] [PATCH v3 0/3] copy GPT attributes

2018-01-16 Thread Cédric Bosdonnat
Hi all, Here is v3 of the series, taking Richard's comments in account. Cédric Bosdonnat (3): daemon: make sgdisk_info_extract_uuid_field more generic New APIs: part_set_gpt_attributes and part_get_gpt_attributes resize: copy GPT partition flags daemon/parted.ml | 45

[Libguestfs] [PATCH v3 3/3] resize: copy GPT partition flags

2018-01-16 Thread Cédric Bosdonnat
In some cases, the first stage bootloader needs the 'Legacy BIOS bootable' flag to be set on the partition. This change copies all flags (including this one) for each partition of the old disk to the new one to avoid ending up with non-bootable disks. --- resize/resize.ml | 15 --- 1

[Libguestfs] [PATCH v2 0/3] copying gpt attributes

2018-01-15 Thread Cédric Bosdonnat
Hi all, Here is the latest version of the series addressing Pino's comments. Cédric Bosdonnat (3): daemon: make sgdisk_info_extract_uuid_field more generic New APIs: part_set_gpt_attributes and part_get_gpt_attributes resize: copy GPT partition flags daemon/parted.ml | 45

[Libguestfs] [PATCH v2 1/3] daemon: make sgdisk_info_extract_uuid_field more generic

2018-01-15 Thread Cédric Bosdonnat
Rename the sgdisk_info_extract_uuid_field to sgdisk_info_extract_field in order to reuse it for other field types. Just like its C ancestor, it now needs an extractor function to be passed as parameter. --- daemon/parted.ml | 22 -- 1 file changed, 12 insertions(+), 10

[Libguestfs] [PATCH v2 2/3] New APIs: part_set_gpt_attributes and part_get_gpt_attributes

2018-01-15 Thread Cédric Bosdonnat
Allow reading and setting the GPT partition attribute flags. --- daemon/parted.ml | 23 +++ daemon/parted.mli | 3 +++ generator/actions_core.ml | 37 + generator/proc_nr.ml | 2 ++ lib/MAX_PROC_NR | 2 +-

[Libguestfs] [PATCH 1/3] daemon: make sgdisk_info_extract_uuid_field more generic

2018-01-10 Thread Cédric Bosdonnat
Rename the sgdisk_info_extract_uuid_field to sgdisk_info_extract_field in order to reuse it for other field types. To avoid possible confusion, the list of valid characters used to extract the value is added to the function parameters. --- daemon/parted.ml | 18 +++--- 1 file changed,

[Libguestfs] [PATCH 3/3] resize: copy GPT partition flags

2018-01-10 Thread Cédric Bosdonnat
In some cases, the first stage bootloader needs the 'Legacy BIOS bootable' flag to be set on the partition. This change copies all flags (including this one) for each partition of the old disk to the new one to avoid ending up with non-bootable disks. --- resize/resize.ml | 15 --- 1

[Libguestfs] [PATCH 2/3] New APIs: part_set_gpt_attributes and part_get_gpt_attributes

2018-01-10 Thread Cédric Bosdonnat
Allow reading and setting the GPT partition attribute flags. --- daemon/parted.ml | 18 +- daemon/parted.mli | 3 +++ generator/actions_core.ml | 40 generator/proc_nr.ml | 2 ++ lib/MAX_PROC_NR | 2 +- 5

[Libguestfs] [PATCH 0/3] Handle GPT attribute flags

2018-01-10 Thread Cédric Bosdonnat
Hi all, Here is the series fixing the bug I mentioned on IRC regarding the GPT attribute flags to copy to the new disk in a virt-resize. Cédric Bosdonnat (3): daemon: make sgdisk_info_extract_uuid_field more generic New APIs: part_set_gpt_attributes and part_get_gpt_attributes resize: copy

[Libguestfs] [PATCH v13 0/3] virt-builder-repository

2017-11-21 Thread Cédric Bosdonnat
the default, and the default is now a mandatory parameter. * Make sure there are items in the lvs list before getting the first one. Cédric Bosdonnat (3): builder: change arch type to distinguish guesses builder: add a template parameter to get_index New tool: virt-builder-repository

[Libguestfs] [PATCH v13 3/3] New tool: virt-builder-repository

2017-11-21 Thread Cédric Bosdonnat
;--keep-index> + +When using a GPG key, don’t remove the unsigned index. + +=item B<--no-compression> + +Don’t compress the template images. + +=item B<--machine-readable> + +This option is used to make the output more machine friendly +when being parsed by other programs. Se

[Libguestfs] [PATCH v13 2/3] builder: add a template parameter to get_index

2017-11-21 Thread Cédric Bosdonnat
get_index now gets a new template parameter. Setting it to true will make the index parsing less picky about missing important data. This can be used to parse a partial index file. --- builder/index_parser.ml | 51 builder/index_parser.mli | 5

[Libguestfs] [PATCH v13 1/3] builder: change arch type to distinguish guesses

2017-11-21 Thread Cédric Bosdonnat
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

[Libguestfs] [PATCH v12 3/3] New tool: virt-builder-repository

2017-11-13 Thread Cédric Bosdonnat
he +value empty. This can be used to avoid setting the default computed value. + +=item B<--keep-index> + +When using a GPG key, don’t remove the unsigned index. + +=item B<--no-compression> + +Don’t compress the template images. + +=item B<--machine-readable> + +This option is used to

[Libguestfs] [PATCH v12 1/3] builder: change arch type to distinguish guesses

2017-11-13 Thread Cédric Bosdonnat
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

[Libguestfs] [PATCH v12 2/3] builder: add a template parameter to get_index

2017-11-13 Thread Cédric Bosdonnat
get_index now gets a new template parameter. Setting it to true will make the index parsing less picky about missing important data. This can be used to parse a partial index file. --- builder/index_parser.ml | 44 builder/index_parser.mli | 5 -

[Libguestfs] [PATCH v12 0/3] virt-builder-repository tool

2017-11-13 Thread Cédric Bosdonnat
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

[Libguestfs] [PATCH v11 3/8] builder: change arch type to (string, string option) maybe.

2017-10-27 Thread Cédric Bosdonnat
In a future commit, the index parser will allow arch not to be set for some cases. In such cases, it will be guessed by inspecting the image, but we need to distinguish between a set value and a guessed one. Using the '(string, string option) maybe' type will help it: match arch with |

[Libguestfs] [PATCH v11 7/8] mllib: add XPath helper xpath_get_nodes

2017-10-27 Thread Cédric Bosdonnat
This function will allow more OCaml-ish processing of XPath queries with multiple results. --- common/mltools/xpath_helpers.ml | 9 +++ common/mltools/xpath_helpers.mli | 4 +++ v2v/output_libvirt.ml| 11 ++-- v2v/test-harness/v2v_test_harness.ml | 51

[Libguestfs] [PATCH v11 4/8] builder: add Utils.get_image_infos function

2017-10-27 Thread Cédric Bosdonnat
This helper function calls qemu-img info on an image file and returns the output as a JSON Yajl tree. This function will be used in future commits. --- builder/Makefile.am | 2 +- builder/utils.ml| 6 ++ builder/utils.mli | 4 3 files changed, 11 insertions(+), 1 deletion(-) diff

[Libguestfs] [PATCH v11 1/8] Ignore builder/*.out and *.img files

2017-10-27 Thread Cédric Bosdonnat
These ignores are covering test-console-ubuntu-12.04 test data. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 36a193054..54dd5c6d0 100644 --- a/.gitignore +++ b/.gitignore @@ -87,12 +87,14 @@ Makefile.in /build-aux/test-driver

[Libguestfs] [PATCH v11 5/8] builder: add a template parameter to get_index

2017-10-27 Thread Cédric Bosdonnat
get_index now gets a new template parameter. Setting it to true will make the index parsing less picky about missing important data. This can be used to parse a partial index file. --- builder/index_parser.ml | 46 ++ builder/index_parser.mli | 5

[Libguestfs] [PATCH v11 8/8] New tool: virt-builder-repository

2017-10-27 Thread Cédric Bosdonnat
g data. Default values are computed from the disk +image. + +When prompted for data, inputting C<-> corresponds to leaving the +value empty. This can be used to avoid setting the default computed value. + +=item B<--keep-index> + +When using a GPG key, don’t remove the unsigned index. + +=item B

[Libguestfs] [PATCH v11 6/8] builder: add Index.write_entry function

2017-10-27 Thread Cédric Bosdonnat
Add a function to properly write virt-builder source index entries. Note that this function is very similar to Index.print_entry that is meant for debugging purposes. --- .gitignore| 1 + builder/Makefile.am | 36 +++- builder/index.mli | 3 +

[Libguestfs] [PATCH v11 2/8] builder: add simple OCaml osinfo-db reader

2017-10-27 Thread Cédric Bosdonnat
From: Pino Toscano Add a simple OCaml-based implementation of reader of the osinfo-db: the only interface is an iterator that invokes an user-supplied function with each XML file found. This implementation behaves like the current C implementation, and still supports the

[Libguestfs] [PATCH v11 2/6] builder: rename docs test script

2017-10-05 Thread Cédric Bosdonnat
Rename test-virt-builder-docs.sh into test-docs.sh to include test for another tool's documentation. --- builder/Makefile.am | 4 ++-- builder/{test-virt-builder-docs.sh => test-docs.sh} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename

[Libguestfs] [PATCH v11 6/6] New tool: virt-builder-repository

2017-10-05 Thread Cédric Bosdonnat
t values are computed from the disk +image. + +When prompted for data, inputting C<-> corresponds to leaving the +value empty. This can be used to avoid setting the default computed value. + +=item B<--keep-index> + +When using a GPG key, don’t remove the unsigned index. + +=item

[Libguestfs] [PATCH v11 3/6] builder: add a template parameter to get_index

2017-10-05 Thread Cédric Bosdonnat
get_index now gets a new template parameter. Setting it to true will make the index parsing less picky about missing important data. This can be used to parse a partial index file. --- builder/builder.ml | 2 +- builder/index_parser.ml | 26 ++

[Libguestfs] [PATCH v11 5/6] mllib: add XPath helper xpath_get_nodes()

2017-10-05 Thread Cédric Bosdonnat
This function will allow more OCaml-ish processing of XPath queries with multiple results. --- common/mltools/xpath_helpers.ml | 9 + common/mltools/xpath_helpers.mli | 4 2 files changed, 13 insertions(+) diff --git a/common/mltools/xpath_helpers.ml

[Libguestfs] [PATCH v11 0/6] virt-builder-repository

2017-10-05 Thread Cédric Bosdonnat
Hi there, This is an update of the series. Just to rebase it on top of Rich's latest changes. Cédric Bosdonnat (5): builder: rename docs test script builder: add a template parameter to get_index builder: add Index.write_entry function mllib: add XPath helper xpath_get_nodes() New tool

[Libguestfs] [PATCH v11 1/6] builder: add simple OCaml osinfo-db reader

2017-10-05 Thread Cédric Bosdonnat
From: Pino Toscano Add a simple OCaml-based implementation of reader of the osinfo-db: the only interface is an iterator that invokes an user-supplied function with each XML file found. This implementation behaves like the current C implementation, and still supports the

[Libguestfs] [PATCH v11 4/6] builder: add Index.write_entry function

2017-10-05 Thread Cédric Bosdonnat
Add a function to properly write virt-builder source index entries. Note that this function is very similar to Index.print_entry that is meant for debugging purposes. --- .gitignore| 1 + builder/Makefile.am | 36 +++- builder/index.mli | 3 +

[Libguestfs] [PATCH v10 0/6] virt-builder-repository

2017-09-20 Thread Cédric Bosdonnat
Hi all, Diff to v9 includes the changes requested by Pino. Cédric Bosdonnat (5): builder: rename docs test script builder: add a template parameter to get_index builder: add Index.write_entry function mllib: add XPath helper xpath_get_nodes() New tool: virt-builder-repository Pino

[Libguestfs] [PATCH v10 1/6] builder: add simple OCaml osinfo-db reader

2017-09-20 Thread Cédric Bosdonnat
From: Pino Toscano Add a simple OCaml-based implementation of reader of the osinfo-db: the only interface is an iterator that invokes an user-supplied function with each XML file found. This implementation behaves like the current C implementation, and still supports the

[Libguestfs] [PATCH v10 5/6] mllib: add XPath helper xpath_get_nodes()

2017-09-20 Thread Cédric Bosdonnat
This function will allow more OCaml-ish processing of XPath queries with multiple results. --- mllib/xpath_helpers.ml | 9 + mllib/xpath_helpers.mli | 4 2 files changed, 13 insertions(+) diff --git a/mllib/xpath_helpers.ml b/mllib/xpath_helpers.ml index e6185bf3d..eb655e1fe 100644

[Libguestfs] [PATCH v10 6/6] New tool: virt-builder-repository

2017-09-20 Thread Cédric Bosdonnat
ting C<-> corresponds to leaving the +value empty. This can be used to avoid setting the default computed value. + +=item B<--keep-index> + +When using a GPG key, don’t remove the unsigned index. + +=item B<--no-compression> + +Don’t compress the template images. + +=item B<--mac

[Libguestfs] [PATCH v10 3/6] builder: add a template parameter to get_index

2017-09-20 Thread Cédric Bosdonnat
get_index now gets a new template parameter. Setting it to true will make the index parsing less picky about missing important data. This can be used to parse a partial index file. --- builder/builder.ml | 2 +- builder/index_parser.ml | 26 ++

[Libguestfs] [PATCH v10 2/6] builder: rename docs test script

2017-09-20 Thread Cédric Bosdonnat
Rename test-virt-builder-docs.sh into test-docs.sh to include test for another tool's documentation. --- builder/Makefile.am | 4 ++-- builder/{test-virt-builder-docs.sh => test-docs.sh} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename

[Libguestfs] [PATCH v10 4/6] builder: add Index.write_entry function

2017-09-20 Thread Cédric Bosdonnat
Add a function to properly write virt-builder source index entries. Note that this function is very similar to Index.print_entry that is meant for debugging purposes. --- .gitignore| 1 + builder/Makefile.am | 36 +++- builder/index.mli | 3 +

[Libguestfs] [PATCH v9 1/7] ocaml osinfo database iterator

2017-09-18 Thread Cédric Bosdonnat
From: Pino Toscano The C osinfo database parser has been deprecated, reimplement the base of it in ocaml for virt-builder-repository to use. This provides an Osinfo.iterate_db() function traversing the files of the osinfo database and calling a function on each of them. ---

[Libguestfs] [PATCH v9 2/7] builder: rename docs test script

2017-09-18 Thread Cédric Bosdonnat
Rename test-virt-builder-docs.sh into test-docs.sh to include test for another tool's documentation. --- builder/Makefile.am | 4 ++-- builder/{test-virt-builder-docs.sh => test-docs.sh} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename

[Libguestfs] [PATCH v9 5/7] mllib: add XPath helper xpath_get_nodes()

2017-09-18 Thread Cédric Bosdonnat
This function will allow more OCaml-ish processing of XPath queries with multiple results. --- mllib/xpath_helpers.ml | 9 + mllib/xpath_helpers.mli | 4 2 files changed, 13 insertions(+) diff --git a/mllib/xpath_helpers.ml b/mllib/xpath_helpers.ml index e6185bf3d..eb655e1fe 100644

[Libguestfs] [PATCH v9 3/7] builder: add a template parameter to get_index

2017-09-18 Thread Cédric Bosdonnat
get_index now gets a new template parameter. Setting it to true will make the index parsing less picky about missing important data. This can be used to parse a partial index file. --- builder/builder.ml | 2 +- builder/index_parser.ml | 26 ++

[Libguestfs] [PATCH v9 4/7] builder: add Index.write_entry function

2017-09-18 Thread Cédric Bosdonnat
Add a function to properly write virt-builder source index entries. Note that this function is very similar to Index.print_entry that is meant for debugging purposes. --- .gitignore| 1 + builder/Makefile.am | 36 +++- builder/index.mli | 3 +

[Libguestfs] [PATCH v9 7/7] New tool: virt-builder-repository

2017-09-18 Thread Cédric Bosdonnat
ed from the disk +image. + +When prompted for data, inputting C<-> corresponds to leaving the +value empty. This can be used to avoid setting the default computed value. + +=item B<--keep-index> + +When using a GPG key, don't remove the unsigned index. + +=item B<--

[Libguestfs] [PATCH v9 6/7] builder: remove useless fish dependency

2017-09-18 Thread Cédric Bosdonnat
--- builder/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builder/Makefile.am b/builder/Makefile.am index 59de42a57..2af44ecd3 100644 --- a/builder/Makefile.am +++ b/builder/Makefile.am @@ -101,8 +101,7 @@ virt_builder_CPPFLAGS = \ -I$(shell $(OCAMLC)

[Libguestfs] [PATCH v8 2/7] builder: rename docs test script

2017-09-12 Thread Cédric Bosdonnat
Rename test-virt-builder-docs.sh into test-docs.sh to include test for another tool's documentation. --- builder/Makefile.am | 4 ++-- builder/{test-virt-builder-docs.sh => test-docs.sh} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename

[Libguestfs] [PATCH v8 6/7] mllib: add XPath helper xpath_get_nodes()

2017-09-12 Thread Cédric Bosdonnat
This function will allow more OCaml-ish processing of XPath queries with multiple results. --- mllib/xpath_helpers.ml | 9 + mllib/xpath_helpers.mli | 4 2 files changed, 13 insertions(+) diff --git a/mllib/xpath_helpers.ml b/mllib/xpath_helpers.ml index e6185bf3d..eb655e1fe 100644

[Libguestfs] [PATCH v8 3/7] builder: add a template parameter to get_index

2017-09-12 Thread Cédric Bosdonnat
get_index now gets a new template parameter. Setting it to true will make the index parsing less picky about missing important data. This can be used to parse a partial index file. --- builder/builder.ml | 2 +- builder/index_parser.ml | 26 ++

[Libguestfs] [PATCH v8 5/7] mllib: add do_mv helper function to Common_utils

2017-09-12 Thread Cédric Bosdonnat
--- mllib/common_utils.ml | 6 ++ mllib/common_utils.mli | 3 +++ 2 files changed, 9 insertions(+) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 597128967..1126f233b 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -561,3 +561,9 @@ let inspect_decrypt g =

[Libguestfs] [PATCH v8 7/7] Add a virt-builder-repository tool

2017-09-12 Thread Cédric Bosdonnat
the +value empty. This can be used to avoid setting the default computed value. + +=item B<--keep-index> + +When using a GPG key, don't remove the unsigned index. + +=item B<--no-compression> + +Don't compress the template images. + +=item B<--machine-readable> + +This option

[Libguestfs] [PATCH v8 0/7] virt-builder-repository tool

2017-09-12 Thread Cédric Bosdonnat
Hi all, Here is the latest iteration on the virt-builder-repository series. Diffs to previous version are: fixing things mentioned by Pino, integrate Pino's osinfo ocaml iterator and adding a check of the mime type to filter potential image files. Cédric Bosdonnat (6): builder: rename docs

[Libguestfs] [supermin][PATCH v2] os-release: use ID_LIKE as a fallback for SUSE detection

2017-09-01 Thread Cédric Bosdonnat
SUSE distros all have in common suse in ID_LIKE field. The ID field could be varying and is even set to 'Dummy' when building the packages. If the usual values for openSUSE/SLE can't be found in ID, try with ID_LIKE. --- Diff with v1: * Use Utils.string_split rather than too recent

[Libguestfs] [supermin][PATCH] os-release: use ID_LIKE as a fallback for SUSE detection

2017-09-01 Thread Cédric Bosdonnat
SUSE distros all have in common suse in ID_LIKE field. The ID field could be varying and is even set to 'Dummy' when building the packages. If the usual values for openSUSE/SLE can't be found in ID, try with ID_LIKE. --- src/os_release.ml | 10 +- src/os_release.mli | 7 +++

[Libguestfs] [PATCH v2] appliance: use ID_LIKE as a fallback for SUSE distro detection

2017-09-01 Thread Cédric Bosdonnat
All SUSE distros have a ID_LIKE=suse, including the fake one used for building that has a ID=Dummy value. Without reading ID_LIKE on SUSE distros, the generated appliance packagelist is not correct. This fix reads ID_LIKE as a fallback if ID contains nothing. --- m4/guestfs_appliance.m4 | 10

[Libguestfs] [PATCH] appliance: read ID_LIKE from os-release as a fallback

2017-07-20 Thread Cédric Bosdonnat
In the appliance used to build the packages for openSUSE, os-release is super minimal and only had ID_LIKE=suse. The code setting the DISTRO variable only searches for ID variable so far, resulting in invalid packagelist on openSUSE. This fix reads ID_LIKE as a fallback if ID contains nothing.

[Libguestfs] [PATCH v7 5/9] builder: add a template parameter to get_index

2017-06-19 Thread Cédric Bosdonnat
get_index now gets a new template parameter. Setting it to true will make the index parsing less picky about missing important data. This can be used to parse a partial index file. --- builder/builder.ml | 2 +- builder/index_parser.ml | 26 ++

[Libguestfs] [PATCH v7 9/9] Add a virt-builder-repository tool

2017-06-19 Thread Cédric Bosdonnat
omputed from the disk +image. + +When prompted for data, inputting C<-> corresponds to leaving the +value empty. This can be used to avoid setting the default computed value. + +=item B<--keep-index> + +When using a GPG key, don't remove the unsigned index. + +=item B<--no-compression>

[Libguestfs] [PATCH v7 1/9] lib/osinfo.c: Extract xml processing into a callback

2017-06-19 Thread Cédric Bosdonnat
In order to further reuse the osinfo database parsing in OCAML, this commit extracts the XML processing for the distro ISOs and places it into a newly created callback. This will later help other code to traverse the osinfo DB files and let them extract what they need from them. --- lib/osinfo.c

[Libguestfs] [PATCH v7 6/9] builder: add Index.write_entry function

2017-06-19 Thread Cédric Bosdonnat
Add a function to properly write virt-builder source index entries. Note that this function is very similar to Index.print_entry that is meant for debugging purposes. --- .gitignore| 1 + builder/Makefile.am | 36 +++- builder/index.mli | 3 +

[Libguestfs] [PATCH v7 8/9] mllib: add XPath helper xpath_get_nodes()

2017-06-19 Thread Cédric Bosdonnat
This function will allow more OCaml-ish processing of XPath queries with multiple results. --- mllib/xpath_helpers.ml | 9 + mllib/xpath_helpers.mli | 4 2 files changed, 13 insertions(+) diff --git a/mllib/xpath_helpers.ml b/mllib/xpath_helpers.ml index d651fab23..c66a21c44 100644

[Libguestfs] [PATCH v7 3/9] mllib: ocaml wrapper for lib/osinfo

2017-06-19 Thread Cédric Bosdonnat
Provide osinfo database parsing API in OCaml. --- lib/osinfo.c | 39 + mllib/Makefile.am | 11 -- mllib/osinfo-c.c | 103 ++ mllib/osinfo.ml | 26 ++ mllib/osinfo.mli | 31 5

[Libguestfs] [PATCH v7 7/9] mllib: add do_mv helper function to Common_utils

2017-06-19 Thread Cédric Bosdonnat
--- mllib/common_utils.ml | 6 ++ mllib/common_utils.mli | 3 +++ 2 files changed, 9 insertions(+) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 6a9b08973..8ed7c7554 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -1188,3 +1188,9 @@ let inspect_decrypt g

[Libguestfs] [PATCH v7 4/9] builder: rename docs test script

2017-06-19 Thread Cédric Bosdonnat
Rename test-virt-builder-docs.sh into test-docs.sh to include test for another tool's documentation. --- builder/Makefile.am | 4 ++-- builder/{test-virt-builder-docs.sh => test-docs.sh} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename

[Libguestfs] [PATCH v7 0/9] Introducing virt-builder-repository

2017-06-19 Thread Cédric Bosdonnat
Hi all, Here is an update of the series fixing Pino's latest comment. It just doesn't implement the change based on never-accepted run commands patch. Cédric Bosdonnat (9): lib/osinfo.c: Extract xml processing into a callback lib: extract osinfo DB traversing API mllib: ocaml wrapper

[Libguestfs] [PATCH v7 2/9] lib: extract osinfo DB traversing API

2017-06-19 Thread Cédric Bosdonnat
Split lib/osinfo.c to provide an API for other pieces of code (namely mllib) to reuse it. The ISO-related processing is thus moved into a lib/osinfo-iso.c file. --- lib/Makefile.am | 2 + lib/osinfo-iso.c | 462 +++ lib/osinfo.c | 420

[Libguestfs] [PATCH] v2v: tell v2v the real root device to mkinitrd

2017-06-01 Thread Cédric Bosdonnat
riable to tell them all what device to use as root. Tested-By: Cédric Bosdonnat <cbosdon...@suse.com> --- v2v/convert_linux.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml index f8dfa00d7..42a19947b 100644 --- a/v2v/conv

[Libguestfs] [PATCH v6 08/10] mllib: add do_mv helper function to Common_utils

2017-04-12 Thread Cédric Bosdonnat
--- mllib/common_utils.ml | 6 ++ mllib/common_utils.mli | 3 +++ 2 files changed, 9 insertions(+) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index ceac57711..5cc865659 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -1191,3 +1191,9 @@ let do_cp src destdir

[Libguestfs] [PATCH v6 07/10] dib: move do_cp to mllib.Commun_utils

2017-04-12 Thread Cédric Bosdonnat
--- dib/utils.ml | 4 mllib/common_utils.ml | 5 + mllib/common_utils.mli | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dib/utils.ml b/dib/utils.ml index afa2ec944..2fe70e7fc 100644 --- a/dib/utils.ml +++ b/dib/utils.ml @@ -98,10 +98,6 @@ let

[Libguestfs] [PATCH v6 06/10] builder: add Index.write_entry function

2017-04-12 Thread Cédric Bosdonnat
Add a function to properly write virt-builder source index entries. Note that this function is very similar to Index.print_entry that is meant for debugging purposes. --- .gitignore| 1 + builder/Makefile.am | 36 +++- builder/index.mli | 3 +

[Libguestfs] [PATCH v6 00/10] Add a virt-builder-repository tool

2017-04-12 Thread Cédric Bosdonnat
been uncovered by introduction of --no-compression Cédric Bosdonnat (10): lib/osinfo.c: Extract xml processing into a callback lib: extract osinfo DB traversing API mllib: ocaml wrapper for lib/osinfo builder: rename docs test script builder: add a template parameter to get_index builder

[Libguestfs] [PATCH v6 09/10] mllib: add XPath helper xpath_get_nodes()

2017-04-12 Thread Cédric Bosdonnat
This function will allow more OCaml-ish processing of XPath queries with multiple results. --- mllib/xpath_helpers.ml | 9 + mllib/xpath_helpers.mli | 4 2 files changed, 13 insertions(+) diff --git a/mllib/xpath_helpers.ml b/mllib/xpath_helpers.ml index 8648596a4..c0f4a7315 100644

[Libguestfs] [PATCH v6 04/10] builder: rename docs test script

2017-04-12 Thread Cédric Bosdonnat
Rename test-virt-builder-docs.sh into test-docs.sh to include test for another tool's documentation. --- builder/Makefile.am | 4 ++-- builder/{test-virt-builder-docs.sh => test-docs.sh} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename

[Libguestfs] [PATCH v6 02/10] lib: extract osinfo DB traversing API

2017-04-12 Thread Cédric Bosdonnat
Split lib/osinfo.c to provide an API for other pieces of code (namely mllib) to reuse it. The ISO-related processing is thus moved into a lib/osinfo-iso.c file. --- lib/Makefile.am | 2 + lib/osinfo-iso.c | 462 +++ lib/osinfo.c | 420

[Libguestfs] [PATCH v6 03/10] mllib: ocaml wrapper for lib/osinfo

2017-04-12 Thread Cédric Bosdonnat
Provide osinfo database parsing API in OCaml. --- lib/osinfo.c | 39 + mllib/Makefile.am | 11 -- mllib/osinfo-c.c | 103 ++ mllib/osinfo.ml | 26 ++ mllib/osinfo.mli | 31 5

[Libguestfs] [PATCH v6 10/10] Add a virt-builder-repository tool

2017-04-12 Thread Cédric Bosdonnat
keep-index> + +When using a GPG key, don't remove the unsigned index. + +=item B<--no-compression> + +Don't compress the template images. + +=item B<--machine-readable> + +This option is used to make the output more machine friendly +when being parse

[Libguestfs] [PATCH v6 05/10] builder: add a template parameter to get_index

2017-04-12 Thread Cédric Bosdonnat
get_index now gets a new template parameter. Setting it to true will make the index parsing less picky about missing important data. This can be used to parse a partial index file. --- builder/builder.ml | 2 +- builder/index_parser.ml | 26 ++

[Libguestfs] [PATCH v6 01/10] lib/osinfo.c: Extract xml processing into a callback

2017-04-12 Thread Cédric Bosdonnat
In order to further reuse the osinfo database parsing in OCAML, this commit extracts the XML processing for the distro ISOs and places it into a newly created callback. This will later help other code to traverse the osinfo DB files and let them extract what they need from them. --- lib/osinfo.c

[Libguestfs] [PATCH v5 04/10] builder: rename docs test script

2017-03-23 Thread Cédric Bosdonnat
Rename test-virt-builder-docs.sh into test-docs.sh to include test for another tool's documentation. --- builder/Makefile.am | 4 ++-- builder/{test-virt-builder-docs.sh => test-docs.sh} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename

[Libguestfs] [PATCH v5 03/10] mllib: ocaml wrapper for lib/osinfo

2017-03-23 Thread Cédric Bosdonnat
Provide osinfo database parsing API in OCAML. --- lib/osinfo.c | 15 mllib/Makefile.am | 11 -- mllib/osinfo-c.c | 102 ++ mllib/osinfo.ml | 26 ++ mllib/osinfo.mli | 31 + 5 files changed,

[Libguestfs] [PATCH v5 07/10] dib: move do_cp to mllib.Commun_utils

2017-03-23 Thread Cédric Bosdonnat
--- dib/utils.ml | 4 mllib/common_utils.ml | 5 + mllib/common_utils.mli | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dib/utils.ml b/dib/utils.ml index 967754d95..92296d173 100644 --- a/dib/utils.ml +++ b/dib/utils.ml @@ -98,10 +98,6 @@ let

[Libguestfs] [PATCH v5 08/10] mllib: add do_mv helper function to Common_utils

2017-03-23 Thread Cédric Bosdonnat
--- mllib/common_utils.ml | 6 ++ mllib/common_utils.mli | 3 +++ 2 files changed, 9 insertions(+) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 945728b5e..7932707c9 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -1172,3 +1172,9 @@ let do_cp src destdir

[Libguestfs] [PATCH v5 06/10] builder: add Index.write_entry function

2017-03-23 Thread Cédric Bosdonnat
Add a function to properly write virt-builder source index entries. Note that this function is very similar to Index.print_entry that is meant for debugging purposes. --- .gitignore| 1 + builder/Makefile.am | 36 +++- builder/index.mli | 3 +

[Libguestfs] [PATCH v5 01/10] lib/osinfo.c: Extract xml processing into a callback

2017-03-23 Thread Cédric Bosdonnat
In order to further reuse the osinfo database parsing in OCAML, this commit extracts the XML processing for the distro ISOs and places it into a newly created callback. This will later help other code to traverse the osinfo DB files and let them extract what they need from them. --- lib/osinfo.c

[Libguestfs] [PATCH v5 09/10] mllib: add XPath helper xpath_get_nodes()

2017-03-23 Thread Cédric Bosdonnat
This function will allow more OCAML-ish processing of xpath queries with multiple results. --- mllib/xpath_helpers.ml | 9 + mllib/xpath_helpers.mli | 4 2 files changed, 13 insertions(+) diff --git a/mllib/xpath_helpers.ml b/mllib/xpath_helpers.ml index 8648596a4..f12156f45 100644

[Libguestfs] [PATCH v4 1/9] lib/osinfo.c: Extract xml processing into a callback

2017-03-07 Thread Cédric Bosdonnat
In order to further reuse the osinfo database parsing in OCAML, this commit extracts the XML processing for the distro ISOs and places it into a newly created callback. This will later help other code to traverse the osinfo DB files and let them extract what they need from them. --- lib/osinfo.c

[Libguestfs] [PATCH v4 3/9] mllib: ocaml wrapper for lib/osinfo

2017-03-07 Thread Cédric Bosdonnat
Provide osinfo database parsing API in OCAML. --- lib/osinfo.c | 13 +++ mllib/Makefile.am | 11 -- mllib/osinfo-c.c | 100 ++ mllib/osinfo.ml | 26 ++ mllib/osinfo.mli | 31 + 5 files changed,

[Libguestfs] [PATCH v4 7/9] dib: move do_cp to mllib.Commun_utils

2017-03-07 Thread Cédric Bosdonnat
--- dib/utils.ml | 4 mllib/common_utils.ml | 5 + mllib/common_utils.mli | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dib/utils.ml b/dib/utils.ml index da5e738ad..e769ebe28 100644 --- a/dib/utils.ml +++ b/dib/utils.ml @@ -95,10 +95,6 @@ let

[Libguestfs] [PATCH v4 0/9] Introducing virt-builder-repository

2017-03-07 Thread Cédric Bosdonnat
this is not perfect, but at least easier to understand. Pino's comment about the Notes regex wasn't quite right... thus I added a unit test for the Index_parser.write_entry As some more code has been moved around, the number of commits in the series increased a little bit ;) Cédric Bosdonnat (9

[Libguestfs] [PATCH v4 5/9] builder: add Index_parser.write_entry function

2017-03-07 Thread Cédric Bosdonnat
Add a function to properly write virt-builder source index entries. Note that this function is very similar to Index.print_entry that is meant for debugging purposes. --- .gitignore| 1 + builder/Makefile.am | 36 +++- builder/index.mli | 3

[Libguestfs] [PATCH v4 9/9] Add a virt-builder-repository tool

2017-03-07 Thread Cédric Bosdonnat
" [...] + +=item B<-K> KEYID + +=item B<--gpg-key> KEYID + +Specify the GPG key to be used to sign the repository index file. +If not provided, the index will left unsigned. C is used to +identify the GPG key to use. This value is passed to gpg's +C<--default-key> option and ca

[Libguestfs] [PATCH v4 6/9] builder: add a template parameter to get_index

2017-03-07 Thread Cédric Bosdonnat
get_index now gets a new template parameter. Setting it to true will make the index parsing less picky about missing important data. This can be used to parse a partial index file. --- builder/builder.ml | 2 +- builder/index_parser.ml | 20 ++-- builder/index_parser.mli |

  1   2   3   >