This commit is contained in:
Rex Dieter 2018-11-27 08:57:02 -06:00
parent a961490685
commit 6c97882c20
4 changed files with 7 additions and 84 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
/AppStream-0.12.2.tar.xz
/AppStream-0.12.3.tar.xz

View File

@ -1,80 +0,0 @@
From 734e9da66bf12fcaa94c10465db2dcf8bb2b94cb Mon Sep 17 00:00:00 2001
From: Matthias Klumpp <matthias@tenstral.net>
Date: Sun, 19 Aug 2018 16:21:15 +0200
Subject: [PATCH] cache: Set explicit variant types for cases where they can
not be inferred
This ensures we do not run into assertion failures in case no array or
dict elements exist from which the final variant type can be
automatically inferred.
This resolves #198
---
src/as-agreement.c | 2 +-
src/as-content-rating.c | 2 +-
src/as-release.c | 4 ++--
src/as-screenshot.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/as-agreement.c b/src/as-agreement.c
index 0deee86..70fa5e6 100644
--- a/src/as-agreement.c
+++ b/src/as-agreement.c
@@ -450,7 +450,7 @@ as_agreement_to_variant (AsAgreement *agreement, GVariantBuilder *builder)
g_variant_builder_add_parsed (&agreement_b, "{'kind', <%u>}", priv->kind);
g_variant_builder_add_parsed (&agreement_b, "{'version_id', %v}", as_variant_mstring_new (priv->version_id));
- g_variant_builder_init (&sections_b, G_VARIANT_TYPE_ARRAY);
+ g_variant_builder_init (&sections_b, (const GVariantType *) "aa{sv}");
for (guint i = 0; i < priv->sections->len; i++) {
as_agreement_section_to_variant (AS_AGREEMENT_SECTION (g_ptr_array_index (priv->sections, i)), &sections_b);
}
diff --git a/src/as-content-rating.c b/src/as-content-rating.c
index 70b4bcd..263a6d0 100644
--- a/src/as-content-rating.c
+++ b/src/as-content-rating.c
@@ -499,7 +499,7 @@ as_content_rating_to_variant (AsContentRating *content_rating, GVariantBuilder *
GVariantBuilder rating_b;
guint j;
- g_variant_builder_init (&values_b, G_VARIANT_TYPE_ARRAY);
+ g_variant_builder_init (&values_b, (const GVariantType *) "a{su}");
for (j = 0; j < priv->keys->len; j++) {
AsContentRatingKey *key = (AsContentRatingKey*) g_ptr_array_index (priv->keys, j);
g_variant_builder_add (&values_b, "{su}", key->id, key->value);
diff --git a/src/as-release.c b/src/as-release.c
index 7a90351..e090826 100644
--- a/src/as-release.c
+++ b/src/as-release.c
@@ -922,14 +922,14 @@ as_release_to_variant (AsRelease *release, GVariantBuilder *builder)
gboolean have_sizes = FALSE;
/* build checksum info */
- g_variant_builder_init (&checksum_b, G_VARIANT_TYPE_DICTIONARY);
+ g_variant_builder_init (&checksum_b, (const GVariantType *) "a{us}");
for (j = 0; j < priv->checksums->len; j++) {
AsChecksum *cs = AS_CHECKSUM (g_ptr_array_index (priv->checksums, j));
as_checksum_to_variant (cs, &checksum_b);
}
/* build size info */
- g_variant_builder_init (&sizes_b, G_VARIANT_TYPE_DICTIONARY);
+ g_variant_builder_init (&sizes_b, (const GVariantType *) "a{ut}");
for (j = 0; j < AS_SIZE_KIND_LAST; j++) {
if (as_release_get_size (release, (AsSizeKind) j) > 0) {
g_variant_builder_add (&sizes_b, "{ut}",
diff --git a/src/as-screenshot.c b/src/as-screenshot.c
index 7c83441..6569dbe 100644
--- a/src/as-screenshot.c
+++ b/src/as-screenshot.c
@@ -596,7 +596,7 @@ as_screenshot_to_variant (AsScreenshot *screenshot, GVariantBuilder *builder)
if (priv->images->len == 0)
return FALSE;
- g_variant_builder_init (&images_b, G_VARIANT_TYPE_ARRAY);
+ g_variant_builder_init (&images_b, (const GVariantType *) "aa{sv}");
for (i = 0; i < priv->images->len; i++)
as_image_to_variant (AS_IMAGE (g_ptr_array_index (priv->images, i)), &images_b);
--
2.19.1

View File

@ -4,8 +4,8 @@
Summary: Utilities to generate, maintain and access the AppStream database
Name: appstream
Version: 0.12.2
Release: 2%{?dist}
Version: 0.12.3
Release: 1%{?dist}
# lib LGPLv2+, tools GPLv2+
License: GPLv2+ and LGPLv2+
@ -181,6 +181,9 @@ mv %{buildroot}%{_datadir}/metainfo/*.xml \
%changelog
* Tue Nov 27 2018 Rex Dieter <rdieter@fedoraproject.org> - 0.12.3-1
- 0.12.3
* Fri Oct 12 2018 Kalev Lember <klember@redhat.com> - 0.12.2-2
- Backport an upstream fix for empty content_rating tags

View File

@ -1 +1 @@
SHA512 (AppStream-0.12.2.tar.xz) = d5c95309d4fddb961f4a5b9ac460840e34d4bae0e256bd0be09ceeab0d45a3ac5254c9e9c183a1e6cb3983ce0a9d6d0e519908f612a5b135ed578ec26556e53d
SHA512 (AppStream-0.12.3.tar.xz) = 3d54bb499e4056d341ffde2878549011708e6699b3ec58756ef2e4080864279ff5e5003224fcbad601007fd9296bb9ed062da7843e3e02272837ecc5d4c802f9