diff -Nru appstream-0.12.0/debian/changelog appstream-0.12.0/debian/changelog --- appstream-0.12.0/debian/changelog 2018-04-06 21:30:08.000000000 +0200 +++ appstream-0.12.0/debian/changelog 2018-09-14 10:59:05.000000000 +0200 @@ -1,3 +1,10 @@ +appstream (0.12.0-3ubuntu1) bionic; urgency=medium + + * cache-explicit-variants.patch: fix crash when upgrading from bionic + to cosmic (LP: #1792537) + + -- Olivier Tilloy Fri, 14 Sep 2018 10:59:05 +0200 + appstream (0.12.0-3) unstable; urgency=medium * load-desktop-data.patch: Load desktop file data properly again diff -Nru appstream-0.12.0/debian/patches/02_cache-explicit-variants.patch appstream-0.12.0/debian/patches/02_cache-explicit-variants.patch --- appstream-0.12.0/debian/patches/02_cache-explicit-variants.patch 1970-01-01 01:00:00.000000000 +0100 +++ appstream-0.12.0/debian/patches/02_cache-explicit-variants.patch 2018-09-14 10:57:07.000000000 +0200 @@ -0,0 +1,58 @@ +From 734e9da66bf12fcaa94c10465db2dcf8bb2b94cb Mon Sep 17 00:00:00 2001 +From: Matthias Klumpp +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(-) + +--- a/src/as-content-rating.c ++++ b/src/as-content-rating.c +@@ -499,7 +499,7 @@ as_content_rating_to_variant (AsContentR + 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); +--- a/src/as-release.c ++++ b/src/as-release.c +@@ -923,14 +923,14 @@ as_release_to_variant (AsRelease *releas + 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}", +--- a/src/as-screenshot.c ++++ b/src/as-screenshot.c +@@ -598,7 +598,7 @@ as_screenshot_to_variant (AsScreenshot * + 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); + diff -Nru appstream-0.12.0/debian/patches/series appstream-0.12.0/debian/patches/series --- appstream-0.12.0/debian/patches/series 2018-04-06 21:09:44.000000000 +0200 +++ appstream-0.12.0/debian/patches/series 2018-09-14 10:57:36.000000000 +0200 @@ -1 +1,2 @@ 01_load-desktop-data.patch +02_cache-explicit-variants.patch