dir: Support finding dependencies offline

Currently if you try to do an offline app install from a USB drive and
the app requires a runtime that's not already installed (or a different
version is installed), the install operation will fail, even if the
needed runtime is available on the USB drive.

The commit ensures that you can successfully find the dependencies
available from peer sources by making flatpak_dir_remote_has_ref() use
flatpak_dir_get_remote_state_optional(), which treats a summary fetch
error as non-fatal. Due to how flatpak_remote_state_lookup_ref() is
written, the summary is still required if there's not a collection ID
set on the remote.

This is a partial fix for https://github.com/flatpak/flatpak/issues/1583

Closes: #1673
Approved by: pwithnall
This commit is contained in:
Matthew Leeds
2018-05-14 20:47:56 -07:00
committed by Atomic Bot
parent 013263fcc0
commit dc7053970f

View File

@@ -8456,7 +8456,7 @@ flatpak_dir_remote_has_ref (FlatpakDir *self,
g_autoptr(GError) local_error = NULL;
g_autoptr(FlatpakRemoteState) state = NULL;
state = flatpak_dir_get_remote_state (self, remote, NULL, &local_error);
state = flatpak_dir_get_remote_state_optional (self, remote, NULL, &local_error);
if (state == NULL)
{
g_debug ("Can't get state for remote %s: %s", remote, local_error->message);