summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Leeds <matthew.leeds@endlessm.com>2018-03-08 20:20:16 -0800
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-13 10:40:14 +0000
commitbcd850ca8bfe95bb7c8beb4d5ab1ca1eaf8fb96f (patch)
treeea033155b2e6e81536eb00e6b628ceed102374f6
parent272af0f8cc306cd863a54a816953d2f0a7b06c20 (diff)
downloadflatpak-bcd850ca8bfe95bb7c8beb4d5ab1ca1eaf8fb96f.tar.gz
dir: Regenerate summary in child repo in more cases
Similarly to commit 272af0f8c, this commit makes sure the child repo used by the system helper has an accurate summary file so it can be pulled from. This time it's for the fetches of the ostree-metadata ref and the appstream data. This fixes a bug that occurs if a remote has a collection ID set and uses the "branches" key as well. Under those conditions, `flatpak remote-ls -d REMOTE` and `flatpak update --appstream REMOTE` can fail with "Error pulling from repo: No summary found". Until recently, the /ostree/repo/config in Endless contained a remote that was shared between flatpak and ostree, which had "branches" set. So that's a use case where this helps. Fixes https://github.com/flatpak/flatpak/issues/1440 Closes: #1478 Approved by: pwithnall
-rw-r--r--common/flatpak-dir.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
index 6fc695d2..ca8b6ea2 100644
--- a/common/flatpak-dir.c
+++ b/common/flatpak-dir.c
@@ -2233,6 +2233,13 @@ flatpak_dir_update_appstream (FlatpakDir *self,
progress, cancellable, error))
return FALSE;
+ /* Regenerate the summary in the child repo because the
+ * flatpak_dir_pull() call above might not copy the remote summary
+ * into the repo if the "branches" key is set on the remote. */
+ if (collection_id != NULL &&
+ !ostree_repo_regenerate_summary (child_repo, NULL, cancellable, error))
+ return FALSE;
+
if (summary_copy != NULL)
{
summary_file = g_file_get_child (ostree_repo_get_path (child_repo), "summary");
@@ -9892,6 +9899,13 @@ flatpak_dir_fetch_remote_repo_metadata (FlatpakDir *self,
NULL, cancellable, error))
return FALSE;
+ /* Regenerate the summary in the child repo because the
+ * flatpak_dir_pull() call above might not copy the remote summary
+ * into the repo if the "branches" key is set on the remote. */
+ if (collection_id != NULL &&
+ !ostree_repo_regenerate_summary (child_repo, NULL, cancellable, error))
+ return FALSE;
+
child_repo_path = g_file_get_path (ostree_repo_get_path (child_repo));
}