socsvn commit: r254261 - in soc2013/mattbw/backend: . actions

mattbw at FreeBSD.org mattbw at FreeBSD.org
Sat Jul 6 22:53:48 UTC 2013


Author: mattbw
Date: Sat Jul  6 22:53:47 2013
New Revision: 254261
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=254261

Log:
  split off high-level querying functions

Added:
  soc2013/mattbw/backend/query_match.c
  soc2013/mattbw/backend/query_match.h
Modified:
  soc2013/mattbw/backend/.indent.pro
  soc2013/mattbw/backend/Makefile
  soc2013/mattbw/backend/actions/actions.h
  soc2013/mattbw/backend/actions/get-details.c
  soc2013/mattbw/backend/actions/get-files.c
  soc2013/mattbw/backend/actions/install-packages.c
  soc2013/mattbw/backend/pk-backend-pkgng.c
  soc2013/mattbw/backend/pkgutils.c
  soc2013/mattbw/backend/query.c
  soc2013/mattbw/backend/query.h

Modified: soc2013/mattbw/backend/.indent.pro
==============================================================================
--- soc2013/mattbw/backend/.indent.pro	Sat Jul  6 21:38:55 2013	(r254260)
+++ soc2013/mattbw/backend/.indent.pro	Sat Jul  6 22:53:47 2013	(r254261)
@@ -1,3 +1,6 @@
 -TPkBackend
 -Tgchar
 -Tgboolean
+-sob
+-nlp
+-ci4

Modified: soc2013/mattbw/backend/Makefile
==============================================================================
--- soc2013/mattbw/backend/Makefile	Sat Jul  6 21:38:55 2013	(r254260)
+++ soc2013/mattbw/backend/Makefile	Sat Jul  6 22:53:47 2013	(r254261)
@@ -9,6 +9,7 @@
 		licenses.c			\
 		pkgutils.c			\
 		query.c				\
+		query_match.c			\
 		utils.c
 SRCS+=						\
 		actions/get-details.c		\

Modified: soc2013/mattbw/backend/actions/actions.h
==============================================================================
--- soc2013/mattbw/backend/actions/actions.h	Sat Jul  6 21:38:55 2013	(r254260)
+++ soc2013/mattbw/backend/actions/actions.h	Sat Jul  6 22:53:47 2013	(r254261)
@@ -32,6 +32,7 @@
 gboolean	get_files_thread(PkBackend *backend);
 gboolean	get_repo_list_thread(PkBackend *backend);
 gboolean	install_packages_thread(PkBackend *backend);
+gboolean	install_files_thread(PkBackend *backend);
 gboolean	simulate_install_packages_thread(PkBackend *backend);
 
 #endif				/* !_PKGNG_BACKEND_ACTIONS_H_ */

Modified: soc2013/mattbw/backend/actions/get-details.c
==============================================================================
--- soc2013/mattbw/backend/actions/get-details.c	Sat Jul  6 21:38:55 2013	(r254260)
+++ soc2013/mattbw/backend/actions/get-details.c	Sat Jul  6 22:53:47 2013	(r254261)
@@ -23,7 +23,7 @@
 #include "pkg.h"
 
 #include "../groups.h"		/* group_from_origin */
-#include "../query.h"		/* Package querying */
+#include "../query_match.h"	/* query_match_... */
 #include "../licenses.h"	/* license_from_pkg */
 
 #include "actions.h"		/* get_details_thread prototype */

Modified: soc2013/mattbw/backend/actions/get-files.c
==============================================================================
--- soc2013/mattbw/backend/actions/get-files.c	Sat Jul  6 21:38:55 2013	(r254260)
+++ soc2013/mattbw/backend/actions/get-files.c	Sat Jul  6 22:53:47 2013	(r254261)
@@ -26,7 +26,7 @@
 
 #include "../groups.h"		/* group_from_origin */
 #include "../hash_traverse.h"	/* HASH_FOR */
-#include "../query.h"		/* Package querying */
+#include "../query_match.h"	/* query_match_... */
 #include "../licenses.h"	/* license_from_pkg */
 
 #include "actions.h"		/* get_files_thread prototype */

Modified: soc2013/mattbw/backend/actions/install-packages.c
==============================================================================
--- soc2013/mattbw/backend/actions/install-packages.c	Sat Jul  6 21:38:55 2013	(r254260)
+++ soc2013/mattbw/backend/actions/install-packages.c	Sat Jul  6 22:53:47 2013	(r254261)
@@ -24,7 +24,7 @@
 
 #include "../hash_traverse.h"	/* HASH_FOR */
 #include "../pkgutils.h"	/* pkgutils_... */
-#include "../query.h"		/* Package querying */
+#include "../query_match.h"	/* query_match_... */
 #include "../utils.h"		/* INTENTIONALLY_IGNORE */
 
 #include "actions.h"		/* install_packages_thread prototype */
@@ -32,7 +32,7 @@
 static gboolean	do_install_packages(struct pkg_jobs *jobs, struct query *q, gboolean simulate);
 static gboolean	do_install_solved_job(struct pkg_jobs *jobs, PkBackend *backend, gboolean simulate);
 static gboolean	do_install_solved_job_real(struct pkg_jobs *jobs, PkBackend *backend);
-static gboolean	job (struct pkg_jobs *jobs, struct query *q);
+static gboolean	job(struct pkg_jobs *jobs, struct query *q);
 static gboolean	sim_job(struct pkg_jobs *jobs, struct query *q);
 static int	install_event_cb(void *backend_v, struct pkg_event *event);
 
@@ -74,12 +74,12 @@
 	pk_backend_set_status(backend, PK_STATUS_ENUM_DEP_RESOLVE);
 	if (pkg_jobs_solve(jobs) != EPKG_OK)
 		pk_backend_error_code(backend,
-				      PK_ERROR_ENUM_DEP_RESOLUTION_FAILED,
-				      "could not solve the job");
+		    PK_ERROR_ENUM_DEP_RESOLUTION_FAILED,
+		    "could not solve the job");
 	else if (pkg_jobs_count(jobs) == 0)
 		pk_backend_error_code(backend,
-				      PK_ERROR_ENUM_INTERNAL_ERROR,
-				      "job contains no packages");
+		    PK_ERROR_ENUM_INTERNAL_ERROR,
+		    "job contains no packages");
 	else
 		success = do_install_solved_job(jobs, backend, simulate);
 
@@ -91,8 +91,8 @@
  */
 static gboolean
 do_install_solved_job(struct pkg_jobs *jobs,
-		      PkBackend *backend,
-		      gboolean simulate)
+    PkBackend *backend,
+    gboolean simulate)
 {
 	gboolean	success;
 	struct pkg     *pkg;
@@ -101,8 +101,8 @@
 	pkg = NULL;
 	while (pkg_jobs(jobs, &pkg) == EPKG_OK)
 		pkgutils_emit(pkg,
-			      backend,
-			      pkgutils_pkg_install_state(pkg));
+		    backend,
+		    pkgutils_pkg_install_state(pkg));
 
 	if (simulate == FALSE)
 		success = do_install_solved_job_real(jobs, backend);
