summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2015-03-05 16:44:28 +0000
committerRichard Hughes <richard@hughsie.com>2015-03-05 16:44:28 +0000
commit5b50ec94099b0a9be6ba357354dd947990380e61 (patch)
tree48d129159ff0a2ec18d41791c91ff1437c67374f
parente1a180f4f57ec1b6fbca37413537ac6561fdb561 (diff)
downloadappstream-glib-5b50ec94099b0a9be6ba357354dd947990380e61.tar.gz
Parse the entire description when reading AppStream releases
-rw-r--r--libappstream-builder/asb-self-test.c15
-rw-r--r--libappstream-glib/as-release.c3
-rw-r--r--libappstream-glib/as-self-test.c4
3 files changed, 17 insertions, 5 deletions
diff --git a/libappstream-builder/asb-self-test.c b/libappstream-builder/asb-self-test.c
index bdd10e8..5bd54fd 100644
--- a/libappstream-builder/asb-self-test.c
+++ b/libappstream-builder/asb-self-test.c
@@ -427,7 +427,10 @@ asb_test_context_test_func (AsbTestContextMode mode)
"<release version=\"2.0.2\" timestamp=\"1424116753\">\n"
"<location>http://www.hughski.com/downloads/colorhug2/firmware/colorhug-2.0.2.cab</location>\n"
"<checksum type=\"sha1\">9de398ebe3bbf477ad1fa344955dcba07e535dc0</checksum>\n"
- "<description><p>This unstable release adds the following features:</p></description>\n"
+ "<description><p>This unstable release adds the following features:</p>"
+ "<ul><li>Add TakeReadingArray to enable panel latency measurements</li>"
+ "<li>Speed up the auto-scaled measurements considerably, using 256ms "
+ "as the smallest sample duration</li></ul></description>\n"
"</release>\n"
"</releases>\n"
"<metadata>\n"
@@ -998,12 +1001,18 @@ asb_test_firmware_func (void)
"<release version=\"2.0.2\" timestamp=\"1424116753\">\n"
"<location>http://www.hughski.com/downloads/colorhug2/firmware/colorhug-2.0.2.cab</location>\n"
"<checksum type=\"sha1\">9de398ebe3bbf477ad1fa344955dcba07e535dc0</checksum>\n"
- "<description><p>This unstable release adds the following features:</p></description>\n"
+ "<description><p>This unstable release adds the following features:</p>"
+ "<ul><li>Add TakeReadingArray to enable panel latency measurements</li>"
+ "<li>Speed up the auto-scaled measurements considerably, using 256ms "
+ "as the smallest sample duration</li></ul></description>\n"
"</release>\n"
"<release version=\"2.0.1\" timestamp=\"1424116753\">\n"
"<location>http://www.hughski.com/downloads/colorhug2/firmware/colorhug-2.0.1.cab</location>\n"
"<checksum type=\"sha1\">6a8e77f590fe8e0de85dc5c85d17819b903e0b87</checksum>\n"
- "<description><p>This unstable release adds the following features:</p></description>\n"
+ "<description><p>This unstable release adds the following features:</p>"
+ "<ul><li>Use TakeReadings() to do a quick non-adaptive measurement</li>"
+ "<li>Scale XYZ measurement with a constant factor to make the CCMX more "
+ "sane</li></ul></description>\n"
"</release>\n"
"<release version=\"2.0.0\" timestamp=\"1425168000\">\n"
"<location>http://www.hughski.com/downloads/colorhug2/firmware/colorhug-2.0.0.cab</location>\n"
diff --git a/libappstream-glib/as-release.c b/libappstream-glib/as-release.c
index bc16468..44e41e9 100644
--- a/libappstream-glib/as-release.c
+++ b/libappstream-glib/as-release.c
@@ -467,7 +467,8 @@ as_release_node_parse (AsRelease *release, GNode *node,
_cleanup_string_free_ GString *xml = NULL;
if (as_node_get_tag (n) != AS_TAG_DESCRIPTION)
continue;
- xml = as_node_to_xml (n->children, AS_NODE_TO_XML_FLAG_NONE);
+ xml = as_node_to_xml (n->children,
+ AS_NODE_TO_XML_FLAG_INCLUDE_SIBLINGS);
as_release_set_description (release,
as_node_get_attribute (n, "xml:lang"),
xml->str, xml->len);
diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c
index be37bf2..9822f8d 100644
--- a/libappstream-glib/as-self-test.c
+++ b/libappstream-glib/as-self-test.c
@@ -203,7 +203,7 @@ as_test_release_appstream_func (void)
"<location>http://baz.com/bar.cab</location>\n"
"<checksum type=\"md5\">deadbeef</checksum>\n"
"<checksum type=\"sha1\">12345</checksum>\n"
- "<description><p>This is a new release</p></description>\n"
+ "<description><p>This is a new release</p><ul><li>Point</li></ul></description>\n"
"<description xml:lang=\"pl\"><p>Oprogramowanie</p></description>\n"
"</release>\n";
_cleanup_free_ AsNodeContext *ctx = NULL;
@@ -231,6 +231,8 @@ as_test_release_appstream_func (void)
g_assert_cmpstr (as_release_get_checksum (release, G_CHECKSUM_MD5), ==, "deadbeef");
g_assert_cmpstr (as_release_get_description (release, "pl"), ==,
"<p>Oprogramowanie</p>");
+ g_assert_cmpstr (as_release_get_description (release, NULL), ==,
+ "<p>This is a new release</p><ul><li>Point</li></ul>");
/* back to node */
root = as_node_new ();