[gnome-builder] flatpak: pass --command to build-finish



commit e1690cfd193401d7cce9334ad1164f0ecd9e9a3c
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jan 19 16:12:35 2018 -0800

    flatpak: pass --command to build-finish
    
    If we know the command from the manifest, we should pass that to the
    flatpak build-finish command. Otherwise, we risk build-finish choosing the
    first binary it finds in /app/bin.
    
    Fixes #353

 src/plugins/flatpak/gbp-flatpak-pipeline-addin.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/flatpak/gbp-flatpak-pipeline-addin.c 
b/src/plugins/flatpak/gbp-flatpak-pipeline-addin.c
index d0d1471d9..ef6f69338 100644
--- a/src/plugins/flatpak/gbp-flatpak-pipeline-addin.c
+++ b/src/plugins/flatpak/gbp-flatpak-pipeline-addin.c
@@ -382,7 +382,8 @@ register_build_finish_stage (GbpFlatpakPipelineAddin  *self,
   g_autoptr(IdeSubprocessLauncher) launcher = NULL;
   g_autoptr(IdeBuildStage) stage = NULL;
   g_autofree gchar *staging_dir = NULL;
-  const gchar *const *finish_args;
+  const gchar * const *finish_args;
+  const gchar *command;
   IdeConfiguration *config;
   guint stage_id;
 
@@ -394,6 +395,7 @@ register_build_finish_stage (GbpFlatpakPipelineAddin  *self,
   if (!GBP_IS_FLATPAK_CONFIGURATION (config))
     return TRUE;
 
+  command = gbp_flatpak_configuration_get_command (GBP_FLATPAK_CONFIGURATION (config));
   finish_args = gbp_flatpak_configuration_get_finish_args (GBP_FLATPAK_CONFIGURATION (config));
   staging_dir = gbp_flatpak_get_staging_dir (config);
 
@@ -401,6 +403,13 @@ register_build_finish_stage (GbpFlatpakPipelineAddin  *self,
 
   ide_subprocess_launcher_push_argv (launcher, "flatpak");
   ide_subprocess_launcher_push_argv (launcher, "build-finish");
+
+  if (command != NULL)
+    {
+      ide_subprocess_launcher_push_argv (launcher, "--command");
+      ide_subprocess_launcher_push_argv (launcher, command);
+    }
+
   ide_subprocess_launcher_push_args (launcher, finish_args);
   ide_subprocess_launcher_push_argv (launcher, staging_dir);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]