trivial: Show results when using FWUPD_XMLB_VERBOSE

This commit is contained in:
Richard Hughes 2022-01-11 21:39:37 +00:00
parent 1ef67c60ca
commit 45673e7d9f
2 changed files with 7 additions and 1 deletions

View File

@ -14,7 +14,7 @@ with a non-standard filesystem layout.
* `FWUPD_DEVICE_TESTS_BASE_URI` sets the base URI when downloading firmware for the device-tests
* `FWUPD_SUPPORTED` overrides the `-Dsupported_build` meson option at runtime
* `FWUPD_VERBOSE` is set when running `--verbose`
* `FWUPD_XMLB_VERBOSE` can be set to show Xmlb silo regeneration
* `FWUPD_XMLB_VERBOSE` can be set to show Xmlb silo regeneration and quirk matches
* `FWUPD_DOWNLOAD_VERBOSE` can be used to show wget or curl output
* standard glibc variables like `LANG` are also honored for CLI tools that are translated
* libcurl respects the session proxy, e.g. `http_proxy`, `all_proxy`, `sftp_proxy` and `no_proxy`

View File

@ -56,6 +56,7 @@ struct _FuQuirks {
XbSilo *silo;
XbQuery *query_kv;
XbQuery *query_vs;
gboolean verbose;
};
G_DEFINE_TYPE(FuQuirks, fu_quirks, G_TYPE_OBJECT)
@ -430,6 +431,8 @@ fu_quirks_lookup_by_id(FuQuirks *self, const gchar *guid, const gchar *key)
g_warning("failed to query: %s", error->message);
return NULL;
}
if (self->verbose)
g_debug("%s:%s → %s", guid, key, xb_node_get_text(n));
return xb_node_get_text(n);
}
@ -495,6 +498,8 @@ fu_quirks_lookup_by_id_iter(FuQuirks *self,
}
for (guint i = 0; i < results->len; i++) {
XbNode *n = g_ptr_array_index(results, i);
if (self->verbose)
g_debug("%s → %s", guid, xb_node_get_text(n));
iter_cb(self, xb_node_get_attr(n, "key"), xb_node_get_text(n), user_data);
}
return TRUE;
@ -518,6 +523,7 @@ fu_quirks_load(FuQuirks *self, FuQuirksLoadFlags load_flags, GError **error)
g_return_val_if_fail(FU_IS_QUIRKS(self), FALSE);
g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
self->load_flags = load_flags;
self->verbose = g_getenv("FWUPD_XMLB_VERBOSE") != NULL;
return fu_quirks_check_silo(self, error);
}