void
pk_backend_repo_enable (PkBackend *self, const gchar *repo_id, gboolean enabled)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (repo_id != NULL);

	pk_backend_set_status (self, PK_STATUS_ENUM_QUERY);

	if (enabled) {
		pk_backend_thread_create (self, pk_backend_repo_enable_thread);
	} else {
		pk_backend_thread_create (self, pk_backend_repo_disable_thread);
	}
}
示例#2
0
/**
 * backend_get_requires:
 */
static void
backend_get_requires (PkBackend *backend, PkBitfield filters, gchar **package_ids, gboolean recursive)
{
	pk_backend_set_bool (backend, "get_depends", false);
	pk_backend_set_bool (backend, "recursive", recursive);
	pk_backend_thread_create (backend, backend_get_depends_or_requires_thread);
}
示例#3
0
/**
 * backend_simulate_remove_packages:
 */
static void
backend_simulate_remove_packages (PkBackend *backend, gchar **packages)
{
	pk_backend_set_bool(backend, "simulate", true);
	pk_backend_set_bool(backend, "remove", true);
	pk_backend_thread_create (backend, backend_manage_packages_thread);
}
示例#4
0
/**
 * backend_resolve:
 */
static void
backend_resolve (PkBackend *backend, PkBitfield filters, gchar **packages)
{
	pk_backend_set_uint (backend, "mode", SEARCH_TYPE_RESOLVE);
	pk_backend_set_strv (backend, "search", packages);
	pk_backend_thread_create (backend, backend_find_packages_thread);
}
示例#5
0
/**
 * backend_install_update_packages:
 */
static void
backend_install_update_packages (PkBackend *backend, gboolean only_trusted, gchar **package_ids)
{
	pk_backend_set_bool(backend, "simulate", false);
	pk_backend_set_bool(backend, "remove", false);
	pk_backend_thread_create (backend, backend_manage_packages_thread);
}
示例#6
0
/**
 * backend_remove_packages:
 */
static void
backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
	pk_backend_set_uint (backend, "type", DEPS_ALLOW);
	pk_backend_set_strv (backend, "package_ids", package_ids);
	pk_backend_thread_create (backend, backend_remove_packages_thread);
}
示例#7
0
/**
 * backend_remove_packages:
 */
static void
backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
	pk_backend_set_bool(backend, "simulate", false);
	pk_backend_set_bool(backend, "remove", true);
	pk_backend_thread_create (backend, backend_manage_packages_thread);
}
示例#8
0
/**
 * backend_search_name:
 */
static void
backend_search_names (PkBackend *backend, PkBitfield filters, gchar **values)
{
	pk_backend_set_uint (backend, "mode", SEARCH_TYPE_NAME);
	pk_backend_set_strv (backend, "search", values);
	pk_backend_thread_create (backend, backend_find_packages_thread);
}
示例#9
0
static void
backend_get_updates (PkBackend *backend, PkBitfield filters)
{
	pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY);
	pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID);

	pk_backend_thread_create (backend, backend_get_updates_thread);
}
示例#10
0
static void
backend_update_system (PkBackend *backend, gboolean only_trusted)
{
	pk_backend_set_status (backend, PK_STATUS_ENUM_UPDATE);
	pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID);

	pk_backend_thread_create (backend, backend_update_system_thread);
}
示例#11
0
/**
 * backend_get_requires:
 */
static void
backend_get_requires (PkBackend *backend, PkBitfield filters, gchar **package_ids, gboolean recursive)
{
	pk_backend_set_uint (backend, "type", DEPS_TYPE_REQUIRES);
	pk_backend_set_strv (backend, "package_ids", package_ids);
	/* TODO: param recursive */
	pk_backend_thread_create (backend, backend_get_depends_requires_thread);
}
示例#12
0
/**
 * backend_refresh_cache:
 */
static void
backend_refresh_cache (PkBackend *backend, gboolean force)
{
	pk_backend_set_status (backend, PK_STATUS_ENUM_REFRESH_CACHE);
	pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID);

	pk_backend_thread_create (backend, backend_refresh_cache_thread);
}
示例#13
0
/**
  * backend_what_provides
  */
static void
backend_what_provides (PkBackend *backend,
		       PkBitfield filters,
		       PkProvidesEnum provide,
		       const gchar *search)
{
	pk_backend_thread_create (backend, backend_what_provides_thread);
}
示例#14
0
/**
 * backend_repo_enable:
 **/
void
backend_repo_enable (PkBackend *backend, const gchar *repo, gboolean enabled)
{
	g_return_if_fail (backend != NULL);
	g_return_if_fail (repo != NULL);

	pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY);
	pk_backend_thread_create (backend, backend_repo_enable_thread);
}
示例#15
0
static void
backend_install_packages (PkBackend *backend, gboolean only_trusted, gchar **package_ids)
{
	pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID);
	pk_backend_set_status (backend, PK_STATUS_ENUM_INSTALL);

	pk_backend_set_strv (backend, "pkids", package_ids);

	pk_backend_thread_create (backend, backend_install_packages_thread);
}
示例#16
0
/**
 * backend_update_packages:
 */
