app: Use AS_FORMAT_STYLE_CATALOG if available

AS_FORMAT_STYLE_COLLECTION is a deprecated alias for ..._CATALOG, and
was removed entirely in appstream git main (presumably version 0.17
or 1.0).

Resolves: https://github.com/flatpak/flatpak/issues/5472
Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie
2023-07-10 18:44:49 +01:00
parent 556984e1c1
commit 7a55b7c49f

View File

@@ -1130,7 +1130,12 @@ flatpak_dir_load_appstream_store (FlatpakDir *self,
NULL);
appstream_file = g_file_new_for_path (appstream_path);
#if AS_CHECK_VERSION(0, 16, 0)
as_metadata_set_format_style (mdata, AS_FORMAT_STYLE_CATALOG);
#else
/* Deprecated name for the same thing */
as_metadata_set_format_style (mdata, AS_FORMAT_STYLE_COLLECTION);
#endif
#if AS_CHECK_VERSION(0, 14, 0)
success = as_metadata_parse_file (mdata, appstream_file, AS_FORMAT_KIND_XML, &local_error);
#else