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
This commit is contained in:
Matthew Leeds
2018-06-19 17:25:59 -07:00
committed by Atomic Bot
parent ac2d51b1c7
commit 4e73b51a0b

View File

@@ -6636,10 +6636,6 @@ flatpak_dir_install (FlatpakDir *self,
/* Dont 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;