diff mbox series

[v2,1/3] tests/lcitool: Generate distribution packages list in JSON format

Message ID 20230711140143.65818-2-philmd@linaro.org
State New
Headers show
Series tests/vm/freebsd: Get up-to-date package list from lcitool | expand

Commit Message

Philippe Mathieu-Daudé July 11, 2023, 2:01 p.m. UTC
Add the generate_pkglist() helper to generate a list of packages
required by a distribution to build QEMU.

Generate the FreeBSD JSON file (based on FreeBSD 13).

Suggested-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/lcitool/refresh | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Daniel P. Berrangé July 11, 2023, 2:04 p.m. UTC | #1
On Tue, Jul 11, 2023 at 04:01:41PM +0200, Philippe Mathieu-Daudé wrote:
> Add the generate_pkglist() helper to generate a list of packages
> required by a distribution to build QEMU.
> 
> Generate the FreeBSD JSON file (based on FreeBSD 13).
> 
> Suggested-by: Erik Skultety <eskultet@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  tests/lcitool/refresh | 11 +++++++++++
>  1 file changed, 11 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
Philippe Mathieu-Daudé July 11, 2023, 2:37 p.m. UTC | #2
On 11/7/23 16:01, Philippe Mathieu-Daudé wrote:
> Add the generate_pkglist() helper to generate a list of packages
> required by a distribution to build QEMU.
> 
> Generate the FreeBSD JSON file (based on FreeBSD 13).
> 
> Suggested-by: Erik Skultety <eskultet@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   tests/lcitool/refresh | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
> index b54566edcc..a5df096074 100755
> --- a/tests/lcitool/refresh
> +++ b/tests/lcitool/refresh
> @@ -84,6 +84,12 @@ def generate_cirrus(target, trailer=None):
>       generate(filename, cmd, trailer)
>   
>   
> +def generate_pkglist(vm, target):
> +    filename = Path(src_dir, "tests", "vm", vm + ".json")
> +    cmd = lcitool_cmd + ["variables", "--format", "json", target, "qemu"]
> +    generate(filename, cmd, None)

Note since json files don't have comments, we can't have the
"THIS IS GENERATED BY A SCRIPT" in header.
diff mbox series

Patch

diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
index b54566edcc..a5df096074 100755
--- a/tests/lcitool/refresh
+++ b/tests/lcitool/refresh
@@ -84,6 +84,12 @@  def generate_cirrus(target, trailer=None):
     generate(filename, cmd, trailer)
 
 
+def generate_pkglist(vm, target):
+    filename = Path(src_dir, "tests", "vm", vm + ".json")
+    cmd = lcitool_cmd + ["variables", "--format", "json", target, "qemu"]
+    generate(filename, cmd, None)
+
+
 # Netmap still needs to be manually built as it is yet to be packaged
 # into a distro. We also add cscope and gtags which are used in the CI
 # test
@@ -191,6 +197,11 @@  try:
     generate_cirrus("freebsd-13")
     generate_cirrus("macos-12")
 
+    #
+    # VM packages lists
+    #
+    generate_pkglist("freebsd", "freebsd-13")
+
     sys.exit(0)
 except Exception as ex:
     print(str(ex), file=sys.stderr)