static void
backend_update_packages (PkBackend *backend, gboolean only_trusted, gchar **package_ids)
{
	/* check network state */
	if (!pk_backend_is_online (backend)) {
		pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot update when offline");
		pk_backend_finished (backend);
		return;
	}
	pk_backend_thread_create (backend, backend_update_packages_thread);
}
示例#17
0
/**
 * backend_refresh_cache:
 */
static void
backend_refresh_cache (PkBackend *backend, gboolean force)
{
	/* check network state */
	if (!pk_backend_is_online (backend)) {
		pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot refresh cache whilst offline");
		pk_backend_finished (backend);
		return;
	}
	/* FIXME: support force */
	pk_backend_thread_create (backend, backend_refresh_cache_thread);
}
示例#18
0
static void
backend_update_packages (PkBackend *backend, gboolean only_trusted, gchar **package_ids)
{
	gint i;

	pk_backend_set_status (backend, PK_STATUS_ENUM_UPDATE);
	pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID);

	for (i = 0; package_ids[i]; i++) {
		pk_backend_set_string (backend, "pkgid", package_ids[i]);
		pk_backend_thread_create (backend, backend_update_package_thread);
	}
}
示例#19
0
/**
 * backend_search_description:
 */
static void
backend_search_description (PkBackend *backend, PkBitfield filters, gchar **search)
{
	SearchParams *params;

	pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY);
	pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID);

	params = g_new0 (SearchParams, 1);
	params->filters = filters;
	params->search_type = SEARCH_DESCRIPTION;
	params->needle = g_utf8_strdown (search[0], -1);
	params->backend = backend;

	pk_backend_set_pointer (backend, "search-params", params);
	pk_backend_thread_create (backend, backend_search_thread);
}
示例#20
0
static void
backend_search_group (PkBackend *backend, PkBitfield filters, gchar **search)
{
	SearchParams *params;

	pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY);
	pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID);

	params = g_new0 (SearchParams, 1);
	params->filters = filters;
	params->search_type = SEARCH_TAG;
	params->needle = g_strdup_printf ("group::%s", search[0]);
	params->backend = backend;

	pk_backend_set_pointer (backend, "search-params", params);
	pk_backend_thread_create (backend, backend_search_thread);
}
示例#21
0
static void
backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
	gpointer *params;

	pk_backend_set_status (backend, PK_STATUS_ENUM_REMOVE);
	pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID);

	/* params is a small array we can pack our thread parameters into */
	params = g_new0 (gpointer, 2);

	params[0] = g_strdupv (package_ids);
	params[1] = GINT_TO_POINTER (allow_deps);
	params[2] = GINT_TO_POINTER (autoremove);

	pk_backend_set_pointer (backend, "remove-params", params);

	pk_backend_thread_create (backend, backend_remove_packages_thread);

}
示例#22
0
/**
 * backend_update_system:
 */
static void
backend_update_system (PkBackend *backend, gboolean only_trusted)
{
	pk_backend_thread_create (backend, backend_update_system_thread);
}
示例#23
0
/**
 * backend_refresh_cache:
 */
static void
backend_refresh_cache (PkBackend *backend, gboolean force)
{
	pk_backend_thread_create (backend, backend_refresh_cache_thread);
}
示例#24
0
/**
 * backend_resolve:
 */
static void
backend_resolve (PkBackend *backend, PkBitfield filters, gchar **packages)
{
	pk_backend_thread_create (backend, backend_resolve_thread);
}
示例#25
0
/**
 * backend_search_group:
 */
static void
backend_search_group (PkBackend *backend, PkBitfield filters, const gchar *search)
{
	pk_backend_thread_create (backend, backend_search_group_thread);
}
示例#26
0
/**
 * backend_install_files:
 */
static void
backend_install_files (PkBackend *backend, gboolean only_trusted, gchar **full_paths)
{
	pk_backend_set_strv (backend, "full_paths", full_paths);
	pk_backend_thread_create (backend, backend_install_files_thread);
}
示例#27
0
/**
 * backend_get_updates:
 */
static void
backend_get_updates (PkBackend *backend, PkBitfield filters)
{
	/* TODO: filters */
	pk_backend_thread_create (backend, backend_get_updates_thread);
}
示例#28
0
/**
 * backend_get_packages:
 */
static void
backend_get_packages (PkBackend *backend, PkBitfield filters)
{
	pk_backend_set_uint (backend, "filters", filters);
	pk_backend_thread_create (backend, backend_get_packages_thread);
}
示例#29
0
/**
 * backend_get_files:
 */
static void
backend_get_files (PkBackend *backend, gchar **package_ids)
{
	pk_backend_set_strv (backend, "package_ids", package_ids);
	pk_backend_thread_create (backend, backend_get_files_thread);
}
示例#30
0
static void
backend_get_details (PkBackend *backend, gchar **package_ids)
{
	pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID);
	pk_backend_thread_create (backend, backend_get_details_thread);
}