@@ -127,8 +127,8 @@
 		success = TRUE;
 	else
 		pk_backend_error_code(backend,
-				    PK_ERROR_ENUM_PACKAGE_FAILED_TO_INSTALL,
-				      "job failed");
+		    PK_ERROR_ENUM_PACKAGE_FAILED_TO_INSTALL,
+		    "job failed");
 
 	pkg_event_register(NULL, NULL);
 
@@ -169,48 +169,48 @@
 	switch (event->type) {
 	case PKG_EVENT_INSTALL_BEGIN:
 		pkgutils_emit(event->e_install_begin.pkg,
-			      backend,
-			      PK_INFO_ENUM_INSTALLING);
+		    backend,
+		    PK_INFO_ENUM_INSTALLING);
 		break;
 	case PKG_EVENT_INSTALL_FINISHED:
 		pkgutils_emit(event->e_install_finished.pkg,
-			      backend,
-			      PK_INFO_ENUM_FINISHED);
+		    backend,
+		    PK_INFO_ENUM_FINISHED);
 		break;
 	case PKG_EVENT_DEINSTALL_BEGIN:
 		pkgutils_emit(event->e_deinstall_begin.pkg,
-			      backend,
-			      PK_INFO_ENUM_REMOVING);
+		    backend,
+		    PK_INFO_ENUM_REMOVING);
 		break;
 	case PKG_EVENT_DEINSTALL_FINISHED:
 		pkgutils_emit(event->e_deinstall_finished.pkg,
-			      backend,
-			      PK_INFO_ENUM_FINISHED);
+		    backend,
+		    PK_INFO_ENUM_FINISHED);
 		break;
 	case PKG_EVENT_UPGRADE_BEGIN:
 		pkgutils_emit(event->e_upgrade_begin.pkg,
-			      backend,
-			      PK_INFO_ENUM_UPDATING);
+		    backend,
+		    PK_INFO_ENUM_UPDATING);
 		break;
 	case PKG_EVENT_UPGRADE_FINISHED:
 		pkgutils_emit(event->e_upgrade_finished.pkg,
-			      backend,
-			      PK_INFO_ENUM_FINISHED);
+		    backend,
+		    PK_INFO_ENUM_FINISHED);
 		break;
 	case PKG_EVENT_ERROR:
 		pk_backend_error_code(backend,
-				    PK_ERROR_ENUM_PACKAGE_FAILED_TO_INSTALL,
-				      event->e_pkg_error.msg);
+		    PK_ERROR_ENUM_PACKAGE_FAILED_TO_INSTALL,
+		    event->e_pkg_error.msg);
 		break;
 	case PKG_EVENT_FILE_MISMATCH:
 		pk_backend_error_code(backend,
-				      PK_ERROR_ENUM_PACKAGE_CORRUPT,
-				pkg_file_path(event->e_file_mismatch.file));
+		    PK_ERROR_ENUM_PACKAGE_CORRUPT,
+		    pkg_file_path(event->e_file_mismatch.file));
 		break;
 	case PKG_EVENT_NOT_FOUND:
 		pk_backend_error_code(backend,
-				      PK_ERROR_ENUM_PACKAGE_DOWNLOAD_FAILED,
-				      event->e_not_found.pkg_name);
+		    PK_ERROR_ENUM_PACKAGE_DOWNLOAD_FAILED,
+		    event->e_not_found.pkg_name);
 	default:
 		/* Do nothing for unrecognised events */
 		break;
@@ -218,5 +218,3 @@
 
 	return EPKG_OK;
 }
-
-

Modified: soc2013/mattbw/backend/pk-backend-pkgng.c
==============================================================================
--- soc2013/mattbw/backend/pk-backend-pkgng.c	Sat Jul  6 21:38:55 2013	(r254260)
+++ soc2013/mattbw/backend/pk-backend-pkgng.c	Sat Jul  6 22:53:47 2013	(r254261)
@@ -65,9 +65,9 @@
 	if (!pkg_initialized())
 		err = pkg_init(NULL);
 	if (err)
-		pk_backend_error_code(backend,
-				      PK_ERROR_ENUM_INTERNAL_ERROR,
-				      "could not initialise pkg");
+		(void)pk_backend_error_code(backend,
+		    PK_ERROR_ENUM_INTERNAL_ERROR,
+		    "could not initialise pkg");
 }
 
 /**
@@ -76,6 +76,7 @@
 void
 pk_backend_destroy(PkBackend *backend)
 {
+
 	INTENTIONALLY_IGNORE(backend);
 	pkg_shutdown();
 }
@@ -88,6 +89,7 @@
 PkBitfield
 pk_backend_get_groups(PkBackend *backend)
 {
+
 	INTENTIONALLY_IGNORE(backend);
 	return available_groups();
 }
@@ -98,11 +100,12 @@
 PkBitfield
 pk_backend_get_filters(PkBackend *backend)
 {
+
 	INTENTIONALLY_IGNORE(backend);
 	return pk_bitfield_from_enums(PK_FILTER_ENUM_GUI,
-				      PK_FILTER_ENUM_INSTALLED,
-				      PK_FILTER_ENUM_DEVELOPMENT,
-				      -1);
+	    PK_FILTER_ENUM_INSTALLED,
+	    PK_FILTER_ENUM_DEVELOPMENT,
+	    -1);
 }
 
 /**
@@ -111,6 +114,7 @@
 gchar          *
 pk_backend_get_mime_types(PkBackend *backend)
 {
+
 	INTENTIONALLY_IGNORE(backend);
 	return g_strdup("application/x-rpm;application/x-deb");
 }
@@ -134,12 +138,12 @@
 
 	if (g_strcmp0(package_ids[0], "scribus;1.3.4-1.fc8;i386;fedora") == 0) {
 		pk_backend_package(backend, PK_INFO_ENUM_AVAILABLE,
-				   "scribus-clipart;1.3.4-1.fc8;i386;fedora", "Clipart for scribus");
+		    "scribus-clipart;1.3.4-1.fc8;i386;fedora", "Clipart for scribus");
 	} else {
 		pk_backend_package(backend, PK_INFO_ENUM_INSTALLED,
-			    "glib2;2.14.0;i386;fedora", "The GLib library");
+		    "glib2;2.14.0;i386;fedora", "The GLib library");
 		pk_backend_package(backend, PK_INFO_ENUM_AVAILABLE,
-				   "gtk2;gtk2-2.11.6-6.fc8;i386;fedora", "GTK+ Libraries for GIMP");
+		    "gtk2;gtk2-2.11.6-6.fc8;i386;fedora", "GTK+ Libraries for GIMP");
 	}
 	pk_backend_finished(backend);
 }
@@ -170,9 +174,9 @@
 	if (!_use_distro_upgrade)
 		goto out;
 	pk_backend_distro_upgrade(backend, PK_DISTRO_UPGRADE_ENUM_STABLE,
-				  "fedora-9", "Fedora 9");
+	    "fedora-9", "Fedora 9");
 	pk_backend_distro_upgrade(backend, PK_DISTRO_UPGRADE_ENUM_UNSTABLE,
-				  "fedora-10-rc1", "Fedora 10 RC1");
+	    "fedora-10-rc1", "Fedora 10 RC1");
 out:
 	pk_backend_finished(backend);
 }
@@ -204,9 +208,9 @@
 
 	pk_backend_set_status(backend, PK_STATUS_ENUM_QUERY);
 	pk_backend_package(backend, PK_INFO_ENUM_INSTALLED,
-			   "glib2;2.14.0;i386;fedora", "The GLib library");
+	    "glib2;2.14.0;i386;fedora", "The GLib library");
 	pk_backend_package(backend, PK_INFO_ENUM_INSTALLED,
-	   "gtk2;gtk2-2.11.6-6.fc8;i386;fedora", "GTK+ Libraries for GIMP");
+	    "gtk2;gtk2-2.11.6-6.fc8;i386;fedora", "GTK+ Libraries for GIMP");
 	pk_backend_finished(backend);
 }
 
@@ -224,22 +228,22 @@
 
 	/* dummy */
 	changelog = "**Thu Mar 12 2009** Adam Jackson <ajax at redhat.com> 1.6.0-13\n"
