Fix vendor-directory remotes for firmware with an <artifact> section

This commit is contained in:
Richard Hughes 2021-06-12 11:28:12 +01:00
parent 5051614206
commit 60453d9d3c

View File

@ -484,14 +484,14 @@ fu_engine_set_release_from_appstream (FuEngine *self,
if (uri == NULL) if (uri == NULL)
uri = g_strdup (tmp); uri = g_strdup (tmp);
fwupd_release_add_location (rel, uri); fwupd_release_add_location (rel, uri);
} else if (remote != NULL && }
fwupd_remote_get_kind (remote) == FWUPD_REMOTE_KIND_DIRECTORY) { }
g_autofree gchar *uri = NULL; if (fwupd_release_get_locations(rel)->len == 0 && remote != NULL &&
tmp = xb_node_query_text (component, "../custom/value[@key='fwupd::FilenameCache']", NULL); fwupd_remote_get_kind (remote) == FWUPD_REMOTE_KIND_DIRECTORY) {
if (tmp != NULL) { tmp = xb_node_query_text (component, "../custom/value[@key='fwupd::FilenameCache']", NULL);
uri = g_strdup_printf ("file://%s", tmp); if (tmp != NULL) {
fwupd_release_add_location (rel, uri); g_autofree gchar *uri = g_strdup_printf ("file://%s", tmp);
} fwupd_release_add_location (rel, uri);
} }
} }
if (artifact == NULL) { if (artifact == NULL) {