diff options
author | Richard Hughes <richard@hughsie.com> | 2015-07-23 13:04:22 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2015-07-23 13:04:54 +0100 |
commit | cb91ddd777b019a4bdf51c364c985bc7cd2dccd3 (patch) | |
tree | bcbb568f3322d92ffef37ffa252936b7e74b54ed | |
parent | 9779a36bfbed6921a85a21304f548cff0a229274 (diff) | |
download | appstream-glib-cb91ddd777b019a4bdf51c364c985bc7cd2dccd3.tar.gz |
Do not parse non-standard sections in .inf files
It makes the story unclear when there are two ways of specifying the location.
-rw-r--r-- | data/tests/example.inf | 4 | ||||
-rw-r--r-- | libappstream-glib/as-app-inf.c | 11 | ||||
-rw-r--r-- | libappstream-glib/as-self-test.c | 1 |
3 files changed, 0 insertions, 16 deletions
diff --git a/data/tests/example.inf b/data/tests/example.inf index 38b32f7..86aa20a 100644 --- a/data/tests/example.inf +++ b/data/tests/example.inf @@ -9,10 +9,6 @@ DriverVer=03/03/2015,2.0.2 PnpLockdown=1 CatalogFile=firmware.cat -; nonstandard -[Location] -URLs = "http://www.hughski.com/foo.cab" - [Manufacturer] %MfgName% = Hughski,NTamd64 diff --git a/libappstream-glib/as-app-inf.c b/libappstream-glib/as-app-inf.c index 80519e1..c7581c6 100644 --- a/libappstream-glib/as-app-inf.c +++ b/libappstream-glib/as-app-inf.c @@ -56,7 +56,6 @@ as_app_parse_inf_file (AsApp *app, GError **error) { guint64 timestamp; - guint i; _cleanup_error_free_ GError *error_local = NULL; _cleanup_free_ gchar *catalog_basename = NULL; _cleanup_free_ gchar *class_guid = NULL; @@ -68,7 +67,6 @@ as_app_parse_inf_file (AsApp *app, _cleanup_free_ gchar *guid = NULL; _cleanup_free_ gchar *id = NULL; _cleanup_free_ gchar *location_checksum = NULL; - _cleanup_free_ gchar *location_url = NULL; _cleanup_free_ gchar *name = NULL; _cleanup_free_ gchar *srcpkg = NULL; _cleanup_free_ gchar *vendor = NULL; @@ -194,15 +192,6 @@ as_app_parse_inf_file (AsApp *app, as_release_set_timestamp (release, timestamp); as_app_add_release (app, release); - /* this is a Linux extension */ - location_url = g_key_file_get_string (kf, "Location", "URLs", NULL); - if (location_url != NULL) { - _cleanup_strv_free_ gchar **location_urls = NULL; - location_urls = g_strsplit (location_url, ",", -1); - for (i = 0; location_urls[i] != NULL; i++) - as_release_add_location (release, location_urls[i], -1); - } - /* add icon */ icon = as_icon_new (); as_icon_set_kind (icon, AS_ICON_KIND_STOCK); diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c index 535a479..3f1e118 100644 --- a/libappstream-glib/as-self-test.c +++ b/libappstream-glib/as-self-test.c @@ -1575,7 +1575,6 @@ as_test_app_parse_file_inf_func (void) releases = as_app_get_releases (app); g_assert_cmpint (releases->len, ==, 1); rel = g_ptr_array_index (releases, 0); - g_assert_cmpstr (as_release_get_location_default (rel), ==, "http://www.hughski.com/foo.cab"); g_assert_cmpint (as_release_get_timestamp (rel), ==, 1425340800); g_assert_cmpstr (as_release_get_version (rel), ==, "2.0.2"); //g_assert_cmpstr (as_release_get_description (rel), ==, "XXX"); |