diff options
author | Matthew Leeds <matthew.leeds@endlessm.com> | 2019-09-16 14:49:02 -0700 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2019-09-19 15:20:15 +0000 |
commit | 989b18bba8424ef962aec029d11a0e619a9f706c (patch) | |
tree | 954e9fc0097c340b12a3fa95f674c1871263b041 /common/flatpak-installation.c | |
parent | 9c3b42d67e6f67c4716caed49e351a339dc64505 (diff) | |
download | flatpak-989b18bba8424ef962aec029d11a0e619a9f706c.tar.gz |
Set a collection ID on FlatpakInstalledRef objects
Currently FlatpakInstalledRef objects are constructed without the
collection-id property set. This is a problem because in the USB app
update support in the Endless fork of GNOME Software, when we find a
FlatpakRemoteRef on a USB drive which matches the ref of a
FlatpakInstalledRef object, the collection IDs of the two objects must
also match, and currently the installed one has a NULL collection ID.
So get the collection ID on the relevant configured remote when
constructing a FlatpakInstalledRef. This should be good enough in most
cases but isn't perfect; see
https://github.com/flatpak/flatpak/issues/3103
Closes: #3114
Approved by: alexlarsson
Diffstat (limited to 'common/flatpak-installation.c')
-rw-r--r-- | common/flatpak-installation.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/common/flatpak-installation.c b/common/flatpak-installation.c index 6e960b68..1fb47b75 100644 --- a/common/flatpak-installation.c +++ b/common/flatpak-installation.c @@ -728,6 +728,7 @@ get_ref (FlatpakDir *dir, g_autofree char *deploy_subdirname = NULL; g_autoptr(GVariant) deploy_data = NULL; g_autofree const char **subpaths = NULL; + g_autofree char *collection_id = NULL; gboolean is_current = FALSE; guint64 installed_size = 0; @@ -757,10 +758,12 @@ get_ref (FlatpakDir *dir, latest_commit = flatpak_dir_read_latest (dir, origin, full_ref, &latest_alt_id, NULL, NULL); + collection_id = flatpak_dir_get_remote_collection_id (dir, origin); + return flatpak_installed_ref_new (full_ref, alt_id ? alt_id : commit, latest_alt_id ? latest_alt_id : latest_commit, - origin, subpaths, + origin, collection_id, subpaths, deploy_path, installed_size, is_current, |