diff --git a/.gitignore b/.gitignore index 0f29705..f2446ff 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,4 @@ /appstream-glib-0.7.14.tar.xz /appstream-glib-0.7.15.tar.xz /appstream-glib-0.7.16.tar.xz +/appstream-glib-0.7.17.tar.xz diff --git a/libappstream-glib.spec b/libappstream-glib.spec index 064cb79..94709ca 100644 --- a/libappstream-glib.spec +++ b/libappstream-glib.spec @@ -5,15 +5,12 @@ Summary: Library for AppStream metadata Name: libappstream-glib -Version: 0.7.16 -Release: 3%{?dist} +Version: 0.7.17 +Release: 1%{?dist} License: LGPLv2+ URL: http://people.freedesktop.org/~hughsient/appstream-glib/ Source0: http://people.freedesktop.org/~hughsient/appstream-glib/releases/appstream-glib-%{version}.tar.xz -# Backported from upstream -Patch0: qt-translations-subdir.patch - BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: docbook-utils BuildRequires: gtk-doc @@ -134,6 +131,13 @@ from a directory of packages. %{_mandir}/man1/appstream-builder.1.gz %changelog +* Thu Feb 20 2020 Richard Hughes 0.7.17-1 +- New upstream release +- Add "icon-theme" as recognised component type +- Fix CI by moving 'future' back a bit +- Make default content rating values match OARS semantics +- Properly initialize unique_id_mutex + * Wed Jan 29 2020 Fedora Release Engineering - 0.7.16-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild diff --git a/qt-translations-subdir.patch b/qt-translations-subdir.patch deleted file mode 100644 index 3b24883..0000000 --- a/qt-translations-subdir.patch +++ /dev/null @@ -1,221 +0,0 @@ -From cea76b901569f8b0c384abe325db37fe445fd341 Mon Sep 17 00:00:00 2001 -From: Kalev Lember -Date: Thu, 14 Nov 2019 14:26:46 +0100 -Subject: [PATCH 1/3] trivial: Move a check earlier so that we exit the correct - loop - ---- - libappstream-glib/as-app-builder.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/libappstream-glib/as-app-builder.c b/libappstream-glib/as-app-builder.c -index 16185ed..6ad0d9a 100644 ---- a/libappstream-glib/as-app-builder.c -+++ b/libappstream-glib/as-app-builder.c -@@ -344,6 +344,11 @@ as_app_builder_search_translations_qt (AsAppBuilderContext *ctx, - /* FIXME: this path probably has to be specified as an attribute - * in the tag from the AppData file */ - t = g_ptr_array_index (ctx->translations, i); -+ if (as_translation_get_kind (t) != AS_TRANSLATION_KIND_QT && -+ as_translation_get_kind (t) != AS_TRANSLATION_KIND_UNKNOWN) -+ continue; -+ if (as_translation_get_id (t) == NULL) -+ continue; - install_dir = as_translation_get_id (t); - path = g_build_filename (prefix, - "share", -@@ -360,11 +365,6 @@ as_app_builder_search_translations_qt (AsAppBuilderContext *ctx, - while ((filename = g_dir_read_name (dir)) != NULL) { - g_autofree gchar *fn = NULL; - g_autofree gchar *locale = NULL; -- if (as_translation_get_kind (t) != AS_TRANSLATION_KIND_QT && -- as_translation_get_kind (t) != AS_TRANSLATION_KIND_UNKNOWN) -- continue; -- if (as_translation_get_id (t) == NULL) -- continue; - if (!g_str_has_prefix (filename, as_translation_get_id (t))) - continue; - locale = g_strdup (filename + strlen (as_translation_get_id (t)) + 1); --- -2.23.0 - - -From e304d6a8b0233c6b805cb68f53bd73259733dac9 Mon Sep 17 00:00:00 2001 -From: Kalev Lember -Date: Thu, 14 Nov 2019 14:27:34 +0100 -Subject: [PATCH 2/3] Support ${id}/${locale}.qm in addition to - ${id}_${locale}.qm - ---- - libappstream-glib/as-app-builder.c | 41 ++++++++++++++++++++++++++++-- - 1 file changed, 39 insertions(+), 2 deletions(-) - -diff --git a/libappstream-glib/as-app-builder.c b/libappstream-glib/as-app-builder.c -index 6ad0d9a..bc712bd 100644 ---- a/libappstream-glib/as-app-builder.c -+++ b/libappstream-glib/as-app-builder.c -@@ -1,6 +1,7 @@ - /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- - * - * Copyright (C) 2015 Richard Hughes -+ * Copyright (C) 2019 Kalev Lember - * - * SPDX-License-Identifier: LGPL-2.1+ - */ -@@ -336,6 +337,7 @@ as_app_builder_search_translations_qt (AsAppBuilderContext *ctx, - /* search for each translation ID */ - for (i = 0; i < ctx->translations->len; i++) { - AsTranslation *t; -+ const gchar *dirname; - const gchar *filename; - const gchar *install_dir; - g_autofree gchar *path = NULL; -@@ -361,18 +363,53 @@ as_app_builder_search_translations_qt (AsAppBuilderContext *ctx, - if (dir == NULL) - return FALSE; - -- /* the format is ${prefix}/share/${install_dir}/translations/${id}_${locale}.qm */ -+ /* look for ${prefix}/share/${install_dir}/translations/${id}_${locale}.qm */ - while ((filename = g_dir_read_name (dir)) != NULL) { - g_autofree gchar *fn = NULL; - g_autofree gchar *locale = NULL; - if (!g_str_has_prefix (filename, as_translation_get_id (t))) - continue; -+ if (!g_str_has_suffix (filename, ".qm")) -+ continue; -+ fn = g_build_filename (path, filename, NULL); -+ if (!g_file_test (fn, G_FILE_TEST_IS_REGULAR)) -+ continue; - locale = g_strdup (filename + strlen (as_translation_get_id (t)) + 1); - g_strdelimit (locale, ".", '\0'); -- fn = g_build_filename (path, filename, NULL); - if (!as_app_builder_parse_file_qt (ctx, locale, fn, error)) - return FALSE; - } -+ -+ g_dir_rewind (dir); -+ -+ /* look for ${prefix}/share/${install_dir}/translations/${id}/${locale}.qm */ -+ while ((dirname = g_dir_read_name (dir)) != NULL) { -+ g_autofree gchar *path_subdir = NULL; -+ g_autoptr(GDir) subdir = NULL; -+ -+ if (!g_str_equal (dirname, as_translation_get_id (t))) -+ continue; -+ path_subdir = g_build_filename (path, dirname, NULL); -+ if (!g_file_test (path_subdir, G_FILE_TEST_IS_DIR)) -+ continue; -+ subdir = g_dir_open (path_subdir, 0, error); -+ if (subdir == NULL) -+ return FALSE; -+ -+ while ((filename = g_dir_read_name (subdir)) != NULL) { -+ g_autofree gchar *fn = NULL; -+ g_autofree gchar *locale = NULL; -+ if (!g_str_has_suffix (filename, ".qm")) -+ continue; -+ fn = g_build_filename (path_subdir, filename, NULL); -+ if (!g_file_test (fn, G_FILE_TEST_IS_REGULAR)) -+ continue; -+ locale = g_strdup (filename); -+ g_strdelimit (locale, ".", '\0'); -+ if (!as_app_builder_parse_file_qt (ctx, locale, fn, error)) -+ return FALSE; -+ } -+ } - } - - return TRUE; --- -2.23.0 - - -From 2e13dcc11de8c4da5822f51fd32f08917f012d09 Mon Sep 17 00:00:00 2001 -From: Kalev Lember -Date: Thu, 14 Nov 2019 14:53:30 +0100 -Subject: [PATCH 3/3] trivial: Add a new self test for ${id}/${locale}.qm - translations - ---- - .../share/kdeapp2/translations/kdeapp2/fr.qm | Bin 0 -> 112 bytes - libappstream-glib/as-self-test.c | 38 ++++++++++++++++++ - 2 files changed, 38 insertions(+) - create mode 100644 data/tests/usr/share/kdeapp2/translations/kdeapp2/fr.qm - -diff --git a/data/tests/usr/share/kdeapp2/translations/kdeapp2/fr.qm b/data/tests/usr/share/kdeapp2/translations/kdeapp2/fr.qm -new file mode 100644 -index 0000000000000000000000000000000000000000..3c6397e22d17fde3e441b4c4bc8ed0044290f115 -GIT binary patch -literal 112 -zcmcE7ks@*G{hX<16=n7(EZlq7iGhKEgHdFS2#{vT1Y&n)AfdqE#E{RB$B+diOBsrQ -z{2Ycb=;6qVrB#Y9po4; - -literal 0 -HcmV?d00001 - -diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c -index 7100f69..eb4cd10 100644 ---- a/libappstream-glib/as-self-test.c -+++ b/libappstream-glib/as-self-test.c -@@ -1,6 +1,7 @@ - /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- - * - * Copyright (C) 2014-2018 Richard Hughes -+ * Copyright (C) 2019 Kalev Lember - * - * SPDX-License-Identifier: LGPL-2.1+ - */ -@@ -437,6 +438,42 @@ as_test_app_builder_qt_func (void) - g_assert_cmpint (g_list_length (list), ==, 1); - } - -+static void -+as_test_app_builder_qt_subdir_func (void) -+{ -+ GError *error = NULL; -+ gboolean ret; -+ guint i; -+ g_autofree gchar *fn = NULL; -+ g_autoptr(AsApp) app = NULL; -+ g_autoptr(GList) list = NULL; -+ const gchar *gettext_domains[] = { "kdeapp2", "notgoingtoexist", NULL }; -+ -+ app = as_app_new (); -+ fn = as_test_get_filename ("usr"); -+ g_assert (fn != NULL); -+ for (i = 0; gettext_domains[i] != NULL; i++) { -+ g_autoptr(AsTranslation) translation = NULL; -+ translation = as_translation_new (); -+ as_translation_set_kind (translation, AS_TRANSLATION_KIND_QT); -+ as_translation_set_id (translation, gettext_domains[i]); -+ as_app_add_translation (app, translation); -+ } -+ ret = as_app_builder_search_translations (app, fn, 25, -+ AS_APP_BUILDER_FLAG_NONE, -+ NULL, &error); -+ g_assert_no_error (error); -+ g_assert (ret); -+ -+ /* check langs */ -+ g_assert_cmpint (as_app_get_language (app, "fr"), ==, 100); -+ g_assert_cmpint (as_app_get_language (app, "en_GB"), ==, -1); -+ -+ /* check size */ -+ list = as_app_get_languages (app); -+ g_assert_cmpint (g_list_length (list), ==, 1); -+} -+ - static void - as_test_tag_func (void) - { -@@ -5693,6 +5730,7 @@ main (int argc, char **argv) - g_test_add_func ("/AppStream/app{builder:gettext}", as_test_app_builder_gettext_func); - g_test_add_func ("/AppStream/app{builder:gettext-nodomain}", as_test_app_builder_gettext_nodomain_func); - g_test_add_func ("/AppStream/app{builder:qt}", as_test_app_builder_qt_func); -+ g_test_add_func ("/AppStream/app{builder:qt-subdir}", as_test_app_builder_qt_subdir_func); - g_test_add_func ("/AppStream/app{translated}", as_test_app_translated_func); - g_test_add_func ("/AppStream/app{validate-style}", as_test_app_validate_style_func); - g_test_add_func ("/AppStream/app{validate-appdata-good}", as_test_app_validate_appdata_good_func); --- -2.23.0 - diff --git a/sources b/sources index 9dbf13f..2e4b323 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (appstream-glib-0.7.16.tar.xz) = a2991dbd26deeb1fb1daef1811c38ff5b55b2fae0bf2d8cc612c2e370613cb6b0468cf287ab3b575f6e6e3203aabcca12dd95474f70a54d6052a34dcb27b951b +SHA512 (appstream-glib-0.7.17.tar.xz) = 72eae6057a4b18b6eca34c795c2bfd982fd7a31500b70beb9553bdf8a7617a03319a2813eb93af20f2e39678ef6ee524dee48b2cbcccde0736f9d10a547ca223