summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-app-inf.c
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2015-08-05 12:01:03 +0100
committerRichard Hughes <richard@hughsie.com>2015-08-05 12:06:01 +0100
commit62bca1ea41f27cc84b73cd8e6381517700ad39f2 (patch)
tree9bac6cfe22c79c772a31aff1ab8b9b746340724d /libappstream-glib/as-app-inf.c
parent1e8e00567a608f28736d86acca6f8d5b6a199d4b (diff)
downloadappstream-glib-62bca1ea41f27cc84b73cd8e6381517700ad39f2.tar.gz
Make the DriverVer in the .inf file optional
This allows the release engineer to _only_ update the metainfo.xml file for each release. If the firmware.inf file is not being used in Windows for driver installation then we should make the file static.
Diffstat (limited to 'libappstream-glib/as-app-inf.c')
-rw-r--r--libappstream-glib/as-app-inf.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/libappstream-glib/as-app-inf.c b/libappstream-glib/as-app-inf.c
index 3650e88..d50fdee 100644
--- a/libappstream-glib/as-app-inf.c
+++ b/libappstream-glib/as-app-inf.c
@@ -159,9 +159,20 @@ as_app_parse_inf_file (AsApp *app,
as_app_set_comment (app, NULL, comment);
/* parse the DriverVer */
- version = as_inf_get_driver_version (kf, &timestamp, error);
- if (version == NULL)
- return FALSE;
+ version = as_inf_get_driver_version (kf, &timestamp, &error_local);
+ if (version == NULL) {
+ if (g_error_matches (error_local,
+ AS_INF_ERROR,
+ AS_INF_ERROR_NOT_FOUND)) {
+ g_clear_error (&error_local);
+ } else {
+ g_set_error_literal (error,
+ AS_APP_ERROR,
+ AS_APP_ERROR_FAILED,
+ error_local->message);
+ return FALSE;
+ }
+ }
/* find the firmware file we're installing */
source_keys = g_key_file_get_keys (kf, "SourceDisksFiles", NULL, NULL);
@@ -187,10 +198,12 @@ as_app_parse_inf_file (AsApp *app,
as_app_add_metadata (app, "CatalogBasename", catalog_basename);
/* add a release with no real description */
- release = as_release_new ();
- as_release_set_version (release, version);
- as_release_set_timestamp (release, timestamp);
- as_app_add_release (app, release);
+ if (version != NULL) {
+ release = as_release_new ();
+ as_release_set_version (release, version);
+ as_release_set_timestamp (release, timestamp);
+ as_app_add_release (app, release);
+ }
/* add icon */
icon = as_icon_new ();