diff --git a/src/fu-common-cab.c b/src/fu-common-cab.c index c755b9b05..22c7f7491 100644 --- a/src/fu-common-cab.c +++ b/src/fu-common-cab.c @@ -187,6 +187,9 @@ fu_common_store_from_cab_file (XbBuilder *builder, GCabCabinet *cabinet, g_autoptr(GError) error_local = NULL; g_autoptr(XbBuilderSource) source = xb_builder_source_new (); + /* rewrite to be under a components root */ + xb_builder_source_set_prefix (source, "components"); + /* parse file */ #ifdef HAVE_GCAB_1_0 blob = gcab_file_get_bytes (cabfile); @@ -440,8 +443,7 @@ fu_common_cab_build_silo (GBytes *blob, guint64 size_max, GError **error) if (silo == NULL) return NULL; - /* this looks weird, but metainfo files have no node */ - components = xb_silo_query (silo, "component", 0, &error_local); + components = xb_silo_query (silo, "components/component", 0, &error_local); if (components == NULL) { g_set_error (error, FWUPD_ERROR, diff --git a/src/fu-engine.c b/src/fu-engine.c index a262e01d0..0a00c3810 100644 --- a/src/fu-engine.c +++ b/src/fu-engine.c @@ -2250,7 +2250,7 @@ fu_engine_get_details (FuEngine *self, gint fd, GError **error) silo = fu_engine_get_silo_from_blob (self, blob, error); if (silo == NULL) return NULL; - components = xb_silo_query (silo, "component", 0, &error_local); + components = xb_silo_query (silo, "components/component", 0, &error_local); if (components == NULL) { g_set_error (error, FWUPD_ERROR, @@ -2261,10 +2261,10 @@ fu_engine_get_details (FuEngine *self, gint fd, GError **error) } /* build the index */ - if (!xb_silo_query_build_index (silo, "component/provides/firmware", + if (!xb_silo_query_build_index (silo, "components/component/provides/firmware", "type", error)) return FALSE; - if (!xb_silo_query_build_index (silo, "component/provides/firmware", + if (!xb_silo_query_build_index (silo, "components/component/provides/firmware", NULL, error)) return FALSE; diff --git a/src/fu-main.c b/src/fu-main.c index 0a2b9dae4..9c40f8484 100644 --- a/src/fu-main.c +++ b/src/fu-main.c @@ -599,7 +599,7 @@ fu_main_install_with_helper (FuMainAuthHelper *helper_ref, GError **error) return FALSE; /* for each component in the silo */ - components = xb_silo_query (helper->silo, "component", 0, error); + components = xb_silo_query (helper->silo, "components/component", 0, error); if (components == NULL) return FALSE; helper->action_ids = g_ptr_array_new_with_free_func (g_free); diff --git a/src/fu-self-test.c b/src/fu-self-test.c index 7a28a33e6..274272ea5 100644 --- a/src/fu-self-test.c +++ b/src/fu-self-test.c @@ -591,7 +591,7 @@ fu_engine_require_hwid_func (void) fu_engine_add_device (engine, device); /* get component */ - component = xb_silo_query_first (silo, "component/id[text()='com.hughski.test.firmware']/..", &error); + component = xb_silo_query_first (silo, "components/component/id[text()='com.hughski.test.firmware']/..", &error); g_assert_no_error (error); g_assert_nonnull (component); @@ -896,7 +896,7 @@ fu_engine_history_func (void) g_assert_nonnull (silo); /* get component */ - component = xb_silo_query_first (silo, "component/id[text()='com.hughski.test.firmware']/..", &error); + component = xb_silo_query_first (silo, "components/component/id[text()='com.hughski.test.firmware']/..", &error); g_assert_no_error (error); g_assert_nonnull (component); @@ -1023,7 +1023,7 @@ fu_engine_history_error_func (void) silo = fu_engine_get_silo_from_blob (engine, blob_cab, &error); g_assert_no_error (error); g_assert_nonnull (silo); - component = xb_silo_query_first (silo, "component/id[text()='com.hughski.test.firmware']/..", &error); + component = xb_silo_query_first (silo, "components/component/id[text()='com.hughski.test.firmware']/..", &error); g_assert_no_error (error); g_assert_nonnull (component); task = fu_install_task_new (device, component); @@ -2595,7 +2595,7 @@ fu_plugin_composite_func (void) silo = fu_common_cab_build_silo (blob, 10240, &error); g_assert_no_error (error); g_assert_nonnull (silo); - components = xb_silo_query (silo, "component", 0, &error); + components = xb_silo_query (silo, "components/component", 0, &error); g_assert_no_error (error); g_assert_nonnull (components); g_assert_cmpint (components->len, ==, 3); @@ -2742,7 +2742,7 @@ fu_common_store_cab_func (void) g_assert_nonnull (silo); /* verify */ - component = xb_silo_query_first (silo, "component/id[text()='com.acme.example.firmware']/..", &error); + component = xb_silo_query_first (silo, "components/component/id[text()='com.acme.example.firmware']/..", &error); g_assert_no_error (error); g_assert_nonnull (component); rel = xb_node_query_first (component, "releases/release", &error); @@ -2792,7 +2792,7 @@ fu_common_store_cab_unsigned_func (void) g_assert_nonnull (silo); /* verify */ - component = xb_silo_query_first (silo, "component/id[text()='com.acme.example.firmware']/..", &error); + component = xb_silo_query_first (silo, "components/component/id[text()='com.acme.example.firmware']/..", &error); g_assert_no_error (error); g_assert_nonnull (component); rel = xb_node_query_first (component, "releases/release", &error); @@ -2837,7 +2837,7 @@ fu_common_store_cab_folder_func (void) g_assert_nonnull (silo); /* verify */ - component = xb_silo_query_first (silo, "component/id[text()='com.acme.example.firmware']/..", &error); + component = xb_silo_query_first (silo, "components/component/id[text()='com.acme.example.firmware']/..", &error); g_assert_no_error (error); g_assert_nonnull (component); rel = xb_node_query_first (component, "releases/release", &error); diff --git a/src/fu-tool.c b/src/fu-tool.c index f4c0ffd69..a5f72fb0f 100644 --- a/src/fu-tool.c +++ b/src/fu-tool.c @@ -731,7 +731,7 @@ fu_util_install (FuUtilPrivate *priv, gchar **values, GError **error) silo = fu_engine_get_silo_from_blob (priv->engine, blob_cab, error); if (silo == NULL) return FALSE; - components = xb_silo_query (silo, "component", 0, error); + components = xb_silo_query (silo, "components/component", 0, error); if (components == NULL) return FALSE;