!3 update version from 0.7.14 to 0.8.2

From: @hua11111 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
This commit is contained in:
openeuler-ci-bot 2023-01-29 08:01:43 +00:00 committed by Gitee
commit 2dda0af5b0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 15 additions and 158 deletions

Binary file not shown.

BIN
appstream-glib-0.8.2.tar.xz Normal file

Binary file not shown.

View File

@ -1,144 +0,0 @@
From d651281e77120ce4c7431364e4787f08189666b6 Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard@hughsie.com>
Date: Wed, 24 Oct 2018 10:15:00 +0100
Subject: [PATCH 1/2] Add as_utils_vercmp_full() for gnome-software
Sometimes we don't want to do the firmware-style heuristics.
---
libappstream-glib/as-utils.c | 42 ++++++++++++++++++++++++++++--------
libappstream-glib/as-utils.h | 14 ++++++++++++
2 files changed, 47 insertions(+), 9 deletions(-)
diff --git a/libappstream-glib/as-utils.c b/libappstream-glib/as-utils.c
index 29f1637..62d411a 100644
--- a/libappstream-glib/as-utils.c
+++ b/libappstream-glib/as-utils.c
@@ -1388,22 +1388,23 @@ as_utils_vercmp_chunk (const gchar *str1, const gchar *str2)
}
/**
- * as_utils_vercmp:
+ * as_utils_vercmp_full:
* @version_a: the release version, e.g. 1.2.3
* @version_b: the release version, e.g. 1.2.3.1
+ * @flags: some #AsVersionCompareFlag
*
* Compares version numbers for sorting.
*
* Returns: -1 if a < b, +1 if a > b, 0 if they are equal, and %G_MAXINT on error
*
- * Since: 0.3.5
+ * Since: 0.7.14
*/
gint
-as_utils_vercmp (const gchar *version_a, const gchar *version_b)
+as_utils_vercmp_full (const gchar *version_a,
+ const gchar *version_b,
+ AsVersionCompareFlag flags)
{
guint longest_split;
- g_autofree gchar *str_a = NULL;
- g_autofree gchar *str_b = NULL;
g_auto(GStrv) split_a = NULL;
g_auto(GStrv) split_b = NULL;
@@ -1416,10 +1417,15 @@ as_utils_vercmp (const gchar *version_a, const gchar *version_b)
return 0;
/* split into sections, and try to parse */
- str_a = as_utils_version_parse (version_a);
- str_b = as_utils_version_parse (version_b);
- split_a = g_strsplit (str_a, ".", -1);
- split_b = g_strsplit (str_b, ".", -1);
+ if (flags & AS_VERSION_COMPARE_FLAG_USE_HEURISTICS) {
+ g_autofree gchar *str_a = as_utils_version_parse (version_a);
+ g_autofree gchar *str_b = as_utils_version_parse (version_b);
+ split_a = g_strsplit (str_a, ".", -1);
+ split_b = g_strsplit (str_b, ".", -1);
+ } else {
+ split_a = g_strsplit (version_a, ".", -1);
+ split_b = g_strsplit (version_b, ".", -1);
+ }
longest_split = MAX (g_strv_length (split_a), g_strv_length (split_b));
for (guint i = 0; i < longest_split; i++) {
gchar *endptr_a = NULL;
@@ -1456,6 +1462,24 @@ as_utils_vercmp (const gchar *version_a, const gchar *version_b)
return 0;
}
+/**
+ * as_utils_vercmp:
+ * @version_a: the release version, e.g. 1.2.3
+ * @version_b: the release version, e.g. 1.2.3.1
+ *
+ * Compares version numbers for sorting.
+ *
+ * Returns: -1 if a < b, +1 if a > b, 0 if they are equal, and %G_MAXINT on error
+ *
+ * Since: 0.3.5
+ */
+gint
+as_utils_vercmp (const gchar *version_a, const gchar *version_b)
+{
+ return as_utils_vercmp_full (version_a, version_b,
+ AS_VERSION_COMPARE_FLAG_USE_HEURISTICS);
+}
+
/**
* as_ptr_array_find_string:
* @array: gchar* array
diff --git a/libappstream-glib/as-utils.h b/libappstream-glib/as-utils.h
index ecb7cdd..8401df8 100644
--- a/libappstream-glib/as-utils.h
+++ b/libappstream-glib/as-utils.h
@@ -95,6 +95,20 @@ typedef enum {
AS_VERSION_PARSE_FLAG_LAST
} AsVersionParseFlag;
+/**
+ * AsVersionCompareFlag:
+ * @AS_VERSION_COMPARE_FLAG_NONE: No flags set
+ * @AS_VERSION_COMPARE_FLAG_USE_HEURISTICS: Use a heuristic to parse version numbers
+ *
+ * The flags used when comparing version numbers.
+ **/
+typedef enum {
+ AS_VERSION_COMPARE_FLAG_NONE = 0,
+ AS_VERSION_COMPARE_FLAG_USE_HEURISTICS = 1 << 0,
+ /*< private >*/
+ AS_VERSION_COMPARE_FLAG_LAST
+} AsVersionCompareFlag;
+
/**
* AsUniqueIdMatchFlags:
* @AS_UNIQUE_ID_MATCH_FLAG_NONE: No flags set
--
2.19.1
From d8f67b1a9be9707c04ed4f1f71eb5365c09c275d Mon Sep 17 00:00:00 2001
From: Kalev Lember <klember@redhat.com>
Date: Wed, 24 Oct 2018 11:45:56 +0200
Subject: [PATCH 2/2] trivial: Add missing prototype for as_utils_vercmp_full
---
libappstream-glib/as-utils.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libappstream-glib/as-utils.h b/libappstream-glib/as-utils.h
index 8401df8..2fa5199 100644
--- a/libappstream-glib/as-utils.h
+++ b/libappstream-glib/as-utils.h
@@ -160,6 +160,9 @@ gboolean as_utils_install_filename (AsUtilsLocation location,
GError **error);
gboolean as_utils_search_token_valid (const gchar *token);
gchar **as_utils_search_tokenize (const gchar *search);
+gint as_utils_vercmp_full (const gchar *version_a,
+ const gchar *version_b,
+ AsVersionCompareFlag flags);
gint as_utils_vercmp (const gchar *version_a,
const gchar *version_b);
gboolean as_utils_guid_is_valid (const gchar *guid);
--
2.19.1

View File

@ -1,18 +1,17 @@
Name: libappstream-glib Name: libappstream-glib
Version: 0.7.14 Version: 0.8.2
Release: 4 Release: 1
Summary: AppStream Abstraction Library Summary: AppStream Abstraction Library
License: LGPLv2+ and GPLv2+ License: LGPLv2+ and GPLv2+
URL: http://people.freedesktop.org/~hughsient/appstream-glib/ URL: http://people.freedesktop.org/~hughsient/appstream-glib/
Source0: http://people.freedesktop.org/~hughsient/appstream-glib/releases/appstream-glib-%{version}.tar.xz Source0: http://people.freedesktop.org/~hughsient/appstream-glib/releases/appstream-glib-%{version}.tar.xz
Patch0001: as_utils_vercmp_full.patch
BuildRequires: glib2-devel >= 2.45.8 docbook-utils gtk-doc gobject-introspection-devel BuildRequires: glib2-devel >= 2.45.8 docbook-utils gtk-doc gobject-introspection-devel
BuildRequires: libsoup-devel >= 2.51.92 gdk-pixbuf2-devel >= 2.31.5 gtk3-devel gettext BuildRequires: libsoup-devel >= 2.51.92 gdk-pixbuf2-devel >= 2.31.5 gtk3-devel gettext
BuildRequires: libuuid-devel libstemmer-devel json-glib-devel >= 1.1.1 meson BuildRequires: libuuid-devel libstemmer-devel json-glib-devel >= 1.1.1 meson
BuildRequires: pango-devel rpm-devel sqlite-devel libxslt docbook-style-xsl BuildRequires: pango-devel rpm-devel sqlite-devel libxslt docbook-style-xsl libcurl
Buildrequires: gperf libarchive-devel fontconfig-devel freetype-devel Buildrequires: gperf libarchive-devel fontconfig-devel freetype-devel libcurl-devel libyaml-devel
Requires: gdk-pixbuf2 >= 2.31.5 glib2 >= 2.45.8 Requires: gdk-pixbuf2 >= 2.31.5 glib2 >= 2.45.8
Requires: json-glib >= 1.1.1 libsoup >= 2.51.92 Requires: json-glib >= 1.1.1 libsoup >= 2.51.92
@ -60,17 +59,16 @@ Help document for the libappstream-glib package.
/sbin/ldconfig /sbin/ldconfig
%files -f appstream-glib.lang %files -f appstream-glib.lang
%doc AUTHORS COPYING %doc AUTHORS COPYING README.md NEWS
%{_libdir}/{libappstream-glib.so.8*,girepository-1.0/*.typelib} %{_libdir}/{libappstream-glib.so.8*,girepository-1.0/*.typelib}
%{_libdir}/{libappstream-builder.so.8*,libappstream-builder.so} %{_bindir}/{appstream-util,appstream-compose}
%{_bindir}/{appstream-util,appstream-compose,appstream-builder}
%{_datadir}/bash-completion/completions/{appstream-util,appstream-builder}
%{_libdir}/asb-plugins-5/*.so
%{_includedir}/libappstream-builder/*.h
%{_datadir}/gir-1.0/AppStreamBuilder-1.0.gir
%{_libdir}/pkgconfig/appstream-builder.pc
%dir %{_datadir}/bash-completion/completions/ %dir %{_datadir}/bash-completion/completions/
%dir %{_includedir}/libappstream-builder %{_datadir}/bash-completion/completions/appstream-util
%{_mandir}/man1/appstream-util.1.gz
%{_mandir}/man1/appstream-compose.1.gz
%{_bindir}/appstream-builder
%{_libdir}/asb-plugins-5/*.so
%{_datadir}/bash-completion/completions/appstream-builder
%files devel %files devel
%{_libdir}/{libappstream-glib.so,pkgconfig/appstream-glib.pc} %{_libdir}/{libappstream-glib.so,pkgconfig/appstream-glib.pc}
@ -87,6 +85,9 @@ Help document for the libappstream-glib package.
%{_mandir}/man1/{appstream-util.1.gz,appstream-compose.1.gz,appstream-builder.1.gz} %{_mandir}/man1/{appstream-util.1.gz,appstream-compose.1.gz,appstream-builder.1.gz}
%changelog %changelog
* Sat Nov 12 2022 hua <dchang@zhixundn.com> 0.8.2-1
- update to 0.8.2
* Wed Jan 20 2021 Ge Wang <wangge@huawei.com> - 0.7.14-4 * Wed Jan 20 2021 Ge Wang <wangge@huawei.com> - 0.7.14-4
- Modify license information - Modify license information