[gnome-builder] flatpak: always try to get manifest command name
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] flatpak: always try to get manifest command name
- Date: Tue, 6 Aug 2019 23:25:07 +0000 (UTC)
commit 910dd39578be6039169de58494c2bc1a0455012d
Author: Christian Hergert <chergert redhat com>
Date: Tue Aug 6 16:24:36 2019 -0700
flatpak: always try to get manifest command name
src/plugins/flatpak/gbp-flatpak-runner.c | 1 +
src/plugins/flatpak/gbp-flatpak-runtime.c | 11 ++---------
2 files changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/src/plugins/flatpak/gbp-flatpak-runner.c b/src/plugins/flatpak/gbp-flatpak-runner.c
index c74a7eeb2..655d6e230 100644
--- a/src/plugins/flatpak/gbp-flatpak-runner.c
+++ b/src/plugins/flatpak/gbp-flatpak-runner.c
@@ -189,6 +189,7 @@ gbp_flatpak_runner_new (IdeContext *context,
g_return_val_if_fail (IDE_IS_CONTEXT (context), NULL);
g_return_val_if_fail (!build_target || IDE_IS_BUILD_TARGET (build_target), NULL);
+ g_return_val_if_fail (build_target || manifest_command, NULL);
self = g_object_new (GBP_TYPE_FLATPAK_RUNNER, NULL);
self->build_path = g_strdup (build_path);
diff --git a/src/plugins/flatpak/gbp-flatpak-runtime.c b/src/plugins/flatpak/gbp-flatpak-runtime.c
index 630cac83b..ef0c61e81 100644
--- a/src/plugins/flatpak/gbp-flatpak-runtime.c
+++ b/src/plugins/flatpak/gbp-flatpak-runtime.c
@@ -243,13 +243,11 @@ gbp_flatpak_runtime_create_launcher (IdeRuntime *runtime,
}
static gchar *
-get_binary_name (GbpFlatpakRuntime *self,
- IdeBuildTarget *build_target)
+get_manifst_command (GbpFlatpakRuntime *self)
{
IdeContext *context = ide_object_get_context (IDE_OBJECT (self));
IdeConfigManager *config_manager = ide_config_manager_from_context (context);
IdeConfig *config = ide_config_manager_get_current (config_manager);
- g_autofree gchar *build_target_name = ide_build_target_get_name (build_target);
if (GBP_IS_FLATPAK_MANIFEST (config))
{
@@ -260,10 +258,6 @@ get_binary_name (GbpFlatpakRuntime *self,
return g_strdup (command);
}
- /* Use the build target name if there's no command in the manifest */
- if (!ide_str_empty0 (build_target_name))
- return g_steal_pointer (&build_target_name);
-
/* Use the project id as a last resort */
return ide_context_dup_project_id (context);
}
@@ -284,8 +278,7 @@ gbp_flatpak_runtime_create_runner (IdeRuntime *runtime,
context = ide_object_get_context (IDE_OBJECT (self));
build_path = get_staging_directory (self);
- if (build_target != NULL)
- binary_name = get_binary_name (self, build_target);
+ binary_name = get_manifst_command (self);
if ((runner = IDE_RUNNER (gbp_flatpak_runner_new (context, build_path, build_target, binary_name))))
ide_object_append (IDE_OBJECT (self), IDE_OBJECT (runner));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]