From b0770ee7d2a4d20013efa167ca62dfd81154562d Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Fri, 17 Nov 2023 18:19:54 -0500 Subject: [PATCH] Update to 1.0.0 final --- .gitignore | 1 + ...potential-issue-where-stemmer-may-ne.patch | 88 +++++++++++++++++++ appstream.spec | 31 +++---- sources | 2 +- 4 files changed, 106 insertions(+), 16 deletions(-) create mode 100644 0001-stemmer-Resolve-potential-issue-where-stemmer-may-ne.patch diff --git a/.gitignore b/.gitignore index fcc810a..028d1da 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ /AppStream-0.15.5.tar.xz /AppStream-0.16.1.tar.xz /appstream-d88ed03cb5b3b1803bdee3528c9b99d528ceb065.tar.gz +/AppStream-1.0.0.tar.xz diff --git a/0001-stemmer-Resolve-potential-issue-where-stemmer-may-ne.patch b/0001-stemmer-Resolve-potential-issue-where-stemmer-may-ne.patch new file mode 100644 index 0000000..71b72e0 --- /dev/null +++ b/0001-stemmer-Resolve-potential-issue-where-stemmer-may-ne.patch @@ -0,0 +1,88 @@ +From 32182d7a7a67d0d204cd0a37bd211bfd0177bc27 Mon Sep 17 00:00:00 2001 +From: Matthias Klumpp +Date: Thu, 16 Nov 2023 00:59:15 +0100 +Subject: [PATCH] stemmer: Resolve potential issue where stemmer may never be + initialized + +If the initial locale was equal to the current stemming language, we may +never have initialized the stemmer (which could lead to crashes or +stemming being disabled). + +So we force the reload to always happen on initialization. +CC: #558 +--- + src/as-stemmer.c | 33 +++++++++++++++++++++------------ + 1 file changed, 21 insertions(+), 12 deletions(-) + +diff --git a/src/as-stemmer.c b/src/as-stemmer.c +index 63d45267..16ebd09b 100644 +--- a/src/as-stemmer.c ++++ b/src/as-stemmer.c +@@ -47,6 +47,8 @@ G_DEFINE_TYPE (AsStemmer, as_stemmer, G_TYPE_OBJECT) + + static gpointer as_stemmer_object = NULL; + ++static void as_stemmer_reload_internal (AsStemmer *stemmer, const gchar *locale, gboolean force); ++ + /** + * as_stemmer_finalize: + **/ +@@ -76,21 +78,14 @@ as_stemmer_init (AsStemmer *stemmer) + + /* we don't use the locale in XML, so it can be POSIX */ + locale = as_get_current_locale_posix (); +- stemmer->current_lang = as_utils_locale_to_language (locale); + +- as_stemmer_reload (stemmer, stemmer->current_lang); ++ /* force a reload for initialization */ ++ as_stemmer_reload_internal (stemmer, locale, TRUE); + #endif + } + +-/** +- * as_stemmer_reload: +- * @stemmer: A #AsStemmer +- * @locale: The stemming language as POSIX locale. +- * +- * Allows realoading the #AsStemmer with a different language. +- */ +-void +-as_stemmer_reload (AsStemmer *stemmer, const gchar *locale) ++static void ++as_stemmer_reload_internal (AsStemmer *stemmer, const gchar *locale, gboolean force) + { + #ifdef HAVE_STEMMING + g_autofree gchar *lang = NULL; +@@ -99,7 +94,7 @@ as_stemmer_reload (AsStemmer *stemmer, const gchar *locale) + /* check if we need to reload */ + lang = as_utils_locale_to_language (locale); + locker = g_mutex_locker_new (&stemmer->mutex); +- if (as_str_equal0 (lang, stemmer->current_lang)) { ++ if (!force && as_str_equal0 (lang, stemmer->current_lang)) { + g_mutex_locker_free (locker); + return; + } +@@ -119,6 +114,20 @@ as_stemmer_reload (AsStemmer *stemmer, const gchar *locale) + #endif + } + ++/** ++ * as_stemmer_reload: ++ * @stemmer: A #AsStemmer ++ * @locale: The stemming language as POSIX locale. ++ * ++ * Allows realoading the #AsStemmer with a different language. ++ * Does nothing if the stemmer is already using the selected language. ++ */ ++void ++as_stemmer_reload (AsStemmer *stemmer, const gchar *locale) ++{ ++ as_stemmer_reload_internal (stemmer, locale, FALSE); ++} ++ + /** + * as_stemmer_stem: + * @stemmer: A #AsStemmer +-- +2.41.0 + diff --git a/appstream.spec b/appstream.spec index 40d44c7..54ea3ac 100644 --- a/appstream.spec +++ b/appstream.spec @@ -1,28 +1,26 @@ -%global basever 1.0.0 -%global commit d88ed03cb5b3b1803bdee3528c9b99d528ceb065 -%global commitdate 20231102 -%global shortcommit %(c=%{commit}; echo ${c:0:7}) - Summary: Utilities to generate, maintain and access the AppStream database Name: appstream -Version: %{basever}%{?commitdate:~git%{commitdate}.%{shortcommit}} +Version: 1.0.0 Release: 1%{?dist} # lib LGPLv2+, tools GPLv2+ License: GPL-2.0-or-later AND LGPL-2.1-or-later #URL: http://www.freedesktop.org/wiki/Distributions/AppStream URL: https://github.com/ximion/appstream -Source0: %{url}/archive/%{commit}/%{name}-%{commit}.tar.gz -%dnl Source0: http://www.freedesktop.org/software/appstream/releases/AppStream-%{version}.tar.xz +Source0: http://www.freedesktop.org/software/appstream/releases/AppStream-%{version}.tar.xz -## upstream patches (lookaside cache) +# upstream patches +## From: https://github.com/ximion/appstream/commit/32182d7a7a67d0d204cd0a37bd211bfd0177bc27 +Patch0001: 0001-stemmer-Resolve-potential-issue-where-stemmer-may-ne.patch + +# upstreamable patches -## upstreamable patches # needed for cmake auto-provides BuildRequires: cmake BuildRequires: meson >= 0.62 BuildRequires: gettext +BuildRequires: git-core BuildRequires: gperf BuildRequires: gtk-doc BuildRequires: intltool @@ -39,6 +37,7 @@ BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(librsvg-2.0) BuildRequires: pkgconfig(libsystemd) BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(libzstd) BuildRequires: pkgconfig(pango) BuildRequires: pkgconfig(Qt6Core) >= 6.2.4 BuildRequires: pkgconfig(xmlb) >= 0.3.14 @@ -92,8 +91,7 @@ Requires: pkgconfig(Qt6Core) >= 6.2.4 %prep -%autosetup -n %{name}-%{commit} -p1 -%dnl %autosetup -n AppStream-%{version} -p1 +%autosetup -n AppStream-%{version} -S git_am %build @@ -144,7 +142,7 @@ mv %{buildroot}%{_datadir}/metainfo/*.xml \ %dir %{_libdir}/girepository-1.0/ %{_libdir}/girepository-1.0/AppStream-1.0.typelib %{_libdir}/libappstream.so.5 -%{_libdir}/libappstream.so.%{basever} +%{_libdir}/libappstream.so.%{version} %{_metainfodir}/org.freedesktop.appstream.cli.*.xml # put in -devel? -- rex %{_datadir}/gettext/its/metainfo.* @@ -175,7 +173,7 @@ mv %{buildroot}%{_datadir}/metainfo/*.xml \ %{_libexecdir}/appstreamcli-compose %{_mandir}/man1/appstreamcli-compose.1* %{_libdir}/libappstream-compose.so.0 -%{_libdir}/libappstream-compose.so.%{basever} +%{_libdir}/libappstream-compose.so.%{version} %{_libdir}/girepository-1.0/AppStreamCompose-1.0.typelib %{_metainfodir}/org.freedesktop.appstream.compose.metainfo.xml @@ -190,7 +188,7 @@ mv %{buildroot}%{_datadir}/metainfo/*.xml \ %files qt %{_libdir}/libAppStreamQt.so.3 -%{_libdir}/libAppStreamQt.so.%{basever} +%{_libdir}/libAppStreamQt.so.%{version} %files qt-devel %{_includedir}/AppStreamQt/ @@ -199,6 +197,9 @@ mv %{buildroot}%{_datadir}/metainfo/*.xml \ %changelog +* Fri Nov 17 2023 Neal Gompa - 1.0.0-1 +- Update to 1.0.0 final + * Thu Nov 02 2023 Neal Gompa - 1.0.0~git20231102.d88ed03-1 - Rebase to 1.0.0 git snapshot diff --git a/sources b/sources index 831584b..f04060e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (appstream-d88ed03cb5b3b1803bdee3528c9b99d528ceb065.tar.gz) = 5d7ab98fb838a5c20f887852a4d20612d656a1eefc6c420822875a53cabcde1d00deabb7ec0d0ae7a585eec16bcd9c9d64887c8205d6423bc235d2c21af2a5c0 +SHA512 (AppStream-1.0.0.tar.xz) = 273f1bbb64794691f04bee0cff782670465c6da238beec040af71a99395afdc8a85a6712c77777ff7c7ca872db6b2c8549782b7773d882e5ed7e9aa2a880f04c