From 9917bb44bc245a15f6254a92838a3d25182cb6c4 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Mon, 20 Apr 2020 13:41:27 -0500 Subject: [PATCH] trivial: fu-tool: correct a reference to wrong device ID when using GUID When finding the device by GUID we need to do a lookup first. --- src/fu-tool.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fu-tool.c b/src/fu-tool.c index fb9f53697..ff9d53e86 100644 --- a/src/fu-tool.c +++ b/src/fu-tool.c @@ -1079,19 +1079,19 @@ fu_util_update_all (FuUtilPrivate *priv, GError **error) } static gboolean -fu_util_update_by_id (FuUtilPrivate *priv, const gchar *device_id, GError **error) +fu_util_update_by_id (FuUtilPrivate *priv, const gchar *id, GError **error) { FwupdRelease *rel; g_autoptr(FuDevice) dev = NULL; g_autoptr(GPtrArray) rels = NULL; - /* do not allow a partial device-id */ - dev = fu_util_get_device (priv, device_id, error); + /* do not allow a partial device-id, lookup GUIDs */ + dev = fu_util_get_device (priv, id, error); if (dev == NULL) return FALSE; /* get the releases for this device and filter for validity */ - rels = fu_engine_get_upgrades (priv->engine, device_id, error); + rels = fu_engine_get_upgrades (priv->engine, fu_device_get_id (dev), error); if (rels == NULL) return FALSE; rel = g_ptr_array_index (rels, 0);