summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-10-24 14:33:02 +0200
committerAlexander Larsson <alexl@redhat.com>2016-10-24 14:36:19 +0200
commit01a68e697b1f78d6dacbbc8ecda464e2bdda6f14 (patch)
treefc293887691921dc05ea053352e177b1e7a54f8c
parentf673d544c94bb3dc4e0ceb264ee65b4b65e7e4fe (diff)
downloadflatpak-01a68e697b1f78d6dacbbc8ecda464e2bdda6f14.tar.gz
Work around ostree partial commit issue
This works around: https://github.com/ostreedev/ostree/issues/541 Which is causing us to not pull the entire set of objects, rather stopping at the first object which is locally available. We fix this by pulling twice in the subdirs != NULL case, which works because the second time the new commit is marked partial and we then pull the entire thing.
-rw-r--r--common/flatpak-dir.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
index 08aed51e..3e870403 100644
--- a/common/flatpak-dir.c
+++ b/common/flatpak-dir.c
@@ -1267,6 +1267,7 @@ repo_pull_one_dir (OstreeRepo *self,
{
GVariantBuilder builder;
gboolean force_disable_deltas = FALSE;
+ g_autoptr(GVariant) options = NULL;
const char *refs_to_fetch[2];
const char *revs_to_fetch[2];
gboolean res;
@@ -1300,8 +1301,21 @@ repo_pull_one_dir (OstreeRepo *self,
g_variant_builder_add (&builder, "{s@v}", "override-commit-ids",
g_variant_new_variant (g_variant_new_strv ((const char * const *) revs_to_fetch, -1)));
- res = ostree_repo_pull_with_options (self, remote_name, g_variant_builder_end (&builder),
+ options = g_variant_ref_sink (g_variant_builder_end (&builder));
+ res = ostree_repo_pull_with_options (self, remote_name, options,
progress, cancellable, error);
+ if (res && dirs_to_pull != NULL)
+ {
+ /* This works around an issue with ostree where it doesn't pull
+ * all dependencies (stops are first locally available object)
+ * unless the commit itself is a commitpartial:
+ * https://github.com/ostreedev/ostree/issues/543
+ * The workaround works by pulling again, and on the new pull
+ * the commit *will* have a commitpartial.
+ */
+ res = ostree_repo_pull_with_options (self, remote_name, options,
+ progress, cancellable, error);
+ }
return res;
}