-		"- xselinux-1.6.0-selinux-nlfd.patch: Acquire the netlink socket from selinux,\n"
-		"  check it ourselves rather than having libselinux bang on it all the time.\n"
-		"\n"
-		"**Wed Mar 11 2009** Adam Jackson <ajax at redhat.com> 1.6.0-10\n"
-		"- xserver-1.6.0-selinux-less.patch: Don't init selinux unless the policy\n"
-		"  says to be an object manager.\n"
-		"\n"
-		"**Wed Mar 11 2009** Adam Jackson <ajax at redhat.com> 1.6.0-11\n"
-		"- xserver-1.6.0-less-acpi-brokenness.patch: Don't build the (broken)\n"
-		"  ACPI code.\n"
-		"\n"
-		"**Wed Mar 11 2009** Adam Jackson <ajax at redhat.com> 1.6.0-12\n"
-		"- Requires: pixman >= 0.14.0\n"
-		"\n"
-		"**Fri Mar  6 2009** Adam Jackson <ajax at redhat.com> 1.6.0-8\n"
-		"- xserver-1.6.0-primary.patch: Really, only look at VGA devices. (#488869)\n";
+	    "- xselinux-1.6.0-selinux-nlfd.patch: Acquire the netlink socket from selinux,\n"
+	    "  check it ourselves rather than having libselinux bang on it all the time.\n"
+	    "\n"
+	    "**Wed Mar 11 2009** Adam Jackson <ajax at redhat.com> 1.6.0-10\n"
+	    "- xserver-1.6.0-selinux-less.patch: Don't init selinux unless the policy\n"
+	    "  says to be an object manager.\n"
+	    "\n"
+	    "**Wed Mar 11 2009** Adam Jackson <ajax at redhat.com> 1.6.0-11\n"
+	    "- xserver-1.6.0-less-acpi-brokenness.patch: Don't build the (broken)\n"
+	    "  ACPI code.\n"
+	    "\n"
+	    "**Wed Mar 11 2009** Adam Jackson <ajax at redhat.com> 1.6.0-12\n"
+	    "- Requires: pixman >= 0.14.0\n"
+	    "\n"
+	    "**Fri Mar  6 2009** Adam Jackson <ajax at redhat.com> 1.6.0-8\n"
+	    "- xserver-1.6.0-primary.patch: Really, only look at VGA devices. (#488869)\n";
 
 	/* each one has a different detail for testing */
 	pk_backend_set_percentage(backend, 0);
