From 4082d3367be4be8f717a3c8e18bc264a07d96e10 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 9 Feb 2018 15:50:18 +0000 Subject: [PATCH] Correctly mark updates as successful even if the device version number is wrong If the device firmware was set incorrectly make then set it to the release version so the database update works correctly. We can't do any kind of vercmp in the database, so use a daemon warning so we can either fix the plugin or the XML. This fixes up the issue that the hardware reports '28.00' and the AppStream release specifies '28.0'. Fixes: https://github.com/hughsie/fwupd/issues/387 --- src/fu-engine.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/fu-engine.c b/src/fu-engine.c index c13554174..0f90ed34b 100644 --- a/src/fu-engine.c +++ b/src/fu-engine.c @@ -1649,6 +1649,13 @@ fu_engine_install (FuEngine *self, error); } + /* ensure the new version matched what we expected */ + if (g_strcmp0 (fu_device_get_version (device), version) != 0) { + g_warning ("new device version '%s' was is not '%s', fixing up", + fu_device_get_version (device), version); + fu_device_set_version (device, version); + } + /* success */ fu_device_set_update_state (device, FWUPD_UPDATE_STATE_SUCCESS); return fu_history_modify_device (self->history, device,