socsvn commit: r253439 - soc2013/mattbw/backend
mattbw at FreeBSD.org
mattbw at FreeBSD.org
Mon Jun 24 19:45:47 UTC 2013
Author: mattbw
Date: Mon Jun 24 19:45:46 2013
New Revision: 253439
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=253439
Log:
cleanup, separate database opener to db.[ch], re-indent
Added:
soc2013/mattbw/backend/db.c
soc2013/mattbw/backend/db.h
Modified:
soc2013/mattbw/backend/Makefile
soc2013/mattbw/backend/get-details.c
soc2013/mattbw/backend/get-details.h
soc2013/mattbw/backend/pk-backend-pkgng.c
Modified: soc2013/mattbw/backend/Makefile
==============================================================================
--- soc2013/mattbw/backend/Makefile Mon Jun 24 19:24:45 2013 (r253438)
+++ soc2013/mattbw/backend/Makefile Mon Jun 24 19:45:46 2013 (r253439)
@@ -2,7 +2,7 @@
LIB= pk_backend_pkgng
SHLIB_MAJOR= 1
-SRCS= pk-backend-pkgng.c get-details.c groups.c
+SRCS= pk-backend-pkgng.c get-details.c groups.c db.c
USE_PK_PKGCONF= 0
Added: soc2013/mattbw/backend/db.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2013/mattbw/backend/db.c Mon Jun 24 19:45:46 2013 (r253439)
@@ -0,0 +1,57 @@
+/*-
+ *
+ * Copyright (C) 2013 Matt Windsor <mattbw at FreeBSD.org>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <glib.h>
+#include "pk-backend.h"
+#include "pkg.h"
+
+/*
+ * Opens a pkgdb ready for remote operations. This will always return TRUE if
+ * and only if a database ready for use is now pointed to by *db, and FALSE
+ * if and only if there isn't.
+ *
+ * This will also emit PackageKit errors if it fails.
+ *
+ * This must be called during the lifetime of "backend", eg after
+ * "pk_backend_initialize" and before "pk_backend_destroy".
+ */
+gboolean
+open_remote_db(struct pkgdb **db, PkBackend *backend)
+{
+ gboolean success;
+ int open_return;
+
+ /* TODO: pkgdb_access for pkg1.1 */
+ success = FALSE;
+ open_return = pkgdb_open(db, PKGDB_REMOTE);
+ if (open_return != EPKG_OK)
+ pk_backend_error_code(backend,
+ PK_ERROR_ENUM_INTERNAL_ERROR,
+ "pkgdb_open returned an error");
+ else if (*db == NULL)
+ pk_backend_error_code(backend,
+ PK_ERROR_ENUM_INTERNAL_ERROR,
+ "pkgdb_open gave us a null pointer");
+ else
+ success = TRUE;
+
+ return success;
+}
Added: soc2013/mattbw/backend/db.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2013/mattbw/backend/db.h Mon Jun 24 19:45:46 2013 (r253439)
@@ -0,0 +1,31 @@
+/*-
+ *
+ * Copyright (C) 2013 Matt Windsor <mattbw at FreeBSD.org>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef _PKGNG_BACKEND_DB_H_
+#define _PKGNG_BACKEND_DB_H_
+
+#include <glib.h> /* gboolean */
+#include "pk-backend.h" /* PkBackend */
+#include "pkg.h" /* struct pkgdb */
+
+gboolean open_remote_db(struct pkgdb **db, PkBackend *backend);
+
+#endif /* !_PKGNG_BACKEND_DETAILS_H_ */
Modified: soc2013/mattbw/backend/get-details.c
==============================================================================
--- soc2013/mattbw/backend/get-details.c Mon Jun 24 19:24:45 2013 (r253438)
+++ soc2013/mattbw/backend/get-details.c Mon Jun 24 19:45:46 2013 (r253439)
@@ -26,6 +26,17 @@
#include "groups.h"
+static gboolean
+get_local_details(gchar *name,
+ gchar *version,
+ gchar *arch,
+ PkBackend *backend,
+ struct pkgdb *db);
+static gboolean
+get_details_for(gchar *package_id,
+ PkBackend *backend,
+ struct pkgdb *db);
+
/*
* Checks two strings with strcmp and emits TRUE if they match. If either
* string is NULL, emit TRUE as well (this is so that missing PackageID
@@ -132,7 +143,7 @@
}
/* Looks the split PackageID up in the local database. */
-gboolean
+static gboolean
get_local_details(gchar *name,
gchar *version,
gchar *arch,
@@ -247,3 +258,34 @@
return success;
}
+
+/*
+ * The thread that performs a GetDetails operation. Should be invoked by the
+ * pk_backend_get_details hook.
+ */
+gboolean
+get_details_thread(PkBackend *backend)
+{
+ gboolean no_error_yet;
+ gchar **package_ids;
+ guint len;
+ guint i;
+ struct pkgdb *db;
+
+
+ package_ids = pk_backend_get_strv(backend, "package_ids");
+ len = g_strv_length(package_ids);
+
+ db = NULL;
+ no_error_yet = open_remote_db(&db, backend);
+
+ pk_backend_set_percentage(backend, 0);
+ for (i = 0; i < len && no_error_yet; i++) {
+ no_error_yet = get_details_for(package_ids[0], backend, db);
+ pk_backend_set_percentage(backend, ((i * 100) / len));
+ }
+ pkgdb_close(db);
+
+ pk_backend_finished(backend);
+ return no_error_yet;
+}
Modified: soc2013/mattbw/backend/get-details.h
==============================================================================
--- soc2013/mattbw/backend/get-details.h Mon Jun 24 19:24:45 2013 (r253438)
+++ soc2013/mattbw/backend/get-details.h Mon Jun 24 19:45:46 2013 (r253439)
@@ -18,9 +18,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef _GET_DETAILS_H_
-#define _GET_DETAILS_H_
+#ifndef _PKGNG_BACKEND_GET_DETAILS_H_
+#define _PKGNG_BACKEND_GET_DETAILS_H_
-gboolean get_details_for(gchar *package_id, PkBackend *backend, struct pkgdb *db);
+#include <glib.h> /* gboolean */
+#include "pk-backend.h" /* PkBackend */
-#endif /* !_GET_DETAILS_H_ */
+gboolean get_details_thread(PkBackend *backend);
+
+#endif /* !_PKGNG_BACKEND_GET_DETAILS_H_ */
Modified: soc2013/mattbw/backend/pk-backend-pkgng.c
==============================================================================
--- soc2013/mattbw/backend/pk-backend-pkgng.c Mon Jun 24 19:24:45 2013 (r253438)
+++ soc2013/mattbw/backend/pk-backend-pkgng.c Mon Jun 24 19:45:46 2013 (r253439)
@@ -57,55 +57,34 @@
static guint _socket_listen_id = 0;
struct pkgng_private {
- struct pkgdb *db;
+ struct pkgdb *db;
};
static struct pkgng_private priv;
-gboolean
-open_remote_db(struct pkgdb **db, PkBackend *backend)
-{
- gboolean success;
- int open_return;
-
- success = FALSE;
- open_return = pkgdb_open(db, PKGDB_REMOTE);
- if (open_return != EPKG_OK)
- pk_backend_error_code(backend,
- PK_ERROR_ENUM_INTERNAL_ERROR,
- "pkgdb_open returned an error");
- else if (*db == NULL)
- pk_backend_error_code(backend,
- PK_ERROR_ENUM_INTERNAL_ERROR,
- "pkgdb_open gave us a null pointer");
- else
- success = TRUE;
-
- return success;
-}
/**
* pk_backend_initialize:
*/
void
-pk_backend_initialize(PkBackend * backend)
+pk_backend_initialize(PkBackend *backend)
{
- int err;
+ int err;
_progress_percentage = 0;
err = pkg_init(NULL);
if (err)
pk_backend_error_code(backend,
- PK_ERROR_ENUM_INTERNAL_ERROR,
- "could not initialise pkg");
+ PK_ERROR_ENUM_INTERNAL_ERROR,
+ "could not initialise pkg");
}
/**
* pk_backend_destroy:
*/
void
-pk_backend_destroy(PkBackend * backend)
+pk_backend_destroy(PkBackend *backend)
{
pkg_shutdown();
}
@@ -114,7 +93,7 @@
* pk_backend_get_groups:
*/
PkBitfield
-pk_backend_get_groups(PkBackend * backend)
+pk_backend_get_groups(PkBackend *backend)
{
return pk_bitfield_from_enums(PK_GROUP_ENUM_ACCESSIBILITY,
PK_GROUP_ENUM_GAMES,
@@ -126,7 +105,7 @@
* pk_backend_get_filters:
*/
PkBitfield
-pk_backend_get_filters(PkBackend * backend)
+pk_backend_get_filters(PkBackend *backend)
{
return pk_bitfield_from_enums(PK_FILTER_ENUM_GUI,
PK_FILTER_ENUM_INSTALLED,
@@ -138,7 +117,7 @@
* pk_backend_get_mime_types:
*/
gchar *
-pk_backend_get_mime_types(PkBackend * backend)
+pk_backend_get_mime_types(PkBackend *backend)
{
return g_strdup("application/x-rpm;application/x-deb");
}
@@ -146,10 +125,10 @@
/**
* pk_backend_cancel_timeout:
*/
-static gboolean
+static gboolean
pk_backend_cancel_timeout(gpointer data)
{
- PkBackend *backend = (PkBackend *) data;
+ PkBackend *backend = (PkBackend *)data;
/* we can now cancel again */
_signal_timeout = 0;
@@ -165,7 +144,7 @@
* pk_backend_cancel:
*/
void
-pk_backend_cancel(PkBackend * backend)
+pk_backend_cancel(PkBackend *backend)
{
/* cancel the timeout */
if (_signal_timeout != 0) {
@@ -180,7 +159,7 @@
* pk_backend_get_depends:
*/
void
-pk_backend_get_depends(PkBackend * backend, PkBitfield filters, gchar ** package_ids, gboolean recursive)
+pk_backend_get_depends(PkBackend *backend, PkBitfield filters, gchar **package_ids, gboolean recursive)
{
pk_backend_set_status(backend, PK_STATUS_ENUM_QUERY);
@@ -196,51 +175,26 @@
pk_backend_finished(backend);
}
-gboolean
-backend_get_details_thread(PkBackend *backend)
-{
- gboolean no_error_yet;
- gchar **package_ids;
- guint len;
- guint i;
- struct pkgdb *db;
-
-
- package_ids = pk_backend_get_strv(backend, "package_ids");
- len = g_strv_length(package_ids);
-
- db = NULL;
- no_error_yet = open_remote_db(&db, backend);
- pk_backend_set_percentage(backend, 0);
- for (i = 0; i < len && no_error_yet; i++) {
- no_error_yet = get_details_for(package_ids[0], backend, db);
- pk_backend_set_percentage(backend, ((i * 100) / len));
- }
- pkgdb_close(db);
- pk_backend_finished(backend);
- return no_error_yet;
-}
-
-
-/**
- * pk_backend_get_details:
+/*
+ * Spawns a thread to get the details of the package IDs requested. The
+ * thread code proper is in "get-details.c".
*/
void
-pk_backend_get_details(PkBackend * backend, gchar ** package_ids)
+pk_backend_get_details(PkBackend *backend, gchar **package_ids)
{
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_details_thread);
+ pk_backend_thread_create(backend, get_details_thread);
}
/**
* pk_backend_get_distro_upgrades:
*/
void
-pk_backend_get_distro_upgrades(PkBackend * backend)
+pk_backend_get_distro_upgrades(PkBackend *backend)
{
pk_backend_set_status(backend, PK_STATUS_ENUM_QUERY);
if (!_use_distro_upgrade)
@@ -257,7 +211,7 @@
* pk_backend_get_files:
*/
void
-pk_backend_get_files(PkBackend * backend, gchar ** package_ids)
+pk_backend_get_files(PkBackend *backend, gchar **package_ids)
{
guint i;
guint len;
@@ -284,7 +238,7 @@
* pk_backend_get_requires:
*/
void
-pk_backend_get_requires(PkBackend * backend, PkBitfield filters, gchar ** package_ids, gboolean recursive)
+pk_backend_get_requires(PkBackend *backend, PkBitfield filters, gchar **package_ids, gboolean recursive)
{
pk_backend_set_status(backend, PK_STATUS_ENUM_QUERY);
pk_backend_package(backend, PK_INFO_ENUM_INSTALLED,
@@ -297,13 +251,13 @@
/**
* pk_backend_get_update_detail_timeout:
**/
-static gboolean
+static gboolean
pk_backend_get_update_detail_timeout(gpointer data)
{
guint i;
guint len;
const gchar *package_id;
- PkBackend *backend = (PkBackend *) data;
+ PkBackend *backend = (PkBackend *)data;
const gchar *changelog;
/* dummy */
@@ -384,7 +338,7 @@
* pk_backend_get_update_detail:
*/
void
-pk_backend_get_update_detail(PkBackend * backend, gchar ** package_ids)
+pk_backend_get_update_detail(PkBackend *backend, gchar **package_ids)
{
pk_backend_set_status(backend, PK_STATUS_ENUM_QUERY);
_package_ids = package_ids;
@@ -394,10 +348,10 @@
/**
* pk_backend_get_updates_timeout:
**/
-static gboolean
+static gboolean
pk_backend_get_updates_timeout(gpointer data)
{
- PkBackend *backend = (PkBackend *) data;
+ PkBackend *backend = (PkBackend *)data;
if (_use_blocked) {
if (!_updated_powertop && !_updated_kernel && !_updated_gtkhtml) {
@@ -430,7 +384,7 @@
* pk_backend_get_updates:
*/
void
-pk_backend_get_updates(PkBackend * backend, PkBitfield filters)
+pk_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);
@@ -443,10 +397,10 @@
_signal_timeout = g_timeout_add(1000, pk_backend_get_updates_timeout, backend);
}
-static gboolean
+static gboolean
pk_backend_install_timeout(gpointer data)
{
- PkBackend *backend = (PkBackend *) data;
+ PkBackend *backend = (PkBackend *)data;
guint sub_percent;
if (_progress_percentage == 100) {
@@ -470,7 +424,7 @@
pk_backend_set_status(backend, PK_STATUS_ENUM_INSTALL);
}
if (_progress_percentage > 30 && _progress_percentage < 50) {
- sub_percent = ((gfloat) (_progress_percentage - 30.0f) / 20.0f) * 100.0f;
+ sub_percent = ((gfloat) (_progress_percentage - 30.0) / 20.0) * 100.0;
pk_backend_set_sub_percentage(backend, sub_percent);
} else {
pk_backend_set_sub_percentage(backend, PK_BACKEND_PERCENTAGE_INVALID);
@@ -484,7 +438,7 @@
* pk_backend_install_packages:
*/
void
-pk_backend_install_packages(PkBackend * backend, gboolean only_trusted, gchar ** package_ids)
+pk_backend_install_packages(PkBackend *backend, gboolean only_trusted, gchar **package_ids)
{
const gchar *license_agreement;
const gchar *eula_id;
@@ -560,8 +514,8 @@
* pk_backend_install_signature:
*/
void
-pk_backend_install_signature(PkBackend * backend, PkSigTypeEnum type,
- const gchar * key_id, const gchar * package_id)
+pk_backend_install_signature(PkBackend *backend, PkSigTypeEnum type,
+ const gchar *key_id, const gchar *package_id)
{
pk_backend_set_status(backend, PK_STATUS_ENUM_INSTALL);
if (type == PK_SIGTYPE_ENUM_GPG &&
@@ -580,10 +534,10 @@
/**
* pk_backend_refresh_cache_timeout:
*/
-static gboolean
+static gboolean
pk_backend_install_files_timeout(gpointer data)
{
- PkBackend *backend = (PkBackend *) data;
+ PkBackend *backend = (PkBackend *)data;
pk_backend_finished(backend);
return FALSE;
}
@@ -592,7 +546,7 @@
* pk_backend_install_files:
*/
void
-pk_backend_install_files(PkBackend * backend, gboolean only_trusted, gchar ** full_paths)
+pk_backend_install_files(PkBackend *backend, gboolean only_trusted, gchar **full_paths)
{
pk_backend_set_status(backend, PK_STATUS_ENUM_INSTALL);
pk_backend_set_percentage(backend, 101);
@@ -602,10 +556,10 @@
/**
* pk_backend_refresh_cache_timeout:
*/
-static gboolean
+static gboolean
pk_backend_refresh_cache_timeout(gpointer data)
{
- PkBackend *backend = (PkBackend *) data;
+ PkBackend *backend = (PkBackend *)data;
if (_progress_percentage == 100) {
pk_backend_finished(backend);
return FALSE;
@@ -621,7 +575,7 @@
* pk_backend_refresh_cache:
*/
void
-pk_backend_refresh_cache(PkBackend * backend, gboolean force)
+pk_backend_refresh_cache(PkBackend *backend, gboolean force)
{
_progress_percentage = 0;
@@ -638,10 +592,10 @@
/**
* pk_backend_resolve_timeout:
*/
-static gboolean
+static gboolean
pk_backend_resolve_timeout(gpointer data)
{
- PkBackend *backend = (PkBackend *) data;
+ PkBackend *backend = (PkBackend *)data;
guint i;
guint len;
gchar **packages = _package_ids;
@@ -683,7 +637,7 @@
* pk_backend_resolve:
*/
void
-pk_backend_resolve(PkBackend * backend, PkBitfield filters, gchar ** packages)
+pk_backend_resolve(PkBackend *backend, PkBitfield filters, gchar **packages)
{
_filters = filters;
_package_ids = packages;
@@ -693,10 +647,10 @@
/**
* pk_backend_rollback_timeout:
*/
-static gboolean
+static gboolean
pk_backend_rollback_timeout(gpointer data)
{
- PkBackend *backend = (PkBackend *) data;
+ PkBackend *backend = (PkBackend *)data;
if (_progress_percentage == 0) {
_updated_gtkhtml = FALSE;
_updated_kernel = FALSE;
@@ -719,7 +673,7 @@
* pk_backend_rollback:
*/
void
-pk_backend_rollback(PkBackend * backend, const gchar * transaction_id)
+pk_backend_rollback(PkBackend *backend, const gchar *transaction_id)
{
/* allow testing error condition */
if (g_strcmp0(transaction_id, "/397_eeecadad_data") == 0) {
@@ -738,7 +692,7 @@
* pk_backend_remove_packages:
*/
void
-pk_backend_remove_packages(PkBackend * backend, gchar ** package_ids, gboolean allow_deps, gboolean autoremove)
+pk_backend_remove_packages(PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
pk_backend_set_status(backend, PK_STATUS_ENUM_REMOVE);
pk_backend_error_code(backend, PK_ERROR_ENUM_NO_NETWORK, "No network connection available");
@@ -749,7 +703,7 @@
* pk_backend_search_details:
*/
void
-pk_backend_search_details(PkBackend * backend, PkBitfield filters, gchar ** values)
+pk_backend_search_details(PkBackend *backend, PkBitfield filters, gchar **values)
{
pk_backend_set_status(backend, PK_STATUS_ENUM_QUERY);
pk_backend_set_allow_cancel(backend, TRUE);
@@ -763,7 +717,7 @@
* pk_backend_search_files:
*/
void
-pk_backend_search_files(PkBackend * backend, PkBitfield filters, gchar ** values)
+pk_backend_search_files(PkBackend *backend, PkBitfield filters, gchar **values)
{
pk_backend_set_status(backend, PK_STATUS_ENUM_QUERY);
pk_backend_set_allow_cancel(backend, TRUE);
@@ -782,7 +736,7 @@
* pk_backend_search_groups:
*/
void
-pk_backend_search_groups(PkBackend * backend, PkBitfield filters, gchar ** values)
+pk_backend_search_groups(PkBackend *backend, PkBitfield filters, gchar **values)
{
pk_backend_set_status(backend, PK_STATUS_ENUM_QUERY);
pk_backend_set_allow_cancel(backend, TRUE);
@@ -798,11 +752,11 @@
/**
* pk_backend_search_name_timeout:
**/
-static gboolean
+static gboolean
pk_backend_search_name_timeout(gpointer data)
{
gchar *locale;
- PkBackend *backend = (PkBackend *) data;
+ PkBackend *backend = (PkBackend *)data;
locale = pk_backend_get_locale(backend);
g_debug("locale is %s", locale);
@@ -832,7 +786,7 @@
* pk_backend_search_names:
*/
void
-pk_backend_search_names(PkBackend * backend, PkBitfield filters, gchar ** values)
+pk_backend_search_names(PkBackend *backend, PkBitfield filters, gchar **values)
{
pk_backend_set_percentage(backend, PK_BACKEND_PERCENTAGE_INVALID);
pk_backend_set_allow_cancel(backend, TRUE);
@@ -843,10 +797,10 @@
/**
* pk_backend_update_packages_download_timeout:
**/
-static gboolean
+static gboolean
pk_backend_update_packages_download_timeout(gpointer data)
{
- PkBackend *backend = (PkBackend *) data;
+ PkBackend *backend = (PkBackend *)data;
guint sub;
if (_progress_percentage == 100) {
@@ -925,7 +879,7 @@
* pk_backend_update_packages:
*/
void
-pk_backend_update_packages(PkBackend * backend, gboolean only_trusted, gchar ** package_ids)
+pk_backend_update_packages(PkBackend *backend, gboolean only_trusted, gchar **package_ids)
{
const gchar *eula_id;
const gchar *license_agreement;
@@ -982,10 +936,10 @@
_signal_timeout = g_timeout_add(200, pk_backend_update_packages_download_timeout, backend);
}
-static gboolean
+static gboolean
pk_backend_update_system_timeout(gpointer data)
{
- PkBackend *backend = (PkBackend *) data;
+ PkBackend *backend = (PkBackend *)data;
if (_progress_percentage == 100) {
/* cleanup socket stuff */
@@ -1054,8 +1008,8 @@
/**
* pk_backend_socket_has_data_cb:
**/
-static gboolean
-pk_backend_socket_has_data_cb(GSocket * socket, GIOCondition condition, PkBackend * backend)
+static gboolean
+pk_backend_socket_has_data_cb(GSocket * socket, GIOCondition condition, PkBackend *backend)
{
GError *error = NULL;
gsize len;
@@ -1122,7 +1076,7 @@
* pk_backend_update_system:
*/
void
-pk_backend_update_system(PkBackend * backend, gboolean only_trusted)
+pk_backend_update_system(PkBackend *backend, gboolean only_trusted)
{
gchar *frontend_socket = NULL;
GError *error = NULL;
@@ -1194,7 +1148,7 @@
* pk_backend_get_repo_list:
*/
void
-pk_backend_get_repo_list(PkBackend * backend, PkBitfield filters)
+pk_backend_get_repo_list(PkBackend *backend, PkBitfield filters)
{
pk_backend_set_status(backend, PK_STATUS_ENUM_QUERY);
pk_backend_repo_detail(backend, "fedora",
@@ -1212,7 +1166,7 @@
* pk_backend_repo_enable:
*/
void
-pk_backend_repo_enable(PkBackend * backend, const gchar * rid, gboolean enabled)
+pk_backend_repo_enable(PkBackend *backend, const gchar *rid, gboolean enabled)
{
pk_backend_set_status(backend, PK_STATUS_ENUM_REQUEST);
@@ -1238,7 +1192,7 @@
* pk_backend_repo_set_data:
*/
void
-pk_backend_repo_set_data(PkBackend * backend, const gchar * rid, const gchar * parameter, const gchar * value)
+pk_backend_repo_set_data(PkBackend *backend, const gchar *rid, const gchar *parameter, const gchar *value)
{
pk_backend_set_status(backend, PK_STATUS_ENUM_REQUEST);
g_warning("REPO '%s' PARAMETER '%s' TO '%s'", rid, parameter, value);
@@ -1263,10 +1217,10 @@
/**
* pk_backend_what_provides_timeout:
*/
-static gboolean
+static gboolean
pk_backend_what_provides_timeout(gpointer data)
{
- PkBackend *backend = (PkBackend *) data;
+ PkBackend *backend = (PkBackend *)data;
if (_progress_percentage == 100) {
if (g_strcmp0(_values[0], "gstreamer0.10(decoder-audio/x-wma)(wmaversion=3)") == 0) {
pk_backend_package(backend, PK_INFO_ENUM_AVAILABLE,
@@ -1306,7 +1260,7 @@
* pk_backend_what_provides:
*/
void
-pk_backend_what_provides(PkBackend * backend, PkBitfield filters, PkProvidesEnum provides, gchar ** values)
+pk_backend_what_provides(PkBackend *backend, PkBitfield filters, PkProvidesEnum provides, gchar **values)
{
_progress_percentage = 0;
_values = values;
@@ -1321,7 +1275,7 @@
* pk_backend_get_packages:
*/
void
-pk_backend_get_packages(PkBackend * backend, PkBitfield filters)
+pk_backend_get_packages(PkBackend *backend, PkBitfield filters)
{
pk_backend_set_status(backend, PK_STATUS_ENUM_REQUEST);
pk_backend_package(backend, PK_INFO_ENUM_INSTALLED,
@@ -1334,7 +1288,7 @@
* pk_backend_download_packages:
*/
void
-pk_backend_download_packages(PkBackend * backend, gchar ** package_ids, const gchar * directory)
+pk_backend_download_packages(PkBackend *backend, gchar **package_ids, const gchar *directory)
{
gchar *filename;
@@ -1363,7 +1317,7 @@
* pk_backend_simulate_install_packages:
*/
void
-pk_backend_simulate_install_packages(PkBackend * backend, gchar ** package_ids)
+pk_backend_simulate_install_packages(PkBackend *backend, gchar **package_ids)
{
pk_backend_set_status(backend, PK_STATUS_ENUM_DEP_RESOLVE);
@@ -1395,10 +1349,10 @@
}
-static gboolean
+static gboolean
pk_backend_upgrade_system_timeout(gpointer data)
{
- PkBackend *backend = (PkBackend *) data;
+ PkBackend *backend = (PkBackend *)data;
if (_progress_percentage == 100) {
pk_backend_require_restart(backend, PK_RESTART_ENUM_SYSTEM, "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed");
pk_backend_finished(backend);
@@ -1444,7 +1398,7 @@
* pk_backend_upgrade_system:
*/
void
-pk_backend_upgrade_system(PkBackend * backend, const gchar * distro_id, PkUpgradeKindEnum upgrade_kind)
+pk_backend_upgrade_system(PkBackend *backend, const gchar *distro_id, PkUpgradeKindEnum upgrade_kind)
{
pk_backend_set_status(backend, PK_STATUS_ENUM_DOWNLOAD);
pk_backend_set_allow_cancel(backend, TRUE);
@@ -1456,7 +1410,7 @@
* pk_backend_transaction_start:
*/
void
-pk_backend_transaction_start(PkBackend * backend)
+pk_backend_transaction_start(PkBackend *backend)
{
/* here you would lock the backend */
pk_backend_message(backend, PK_MESSAGE_ENUM_AUTOREMOVE_IGNORED, "backend is crap");
@@ -1468,7 +1422,7 @@
* pk_backend_transaction_stop:
*/
void
-pk_backend_transaction_stop(PkBackend * backend)
+pk_backend_transaction_stop(PkBackend *backend)
{
/* here you would unlock the backend */
pk_backend_message(backend, PK_MESSAGE_ENUM_CONFIG_FILES_CHANGED, "backend is crap");
@@ -1489,7 +1443,7 @@
* pk_backend_get_description:
*/
gchar *
-pk_backend_get_description(PkBackend * backend)
+pk_backend_get_description(PkBackend *backend)
{
return g_strdup("pkgng");
}
@@ -1498,7 +1452,7 @@
* pk_backend_get_author:
*/
gchar *
-pk_backend_get_author(PkBackend * backend)
+pk_backend_get_author(PkBackend *backend)
{
return g_strdup("Matt Windsor <mattbw at FreeBSD.org>");
}
More information about the svn-soc-all
mailing list