@@ -248,43 +252,43 @@
 		package_id = _package_ids[i];
 		if (g_strcmp0(package_id, "powertop;1.8-1.fc8;i386;fedora") == 0) {
 			pk_backend_update_detail(backend, package_id,
-				    "powertop;1.7-1.fc8;i386;installed", "",
-						 "http://www.distro-update.org/page?moo;Bugfix release for powertop",
-						 "http://bgzilla.fd.org/result.php?#12344;Freedesktop Bugzilla #12344",
-						 "", PK_RESTART_ENUM_NONE, "Update to newest upstream source",
-						 changelog, PK_UPDATE_STATE_ENUM_STABLE, "2009-11-17T09:19:00", "2009-11-19T09:19:00");
+			    "powertop;1.7-1.fc8;i386;installed", "",
+			    "http://www.distro-update.org/page?moo;Bugfix release for powertop",
+			    "http://bgzilla.fd.org/result.php?#12344;Freedesktop Bugzilla #12344",
+			    "", PK_RESTART_ENUM_NONE, "Update to newest upstream source",
+			    changelog, PK_UPDATE_STATE_ENUM_STABLE, "2009-11-17T09:19:00", "2009-11-19T09:19:00");
 		} else if (g_strcmp0(package_id, "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed") == 0) {
 			pk_backend_update_detail(backend, package_id,
-			   "kernel;2.6.22-0.104.rc3.git6.fc8;i386;installed"
-						 PK_PACKAGE_IDS_DELIM
-						 "kernel;2.6.22-0.105.rc3.git7.fc8;i386;installed", "",
-						 "http://www.distro-update.org/page?moo;Bugfix release for kernel",
-						 "http://bgzilla.fd.org/result.php?#12344;Freedesktop Bugzilla #12344;"
-						 "http://bgzilla.gnome.org/result.php?#9876;GNOME Bugzilla #9876",
-						 "http://nvd.nist.gov/nvd.cfm?cvename=CVE-2007-3381;CVE-2007-3381",
-						 PK_RESTART_ENUM_SYSTEM,
-				      "Update to newest upstream version.\n"
-						 "* This should fix many driver bugs when using nouveau\n"
-						 " * This also introduces the new `frobnicator` driver for *vibrating* rabbit hardware.",
-						 changelog, PK_UPDATE_STATE_ENUM_UNSTABLE, "2008-06-28T09:19:00", NULL);
+			    "kernel;2.6.22-0.104.rc3.git6.fc8;i386;installed"
+			    PK_PACKAGE_IDS_DELIM
+			    "kernel;2.6.22-0.105.rc3.git7.fc8;i386;installed", "",
+			    "http://www.distro-update.org/page?moo;Bugfix release for kernel",
+			    "http://bgzilla.fd.org/result.php?#12344;Freedesktop Bugzilla #12344;"
+			    "http://bgzilla.gnome.org/result.php?#9876;GNOME Bugzilla #9876",
+			    "http://nvd.nist.gov/nvd.cfm?cvename=CVE-2007-3381;CVE-2007-3381",
+			    PK_RESTART_ENUM_SYSTEM,
+			    "Update to newest upstream version.\n"
+			    "* This should fix many driver bugs when using nouveau\n"
+			    " * This also introduces the new `frobnicator` driver for *vibrating* rabbit hardware.",
+			    changelog, PK_UPDATE_STATE_ENUM_UNSTABLE, "2008-06-28T09:19:00", NULL);
 		} else if (g_strcmp0(package_id, "gtkhtml2;2.19.1-4.fc8;i386;fedora") == 0) {
 			pk_backend_update_detail(backend, package_id,
-				"gtkhtml2;2.18.1-22.fc8;i386;installed", "",
-						 "http://www.distro-update.org/page?moo;Bugfix release for gtkhtml",
-						 "http://bgzilla.gnome.org/result.php?#9876;GNOME Bugzilla #9876",
-					      NULL, PK_RESTART_ENUM_SESSION,
-			       "Update to latest *whizz* **bang** version\n"
-						 "* support this new thing\n"
-						 "* something else\n"
-						 "- and that new thing",
-						 changelog, PK_UPDATE_STATE_ENUM_UNKNOWN, "2008-07-25T09:19:00", NULL);
+			    "gtkhtml2;2.18.1-22.fc8;i386;installed", "",
+			    "http://www.distro-update.org/page?moo;Bugfix release for gtkhtml",
+			    "http://bgzilla.gnome.org/result.php?#9876;GNOME Bugzilla #9876",
+			    NULL, PK_RESTART_ENUM_SESSION,
+			    "Update to latest *whizz* **bang** version\n"
+			    "* support this new thing\n"
+			    "* something else\n"
+			    "- and that new thing",
+			    changelog, PK_UPDATE_STATE_ENUM_UNKNOWN, "2008-07-25T09:19:00", NULL);
 
 		} else if (g_strcmp0(package_id, "vino;2.24.2.fc9;i386;fedora") == 0) {
 			pk_backend_update_detail(backend, package_id,
-					  "vino;2.24.1.fc9;i386;fedora", "",
-					 "", "", NULL, PK_RESTART_ENUM_NONE,
-						 "Cannot get update as update conflics with vncviewer",
-						 changelog, PK_UPDATE_STATE_ENUM_UNKNOWN, "2008-07-25", NULL);
+			    "vino;2.24.1.fc9;i386;fedora", "",
+			    "", "", NULL, PK_RESTART_ENUM_NONE,
+			    "Cannot get update as update conflics with vncviewer",
+			    changelog, PK_UPDATE_STATE_ENUM_UNKNOWN, "2008-07-25", NULL);
 		} else {
 			/* signal to UI */
 			pk_backend_error_code(backend, PK_ERROR_ENUM_INTERNAL_ERROR, "the package update detail was not found for %s", package_id);
@@ -317,18 +321,18 @@
 
 	if (!_updated_powertop) {
 		pk_backend_package(backend, PK_INFO_ENUM_NORMAL,
-				   "powertop;1.8-1.fc8;i386;fedora",
-				   "Power consumption monitor");
+		    "powertop;1.8-1.fc8;i386;fedora",
+		    "Power consumption monitor");
 	}
 	if (!_updated_kernel) {
 		pk_backend_package(backend, PK_INFO_ENUM_BUGFIX,
-			  "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
-		"The Linux kernel (the core of the Linux operating system)");
+		    "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
+		    "The Linux kernel (the core of the Linux operating system)");
 	}
 	if (!_updated_gtkhtml) {
 		pk_backend_package(backend, PK_INFO_ENUM_SECURITY,
-				   "gtkhtml2;2.19.1-4.fc8;i386;fedora",
-				   "An HTML widget for GTK+ 2.0");
+		    "gtkhtml2;2.19.1-4.fc8;i386;fedora",
+		    "An HTML widget for GTK+ 2.0");
 	}
 	pk_backend_finished(backend);
 	_signal_timeout = 0;
@@ -374,7 +378,7 @@
  */
 void
 pk_backend_install_signature(PkBackend *backend, PkSigTypeEnum type,
-			     const gchar *key_id, const gchar *package_id)
+    const gchar *key_id, const gchar *package_id)
 {
 	pk_backend_set_status(backend, PK_STATUS_ENUM_INSTALL);
 	if (type == PK_SIGTYPE_ENUM_GPG &&
@@ -384,8 +388,8 @@
 		_has_signature = TRUE;
 	} else {
 		pk_backend_error_code(backend, PK_ERROR_ENUM_GPG_FAILURE,
-			      "GPG key %s not recognised for package_id %s",
-				      key_id, package_id);
+		    "GPG key %s not recognised for package_id %s",
+		    key_id, package_id);
 	}
 	pk_backend_finished(backend);
 }
@@ -473,22 +477,22 @@
 		if (g_strcmp0(packages[i], "vips-doc") == 0 || g_strcmp0(packages[i], "vips-doc;7.12.4-2.fc8;noarch;linva") == 0) {
 			if (!pk_bitfield_contain(_filters, PK_FILTER_ENUM_INSTALLED)) {
 				pk_backend_package(backend, PK_INFO_ENUM_AVAILABLE,
-						   "vips-doc;7.12.4-2.fc8;noarch;linva", "The vips documentation package.");
+				    "vips-doc;7.12.4-2.fc8;noarch;linva", "The vips documentation package.");
 			}
 		} else if (g_strcmp0(packages[i], "glib2") == 0 || g_strcmp0(packages[i], "glib2;2.14.0;i386;fedora") == 0) {
 			if (!pk_bitfield_contain(_filters, PK_FILTER_ENUM_NOT_INSTALLED)) {
 				pk_backend_package(backend, PK_INFO_ENUM_INSTALLED,
-						   "glib2;2.14.0;i386;fedora", "The GLib library");
+				    "glib2;2.14.0;i386;fedora", "The GLib library");
 			}
 		} else if (g_strcmp0(packages[i], "powertop") == 0 || g_strcmp0(packages[i], "powertop;1.8-1.fc8;i386;fedora") == 0)
 			pk_backend_package(backend, PK_INFO_ENUM_INSTALLED,
-					   "powertop;1.8-1.fc8;i386;fedora", "Power consumption monitor");
+			    "powertop;1.8-1.fc8;i386;fedora", "Power consumption monitor");
 		else if (g_strcmp0(packages[i], "kernel") == 0 || g_strcmp0(packages[i], "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed") == 0)
 			pk_backend_package(backend, PK_INFO_ENUM_INSTALLED,
-					   "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed", "The Linux kernel (the core of the Linux operating system)");
+			    "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed", "The Linux kernel (the core of the Linux operating system)");
 		else if (g_strcmp0(packages[i], "gtkhtml2") == 0 || g_strcmp0(packages[i], "gtkhtml2;2.19.1-4.fc8;i386;fedora") == 0)
 			pk_backend_package(backend, PK_INFO_ENUM_INSTALLED,
-					   "gtkhtml2;2.19.1-4.fc8;i386;fedora", "An HTML widget for GTK+ 2.0");
+			    "gtkhtml2;2.19.1-4.fc8;i386;fedora", "An HTML widget for GTK+ 2.0");
 	}
 	pk_backend_set_percentage(backend, 100);
 	pk_backend_finished(backend);
