Getting information about updates
Alexander Larsson
alexl at redhat.com
Fri Oct 21 06:56:15 UTC 2016
On tor, 2016-10-20 at 16:59 +0100, Richard Hughes wrote:
>
> So, we add a GSetting, and support both modes. Now in the endless
> case
> alternate-mode we do once per day:
>
> * flatpak_installation_drop_caches
> * flatpak_installation_update_appstream_sync
>
> and then we get the list of updates using:
>
> * flatpak_installation_list_installed_refs
Surely you mean flatpak_installation_list_installed_refs_for_update()
here?
> If i understand correctly, flatpak_ref_get_commit() returns the app
> ref installed right now, and
> flatpak_installed_ref_get_latest_commit()
> gets the latest commit as found in the remote cache. But, we don't
> actually know if get_latest_commit() is returning a commit that's
> already downloaded or not. This is important as we need to report to
> the UI if there will be network access required. I guess I could call
> list_installed_refs_for_update *and* list_installed_refs(), comparing
> one against the other, but that's non-awesome. Ideally I want some
> kind of API that tells me if a commit is downloaded or not. I guess
> flatpak_installation_fetch_remote_size_sync() also works, but that's
> going to be super slow as it's doing network IO. Ideas?
No that is not how it works, it returns the same thing as
list_installed_refs, but filtered so that only things that have an
update upstream is listed. So "get_commit()" is the installed version
and "get_latest_commit()" is the latest locally pulled version.
The new remote commit id is not really returned. Do you need that?
Also, if you need something more
complicated, flatpak_installation_list_installed_refs_for_update() is
really just a helper function on top of the lower level calls, which
are list_remote_refs_sync() and list_installed_refs().
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Alexander Larsson Red Hat, Inc
alexl at redhat.com alexander.larsson at gmail.com
He's a one-legged albino photographer from the Mississippi delta. She's a
strong-willed mute opera singer in the witness protection program. They
fight crime!
More information about the xdg-app
mailing list