[gnome-builder] flatpak: work around flatpak-builder --state-dir bug



commit 75a736583d1a068970660d9a857bf35f3e4aff5d
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 10 14:32:29 2018 -0800

    flatpak: work around flatpak-builder --state-dir bug
    
    It appears that if we don't want updates, flatpak-builder will still query
    the remote peer because it fails to find a local mirror directory for the
    peer. However, if we specify --extra-sources, we can make it find it as
    expected.
    
    We probably need to fix builder_context_find_in_sources_dirs_va() to check
    the specified --state-dir.

 src/plugins/flatpak/gbp-flatpak-download-stage.c |   14 +++++++++++---
 src/plugins/flatpak/gbp-flatpak-pipeline-addin.c |    8 ++++++++
 2 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/flatpak/gbp-flatpak-download-stage.c 
b/src/plugins/flatpak/gbp-flatpak-download-stage.c
index 860d701..a88882c 100644
--- a/src/plugins/flatpak/gbp-flatpak-download-stage.c
+++ b/src/plugins/flatpak/gbp-flatpak-download-stage.c
@@ -109,12 +109,20 @@ gbp_flatpak_download_stage_query (IdeBuildStage    *stage,
 
       ide_subprocess_launcher_push_argv (launcher, "--download-only");
 
-      if (!self->force_update)
+      if (self->state_dir != NULL)
         {
-          ide_subprocess_launcher_push_argv (launcher, "--disable-updates");
-          ide_subprocess_launcher_push_argv (launcher, "--disable-download");
+          /*
+           * We need to specify to flatpak-builder the location for the sources
+           * so that it doesn't try to ping the remote host. This should
+           * _probably_ be fixed in upstream flatpak-builder.
+           */
+          ide_subprocess_launcher_push_argv (launcher, "--extra-sources");
+          ide_subprocess_launcher_push_argv (launcher, self->state_dir);
         }
 
+      if (!self->force_update)
+        ide_subprocess_launcher_push_argv (launcher, "--disable-updates");
+
       stop_at_option = g_strdup_printf ("--stop-at=%s", primary_module);
       ide_subprocess_launcher_push_argv (launcher, stop_at_option);
 
diff --git a/src/plugins/flatpak/gbp-flatpak-pipeline-addin.c 
b/src/plugins/flatpak/gbp-flatpak-pipeline-addin.c
index 1d50a9d..bf67d96 100644
--- a/src/plugins/flatpak/gbp-flatpak-pipeline-addin.c
+++ b/src/plugins/flatpak/gbp-flatpak-pipeline-addin.c
@@ -344,6 +344,14 @@ register_dependencies_stage (GbpFlatpakPipelineAddin  *self,
     {
       ide_subprocess_launcher_push_argv (launcher, "--state-dir");
       ide_subprocess_launcher_push_argv (launcher, self->state_dir);
+
+      /*
+       * We need to specify to flatpak-builder the location for the sources
+       * so that it doesn't try to ping the remote host. This should
+       * _probably_ be fixed in upstream flatpak-builder.
+       */
+      ide_subprocess_launcher_push_argv (launcher, "--extra-sources");
+      ide_subprocess_launcher_push_argv (launcher, self->state_dir);
     }
 
   stop_at_option = g_strdup_printf ("--stop-at=%s", primary_module);


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