@@ -579,8 +583,8 @@
 	pk_backend_set_status(backend, PK_STATUS_ENUM_QUERY);
 	pk_backend_set_allow_cancel(backend, TRUE);
 	pk_backend_package(backend, PK_INFO_ENUM_AVAILABLE,
-			   "vips-doc;7.12.4-2.fc8;noarch;linva",
-			   "The vips \"documentation\" package.");
+	    "vips-doc;7.12.4-2.fc8;noarch;linva",
+	    "The vips \"documentation\" package.");
 	pk_backend_finished(backend);
 }
 
@@ -596,12 +600,12 @@
 	pk_backend_set_allow_cancel(backend, TRUE);
 	if (!pk_bitfield_contain(filters, PK_FILTER_ENUM_INSTALLED))
 		pk_backend_package(backend, PK_INFO_ENUM_AVAILABLE,
-				   "vips-doc;7.12.4-2.fc8;noarch;linva",
-				   "The vips documentation package");
+		    "vips-doc;7.12.4-2.fc8;noarch;linva",
+		    "The vips documentation package");
 	else
 		pk_backend_package(backend, PK_INFO_ENUM_INSTALLED,
-				   "vips-doc;7.12.4-2.fc8;noarch;linva",
-				   "The vips documentation package");
+		    "vips-doc;7.12.4-2.fc8;noarch;linva",
+		    "The vips documentation package");
 	pk_backend_finished(backend);
 }
 
@@ -617,11 +621,11 @@
 	pk_backend_set_status(backend, PK_STATUS_ENUM_QUERY);
 	pk_backend_set_allow_cancel(backend, TRUE);
 	pk_backend_package(backend, PK_INFO_ENUM_AVAILABLE,
-			   "vips-doc;7.12.4-2.fc8;noarch;linva",
-			   "The vips documentation package.");
+	    "vips-doc;7.12.4-2.fc8;noarch;linva",
+	    "The vips documentation package.");
 	pk_backend_package(backend, PK_INFO_ENUM_AVAILABLE,
-			   "bǣwulf-utf8;0.1;noarch;hughsie",
-			   "The bǣwulf server test name.");
+	    "bǣwulf-utf8;0.1;noarch;hughsie",
+	    "The bǣwulf server test name.");
 	pk_backend_finished(backend);
 }
 
@@ -638,22 +642,22 @@
 	g_debug("locale is %s", locale);
 	if (g_strcmp0(locale, "en_GB.utf8") != 0) {
 		pk_backend_package(backend, PK_INFO_ENUM_INSTALLED,
-				   "evince;0.9.3-5.fc8;i386;installed",
-				   "PDF Dokument Ƥrŏgrȃɱ");
+		    "evince;0.9.3-5.fc8;i386;installed",
+		    "PDF Dokument Ƥrŏgrȃɱ");
 	} else {
 		pk_backend_package(backend, PK_INFO_ENUM_INSTALLED,
-				   "evince;0.9.3-5.fc8;i386;installed",
-				   "PDF Document viewer");
+		    "evince;0.9.3-5.fc8;i386;installed",
+		    "PDF Document viewer");
 	}
 	pk_backend_package(backend, PK_INFO_ENUM_INSTALLED,
-			   "tetex;3.0-41.fc8;i386;fedora",
+	    "tetex;3.0-41.fc8;i386;fedora",
 	    "TeTeX is an implementation of TeX for Linux or UNIX systems.");
 	pk_backend_package(backend, PK_INFO_ENUM_AVAILABLE,
-			   "scribus;1.3.4-1.fc8;i386;fedora",
-		   "Scribus is an desktop open source page layout program");
+	    "scribus;1.3.4-1.fc8;i386;fedora",
+	    "Scribus is an desktop open source page layout program");
 	pk_backend_package(backend, PK_INFO_ENUM_AVAILABLE,
-			   "vips-doc;7.12.4-2.fc8;noarch;linva",
-			   "The vips documentation package.");
+	    "vips-doc;7.12.4-2.fc8;noarch;linva",
+	    "The vips documentation package.");
 	pk_backend_finished(backend);
 	return FALSE;
 }
@@ -688,15 +692,15 @@
 	}
 	if (_progress_percentage == 0 && !_updated_powertop) {
 		pk_backend_package(backend, PK_INFO_ENUM_DOWNLOADING,
-				   "powertop;1.8-1.fc8;i386;fedora",
-				   "Power consumption monitor");
+		    "powertop;1.8-1.fc8;i386;fedora",
+		    "Power consumption monitor");
 		pk_backend_set_sub_percentage(backend, 0);
 	}
 	if (_progress_percentage == 20 && !_updated_kernel) {
 		pk_backend_set_sub_percentage(backend, 100);
 		pk_backend_package(backend, PK_INFO_ENUM_DOWNLOADING,
-			  "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
-		"The Linux kernel (the core of the Linux operating system)");
+		    "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
+		    "The Linux kernel (the core of the Linux operating system)");
 		pk_backend_set_sub_percentage(backend, 0);
 		pk_backend_require_restart(backend, PK_RESTART_ENUM_SYSTEM, "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed");
 	}
@@ -708,8 +712,8 @@
 		pk_backend_message(backend, PK_MESSAGE_ENUM_BROKEN_MIRROR, "fedora-updates-testing-source metadata is invalid");
 		pk_backend_set_sub_percentage(backend, 100);
 		pk_backend_package(backend, PK_INFO_ENUM_INSTALLING,
-				   "gtkhtml2;2.19.1-4.fc8;i386;fedora",
-				   "An HTML widget for GTK+ 2.0");
+		    "gtkhtml2;2.19.1-4.fc8;i386;fedora",
+		    "An HTML widget for GTK+ 2.0");
 		_updated_gtkhtml = TRUE;
 		pk_backend_set_sub_percentage(backend, 0);
 	}
