[gnome-builder] flatpak: ignore build stages when not using flatpak manifest



commit ea0d35e98c876e19ded7672f156ea47d377908ea
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jul 24 12:45:57 2018 -0700

    flatpak: ignore build stages when not using flatpak manifest
    
    This allows us to short circuit any pipeline setup (and sniffing
    flatpak-builder version) when the build configuration is not a flatpak
    manifest.

 src/plugins/flatpak/gbp-flatpak-pipeline-addin.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)
---
diff --git a/src/plugins/flatpak/gbp-flatpak-pipeline-addin.c 
b/src/plugins/flatpak/gbp-flatpak-pipeline-addin.c
index 9282bf543..8f73ae2ac 100644
--- a/src/plugins/flatpak/gbp-flatpak-pipeline-addin.c
+++ b/src/plugins/flatpak/gbp-flatpak-pipeline-addin.c
@@ -672,11 +672,18 @@ gbp_flatpak_pipeline_addin_load (IdeBuildPipelineAddin *addin,
   g_autoptr(GError) error = NULL;
   IdeConfiguration *config;
   IdeContext *context;
-  IdeRuntime *runtime;
 
   g_assert (GBP_IS_FLATPAK_PIPELINE_ADDIN (self));
   g_assert (IDE_IS_BUILD_PIPELINE (pipeline));
 
+  config = ide_build_pipeline_get_configuration (pipeline);
+
+  if (!GBP_IS_FLATPAK_MANIFEST (config))
+    {
+      g_message ("Not using flatpak manifest, refusing to add flatpak build pipeline stages");
+      return;
+    }
+
   sniff_flatpak_builder_version (self);
 
   if (VERSION_CHECK (&self->version, 0, 10, 5))
@@ -697,20 +704,6 @@ gbp_flatpak_pipeline_addin_load (IdeBuildPipelineAddin *addin,
                                           NULL);
     }
 
-  config = ide_build_pipeline_get_configuration (pipeline);
-
-  /* TODO: Once we have GbpFlatpakConfiguration, we can check for
-   *       that (and it should only allow for valid flatpak runtimes).
-   */
-
-  runtime = ide_configuration_get_runtime (config);
-
-  if (!GBP_IS_FLATPAK_RUNTIME (runtime))
-    {
-      g_message ("Configuration is not using flatpak, ignoring pipeline");
-      return;
-    }
-
   /*
    * TODO: We should add the ability to mark a pipeline as broken, if we
    *       detect something that is alarming. That will prevent builds from


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