[gnome-builder] plugins/podman: Streamline runtime launcher creation
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] plugins/podman: Streamline runtime launcher creation
- Date: Sun, 6 Sep 2020 20:24:48 +0000 (UTC)
commit 1b887ca5172cdd332a2ddcee951be5dfabdf8226
Author: Ondřej Míchal <harrymichal seznam cz>
Date: Sun Sep 6 14:43:31 2020 +0200
plugins/podman: Streamline runtime launcher creation
'gbp_flatpak_runtime_create_launcher' has a runtime id check at the
beginning. This adds it to 'gbp_podman_runtime_create_launcher' to unify
the implementation.
The 'run-on-host' == 'TRUE' is redundant in the case of Podman's runtime
launcher because it is always executed on the host (implementation
detail of 'gbp_podman_subprocess_launcher_spawn').
src/plugins/podman/gbp-podman-runtime.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/podman/gbp-podman-runtime.c b/src/plugins/podman/gbp-podman-runtime.c
index 2c119c4de..7ec3cfe5f 100644
--- a/src/plugins/podman/gbp-podman-runtime.c
+++ b/src/plugins/podman/gbp-podman-runtime.c
@@ -75,12 +75,17 @@ static IdeSubprocessLauncher *
gbp_podman_runtime_create_launcher (IdeRuntime *runtime,
GError **error)
{
- const gchar *id;
GbpPodmanRuntime *self = (GbpPodmanRuntime *)runtime;
+ IdeSubprocessLauncher *launcher;
+ const gchar *runtime_id;
+ const gchar *id;
g_assert (IDE_IS_MAIN_THREAD ());
g_assert (GBP_IS_PODMAN_RUNTIME (self));
+ runtime_id = ide_runtime_get_id (runtime);
+ g_return_val_if_fail (g_str_has_prefix (runtime_id, "podman:"), NULL);
+
maybe_start (self);
if (json_object_has_member (self->object, "ID"))
@@ -90,10 +95,11 @@ gbp_podman_runtime_create_launcher (IdeRuntime *runtime,
g_return_val_if_fail (id != NULL, NULL);
- return g_object_new (GBP_TYPE_PODMAN_SUBPROCESS_LAUNCHER,
+ launcher = g_object_new (GBP_TYPE_PODMAN_SUBPROCESS_LAUNCHER,
"id", id,
- "run-on-host", TRUE,
NULL);
+
+ return launcher;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]