Do not merge existing LVFS metadata

If we change the filenames or hash values we don't want duplicate locations.
This commit is contained in:
Richard Hughes 2015-07-21 14:16:54 +01:00
parent 0b8d461099
commit 2b60a33c8f

View File

@ -572,6 +572,23 @@ fu_main_get_action_id_for_device (FuMainAuthHelper *helper)
return "org.freedesktop.fwupd.update-internal";
}
/**
* _as_store_set_priority:
**/
static void
_as_store_set_priority (AsStore *store, gint priority)
{
AsApp *app;
GPtrArray *apps;
guint i;
apps = as_store_get_apps (store);
for (i = 0; i < apps->len; i++) {
app = g_ptr_array_index (apps, i);
as_app_set_priority (app, priority);
}
}
/**
* fu_main_daemon_update_metadata:
*
@ -599,6 +616,8 @@ fu_main_daemon_update_metadata (gint fd, gint fd_sig, GError **error)
if (g_file_query_exists (file, NULL)) {
if (!as_store_from_file (store, file, NULL, NULL, error))
return FALSE;
/* ensure we don't merge existing entries */
_as_store_set_priority (store, -1);
}
/* read the entire file into memory */