[gnome-builder] flatpak: include --branch when calling which



commit 788dac76a873b8dbcca10a1b09ddfa34fe4499b8
Author: Christian Hergert <chergert redhat com>
Date:   Thu Mar 14 16:08:12 2019 -0700

    flatpak: include --branch when calling which
    
    When determining if we have a program, we should also include
    the branch for the SDK.

 src/plugins/flatpak/gbp-flatpak-runtime.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/plugins/flatpak/gbp-flatpak-runtime.c b/src/plugins/flatpak/gbp-flatpak-runtime.c
index ab5ca1253..f219f880f 100644
--- a/src/plugins/flatpak/gbp-flatpak-runtime.c
+++ b/src/plugins/flatpak/gbp-flatpak-runtime.c
@@ -95,6 +95,7 @@ gbp_flatpak_runtime_contains_program_in_path (IdeRuntime   *runtime,
   g_autoptr(IdeSubprocessLauncher) launcher = NULL;
   g_autoptr(IdeSubprocess) subprocess = NULL;
   g_autofree gchar *arch = NULL;
+  g_autofree gchar *branch = NULL;
 
   g_assert (GBP_IS_FLATPAK_RUNTIME (self));
   g_assert (program != NULL);
@@ -105,6 +106,9 @@ gbp_flatpak_runtime_contains_program_in_path (IdeRuntime   *runtime,
 
   arch = g_strdup_printf ("--arch=%s", ide_triplet_get_arch (self->triplet));
 
+  if (self->branch != NULL)
+    branch = g_strdup_printf ("--branch=%s", self->branch);
+
   /*
    * To check if a program is available, we don't want to use the normal
    * launcher because it will only be available if the build directory
@@ -120,6 +124,8 @@ gbp_flatpak_runtime_contains_program_in_path (IdeRuntime   *runtime,
   ide_subprocess_launcher_push_argv (launcher, "flatpak");
   ide_subprocess_launcher_push_argv (launcher, "run");
   ide_subprocess_launcher_push_argv (launcher, arch);
+  if (branch != NULL)
+    ide_subprocess_launcher_push_argv (launcher, branch);
   ide_subprocess_launcher_push_argv (launcher, "--command=which");
   ide_subprocess_launcher_push_argv (launcher, self->sdk);
   ide_subprocess_launcher_push_argv (launcher, program);


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