[gnome-builder] flatpak: add helper to resolve sdk extensions
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] flatpak: add helper to resolve sdk extensions
- Date: Sat, 1 May 2021 02:36:06 +0000 (UTC)
commit 78742b59bfc67f5da227ac0844c5620e5a7bf6d4
Author: Christian Hergert <chergert redhat com>
Date: Fri Apr 30 19:14:39 2021 -0700
flatpak: add helper to resolve sdk extensions
src/plugins/flatpak/gbp-flatpak-manifest.c | 29 +++++++++++++++++++++++++++++
src/plugins/flatpak/gbp-flatpak-manifest.h | 4 ++++
2 files changed, 33 insertions(+)
---
diff --git a/src/plugins/flatpak/gbp-flatpak-manifest.c b/src/plugins/flatpak/gbp-flatpak-manifest.c
index 5ddc67fd6..e3359883e 100644
--- a/src/plugins/flatpak/gbp-flatpak-manifest.c
+++ b/src/plugins/flatpak/gbp-flatpak-manifest.c
@@ -1108,3 +1108,32 @@ gbp_flatpak_manifest_get_platform (GbpFlatpakManifest *self)
return self->runtime;
}
+
+void
+gbp_flatpak_manifest_resolve_extensions (GbpFlatpakManifest *self,
+ IpcFlatpakService *service)
+{
+ g_return_if_fail (GBP_IS_FLATPAK_MANIFEST (self));
+ g_return_if_fail (!service || IPC_IS_FLATPAK_SERVICE (service));
+
+ if (self->sdk_extensions == NULL || service == NULL)
+ return;
+
+ for (guint i = 0; self->sdk_extensions[i]; i++)
+ {
+ g_autofree char *resolved = NULL;
+
+ ipc_flatpak_service_call_resolve_extension_sync (service,
+ self->sdk,
+ self->sdk_extensions[i],
+ &resolved,
+ NULL,
+ NULL);
+
+ if (!ide_str_empty0 (resolved))
+ {
+ g_free (self->sdk_extensions[i]);
+ self->sdk_extensions[i] = g_steal_pointer (&resolved);
+ }
+ }
+}
diff --git a/src/plugins/flatpak/gbp-flatpak-manifest.h b/src/plugins/flatpak/gbp-flatpak-manifest.h
index b05321f89..fbda0e2e2 100644
--- a/src/plugins/flatpak/gbp-flatpak-manifest.h
+++ b/src/plugins/flatpak/gbp-flatpak-manifest.h
@@ -23,6 +23,8 @@
#include <libide-foundry.h>
+#include "ipc-flatpak-service.h"
+
G_BEGIN_DECLS
#define GBP_TYPE_FLATPAK_MANIFEST (gbp_flatpak_manifest_get_type())
@@ -49,6 +51,8 @@ void gbp_flatpak_manifest_save_async (GbpFlatpakManifest
gboolean gbp_flatpak_manifest_save_finish (GbpFlatpakManifest *self,
GAsyncResult *result,
GError **error);
+void gbp_flatpak_manifest_resolve_extensions (GbpFlatpakManifest *self,
+ IpcFlatpakService *service);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]