diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-10-26 20:10:29 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-10-26 20:10:29 +0200 |
commit | 2d201f9bf76c231271f312ed45eff2fe70bf80c1 (patch) | |
tree | 72a62513f66151606b4e0169c8482ba81916ec9a | |
parent | 27c128cab8c098dc93de5ef5be34fbbe7b3cab77 (diff) | |
download | packages-2d201f9bf76c231271f312ed45eff2fe70bf80c1.tar.xz |
extra/appstream-glib: added patch to make testing pass
-rw-r--r-- | extra/appstream-glib/PKGBUILD | 10 | ||||
-rw-r--r-- | extra/appstream-glib/appstream-glib-0.7.2-aptest.patch | 242 |
2 files changed, 252 insertions, 0 deletions
diff --git a/extra/appstream-glib/PKGBUILD b/extra/appstream-glib/PKGBUILD new file mode 100644 index 00000000..2256adbe --- /dev/null +++ b/extra/appstream-glib/PKGBUILD @@ -0,0 +1,10 @@ +source+=('appstream-glib-0.7.2-aptest.patch') +sha256sums+=('de5ca5f21e19f9d6ecb361c39c850cbfee9307049a82436ff0f14f360f525307') + +eval "$( + declare -f prepare | \ + sed ' + /}/ i \ + patch -Np1 -i "$srcdir/appstream-glib-0.7.2-aptest.patch" + ' +)" diff --git a/extra/appstream-glib/appstream-glib-0.7.2-aptest.patch b/extra/appstream-glib/appstream-glib-0.7.2-aptest.patch new file mode 100644 index 00000000..17b45070 --- /dev/null +++ b/extra/appstream-glib/appstream-glib-0.7.2-aptest.patch @@ -0,0 +1,242 @@ +diff --git a/libappstream-builder/asb-self-test.c b/libappstream-builder/asb-self-test.c +index c13ed85..62ceeae 100644 +--- a/libappstream-builder/asb-self-test.c ++++ b/libappstream-builder/asb-self-test.c +@@ -491,6 +491,7 @@ asb_test_context_func (void) + "<provides>\n" + "<dbus type=\"session\">org.freedesktop.AppStream</dbus>\n" + "</provides>\n" ++ "<launchable type=\"desktop-id\">app.desktop</launchable>\n" + "<languages>\n" + "<lang percentage=\"100\">en_GB</lang>\n" + "<lang percentage=\"33\">ru</lang>\n" +diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c +index 488fd09..7f19b9b 100644 +--- a/libappstream-glib/as-app.c ++++ b/libappstream-glib/as-app.c +@@ -4635,7 +4635,7 @@ as_app_node_insert (AsApp *app, GNode *parent, AsNodeContext *ctx) + } + + /* <launchables> */ +- if (priv->launchables->len > 0 && as_node_context_get_version (ctx) > 0.9) { ++ if (priv->launchables->len > 0) { + g_ptr_array_sort (priv->launchables, as_app_launchables_sort_cb); + for (i = 0; i < priv->launchables->len; i++) { + AsLaunchable *launchable = g_ptr_array_index (priv->launchables, i); +diff --git a/libappstream-glib/as-icon.c b/libappstream-glib/as-icon.c +index 9fc3ba7..8a13ae0 100644 +--- a/libappstream-glib/as-icon.c ++++ b/libappstream-glib/as-icon.c +@@ -513,11 +513,9 @@ as_icon_node_insert_embedded (AsIcon *icon, GNode *parent, AsNodeContext *ctx) + n = as_node_insert (parent, "icon", NULL, 0, + "type", as_icon_kind_to_string (priv->kind), + NULL); +- if (as_node_context_get_version (ctx) >= 0.8) { +- as_node_add_attribute_as_uint (n, "width", priv->width); +- as_node_add_attribute_as_uint (n, "height", priv->height); +- } +- if (priv->scale > 1 && as_node_context_get_version (ctx) > 0.9) ++ as_node_add_attribute_as_uint (n, "width", priv->width); ++ as_node_add_attribute_as_uint (n, "height", priv->height); ++ if (priv->scale > 1) + as_node_add_attribute_as_uint (n, "scale", priv->scale); + as_node_insert (n, "name", priv->name, 0, NULL); + data = g_base64_encode (g_bytes_get_data (priv->data, NULL), +@@ -575,8 +573,7 @@ as_icon_node_insert (AsIcon *icon, GNode *parent, AsNodeContext *ctx) + } + break; + } +- if (priv->kind == AS_ICON_KIND_CACHED && +- as_node_context_get_version (ctx) >= 0.8) { ++ if (priv->kind == AS_ICON_KIND_CACHED) { + if (priv->width > 0) + as_node_add_attribute_as_uint (n, "width", priv->width); + if (priv->height > 0) +diff --git a/libappstream-glib/as-release.c b/libappstream-glib/as-release.c +index 833ec6a..3ccefaa 100644 +--- a/libappstream-glib/as-release.c ++++ b/libappstream-glib/as-release.c +@@ -645,7 +645,6 @@ as_release_node_insert (AsRelease *release, GNode *parent, AsNodeContext *ctx) + AsReleasePrivate *priv = GET_PRIVATE (release); + AsChecksum *checksum; + GNode *n; +- guint i; + + n = as_node_insert (parent, "release", NULL, + AS_NODE_INSERT_FLAG_NONE, +@@ -667,19 +666,16 @@ as_release_node_insert (AsRelease *release, GNode *parent, AsNodeContext *ctx) + } + if (priv->version != NULL) + as_node_add_attribute (n, "version", priv->version); +- if (as_node_context_get_version (ctx) >= 0.9) { +- const gchar *tmp; +- for (i = 0; priv->locations != NULL && i < priv->locations->len; i++) { +- tmp = g_ptr_array_index (priv->locations, i); +- as_node_insert (n, "location", tmp, +- AS_NODE_INSERT_FLAG_NONE, NULL); +- } +- for (i = 0; priv->checksums != NULL && i < priv->checksums->len; i++) { +- checksum = g_ptr_array_index (priv->checksums, i); +- as_checksum_node_insert (checksum, n, ctx); +- } ++ for (guint i = 0; priv->locations != NULL && i < priv->locations->len; i++) { ++ const gchar *tmp = g_ptr_array_index (priv->locations, i); ++ as_node_insert (n, "location", tmp, ++ AS_NODE_INSERT_FLAG_NONE, NULL); ++ } ++ for (guint i = 0; priv->checksums != NULL && i < priv->checksums->len; i++) { ++ checksum = g_ptr_array_index (priv->checksums, i); ++ as_checksum_node_insert (checksum, n, ctx); + } +- if (priv->descriptions != NULL && as_node_context_get_version (ctx) >= 0.6) { ++ if (priv->descriptions != NULL) { + as_node_insert_localized (n, "description", priv->descriptions, + AS_NODE_INSERT_FLAG_PRE_ESCAPED | + AS_NODE_INSERT_FLAG_DEDUPE_LANG); +@@ -687,7 +683,7 @@ as_release_node_insert (AsRelease *release, GNode *parent, AsNodeContext *ctx) + + /* add sizes */ + if (priv->sizes != NULL) { +- for (i = 0; i < AS_SIZE_KIND_LAST; i++) { ++ for (guint i = 0; i < AS_SIZE_KIND_LAST; i++) { + g_autofree gchar *size_str = NULL; + if (priv->sizes[i] == 0) + continue; +diff --git a/libappstream-glib/as-screenshot.c b/libappstream-glib/as-screenshot.c +index 65ce4e7..327b20a 100644 +--- a/libappstream-glib/as-screenshot.c ++++ b/libappstream-glib/as-screenshot.c +@@ -436,15 +436,13 @@ as_screenshot_node_insert (AsScreenshot *screenshot, + as_node_add_attribute (n, "type", + as_screenshot_kind_to_string (priv->kind)); + } +- if (as_node_context_get_version (ctx) >= 0.41) { +- if (priv->captions != NULL) { +- as_node_insert_localized (n, +- "caption", +- priv->captions, +- AS_NODE_INSERT_FLAG_DEDUPE_LANG); +- } ++ if (priv->captions != NULL) { ++ as_node_insert_localized (n, ++ "caption", ++ priv->captions, ++ AS_NODE_INSERT_FLAG_DEDUPE_LANG); + } +- if (as_node_context_get_version (ctx) >= 0.8 && priv->priority != 0) ++ if (priv->priority != 0) + as_node_add_attribute_as_int (n, "priority", priv->priority); + for (i = 0; i < priv->images->len; i++) { + image = g_ptr_array_index (priv->images, i); +diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c +index b73a528..d8b4889 100644 +--- a/libappstream-glib/as-self-test.c ++++ b/libappstream-glib/as-self-test.c +@@ -968,7 +968,7 @@ as_test_icon_func (void) + as_node_context_set_version (ctx, 0.4); + n = as_icon_node_insert (icon, root, ctx); + xml = as_node_to_xml (n, AS_NODE_TO_XML_FLAG_NONE); +- ret = as_test_compare_lines (xml->str, src, &error); ++ ret = as_test_compare_lines (xml->str, "<icon type=\"cached\" height=\"64\" width=\"64\">app.png</icon>", &error); + g_assert_no_error (error); + g_assert (ret); + g_string_free (xml, TRUE); +@@ -1098,7 +1098,7 @@ as_test_icon_embedded_func (void) + AsNode *root; + GString *xml; + const gchar *src = +-"<icon type=\"embedded\"><name>app.png</name>" ++"<icon type=\"embedded\" height=\"32\" width=\"32\"><name>app.png</name>" + "<filecontent>\n" + "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJ\n" + "TUUH1gsaCxQZBldDDAAACLxJREFUWIW9lmtsHNUVx/8zd3Zm9uFd73ptZ/3Gid+OoUlwyAscSJw4\n" +@@ -2465,6 +2465,7 @@ as_test_app_no_markup_func (void) + "<component type=\"desktop\">\n" + "<id>org.gnome.Software.desktop</id>\n" + "<description>Software is awesome:\n\n * Bada\n * Boom!</description>\n" ++ "<launchable type=\"desktop-id\">org.gnome.Software.desktop</launchable>\n" + "</component>\n"; + g_autoptr(AsNodeContext) ctx = NULL; + g_autoptr(AsApp) app = NULL; +@@ -3038,7 +3039,7 @@ as_test_store_embedded_func (void) + "<id>eog.desktop</id>" + "<pkgname>eog</pkgname>" + "<name>Image Viewer</name>" +-"<icon type=\"embedded\">" ++"<icon type=\"embedded\" height=\"32\" width=\"32\">" + "<name>eog.png</name>" + "<filecontent>\n" + "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJ\n" +@@ -3084,6 +3085,7 @@ as_test_store_embedded_func (void) + "xxVXYLZ16ADU690D3JzxXLG581caBWBep/71278AZpn8hFce4VcAAAAASUVORK5CYII=\n" + "</filecontent>" + "</icon>" ++"<launchable type=\"desktop-id\">eog.desktop</launchable>" + "</component>" + "</components>"; + +@@ -3909,30 +3911,12 @@ as_test_store_versions_func (void) + "<description><p>Hello</p></description>\n" + "</release>\n" + "</releases>\n" ++ "<launchable type=\"desktop-id\">test.desktop</launchable>\n" + "</component>\n" + "</components>\n", &error); + g_assert_no_error (error); + g_assert (ret); + g_string_free (xml, TRUE); +- +- /* test with legacy options */ +- as_store_set_api_version (store, 0.6); +- xml = as_store_to_xml (store, 0); +- g_assert_cmpstr (xml->str, ==, +- "<components version=\"0.6\">" +- "<component type=\"desktop\">" +- "<id>test.desktop</id>" +- "<description><p>Hello world</p></description>" +- "<architectures><arch>i386</arch></architectures>" +- "<releases>" +- "<release timestamp=\"123\" version=\"0.1.2\">" +- "<description><p>Hello</p></description>" +- "</release>" +- "</releases>" +- "</component>" +- "</components>"); +- g_string_free (xml, TRUE); +- + g_object_unref (store); + + /* load a version 0.6 file to the store */ +@@ -3952,6 +3936,7 @@ as_test_store_versions_func (void) + "<components version=\"0.6\">" + "<component type=\"desktop\">" + "<id>test.desktop</id>" ++ "<launchable type=\"desktop-id\">test.desktop</launchable>" + "</component>" + "</components>"); + g_string_free (xml, TRUE); +@@ -3977,6 +3962,7 @@ as_test_store_addons_func (void) + "</component>" + "<component type=\"desktop\">" + "<id>eclipse.desktop</id>" ++ "<launchable type=\"desktop-id\">eclipse.desktop</launchable>" + "</component>" + "</components>"; + g_autoptr(AsStore) store = NULL; +@@ -4059,6 +4045,7 @@ as_test_node_no_dup_c_func (void) + "<component type=\"desktop\">" + "<id>test.desktop</id>" + "<name>Krita</name>" ++ "<launchable type=\"desktop-id\">test.desktop</launchable>" + "</component>"); + g_string_free (xml, TRUE); + as_node_unref (root); +@@ -4868,7 +4855,7 @@ as_test_store_yaml_func (void) + "<id>iceweasel.desktop</id>\n" + "<pkgname>iceweasel</pkgname>\n" + "<name>Iceweasel</name>\n" +- "<icon type=\"cached\">iceweasel.png</icon>\n" ++ "<icon type=\"cached\" height=\"64\" width=\"64\">iceweasel.png</icon>\n" + "<keywords>\n" + "<keyword>browser</keyword>\n" + "</keywords>\n" |