mirror of
https://github.com/flatpak/flatpak.git
synced 2026-02-02 03:51:28 -05:00
p2p: When updating/installing, resolve via ostree-metadata if possible
If the commit is available in the ostree-metadata and it matches what the latest available commit in the p2p results then resolve it to that, so we don't have to download the commit object.
This commit is contained in:
committed by
Alexander Larsson
parent
54415b79c7
commit
3d47dc02fa
@@ -2337,6 +2337,20 @@ resolve_p2p_ops (FlatpakTransaction *self,
|
||||
if (state == NULL)
|
||||
return FALSE;
|
||||
|
||||
/* Resolve any ops that we can resolve from the ostree-metadata info */
|
||||
for (i = 0, l = p2p_ops; l != NULL; i++, l = l->next)
|
||||
{
|
||||
FlatpakTransactionOperation *op = l->data;
|
||||
FlatpakDirResolve *resolve = g_ptr_array_index (resolves, i);
|
||||
|
||||
if (resolve->resolved_commit == NULL)
|
||||
{
|
||||
g_autoptr(FlatpakRemoteState) state = flatpak_transaction_ensure_remote_state (self, op->kind, op->remote, NULL);
|
||||
if (state != NULL)
|
||||
flatpak_dir_resolve_maybe_resolve_from_metadata (resolve, state);
|
||||
}
|
||||
}
|
||||
|
||||
/* This does the downloads of the actual commit objects that are needed. */
|
||||
if (!flatpak_dir_finish_resolve_p2p_refs (priv->dir, (FlatpakDirResolve **) resolves->pdata,
|
||||
state, cancellable, error))
|
||||
|
||||
Reference in New Issue
Block a user