summaryrefslogtreecommitdiff
path: root/src/pk-backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pk-backend.c')
-rw-r--r--src/pk-backend.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/pk-backend.c b/src/pk-backend.c
index 2ed71e11..e3c36559 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -328,6 +328,10 @@ pk_backend_get_roles (PkBackend *backend)
pk_bitfield_add (roles, PK_ROLE_ENUM_SIMULATE_UPDATE_PACKAGES);
if (desc->upgrade_system != NULL)
pk_bitfield_add (roles, PK_ROLE_ENUM_UPGRADE_SYSTEM);
+ if (desc->repair_system != NULL)
+ pk_bitfield_add (roles, PK_ROLE_ENUM_REPAIR_SYSTEM);
+ if (desc->simulate_repair_system != NULL)
+ pk_bitfield_add (roles, PK_ROLE_ENUM_SIMULATE_REPAIR_SYSTEM);
backend->priv->roles = roles;
out:
return backend->priv->roles;
@@ -672,6 +676,8 @@ pk_backend_set_name (PkBackend *backend, const gchar *backend_name, GError **err
g_module_symbol (handle, "pk_backend_update_system", (gpointer *)&desc->update_system);
g_module_symbol (handle, "pk_backend_what_provides", (gpointer *)&desc->what_provides);
g_module_symbol (handle, "pk_backend_upgrade_system", (gpointer *)&desc->upgrade_system);
+ g_module_symbol (handle, "pk_backend_repair_system", (gpointer *)&desc->repair_system);
+ g_module_symbol (handle, "pk_backend_simulate_repair_system", (gpointer *)&desc->simulate_repair_system);
/* get old static string data */
ret = g_module_symbol (handle, "pk_backend_get_author", (gpointer *)&backend_vfunc);
@@ -3797,6 +3803,34 @@ pk_backend_upgrade_system (PkBackend *backend, const gchar *distro_id, PkUpgrade
}
/**
+ * pk_backend_repair_system:
+ */
+void
+pk_backend_repair_system (PkBackend *backend, gboolean only_trusted)
+{
+ g_return_if_fail (PK_IS_BACKEND (backend));
+ g_return_if_fail (backend->priv->desc->repair_system != NULL);
+ pk_backend_set_role_internal (backend, PK_ROLE_ENUM_REPAIR_SYSTEM);
+ pk_store_set_bool (backend->priv->store, "only_trusted", only_trusted);
+ pk_backend_transaction_reset (backend);
+ backend->priv->desc->repair_system (backend, only_trusted);
+}
+
+/**
+ * pk_backend_simulate_repair_system:
+ */
+void
+pk_backend_simulate_repair_system (PkBackend *backend)
+{
+ g_return_if_fail (PK_IS_BACKEND (backend));
+ g_return_if_fail (backend->priv->desc->repair_system != NULL);
+ pk_backend_set_role_internal (backend, PK_ROLE_ENUM_SIMULATE_REPAIR_SYSTEM);
+ pk_backend_set_bool (backend, "hint:simulate", TRUE);
+ pk_backend_transaction_reset (backend);
+ backend->priv->desc->simulate_repair_system (backend);
+}
+
+/**
* pk_backend_init:
**/
static void