@@ -718,24 +722,24 @@
 		pk_backend_set_allow_cancel(backend, FALSE);
 		pk_backend_set_sub_percentage(backend, 100);
 		pk_backend_package(backend, PK_INFO_ENUM_INSTALLING,
-				   "powertop;1.8-1.fc8;i386;fedora",
-				   "Power consumption monitor");
+		    "powertop;1.8-1.fc8;i386;fedora",
+		    "Power consumption monitor");
 		_updated_powertop = TRUE;
 		pk_backend_set_sub_percentage(backend, 0);
 	}
 	if (_progress_percentage == 60 && !_updated_kernel) {
 		pk_backend_set_sub_percentage(backend, 100);
 		pk_backend_package(backend, PK_INFO_ENUM_UPDATING,
-			  "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
-		"The Linux kernel (the core of the Linux operating system)");
+		    "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
+		    "The Linux kernel (the core of the Linux operating system)");
 		_updated_kernel = TRUE;
 		pk_backend_set_sub_percentage(backend, 0);
 	}
 	if (_progress_percentage == 80 && !_updated_kernel) {
 		pk_backend_set_sub_percentage(backend, 100);
 		pk_backend_package(backend, PK_INFO_ENUM_CLEANUP,
-			  "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
-		"The Linux kernel (the core of the Linux operating system)");
+		    "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
+		    "The Linux kernel (the core of the Linux operating system)");
 		pk_backend_set_sub_percentage(backend, 0);
 	}
 	_progress_percentage += 1;
@@ -761,13 +765,13 @@
 
 	if (_use_gpg && !_has_signature) {
 		pk_backend_repo_signature_required(backend, package_ids[0], "updates",
-						"http://example.com/gpgkey",
-				     "Test Key (Fedora) fedora at example.com",
-						   "BB7576AC",
-			"D8CC 06C2 77EC 9C53 372F C199 B1EE 1799 F24F 1B08",
-					 "2007-10-04", PK_SIGTYPE_ENUM_GPG);
+		    "http://example.com/gpgkey",
+		    "Test Key (Fedora) fedora at example.com",
+		    "BB7576AC",
+		    "D8CC 06C2 77EC 9C53 372F C199 B1EE 1799 F24F 1B08",
+		    "2007-10-04", PK_SIGTYPE_ENUM_GPG);
 		pk_backend_error_code(backend, PK_ERROR_ENUM_GPG_FAILURE,
-				"GPG signed package could not be verified");
+		    "GPG signed package could not be verified");
 		pk_backend_finished(backend);
 		return;
 	}
@@ -775,27 +779,27 @@
 	has_eula = pk_backend_is_eula_valid(backend, eula_id);
 	if (_use_eula && !has_eula) {
 		license_agreement = "Narrator: In A.D. 2101, war was beginning.\n"
-			"Captain: What happen ?\n"
-			"Mechanic: Somebody set up us the bomb.\n\n"
-			"Operator: We get signal.\n"
-			"Captain: What !\n"
-			"Operator: Main screen turn on.\n"
-			"Captain: It's you !!\n"
-			"CATS: How are you gentlemen !!\n"
-			"CATS: All your base are belong to us.\n"
-			"CATS: You are on the way to destruction.\n\n"
-			"Captain: What you say !!\n"
-			"CATS: You have no chance to survive make your time.\n"
-			"CATS: Ha Ha Ha Ha ....\n\n"
-			"Operator: Captain!! *\n"
-			"Captain: Take off every 'ZIG' !!\n"
-			"Captain: You know what you doing.\n"
-			"Captain: Move 'ZIG'.\n"
-			"Captain: For great justice.\n";
+		    "Captain: What happen ?\n"
+		    "Mechanic: Somebody set up us the bomb.\n\n"
+		    "Operator: We get signal.\n"
+		    "Captain: What !\n"
+		    "Operator: Main screen turn on.\n"
+		    "Captain: It's you !!\n"
+		    "CATS: How are you gentlemen !!\n"
+		    "CATS: All your base are belong to us.\n"
+		    "CATS: You are on the way to destruction.\n\n"
+		    "Captain: What you say !!\n"
+		    "CATS: You have no chance to survive make your time.\n"
+		    "CATS: Ha Ha Ha Ha ....\n\n"
+		    "Operator: Captain!! *\n"
+		    "Captain: Take off every 'ZIG' !!\n"
+		    "Captain: You know what you doing.\n"
+		    "Captain: Move 'ZIG'.\n"
+		    "Captain: For great justice.\n";
 		pk_backend_eula_required(backend, eula_id, package_ids[0],
-					 "CATS Inc.", license_agreement);
+		    "CATS Inc.", license_agreement);
 		pk_backend_error_code(backend, PK_ERROR_ENUM_NO_LICENSE_AGREEMENT,
-				 "licence not installed so cannot install");
+		    "licence not installed so cannot install");
 		pk_backend_finished(backend);
 		return;
 	}
@@ -825,13 +829,13 @@
 	}
 	if (_progress_percentage == 0 && !_updated_powertop) {
 		pk_backend_package(backend, PK_INFO_ENUM_DOWNLOADING,
-				   "powertop;1.8-1.fc8;i386;fedora",
-				   "Power consumption monitor");
+		    "powertop;1.8-1.fc8;i386;fedora",
+		    "Power consumption monitor");
 	}
 	if (_progress_percentage == 20 && !_updated_kernel) {
 		pk_backend_package(backend, PK_INFO_ENUM_DOWNLOADING,
-			  "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
-		"The Linux kernel (the core of the Linux operating system)");
+		    "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
+		    "The Linux kernel (the core of the Linux operating system)");
 	}
 	if (_progress_percentage == 30 && !_updated_gtkhtml) {
 		pk_backend_message(backend, PK_MESSAGE_ENUM_NEWER_PACKAGE_EXISTS, "A newer package preupgrade is available in fedora-updates-testing");
@@ -840,28 +844,28 @@
 		pk_backend_message(backend, PK_MESSAGE_ENUM_BROKEN_MIRROR, "fedora-updates-testing-debuginfo metadata is invalid");
 		pk_backend_message(backend, PK_MESSAGE_ENUM_BROKEN_MIRROR, "fedora-updates-testing-source metadata is invalid");
 		pk_backend_package(backend, PK_INFO_ENUM_INSTALLING,
-				   "gtkhtml2;2.19.1-4.fc8;i386;fedora",
-				   "An HTML widget for GTK+ 2.0");
+		    "gtkhtml2;2.19.1-4.fc8;i386;fedora",
+		    "An HTML widget for GTK+ 2.0");
 		_updated_gtkhtml = TRUE;
 	}
 	if (_progress_percentage == 40 && !_updated_powertop) {
 		pk_backend_set_status(backend, PK_STATUS_ENUM_UPDATE);
 		pk_backend_set_allow_cancel(backend, FALSE);
 		pk_backend_package(backend, PK_INFO_ENUM_INSTALLING,
-				   "powertop;1.8-1.fc8;i386;fedora",
-				   "Power consumption monitor");
+		    "powertop;1.8-1.fc8;i386;fedora",
+		    "Power consumption monitor");
 		_updated_powertop = TRUE;
 	}
 	if (_progress_percentage == 60 && !_updated_kernel) {
 		pk_backend_package(backend, PK_INFO_ENUM_UPDATING,
-			  "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
-		"The Linux kernel (the core of the Linux operating system)");
+		    "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
+		    "The Linux kernel (the core of the Linux operating system)");
 		_updated_kernel = TRUE;
 	}
 	if (_progress_percentage == 80 && !_updated_kernel) {
 		pk_backend_package(backend, PK_INFO_ENUM_CLEANUP,
-			  "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
-		"The Linux kernel (the core of the Linux operating system)");
+		    "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
+		    "The Linux kernel (the core of the Linux operating system)");
 	}
 	_progress_percentage += 1;
 	pk_backend_set_percentage(backend, _progress_percentage);
