From e202a3985125c61df2ea547a12aa63c6fd4799a4 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Sat, 12 Oct 2019 19:31:14 -0500 Subject: [PATCH] trivial: fu-util: add some extra checks around automatic reports Avoid some extra roundtrips to the daemon if user has poked at some files. --- src/fu-util.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/fu-util.c b/src/fu-util.c index 50b305ce3..9b6c1691a 100644 --- a/src/fu-util.c +++ b/src/fu-util.c @@ -252,6 +252,8 @@ fu_util_maybe_enable_automatic (FuUtilPrivate *priv, GPtrArray *remotes, GError for (guint i = 0; i < remotes->len; i++) { FwupdRemote *remote = g_ptr_array_index (remotes, i); const gchar *remote_id = fwupd_remote_get_id (remote); + if (fwupd_remote_get_report_uri (remote) == NULL) + continue; if (!fwupd_client_modify_remote (priv->client, remote_id, "ReportURI", "", NULL, error)) @@ -272,6 +274,10 @@ fu_util_maybe_enable_automatic (FuUtilPrivate *priv, GPtrArray *remotes, GError for (guint i = 0; i < remotes->len; i++) { FwupdRemote *remote = g_ptr_array_index (remotes, i); const gchar *remote_id = fwupd_remote_get_id (remote); + if (fwupd_remote_get_report_uri (remote) == NULL) + continue; + if (fwupd_remote_get_automatic_reports (remote)) + continue; if (!fwupd_client_modify_remote (priv->client, remote_id, "AutomaticReports", "true", NULL, error))