[gnome-builder] plugins/flatpak: fix parsing of build-args
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] plugins/flatpak: fix parsing of build-args
- Date: Thu, 21 Jul 2022 07:43:56 +0000 (UTC)
commit dcad11cf75314ac1820d90f6e12cb832aeef0068
Author: Christian Hergert <chergert redhat com>
Date: Thu Jul 21 00:41:35 2022 -0700
plugins/flatpak: fix parsing of build-args
These should be {"build-options":{"build-args":[]}} rather than in the
top-level object, according to flatpak-manifest manual.
src/plugins/flatpak/gbp-flatpak-manifest.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/flatpak/gbp-flatpak-manifest.c b/src/plugins/flatpak/gbp-flatpak-manifest.c
index 19f8002f9..479c47198 100644
--- a/src/plugins/flatpak/gbp-flatpak-manifest.c
+++ b/src/plugins/flatpak/gbp-flatpak-manifest.c
@@ -169,6 +169,7 @@ discover_strv_field (JsonObject *object,
g_ptr_array_add (ar, NULL);
+ g_clear_pointer (location, g_strfreev);
*location = (gchar **)g_ptr_array_free (g_steal_pointer (&ar), FALSE);
return TRUE;
@@ -210,6 +211,26 @@ discover_strv_as_quoted (JsonObject *object,
return FALSE;
}
+static void
+discover_build_options (GbpFlatpakManifest *self,
+ JsonObject *root)
+{
+ JsonObject *build_options;
+
+ g_assert (GBP_IS_FLATPAK_MANIFEST (self));
+ g_assert (root != NULL);
+
+ /* TODO: this all needs a revamp, as these can be changed per arch */
+
+ if (!json_object_has_member (root, "build-options"))
+ return;
+
+ if (!(build_options = json_object_get_object_member (root, "build-options")))
+ return;
+
+ discover_strv_field (build_options, "build-args", &self->build_args);
+}
+
static void
discover_environ (GbpFlatpakManifest *self,
JsonObject *root)
@@ -423,7 +444,6 @@ gbp_flatpak_manifest_initable_init (GInitable *initable,
discover_string_field (root_obj, "base-version", &self->base_version);
discover_string_field (root_obj, "sdk", &self->sdk);
discover_string_field (root_obj, "command", &self->command);
- discover_strv_field (root_obj, "build-args", &self->build_args);
discover_strv_field (root_obj, "finish-args", &self->finish_args);
discover_strv_field (root_obj, "sdk-extensions", &self->sdk_extensions);
discover_strv_field (root_obj, "x-run-args", &self->x_run_args);
@@ -479,6 +499,7 @@ gbp_flatpak_manifest_initable_init (GInitable *initable,
(const gchar * const *)make_install_args);
discover_environ (self, root_obj);
+ discover_build_options (self, root_obj);
self->root = json_node_ref (root);
self->primary = json_object_ref (primary);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]