@@ -885,7 +889,7 @@
 	/* the helper process exited */
 	if ((condition & G_IO_HUP) > 0) {
 		pk_backend_error_code(backend, PK_ERROR_ENUM_INTERNAL_ERROR,
-				      "socket was disconnected");
+		    "socket was disconnected");
 		pk_backend_finished(backend);
 		ret = FALSE;
 		goto out;
@@ -895,7 +899,7 @@
 		len = g_socket_receive(socket, buffer, 1024, NULL, &error);
 		if (error != NULL) {
 			pk_backend_error_code(backend, PK_ERROR_ENUM_INTERNAL_ERROR,
-				      "failed to read: %s", error->message);
+			    "failed to read: %s", error->message);
 			pk_backend_finished(backend);
 			g_error_free(error);
 			ret = FALSE;
@@ -912,14 +916,14 @@
 			wrote = g_socket_send(_socket, "invalid\n", 8, NULL, &error);
 			if (error != NULL) {
 				pk_backend_error_code(backend, PK_ERROR_ENUM_INTERNAL_ERROR,
-						      "failed to write to socket: %s", error->message);
+				    "failed to write to socket: %s", error->message);
 				pk_backend_finished(backend);
 				g_error_free(error);
 				goto out;
 			}
 			if (wrote != 8) {
 				pk_backend_error_code(backend, PK_ERROR_ENUM_INTERNAL_ERROR,
-				   "failed to write, only %i bytes", wrote);
+				    "failed to write, only %i bytes", wrote);
 				pk_backend_finished(backend);
 				goto out;
 			}
@@ -927,7 +931,7 @@
 			g_debug("ignoring invalid data (one is good)");
 		} else {
 			pk_backend_error_code(backend, PK_ERROR_ENUM_INTERNAL_ERROR,
-					      "unexpected data: %s", buffer);
+			    "unexpected data: %s", buffer);
 			g_source_remove(_signal_timeout);
 			pk_backend_finished(backend);
 			goto out;
@@ -963,7 +967,7 @@
 	frontend_socket = pk_backend_get_frontend_socket(backend);
 	if (frontend_socket == NULL) {
 		pk_backend_error_code(backend, PK_ERROR_ENUM_INTERNAL_ERROR,
-				      "failed to get frontend socket");
+		    "failed to get frontend socket");
 		pk_backend_finished(backend);
 		goto out;
 	}
@@ -971,7 +975,7 @@
 	_socket = g_socket_new(G_SOCKET_FAMILY_UNIX, G_SOCKET_TYPE_STREAM, G_SOCKET_PROTOCOL_DEFAULT, &error);
 	if (_socket == NULL) {
 		pk_backend_error_code(backend, PK_ERROR_ENUM_INTERNAL_ERROR,
-			     "failed to create socket: %s", error->message);
+		    "failed to create socket: %s", error->message);
 		pk_backend_finished(backend);
 		g_error_free(error);
 		goto out;
@@ -984,7 +988,7 @@
 	ret = g_socket_connect(_socket, address, NULL, &error);
 	if (!ret) {
 		pk_backend_error_code(backend, PK_ERROR_ENUM_INTERNAL_ERROR,
-			       "failed to open socket: %s", error->message);
+		    "failed to open socket: %s", error->message);
 		pk_backend_finished(backend);
 		g_error_free(error);
 		goto out;
@@ -998,7 +1002,7 @@
 	wrote = g_socket_send(_socket, "ping\n", 5, NULL, &error);
 	if (wrote != 5) {
 		pk_backend_error_code(backend, PK_ERROR_ENUM_INTERNAL_ERROR,
-				   "failed to write, only %i bytes", wrote);
+		    "failed to write, only %i bytes", wrote);
 		pk_backend_finished(backend);
 		goto out;
 	}
@@ -1040,12 +1044,12 @@
 	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,
