This commit is contained in:
Rex Dieter 2016-09-17 12:48:16 -05:00
parent c234fee8d4
commit 08da6ff3c4
6 changed files with 12 additions and 149 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/AppStream-0.9.8.tar.xz
/AppStream-0.10.1.tar.xz

View File

@ -1,61 +0,0 @@
From 342a3f02d92421d6cc8d6b5f41db672396b94671 Mon Sep 17 00:00:00 2001
From: Matthias Klumpp <matthias@tenstral.net>
Date: Thu, 11 Aug 2016 03:50:36 +0200
Subject: [PATCH 05/34] Resolve unit test failures on arm and mips
Printing guint64 values doesn't work the same on all platforms and was
wrongly implemented.
Good that we have unit tests!
This should resolve the issue in a (mostly) portable way.
---
src/as-xmldata.c | 4 ++--
src/as-yamldata.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/as-xmldata.c b/src/as-xmldata.c
index 465aed5..2ad2929 100644
--- a/src/as-xmldata.c
+++ b/src/as-xmldata.c
@@ -600,7 +600,7 @@ as_xmldata_process_releases_tag (AsXMLData *xdt, xmlNode *node, AsComponent *cpt
prop = (gchar*) xmlGetProp (iter, (xmlChar*) "timestamp");
if (prop != NULL) {
- timestamp = g_ascii_strtoll (prop, NULL, 10);
+ timestamp = atol (prop);
as_release_set_timestamp (release, timestamp);
g_free (prop);
}
@@ -1396,7 +1396,7 @@ as_xmldata_add_release_subnodes (AsXMLData *xdt, AsComponent *cpt, xmlNode *root
g_autofree gchar *time_str = NULL;
if (priv->mode == AS_PARSER_MODE_DISTRO) {
- time_str = g_strdup_printf ("%ld", unixtime);
+ time_str = g_strdup_printf ("%" G_GUINT64_FORMAT, unixtime);
xmlNewProp (subnode, (xmlChar*) "timestamp",
(xmlChar*) time_str);
} else {
diff --git a/src/as-yamldata.c b/src/as-yamldata.c
index 91b54f9..847dbae 100644
--- a/src/as-yamldata.c
+++ b/src/as-yamldata.c
@@ -679,7 +679,7 @@ as_yamldata_process_releases (AsYAMLData *ydt, GNode *node, AsComponent *cpt)
value = as_yaml_node_get_value (n);
if (g_strcmp0 (key, "unix-timestamp") == 0) {
- as_release_set_timestamp (rel, g_ascii_strtoll (value, NULL, 10));
+ as_release_set_timestamp (rel, atol (value));
} else if (g_strcmp0 (key, "date") == 0) {
g_autoptr(GDateTime) time;
time = as_iso8601_to_datetime (value);
@@ -1639,7 +1639,7 @@ as_yaml_data_emit_releases (AsYAMLData *ydt, yaml_emitter_t *emitter, AsComponen
g_autofree gchar *time_str = NULL;
if (priv->mode == AS_PARSER_MODE_DISTRO) {
- time_str = g_strdup_printf ("%ld", unixtime);
+ time_str = g_strdup_printf ("%" G_GUINT64_FORMAT, unixtime);
as_yaml_emit_entry (emitter, "unix-timestamp", time_str);
} else {
GTimeVal time;
--
2.7.4

View File

@ -1,53 +0,0 @@
From b54e9a0845b3db186a01a9227b89ee793fd1eab2 Mon Sep 17 00:00:00 2001
From: Matthias Klumpp <matthias@tenstral.net>
Date: Tue, 16 Aug 2016 19:11:26 +0200
Subject: [PATCH 30/34] Fix test failures on 32bit architectures
---
src/as-xmldata.c | 2 +-
tests/test-xmldata.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/as-xmldata.c b/src/as-xmldata.c
index ae73dc6..7686bdf 100644
--- a/src/as-xmldata.c
+++ b/src/as-xmldata.c
@@ -1423,7 +1423,7 @@ as_xmldata_add_release_subnodes (AsXMLData *xdt, AsComponent *cpt, xmlNode *root
releases = as_component_get_releases (cpt);
for (i = 0; i < releases->len; i++) {
xmlNode *subnode;
- glong unixtime;
+ guint64 unixtime;
GPtrArray *locations;
guint j;
release = (AsRelease*) g_ptr_array_index (releases, i);
diff --git a/tests/test-xmldata.c b/tests/test-xmldata.c
index 83735a7..0fa7f02 100644
--- a/tests/test-xmldata.c
+++ b/tests/test-xmldata.c
@@ -380,11 +380,11 @@ test_appstream_write_description ()
"de");
tmp = as_metadata_component_to_upstream_xml (metad);
- g_assert_cmpstr (tmp, ==, EXPECTED_XML_LOCALIZED);
+ g_assert (as_test_compare_lines (tmp, EXPECTED_XML_LOCALIZED));
g_free (tmp);
tmp = as_metadata_components_to_distro_xml (metad);
- g_assert_cmpstr (tmp, ==, EXPECTED_XML_DISTRO);
+ g_assert (as_test_compare_lines (tmp, EXPECTED_XML_DISTRO));
g_free (tmp);
}
@@ -492,7 +492,7 @@ test_xml_write_languages (void)
as_component_add_language (cpt, "en_GB", 98);
res = as_xml_test_serialize (cpt, AS_PARSER_MODE_UPSTREAM);
- g_assert_cmpstr (res, ==, expected_lang_xml);
+ g_assert (as_test_compare_lines (res, expected_lang_xml));
}
/**
--
2.7.4

View File

@ -1,26 +0,0 @@
From 79bbbe3e486e49b90a74f6eb8b91864212f882e4 Mon Sep 17 00:00:00 2001
From: Matthias Klumpp <matthias@tenstral.net>
Date: Thu, 18 Aug 2016 17:57:12 +0200
Subject: [PATCH 35/35] Make cache support translate URLs
This should resolve the assertion failure described in
https://bugs.launchpad.net/ubuntu/+source/appstream/+bug/1614375
---
src/pb/ascache.proto | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/pb/ascache.proto b/src/pb/ascache.proto
index d7fea2b..418d6aa 100644
--- a/src/pb/ascache.proto
+++ b/src/pb/ascache.proto
@@ -74,6 +74,7 @@ message Url {
FAQ = 3;
HELP = 4;
DONATION = 5;
+ TRANSLATE = 6;
}
required Type type = 1 [default = UNKNOWN];
--
2.7.4

View File

@ -4,8 +4,8 @@
Summary: Utilities to generate, maintain and access the AppStream Xapian database
Name: appstream
Version: 0.9.8
Release: 3%{?dist}
Version: 0.10.1
Release: 1%{?dist}
# lib LGPLv2+, tools GPLv2+
License: GPLv2+ and LGPLv2+
@ -14,15 +14,13 @@ URL: https://github.com/ximion/appstream
Source0: http://www.freedesktop.org/software/appstream/releases/AppStream-%{version}.tar.xz
## upstream patches
Patch5: 0005-Resolve-unit-test-failures-on-arm-and-mips.patch
Patch30: 0030-Fix-test-failures-on-32bit-architectures.patch
Patch35: 0035-Make-cache-support-translate-URLs.patch
## upstreamable patches
BuildRequires: cmake
BuildRequires: gettext
BuildRequires: intltool
BuildRequires: libstemmer-devel
BuildRequires: pkgconfig(gio-2.0) pkgconfig(gobject-introspection-1.0)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(packagekit-glib2)
@ -83,7 +81,8 @@ pushd %{_target_platform}
%{cmake} .. \
-DQT:BOOL=ON \
-DTESTS:BOOL=ON \
-DVAPI:BOOL=%{?vala:ON}%{!?vala:OFF}
-DVAPI:BOOL=%{?vala:ON}%{!?vala:OFF} \
-DCMAKE_INSTALL_METAINFODIR:PATH=share/appstream
popd
make %{?_smp_mflags} -C %{_target_platform}
@ -121,9 +120,9 @@ make test -C %{_target_platform} ARGS="--output-on-failure --timeout 300"
%config(noreplace) %{_sysconfdir}/appstream.conf
%dir %{_libdir}/girepository-1.0/
%{_libdir}/girepository-1.0/AppStream-1.0.typelib
%{_libdir}/libappstream.so.3*
%{_libdir}/libappstream.so.4*
%{_libdir}/libappstream.so.%{version}
%{_datadir}/app-info/categories.xml
%{_datadir}/appstream/org.freedesktop.appstream.cli.metainfo.xml
# put in -devel? -- rex
%{_datadir}/gettext/its/metainfo.*
%ghost /var/cache/app-info/cache.watch
@ -162,6 +161,9 @@ make test -C %{_target_platform} ARGS="--output-on-failure --timeout 300"
%changelog
* Sat Sep 17 2016 Rex Dieter <rdieter@fedoraproject.org> - 0.10.1-1
- 0.10.1
* Thu Aug 18 2016 Rex Dieter <rdieter@fedoraproject.org> - 0.9.8-3
- pull in upstream fixes

View File

@ -1 +1 @@
ef59eace0af140a03e0e5807d6057b1f AppStream-0.9.8.tar.xz
a07a54f47a8bc5fafb7d87e86888e019 AppStream-0.10.1.tar.xz