From 4e73b51a0bac05da0cdd280cec3ac0d0fc47b46b Mon Sep 17 00:00:00 2001 From: Matthew Leeds Date: Tue, 19 Jun 2018 17:25:59 -0700 Subject: [PATCH] dir: Avoid unnecessary fetches of ostree-metadata This commit removes fetches of ostree-metadata from flatpak_dir_install() and flatpak_dir_update(), which both pull it into the child repo when doing system-helper deployments. Both functions have a FlatpakRemoteState object passed in and when that is initialized, _flatpak_dir_fetch_remote_state_metadata_branch() pulls and deploys ostree-metadata so it can be queried against for repo metadata and served onto LAN and USB peers. So there's no need to pull it again here. The issue of resolving a ref and its metadata atomically remains, but that will be addressed by https://github.com/flatpak/flatpak/pull/1796. Closes: #1806 Approved by: alexlarsson --- common/flatpak-dir.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 9c07a355..ce8c5739 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -6636,10 +6636,6 @@ flatpak_dir_install (FlatpakDir *self, /* Don’t resolve a rev or OstreeRepoFinderResult set early; the pull * code will do this. */ - /* FIXME: Ideally we could merge these two flatpak_dir_pull() calls - * so @ref and %OSTREE_REPO_METADATA_REF are resolved atomically. - * However, pulling them separately is no worse than the old code path - * where the summary and ref were pulled separately. */ if (!flatpak_dir_pull (self, state, ref, opt_commit, NULL, subpaths, child_repo, flatpak_flags, @@ -6647,14 +6643,6 @@ flatpak_dir_install (FlatpakDir *self, progress, cancellable, error)) return FALSE; - if (state->collection_id != NULL && - !flatpak_dir_pull (self, state, OSTREE_REPO_METADATA_REF, NULL, NULL, NULL, - child_repo, - flatpak_flags, - OSTREE_REPO_PULL_FLAGS_MIRROR, - progress, cancellable, error)) - return FALSE; - if (!child_repo_ensure_summary (child_repo, state, cancellable, error)) return FALSE; @@ -7255,22 +7243,12 @@ flatpak_dir_update (FlatpakDir *self, if (child_repo == NULL) return FALSE; - /* FIXME: Ideally we could merge these two flatpak_dir_pull() calls - * so @ref and %OSTREE_REPO_METADATA_REF are resolved atomically. - * However, pulling them separately is no worse than the old code path - * where the summary and ref were pulled separately. */ flatpak_flags |= FLATPAK_PULL_FLAGS_SIDELOAD_EXTRA_DATA; if (!flatpak_dir_pull (self, state, ref, commit, results, subpaths, child_repo, flatpak_flags, OSTREE_REPO_PULL_FLAGS_MIRROR, progress, cancellable, error)) return FALSE; - if (state->collection_id != NULL && - !flatpak_dir_pull (self, state, OSTREE_REPO_METADATA_REF, NULL, NULL, NULL, - child_repo, - flatpak_flags, OSTREE_REPO_PULL_FLAGS_MIRROR, - progress, cancellable, error)) - return FALSE; if (!child_repo_ensure_summary (child_repo, state, cancellable, error)) return FALSE;