-			"gstreamer-plugins-bad;0.10.3-5.lvn;i386;available",
-					   "GStreamer streaming media framework \"bad\" plug-ins");
+			    "gstreamer-plugins-bad;0.10.3-5.lvn;i386;available",
+			    "GStreamer streaming media framework \"bad\" plug-ins");
 		} else if (g_strcmp0(_values[0], "gstreamer0.10(decoder-video/x-wma)(wmaversion=3)") == 0) {
 			pk_backend_package(backend, PK_INFO_ENUM_AVAILABLE,
-					   "gstreamer-plugins-flumpegdemux;0.10.15-5.lvn;i386;available",
-					   "MPEG demuxer for GStreamer");
+			    "gstreamer-plugins-flumpegdemux;0.10.15-5.lvn;i386;available",
+			    "MPEG demuxer for GStreamer");
 		} else {
 			/*
 			 * pkcon install vips-doc says it's installed cause
@@ -1054,13 +1058,13 @@
 			if (g_strcmp0(_values[0], "vips-doc") != 0) {
 				if (!pk_bitfield_contain(_filters, PK_FILTER_ENUM_NOT_INSTALLED)) {
 					pk_backend_package(backend, PK_INFO_ENUM_INSTALLED,
-					"evince;0.9.3-5.fc8;i386;installed",
-						     "PDF Document viewer");
+					    "evince;0.9.3-5.fc8;i386;installed",
+					    "PDF Document viewer");
 				}
 				if (!pk_bitfield_contain(_filters, PK_FILTER_ENUM_INSTALLED)) {
 					pk_backend_package(backend, PK_INFO_ENUM_AVAILABLE,
-					  "scribus;1.3.4-1.fc8;i386;fedora",
-							   "Scribus is an desktop open source page layout program");
+					    "scribus;1.3.4-1.fc8;i386;fedora",
+					    "Scribus is an desktop open source page layout program");
 				}
 			}
 		}
@@ -1099,8 +1103,8 @@
 
 	pk_backend_set_status(backend, PK_STATUS_ENUM_REQUEST);
 	pk_backend_package(backend, PK_INFO_ENUM_INSTALLED,
-			   "update1;2.19.1-4.fc8;i386;fedora",
-			   "The first update");
+	    "update1;2.19.1-4.fc8;i386;fedora",
+	    "The first update");
 	pk_backend_finished(backend);
 }
 
@@ -1120,7 +1124,7 @@
 	filename = g_build_filename(directory, "powertop-1.8-1.fc8.rpm", NULL);
 	g_file_set_contents(filename, "powertop data", -1, NULL);
 	pk_backend_package(backend, PK_INFO_ENUM_DOWNLOADING,
-	     "powertop;1.8-1.fc8;i386;fedora", "Power consumption monitor");
+	    "powertop;1.8-1.fc8;i386;fedora", "Power consumption monitor");
 	pk_backend_files(backend, "powertop;1.8-1.fc8;i386;fedora", filename);
 	g_free(filename);
 
@@ -1128,7 +1132,7 @@
 	filename = g_build_filename(directory, "powertop-common-1.8-1.fc8.rpm", NULL);
 	g_file_set_contents(filename, "powertop-common data", -1, NULL);
 	pk_backend_package(backend, PK_INFO_ENUM_DOWNLOADING,
-			   "powertop-common;1.8-1.fc8;i386;fedora", "Power consumption monitor");
+	    "powertop-common;1.8-1.fc8;i386;fedora", "Power consumption monitor");
 	pk_backend_files(backend, "powertop-common;1.8-1.fc8;i386;fedora", filename);
 	g_free(filename);
 
@@ -1165,30 +1169,30 @@
 	}
 	if (_progress_percentage == 20) {
 		pk_backend_package(backend, PK_INFO_ENUM_DOWNLOADING,
-			  "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
-		"The Linux kernel (the core of the Linux operating system)");
+		    "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
+		    "The Linux kernel (the core of the Linux operating system)");
 	}
 	if (_progress_percentage == 30) {
 		pk_backend_package(backend, PK_INFO_ENUM_DOWNLOADING,
-				   "gtkhtml2;2.19.1-4.fc8;i386;fedora",
-				   "An HTML widget for GTK+ 2.0");
+		    "gtkhtml2;2.19.1-4.fc8;i386;fedora",
+		    "An HTML widget for GTK+ 2.0");
 	}
 	if (_progress_percentage == 40) {
 		pk_backend_set_allow_cancel(backend, FALSE);
 		pk_backend_package(backend, PK_INFO_ENUM_DOWNLOADING,
-				   "powertop;1.8-1.fc8;i386;fedora",
-				   "Power consumption monitor");
+		    "powertop;1.8-1.fc8;i386;fedora",
+		    "Power consumption monitor");
 	}
 	if (_progress_percentage == 60) {
 		pk_backend_set_allow_cancel(backend, TRUE);
 		pk_backend_package(backend, PK_INFO_ENUM_DOWNLOADING,
-			  "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
-		"The Linux kernel (the core of the Linux operating system)");
+		    "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed",
+		    "The Linux kernel (the core of the Linux operating system)");
 	}
 	if (_progress_percentage == 80) {
 		pk_backend_package(backend, PK_INFO_ENUM_DOWNLOADING,
-				   "powertop;1.8-1.fc8;i386;fedora",
-				   "Power consumption monitor");
+		    "powertop;1.8-1.fc8;i386;fedora",
+		    "Power consumption monitor");
 	}
 	_progress_percentage += 1;
 	pk_backend_set_percentage(backend, _progress_percentage);

Modified: soc2013/mattbw/backend/pkgutils.c
==============================================================================
--- soc2013/mattbw/backend/pkgutils.c	Sat Jul  6 21:38:55 2013	(r254260)
+++ soc2013/mattbw/backend/pkgutils.c	Sat Jul  6 22:53:47 2013	(r254261)
@@ -99,6 +99,8 @@
 	char           *comment;
 	gchar          *id;
 
+	comment = id = NULL;
+
 	pkg_get(pkg, PKG_COMMENT, &comment);
 	id = pkgutils_pkg_to_id(pkg);
 	pk_backend_package(backend, info, id, comment);
@@ -115,7 +117,7 @@
 	const gchar   **id_bits;
 
 	/* Make sure the initial string vector's pointers are all NULL */
-	id_bits = g_new0(const gchar *, 4);
+	id_bits = calloc(4, sizeof(const gchar *));
 
 	/*
 	 * This is split through an intermediate function so the same code
@@ -123,8 +125,8 @@
 	 */
 	id = pkgutils_pkg_to_id_through(pkg, id_bits);
 
-	/* we don't own any of the strings, so we don't use g_strfreev. */
-	g_free(id_bits);
+	/* we don't own any of the strings, so we don't free those. */
+	free(id_bits);
 
 	return id;
 }
@@ -137,17 +139,18 @@
 gchar          *
 pkgutils_pkg_to_id_through(struct pkg *pkg, const gchar **strv)
 {
+
 	pkg_get(pkg,
-		PKG_NAME, strv + PK_PACKAGE_ID_NAME,
-		PKG_VERSION, strv + PK_PACKAGE_ID_VERSION,
-		PKG_ARCH, strv + PK_PACKAGE_ID_ARCH);
+	    PKG_NAME, strv + PK_PACKAGE_ID_NAME,
+	    PKG_VERSION, strv + PK_PACKAGE_ID_VERSION,
+	    PKG_ARCH, strv + PK_PACKAGE_ID_ARCH);
 
 	strv[PK_PACKAGE_ID_DATA] = pkgutils_pk_repo_of(pkg);
 
 	return pk_package_id_build(strv[PK_PACKAGE_ID_NAME],
-				   strv[PK_PACKAGE_ID_VERSION],
-				   strv[PK_PACKAGE_ID_ARCH],
-				   strv[PK_PACKAGE_ID_DATA]);
+	    strv[PK_PACKAGE_ID_VERSION],
+	    strv[PK_PACKAGE_ID_ARCH],
+	    strv[PK_PACKAGE_ID_DATA]);
 }
 
 /*
@@ -164,7 +167,8 @@
 	const char     *repo_name;
 	struct pkg_repo *repo_struct;
 
-	repo = NULL;
+	repo = repo_name = NULL;
+	repo_struct = NULL;
 
 	/*
 	 * We can get the repo NAME directly, but we need the repo IDENT.

Modified: soc2013/mattbw/backend/query.c
==============================================================================
--- soc2013/mattbw/backend/query.c	Sat Jul  6 21:38:55 2013	(r254260)
+++ soc2013/mattbw/backend/query.c	Sat Jul  6 22:53:47 2013	(r254261)
@@ -49,13 +49,11 @@
 	pkg_jobs_t	job_type;
 };
 
-static gboolean	match(struct query *q, gchar **match_id_p, struct pkg **match_pkg_p);
-static gboolean	match_id_in_it(struct pkgdb_it *it, struct query *q, gchar **match_id_p, struct pkg **match_pkg_p);
-static gboolean	query_do(PkBackend *backend, unsigned int load_flags, emit_ptr emitter, pkg_jobs_t job_type, job_emit_ptr job_emitter, query_body_ptr body);
-static gboolean	query_emit_to_job(struct pkg *pkg, const gchar *id, struct query *q);
-static gboolean	query_match(struct query *q);
+static gboolean match_id_in_it(struct pkgdb_it *it, struct query *q, struct pkg
+**match_pkg_p, gchar **match_id_p);
 static gboolean	try_id_match(struct pkg *pkg, struct query *q, gchar **match_id);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-soc-all mailing list