[PackageKit-commit] packagekit: Branch 'master' - 35 commits

Richard Hughes hughsient at kemper.freedesktop.org
Fri Aug 15 08:47:24 PDT 2008


 backends/apt/aptDBUSBackend.py     |   90 +++++++-
 backends/apt/pk-backend-apt.c      |   11 -
 backends/yum/helpers/yumBackend.py |    3 
 backends/zypp/pk-backend-zypp.cpp  |  106 +++++++--
 backends/zypp/zypp-utils.cpp       |   18 +
 backends/zypp/zypp-utils.h         |    2 
 client/.gitignore                  |    1 
 client/Makefile.am                 |   26 ++
 client/pk-console.c                |   21 +
 client/pk-generate-pack-main.c     |  163 +++++++++++++++
 client/pk-generate-pack.c          |  401 +++++++++++++++++++++++++------------
 client/pk-generate-pack.h          |   46 ++++
 client/pk-self-test.c              |   47 ++++
 configure.ac                       |   10 
 contrib/pk-completion.bash         |    2 
 libpackagekit/Makefile.am          |   10 
 libpackagekit/pk-client.c          |   71 +++++-
 libpackagekit/pk-common.c          |   49 ++++
 libpackagekit/pk-common.h          |   11 +
 libpackagekit/pk-control.c         |    7 
 libpackagekit/pk-dbus-monitor.c    |    6 
 libpackagekit/pk-enum.c            |    2 
 po/POTFILES.in                     |    1 
 po/pt_BR.po                        |  260 +++++++++++++++++------
 python/packagekit/daemonBackend.py |   27 ++
 src/Makefile.am                    |    2 
 src/pk-security-dummy.c            |   14 +
 src/pk-security-polkit.c           |   37 +++
 src/pk-security.h                  |    4 
 src/pk-transaction.c               |  155 ++++++++++++++
 src/pk-transaction.h               |    2 
 31 files changed, 1327 insertions(+), 278 deletions(-)

New commits:
commit 946eb7534893a25033107b5a1e2806cdb1abc2ae
Author: Shishir Goel <crazyontheedge at gmail.com>
Date:   Fri Aug 15 16:26:11 2008 +0100

    add test cases for pkgenpack

diff --git a/client/.gitignore b/client/.gitignore
index 76600ed..82b5baa 100644
--- a/client/.gitignore
+++ b/client/.gitignore
@@ -11,6 +11,7 @@ pk-application
 pk-import-desktop
 pk-import-specspo
 pk-generate-package-list
+pk-self-test
 *.glade.bak
 *.gladep
 *.gladep.bak
diff --git a/client/Makefile.am b/client/Makefile.am
index 94d1d41..82b2330 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -111,6 +111,30 @@ pk_import_specspo_LDADD =				\
 	$(PK_LIBS)					\
 	$(NULL)
 
+if PK_BUILD_TESTS
+
+check_PROGRAMS =					\
+	pk-self-test
+
+pk_self_test_SOURCES =					\
+	pk-self-test.c					\
+	pk-generate-pack.c				\
+	pk-tools-common.c				\
+	pk-tools-common.h				\
+	$(shared_SOURCES)				\
+	$(NULL)
+
+pk_self_test_LDADD =					\
+	$(GLIB_LIBS)					\
+	$(DBUS_LIBS)					\
+	$(SELFTEST_LIBS)				\
+	$(TAR_LIBS)					\
+	$(PK_LIBS)					\
+	$(NULL)
+
+TESTS = pk-self-test
+endif
+
 clean-local:
 	rm -f *~
 	rm -f *.out
diff --git a/client/pk-generate-pack.c b/client/pk-generate-pack.c
index 820cf2c..8beeab9 100644
--- a/client/pk-generate-pack.c
+++ b/client/pk-generate-pack.c
@@ -59,6 +59,12 @@ pk_generate_pack_perhaps_resolve (PkClient *client, PkFilterEnum filter, const g
 	PkPackageList *list;
 	gchar **packages;
 
+	/* check for NULL values */
+	if (package == NULL) {
+		pk_warning ("Cannot resolve the package: invalid package");
+		return NULL;
+	}
+
 	/* have we passed a complete package_id? */
 	valid = pk_package_id_check (package);
 	if (valid) {
@@ -135,6 +141,13 @@ pk_generate_pack_download_only (PkClient *client, gchar **package_ids, const gch
 	gboolean ret;
 	GError *error = NULL;
 
+	/* check for NULL values */
+	if (package_ids == NULL || directory == NULL) {
+		pk_warning (_("failed to download: invalid package_id and/or directory"));
+		ret = FALSE;
+		goto out;
+	}
+
 	pk_debug ("download+ %s %s", package_ids[0], directory);
 	ret = pk_client_reset (client, &error);
 	if (!ret) {
@@ -167,6 +180,13 @@ pk_generate_pack_exclude_packages (PkPackageList *list, const gchar *package_lis
 
 	list_packages = pk_package_list_new ();
 
+	/* check for NULL values */
+	if (package_list == NULL) {
+		pk_warning ("Cannot find the list of packages to be excluded");
+		ret = FALSE;
+		goto out;
+	}
+
 	/* load a list of packages already found on the users system */
 	ret = pk_package_list_add_file (list_packages, package_list);
 	if (!ret)
@@ -200,6 +220,14 @@ pk_generate_pack_set_metadata (const gchar *full_path)
 	GKeyFile *file = NULL;
 	gchar *data = NULL;
 
+	file = g_key_file_new ();
+
+	/* check for NULL values */
+	if (full_path == NULL) {
+		pk_warning (_("Could not find a valid metadata file"));
+		goto out;
+	}
+
 	/* get needed data */
 	distro_id = pk_get_distro_id ();
 	if (distro_id == NULL)
@@ -208,7 +236,6 @@ pk_generate_pack_set_metadata (const gchar *full_path)
 	if (datetime == NULL)
 		goto out;
 
-	file = g_key_file_new ();
 	g_key_file_set_string (file, PK_SERVICE_PACK_GROUP_NAME, "distro_id", distro_id);
 	g_key_file_set_string (file, PK_SERVICE_PACK_GROUP_NAME, "created", datetime);
 
@@ -279,6 +306,13 @@ pk_generate_pack_create (const gchar *tarfilename, GPtrArray *file_array, GError
 		goto out;
 	}
 
+	/* check for NULL values */
+	if (file_array == NULL) {
+		g_remove ((gchar *) tarfilename);
+		ret = FALSE;
+		goto out;
+	}
+
 	/* add each of the files */
 	for (i=0; i<file_array->len; i++) {
 		src = (gchar *) g_ptr_array_index (file_array, i);
@@ -325,6 +359,12 @@ pk_generate_pack_scan_dir (const gchar *directory)
 	GDir *dir;
 	const gchar *filename;
 
+	/* check for NULL values */
+	if (directory == NULL) {
+		pk_warning ("failed to get directory");
+		goto out;
+	}
+
 	/* try and open the directory */
 	dir = g_dir_open (directory, 0, NULL);
 	if (dir == NULL) {
@@ -469,3 +509,213 @@ out:
 	return ret;
 }
 
+/***************************************************************************
+ ***                          MAKE CHECK TESTS                           ***
+ ***************************************************************************/
+#ifdef PK_BUILD_TESTS
+#include <libselftest.h>
+
+void
+libst_generate_pack (LibSelfTest *test)
+{
+	PkClient *client = NULL;
+	gboolean ret;
+	gboolean retval;
+	GError *error = NULL;
+	gchar *file;
+	PkPackageList *list = NULL;
+	GPtrArray *file_array = NULL;
+	gchar *src;
+	gchar **package_ids;
+
+	if (libst_start (test, "PkGeneratePack", CLASS_AUTO) == FALSE) {
+		return;
+	}
+
+	/************************************************************/
+	libst_title (test, "get client");
+	client = pk_client_new ();
+	if (client != NULL)
+		libst_success (test, NULL);
+	else
+		libst_failed (test, NULL);
+
+	/************************************************************/
+	libst_title (test, "test perhaps resolve NULL");
+	retval = pk_client_reset (client, &error);
+	file = pk_generate_pack_perhaps_resolve (client, PK_FILTER_ENUM_NONE, NULL, &error);
+	if (file == NULL) {
+		libst_success (test, NULL);
+	} else {
+		libst_failed (test, "failed to resolve %s", error->message);
+		g_error_free (error);
+	}
+	g_free (file);
+
+	/************************************************************/
+	libst_title (test, "test perhaps resolve gitk");
+	retval = pk_client_reset(client, &error);
+	file = pk_generate_pack_perhaps_resolve (client, PK_FILTER_ENUM_NONE, "gitk;1.5.5.1-1.fc9;i386;installed", &error);
+	if (file != NULL && pk_strequal (file, "gitk;1.5.5.1-1.fc9;i386;installed"))
+		libst_success (test, NULL);
+	else
+		libst_failed (test, "got: %s", file);
+	g_free (file);
+
+	/************************************************************/
+	libst_title (test, "download only NULL");
+	ret = pk_generate_pack_download_only (client, NULL, NULL);
+	if (!ret)
+		libst_success (test, NULL);
+	else
+		libst_failed (test, NULL);
+
+	/************************************************************/
+	libst_title (test, "download only gitk");
+	package_ids = pk_package_ids_from_id ("gitk;1.5.5.1-1.fc9;i386;installed");
+	ret = pk_generate_pack_download_only (client, package_ids, "/tmp");
+	if (ret)
+		libst_success (test, NULL);
+	else
+		libst_failed (test, NULL);
+	g_strfreev (package_ids);
+
+	/************************************************************/
+	libst_title (test, "exclude NULL");
+	list = pk_package_list_new ();
+	ret = pk_generate_pack_exclude_packages (list, NULL);
+	if (!ret)
+		libst_success (test, NULL);
+	else
+		libst_failed (test, NULL);
+
+	/************************************************************/
+	libst_title (test, "exclude /var/lib/PackageKit/package-list.txt");
+	list = pk_package_list_new ();
+	ret = pk_generate_pack_exclude_packages (list, "/var/lib/PackageKit/package-list.txt");
+	if (ret)
+		libst_success (test, NULL);
+	else
+		libst_failed (test, NULL);
+
+	/************************************************************/
+	libst_title (test, "exclude false.txt");
+	list = pk_package_list_new ();
+	ret = pk_generate_pack_exclude_packages (list, "/media/USB/false.txt");
+	if (!ret)
+		libst_success (test, NULL);
+	else
+		libst_failed (test, NULL);
+
+	/************************************************************/
+	libst_title (test, "metadata NULL");
+	ret = pk_generate_pack_set_metadata (NULL);
+	if (!ret)
+		libst_success (test, NULL);
+	else
+		libst_failed (test, NULL);
+
+	/************************************************************/
+	libst_title (test, "metadata /tmp/metadata.conf");
+	ret = pk_generate_pack_set_metadata ("/tmp/metadata.conf");
+	if (ret)
+		libst_success (test, NULL);
+	else
+		libst_failed (test, NULL);
+	g_remove ("/tmp/metadata.conf");
+
+	/************************************************************/
+	libst_title (test, "scandir NULL");
+	file_array = pk_generate_pack_scan_dir (NULL);
+	if (file_array == NULL)
+		libst_success (test, NULL);
+	else
+		libst_failed (test, NULL);
+
+	/************************************************************/
+	libst_title (test, "scandir /tmp");
+	file_array = pk_generate_pack_scan_dir ("/tmp");
+	if (file_array != NULL)
+		libst_success (test, NULL);
+	else
+		libst_failed (test, NULL);
+
+	/************************************************************/
+	libst_title (test, "generate pack NULL NULL");
+	ret = pk_generate_pack_create (NULL, NULL, &error);
+	if (!ret) {
+		if (error != NULL)
+			libst_success (test, "failed to create pack %s" , error->message);
+		else
+			libst_failed (test, "could not set error");
+	} else {
+		libst_failed (test, NULL);
+	}
+
+	/************************************************************/
+	libst_title (test, "generate pack /tmp/test.pack NULL");
+	ret = pk_generate_pack_create ("/tmp/test.pack", NULL, &error);
+	if (!ret) {
+		if (error != NULL)
+			libst_success (test, "failed to create pack %s" , error->message);
+		else
+			libst_failed (test, "could not set error");
+	} else {
+		libst_failed (test, NULL);
+	}
+
+	/************************************************************/
+	libst_title (test, "generate pack /tmp/test NULL");
+	ret = pk_generate_pack_create ("/tmp/test", NULL, &error);
+	if (!ret) {
+		if (error != NULL)
+			libst_success (test, "failed to create pack %s" , error->message);
+		else
+			libst_failed (test, "could not set error");
+	} else {
+		libst_failed (test, NULL);
+	}
+
+	/************************************************************/
+	libst_title (test, "generate pack /tmp/test.tar NULL");
+	ret = pk_generate_pack_create ("test.tar", NULL, &error);
+	if (!ret) {
+		if (error != NULL)
+			libst_success (test, "failed to create pack %s" , error->message);
+		else
+			libst_failed (test, "could not set error");
+	} else {
+		libst_failed (test, NULL);
+	}
+
+	/************************************************************/
+	libst_title (test, "generate pack NULL gitk");
+	file_array = g_ptr_array_new ();
+	g_ptr_array_add (file_array, NULL);
+	ret = pk_generate_pack_create (NULL, file_array, &error);
+	if (!ret) {
+		if (error != NULL)
+			libst_success (test, "failed to create pack %s" , error->message);
+		else
+			libst_failed (test, "could not set error");
+	} else {
+		libst_failed (test, NULL);
+	}
+
+	/************************************************************/
+	libst_title (test, "generate pack /tmp/gitk.pack gitk");
+	file_array = g_ptr_array_new ();
+	src = g_build_filename ("/tmp", "gitk-1.5.5.1-1.fc9.i386.rpm", NULL);
+	g_ptr_array_add (file_array, src);
+	ret = pk_generate_pack_create ("/tmp/gitk.pack",file_array, &error);
+	if (!ret) {
+		if (error != NULL)
+			libst_failed (test, "failed to create pack %s" , error->message);
+		else
+			libst_failed (test, "could not set error");
+	} else {
+		libst_success (test, NULL);
+	}
+	/************************************************************/
+}
+#endif
diff --git a/client/pk-self-test.c b/client/pk-self-test.c
new file mode 100644
index 0000000..063ae15
--- /dev/null
+++ b/client/pk-self-test.c
@@ -0,0 +1,47 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Richard Hughes <richard at hughsie.com>
+ * Copyright (C) 2008 Shishir Goel <crazyontheedge at gmail.com>
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include <glib.h>
+#include <glib-object.h>
+#include <libselftest.h>
+#include <pk-debug.h>
+
+/* prototypes */
+void libst_generate_pack (LibSelfTest *test);
+
+int
+main (int argc, char **argv)
+{
+	LibSelfTest test;
+
+	g_type_init ();
+	libst_init (&test);
+	pk_debug_init (TRUE);
+
+	/* tests go here */
+	libst_generate_pack (&test);
+	
+	return (libst_finish (&test));
+}
+
commit 041689eaf5ba45a69fee975b48e2d4eeb3898558
Author: Shishir Goel <crazyontheedge at gmail.com>
Date:   Fri Aug 15 16:15:11 2008 +0100

    add a separate main file for pkgenpack

diff --git a/client/Makefile.am b/client/Makefile.am
index 8d893e1..94d1d41 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -63,7 +63,9 @@ pkmon_LDADD =						\
 	$(NULL)
 
 pkgenpack_SOURCES =					\
+	pk-generate-pack-main.c				\
 	pk-generate-pack.c				\
+	pk-generate-pack.h				\
 	pk-tools-common.c				\
 	pk-tools-common.h				\
 	$(NULL)
diff --git a/client/pk-generate-pack-main.c b/client/pk-generate-pack-main.c
new file mode 100644
index 0000000..386eedc
--- /dev/null
+++ b/client/pk-generate-pack-main.c
@@ -0,0 +1,163 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Richard Hughes <richard at hughsie.com>
+ * Copyright (C) 2008 Shishir Goel <crazyontheedge at gmail.com>
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <glib/gstdio.h>
+#include <dbus/dbus-glib.h>
+
+#include <pk-debug.h>
+#include <pk-client.h>
+#include <pk-control.h>
+
+
+#include "pk-tools-common.h"
+#include "pk-generate-pack.h"
+
+int
+main (int argc, char *argv[])
+{
+	GError *error = NULL;
+	gboolean verbose = FALSE;
+	gchar *with_package_list = NULL;
+	GOptionContext *context;
+	gchar *options_help;
+	gboolean ret;
+	guint retval;
+	const gchar *package = NULL;
+	gchar *pack_filename = NULL;
+	gchar *packname = NULL;
+	PkControl *control = NULL;
+	PkRoleEnum roles;
+	const gchar *package_list = NULL;
+	gchar *tempdir = NULL;
+	gboolean exists;
+	gboolean overwrite;
+
+	const GOptionEntry options[] = {
+		{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
+			_("Show extra debugging information"), NULL },
+		{ "with-package-list", '\0', 0, G_OPTION_ARG_STRING, &with_package_list,
+			_("Set the path of the file with the list of packages/dependencies to be excluded"), NULL},
+		{ NULL}
+	};
+
+	if (! g_thread_supported ()) {
+		g_thread_init (NULL);
+	}
+	dbus_g_thread_init ();
+	g_type_init ();
+
+	context = g_option_context_new ("PackageKit Pack Generator");
+	g_option_context_add_main_entries (context, options, NULL);
+	g_option_context_parse (context, &argc, &argv, NULL);
+	/* Save the usage string in case command parsing fails. */
+	options_help = g_option_context_get_help (context, TRUE, NULL);
+	g_option_context_free (context);
+	pk_debug_init (verbose);
+
+	if (with_package_list != NULL) {
+		package_list = with_package_list;
+	} else {
+		package_list = "/var/lib/PackageKit/package-list.txt";
+	}
+
+	if (argc < 2) {
+		g_print ("%s", options_help);
+		return 1;
+	}
+
+	/* are we dumb and can't check for depends? */
+	control = pk_control_new ();
+	roles = pk_control_get_actions (control);
+	if (!pk_enums_contain (roles, PK_ROLE_ENUM_GET_DEPENDS)) {
+		g_print ("Please use a backend that supports GetDepends!\n");
+		goto out;
+	}
+
+	/* get the arguments */
+	pack_filename = argv[1];
+	if (argc > 2) {
+		package = argv[2];
+	}
+
+	/* have we specified the right things */
+	if (pack_filename == NULL || package == NULL) {
+		g_print (_("You need to specify the pack name and packages to be packed\n"));
+		goto out;
+	}
+
+	/* check the suffix */
+	if (!g_str_has_suffix (pack_filename,".pack")) {
+		g_print(_("Invalid name for the service pack, Specify a name with .pack extension\n"));
+		goto out;
+	}
+
+	/* download packages to a temporary directory */
+	tempdir = g_build_filename (g_get_tmp_dir (), "pack", NULL);
+
+	/* check if file exists before we overwrite it */
+	exists = g_file_test (pack_filename, G_FILE_TEST_EXISTS);
+
+	/*ask user input*/
+	if (exists) {
+		overwrite = pk_console_get_prompt (_("A pack with the same name already exists, do you want to overwrite it?"), FALSE);
+		if (!overwrite) {
+			g_print ("%s\n", _("Cancelled!"));
+			goto out;
+		}
+	}
+
+	/* get rid of temp directory if it already exists */
+	g_rmdir (tempdir);
+
+	/* make the temporary directory */
+	retval = g_mkdir_with_parents (tempdir, 0777);
+	if (retval != 0) {
+		g_print ("%s: %s\n", _("Failed to create directory"), tempdir);
+		goto out;
+	}
+
+	/* generate the pack */
+	ret = pk_generate_pack_main (pack_filename, tempdir, package, package_list, &error);
+	if (!ret) {
+		g_print ("%s: %s\n", _("Failed to create pack"), error->message);
+		g_error_free (error);
+		goto out;
+	}
+
+out:
+	/* get rid of temp directory */
+	g_rmdir (tempdir);
+	g_free (tempdir);
+	g_free (packname);
+	g_free (with_package_list);
+	g_free (options_help);
+	g_object_unref (control);
+	return 0;
+}
diff --git a/client/pk-generate-pack.c b/client/pk-generate-pack.c
index 84b9900..820cf2c 100644
--- a/client/pk-generate-pack.c
+++ b/client/pk-generate-pack.c
@@ -48,7 +48,7 @@
 /**
  * pk_generate_pack_perhaps_resolve:
  **/
-static gchar *
+gchar *
 pk_generate_pack_perhaps_resolve (PkClient *client, PkFilterEnum filter, const gchar *package, GError **error)
 {
 	gboolean ret;
@@ -129,7 +129,7 @@ pk_generate_pack_perhaps_resolve (PkClient *client, PkFilterEnum filter, const g
 /**
  * pk_generate_pack_download_only:
  **/
-static gboolean
+gboolean
 pk_generate_pack_download_only (PkClient *client, gchar **package_ids, const gchar *directory)
 {
 	gboolean ret;
@@ -155,7 +155,7 @@ out:
 /**
  * pk_generate_pack_exclude_packages:
  **/
-static gboolean
+gboolean
 pk_generate_pack_exclude_packages (PkPackageList *list, const gchar *package_list)
 {
 	guint i;
@@ -190,7 +190,7 @@ out:
 /**
  * pk_generate_pack_set_metadata:
  **/
-static gboolean
+gboolean
 pk_generate_pack_set_metadata (const gchar *full_path)
 {
 	gboolean ret = FALSE;
@@ -239,7 +239,7 @@ out:
 /**
  * pk_generate_pack_create:
  **/
-static gboolean
+gboolean
 pk_generate_pack_create (const gchar *tarfilename, GPtrArray *file_array, GError **error)
 {
 	gboolean ret = TRUE;
@@ -317,7 +317,7 @@ out:
 /**
  * pk_generate_pack_scan_dir:
  **/
-static GPtrArray *
+GPtrArray *
 pk_generate_pack_scan_dir (const gchar *directory)
 {
 	gchar *src;
@@ -346,7 +346,7 @@ out:
 /**
  * pk_generate_pack_main:
  **/
-static gboolean
+gboolean
 pk_generate_pack_main (const gchar *pack_filename, const gchar *directory, const gchar *package, const gchar *package_list, GError **error)
 {
 
@@ -469,126 +469,3 @@ out:
 	return ret;
 }
 
-int
-main (int argc, char *argv[])
-{
-	GError *error = NULL;
-	gboolean verbose = FALSE;
-	gchar *with_package_list = NULL;
-	GOptionContext *context;
-	gchar *options_help;
-	gboolean ret;
-	guint retval;
-	const gchar *package = NULL;
-	gchar *pack_filename = NULL;
-	gchar *packname = NULL;
-	PkControl *control = NULL;
-	PkRoleEnum roles;
-	const gchar *package_list = NULL;
-	gchar *tempdir = NULL;
-	gboolean exists;
-	gboolean overwrite;
-
-	const GOptionEntry options[] = {
-		{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
-			_("Show extra debugging information"), NULL },
-		{ "with-package-list", '\0', 0, G_OPTION_ARG_STRING, &with_package_list,
-			_("Set the path of the file with the list of packages/dependencies to be excluded"), NULL},
-		{ NULL}
-	};
-
-	if (! g_thread_supported ()) {
-		g_thread_init (NULL);
-	}
-	dbus_g_thread_init ();
-	g_type_init ();
-
-	context = g_option_context_new ("PackageKit Pack Generator");
-	g_option_context_add_main_entries (context, options, NULL);
-	g_option_context_parse (context, &argc, &argv, NULL);
-	/* Save the usage string in case command parsing fails. */
-	options_help = g_option_context_get_help (context, TRUE, NULL);
-	g_option_context_free (context);
-	pk_debug_init (verbose);
-
-	if (with_package_list != NULL) {
-		package_list = with_package_list;
-	} else {
-		package_list = "/var/lib/PackageKit/package-list.txt";
-	}
-
-	if (argc < 2) {
-		g_print ("%s", options_help);
-		return 1;
-	}
-
-	/* are we dumb and can't check for depends? */
-	control = pk_control_new ();
-	roles = pk_control_get_actions (control);
-	if (!pk_enums_contain (roles, PK_ROLE_ENUM_GET_DEPENDS)) {
-		g_print ("Please use a backend that supports GetDepends!\n");
-		goto out;
-	}
-
-	/* get the arguments */
-	pack_filename = argv[1];
-	if (argc > 2) {
-		package = argv[2];
-	}
-
-	/* have we specified the right things */
-	if (pack_filename == NULL || package == NULL) {
-		g_print (_("You need to specify the pack name and packages to be packed\n"));
-		goto out;
-	}
-
-	/* check the suffix */
-	if (!g_str_has_suffix (pack_filename,".pack")) {
-		g_print(_("Invalid name for the service pack, Specify a name with .pack extension\n"));
-		goto out;
-	}
-
-	/* download packages to a temporary directory */
-	tempdir = g_build_filename (g_get_tmp_dir (), "pack", NULL);
-
-	/* check if file exists before we overwrite it */
-	exists = g_file_test (pack_filename, G_FILE_TEST_EXISTS);
-
-	/*ask user input*/
-	if (exists) {
-		overwrite = pk_console_get_prompt (_("A pack with the same name already exists, do you want to overwrite it?"), FALSE);
-		if (!overwrite) {
-			g_print ("%s\n", _("Cancelled!"));
-			goto out;
-		}
-	}
-
-	/* get rid of temp directory if it already exists */
-	g_rmdir (tempdir);
-
-	/* make the temporary directory */
-	retval = g_mkdir_with_parents (tempdir, 0777);
-	if (retval != 0) {
-		g_print ("%s: %s\n", _("Failed to create directory"), tempdir);
-		goto out;
-	}
-
-	/* generate the pack */
-	ret = pk_generate_pack_main (pack_filename, tempdir, package, package_list, &error);
-	if (!ret) {
-		g_print ("%s: %s\n", _("Failed to create pack"), error->message);
-		g_error_free (error);
-		goto out;
-	}
-
-out:
-	/* get rid of temp directory */
-	g_rmdir (tempdir);
-	
-	g_free (tempdir);
-	g_free (packname);
-	g_free (with_package_list);
-	g_free (options_help);
-	g_object_unref (control);
-	return 0;
-}
diff --git a/client/pk-generate-pack.h b/client/pk-generate-pack.h
new file mode 100644
index 0000000..587a1b8
--- /dev/null
+++ b/client/pk-generate-pack.h
@@ -0,0 +1,46 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Richard Hughes <richard at hughsie.com>
+ * Copyright (C) 2008 Shishir Goel <crazyontheedge at gmail.com>
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __PK_GENERATE_PACK_H
+#define __PK_GENERATE_PACK_H
+
+gchar		*pk_generate_pack_perhaps_resolve		(PkClient *client,
+								 PkFilterEnum filter, 
+								 const gchar *package,
+								 GError **error);
+gboolean	 pk_generate_pack_download_only 		(PkClient *client,
+								 gchar **package_ids,
+								 const gchar *directory);
+gboolean	 pk_generate_pack_exclude_packages		(PkPackageList *list,
+								 const gchar *package_list);
+gboolean	 pk_generate_pack_set_metadata			(const gchar *full_path);
+gboolean	 pk_generate_pack_create 			(const gchar *tarfilename,
+								 GPtrArray *file_array,
+								 GError **error);
+GPtrArray 	*pk_generate_pack_scan_dir			(const gchar *directory);
+gboolean	 pk_generate_pack_main				(const gchar *pack_filename,
+								 const gchar *directory,
+								 const gchar *package,
+								 const gchar *package_list,
+								 GError **error);
+
+#endif /* __PK_GENERATE_PACK_H */
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 539b8dd..908a81d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -3,6 +3,7 @@
 # Please keep this file sorted alphabetically.
 client/pk-console.c
 client/pk-generate-pack.c
+client/pk-generate-pack-main.c
 client/pk-import-desktop.c
 client/pk-import-specspo.c
 client/pk-monitor.c
commit 608dc6e78a29f5c243225666f2efb65c32a85aa7
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Aug 15 15:55:44 2008 +0100

    trivial: fix two typos in the configure script for the PLUGIN flags

diff --git a/configure.ac b/configure.ac
index 828c7dd..68e91a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -252,8 +252,8 @@ PKG_CHECK_MODULES(PK_BROWSER_PLUGIN, mozilla-plugin gio-unix-2.0 cairo pango gtk
 
 AM_CONDITIONAL(PK_BUILD_BROWSER_PLUGIN, test $build_browser_plugin = "yes")
 		 
-AC_SUBST(PK_PLUGIN_CFLAGS)
-AC_SUBST(PK_PLUGIN_LIBS)
+AC_SUBST(PK_BROWSER_PLUGIN_CFLAGS)
+AC_SUBST(PK_BROWSER_PLUGIN_LIBS)
 
 if test $build_browser_plugin = "yes"; then
 	# Check if we have GdkAppLaunchContext (new in GTK+-2.14)
@@ -261,8 +261,8 @@ if test $build_browser_plugin = "yes"; then
 	packagekit_save_CPPFLAGS="$CPPFLAGS"
 	packagekit_save_LDFLAGS="$LDFLAGS"
 
-	CPPFLAGS="$CPPFLAGS $PLUGIN_CFLAGS"
-	LDFLAGS="$CPPFLAGS $PLUGIN_LIBS"
+	CPPFLAGS="$CPPFLAGS $PK_BROWSER_PLUGIN_CFLAGS"
+	LDFLAGS="$CPPFLAGS $PK_BROWSER_PLUGIN_LIBS"
 
 	AC_CHECK_FUNCS(gdk_app_launch_context_new)
 
commit a94cc424e8d4118438c49476e764c68850c6531e
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Aug 15 13:59:25 2008 +0100

    bugfix: correct the 'over the wire' enum for update-packages

diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index e13d8bb..abb1abb 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -106,7 +106,7 @@ static PkEnumMatch enum_role[] = {
 	{PK_ROLE_ENUM_SEARCH_GROUP,		"search-group"},
 	{PK_ROLE_ENUM_SEARCH_NAME,		"search-name"},
 	{PK_ROLE_ENUM_SERVICE_PACK,		"service-pack"},
-	{PK_ROLE_ENUM_UPDATE_PACKAGES,		"update-package"},
+	{PK_ROLE_ENUM_UPDATE_PACKAGES,		"update-packages"},
 	{PK_ROLE_ENUM_UPDATE_SYSTEM,		"update-system"},
 	{PK_ROLE_ENUM_WHAT_PROVIDES,		"what-provides"},
 	{PK_ROLE_ENUM_ACCEPT_EULA,		"accept-eula"},
commit 59dfacc6aa73078e3597c0e780694b265c40bfc4
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Aug 15 13:31:03 2008 +0100

    trivial: gtk-doc markup fixes

diff --git a/libpackagekit/pk-common.c b/libpackagekit/pk-common.c
index 5efb82d..1eaf99a 100644
--- a/libpackagekit/pk-common.c
+++ b/libpackagekit/pk-common.c
@@ -189,7 +189,7 @@ pk_iso8601_difference (const gchar *isodate)
 
 /**
  * pk_iso8601_from_date:
- * @isodate: a %GDate to convert
+ * @date: a %GDate to convert
  *
  * Return value: If valid then a new ISO8601 date, else NULL
  **/
@@ -209,7 +209,7 @@ pk_iso8601_from_date (const GDate *date)
 
 /**
  * pk_iso8601_to_date:
- * @isodate: The ISO8601 date to convert
+ * @iso_date: The ISO8601 date to convert
  *
  * Return value: If valid then a new %GDate, else NULL
  **/
diff --git a/libpackagekit/pk-dbus-monitor.c b/libpackagekit/pk-dbus-monitor.c
index feb29dd..a1e0808 100644
--- a/libpackagekit/pk-dbus-monitor.c
+++ b/libpackagekit/pk-dbus-monitor.c
@@ -108,7 +108,7 @@ pk_dbus_monitor_name_owner_changed_cb (DBusGProxy *proxy, const gchar *name,
 
 /**
  * pk_dbus_monitor_assign:
- * @pk_dbus_monitor: This class instance
+ * @monitor: This class instance
  * @bus_type: The bus type, either PK_DBUS_MONITOR_SESSION or PK_DBUS_MONITOR_SYSTEM
  * @service: The PK_DBUS_MONITOR service name
  * Return value: success
@@ -175,7 +175,7 @@ pk_dbus_monitor_assign (PkDbusMonitor *monitor, PkDbusMonitorType bus_type, cons
 
 /**
  * pk_dbus_monitor_is_connected:
- * @pk_dbus_monitor: This class instance
+ * @monitor: This class instance
  * Return value: if we are connected to a valid watch
  **/
 gboolean
@@ -224,7 +224,7 @@ pk_dbus_monitor_class_init (PkDbusMonitorClass *klass)
 
 /**
  * pk_dbus_monitor_init:
- * @dbus_monitor: This class instance
+ * @monitor: This class instance
  **/
 static void
 pk_dbus_monitor_init (PkDbusMonitor *monitor)
commit 34ab2453cd8582e4f82a2749972b2900769a8045
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Aug 15 13:26:21 2008 +0100

    trivial: better name for the permission checker function

diff --git a/libpackagekit/pk-common.c b/libpackagekit/pk-common.c
index d34f240..5efb82d 100644
--- a/libpackagekit/pk-common.c
+++ b/libpackagekit/pk-common.c
@@ -876,7 +876,7 @@ pk_strbuild_va (const gchar *first_element, va_list *args)
 }
 
 /**
- * gpk_client_check_permissions:
+ * gpk_check_permissions:
  * @filename: a filename to check
  * @euid: the effective user ID to check for, or the output of geteuid()
  * @egid: the effective group ID to check for, or the output of getegid()
@@ -888,7 +888,7 @@ pk_strbuild_va (const gchar *first_element, va_list *args)
  * Return value: %TRUE if the file has access perms
  **/
 gboolean
-pk_client_check_permissions (const gchar *filename, guint euid, guint egid, guint mode)
+pk_check_permissions (const gchar *filename, guint euid, guint egid, guint mode)
 {
 	struct stat statbuf;
 
diff --git a/libpackagekit/pk-common.h b/libpackagekit/pk-common.h
index 6a07e3c..cb91b16 100644
--- a/libpackagekit/pk-common.h
+++ b/libpackagekit/pk-common.h
@@ -113,7 +113,7 @@ gchar		*pk_iso8601_from_date			(const GDate	*date);
 GDate		*pk_iso8601_to_date			(const gchar	*iso_date);
 gchar		*pk_get_distro_id			(void)
 							 G_GNUC_WARN_UNUSED_RESULT;
-gboolean	 pk_client_check_permissions		(const gchar	*filename,
+gboolean	 pk_check_permissions			(const gchar	*filename,
 							 guint		 euid,
 							 guint		 egid,
 							 guint		 mode);
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index 35d1b35..9fc5d25 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -1299,7 +1299,7 @@ pk_transaction_download_packages (PkTransaction *transaction, gchar **package_id
 	}
 
 	/* check for write access on the directory */
-	ret = pk_client_check_permissions (directory, uid, uid, W_OK);
+	ret = pk_check_permissions (directory, uid, uid, W_OK);
 	if (!ret) {
 	        error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_DENIED,
 	                             "cannot get write to %s with uid %i", directory, uid);
commit 8c8810a63f415604c004075ea511c0b94001845d
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Aug 15 13:22:45 2008 +0100

    bugfix: check for write access on the directory we are downloading into to prevent problems like 'pkcon download /etc/ hal'

diff --git a/libpackagekit/pk-common.c b/libpackagekit/pk-common.c
index e56e192..d34f240 100644
--- a/libpackagekit/pk-common.c
+++ b/libpackagekit/pk-common.c
@@ -34,6 +34,8 @@
 #include <string.h>
 #include <sys/types.h>
 #include <sys/utsname.h>
+#include <sys/stat.h>
+
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif /* HAVE_UNISTD_H */
@@ -873,6 +875,45 @@ pk_strbuild_va (const gchar *first_element, va_list *args)
 	return g_string_free (string, FALSE);
 }
 
+/**
+ * gpk_client_check_permissions:
+ * @filename: a filename to check
+ * @euid: the effective user ID to check for, or the output of geteuid()
+ * @egid: the effective group ID to check for, or the output of getegid()
+ * @mode: bitfield of R_OK, W_OK, XOK
+ *
+ * Like, access but a bit more accurate - access will let root do anything.
+ * Does not get read-only or no-exec filesystems right.
+ *
+ * Return value: %TRUE if the file has access perms
+ **/
+gboolean
+pk_client_check_permissions (const gchar *filename, guint euid, guint egid, guint mode)
+{
+	struct stat statbuf;
+
+	if (stat (filename, &statbuf) == 0) {
+		if ((mode & R_OK) &&
+		    !((statbuf.st_mode & S_IROTH) ||
+		      ((statbuf.st_mode & S_IRUSR) && euid == statbuf.st_uid) ||
+		      ((statbuf.st_mode & S_IRGRP) && egid == statbuf.st_gid)))
+			return FALSE;
+		if ((mode & W_OK) &&
+		    !((statbuf.st_mode & S_IWOTH) ||
+		      ((statbuf.st_mode & S_IWUSR) && euid == statbuf.st_uid) ||
+		      ((statbuf.st_mode & S_IWGRP) && egid == statbuf.st_gid)))
+			return FALSE;
+		if ((mode & X_OK) &&
+		    !((statbuf.st_mode & S_IXOTH) ||
+		      ((statbuf.st_mode & S_IXUSR) && euid == statbuf.st_uid) ||
+		      ((statbuf.st_mode & S_IXGRP) && egid == statbuf.st_gid)))
+			return FALSE;
+
+		return TRUE;
+	}
+	return FALSE;
+}
+
 /***************************************************************************
  ***                          MAKE CHECK TESTS                           ***
  ***************************************************************************/
diff --git a/libpackagekit/pk-common.h b/libpackagekit/pk-common.h
index 02a508b..6a07e3c 100644
--- a/libpackagekit/pk-common.h
+++ b/libpackagekit/pk-common.h
@@ -113,6 +113,10 @@ gchar		*pk_iso8601_from_date			(const GDate	*date);
 GDate		*pk_iso8601_to_date			(const gchar	*iso_date);
 gchar		*pk_get_distro_id			(void)
 							 G_GNUC_WARN_UNUSED_RESULT;
+gboolean	 pk_client_check_permissions		(const gchar	*filename,
+							 guint		 euid,
+							 guint		 egid,
+							 guint		 mode);
 
 G_END_DECLS
 
diff --git a/src/pk-security-dummy.c b/src/pk-security-dummy.c
index 0c47305..6ee3d45 100644
--- a/src/pk-security-dummy.c
+++ b/src/pk-security-dummy.c
@@ -46,9 +46,6 @@ G_DEFINE_TYPE (PkSecurity, pk_security, G_TYPE_OBJECT)
 
 /**
  * pk_security_action_is_allowed:
- *
- * Only valid from an async caller, which is fine, as we won't prompt the user
- * when not async.
  **/
 G_GNUC_WARN_UNUSED_RESULT gboolean
 pk_security_action_is_allowed (PkSecurity *security, const gchar *dbus_sender,
@@ -59,6 +56,17 @@ pk_security_action_is_allowed (PkSecurity *security, const gchar *dbus_sender,
 }
 
 /**
+ * pk_security_uid_from_dbus_sender:
+ **/
+gboolean
+pk_security_uid_from_dbus_sender (PkSecurity *security, const gchar *dbus_name, guint *uid)
+{
+	g_return_val_if_fail (PK_IS_SECURITY (security), FALSE);
+	/* not returning TRUE due to easy misuse */
+	return FALSE;
+}
+
+/**
  * pk_security_finalize:
  **/
 static void
diff --git a/src/pk-security-polkit.c b/src/pk-security-polkit.c
index 1310cd7..1c4aa6e 100644
--- a/src/pk-security-polkit.c
+++ b/src/pk-security-polkit.c
@@ -54,6 +54,40 @@ G_DEFINE_TYPE (PkSecurity, pk_security, G_TYPE_OBJECT)
 static gpointer pk_security_object = NULL;
 
 /**
+ * pk_security_uid_from_dbus_sender:
+ **/
+gboolean
+pk_security_uid_from_dbus_sender (PkSecurity *security, const gchar *dbus_name, guint *uid)
+{
+	PolKitCaller *caller;
+	DBusError dbus_error;
+	polkit_bool_t retval;
+	gboolean ret = FALSE;
+
+	g_return_val_if_fail (PK_IS_SECURITY (security), FALSE);
+
+	/* get the PolKitCaller information */
+	dbus_error_init (&dbus_error);
+	caller = polkit_caller_new_from_dbus_name (security->priv->connection, dbus_name, &dbus_error);
+	if (dbus_error_is_set (&dbus_error)) {
+		pk_warning ("failed to get caller %s: %s\n", dbus_error.name, dbus_error.message);
+		dbus_error_free (&dbus_error);
+		goto out;
+	}
+
+	/* get uid */
+	retval = polkit_caller_get_uid (caller, uid);
+	if (!retval) {
+		pk_warning ("failed to get UID");
+		goto out;
+	}
+	ret = TRUE;
+out:
+	polkit_caller_unref (caller);
+	return ret;
+}
+
+/**
  * pk_security_can_do_action:
  **/
 G_GNUC_WARN_UNUSED_RESULT static PolKitResult
@@ -102,7 +136,6 @@ pk_security_role_to_action (PkSecurity *security, gboolean trusted, PkRoleEnum r
 {
 	const gchar *policy = NULL;
 
-	g_return_val_if_fail (security != NULL, NULL);
 	g_return_val_if_fail (PK_IS_SECURITY (security), NULL);
 
 	if (role == PK_ROLE_ENUM_UPDATE_PACKAGES ||
diff --git a/src/pk-security.h b/src/pk-security.h
index 3037c8e..834c1a9 100644
--- a/src/pk-security.h
+++ b/src/pk-security.h
@@ -53,6 +53,10 @@ typedef struct
 GType		 pk_security_get_type		(void) G_GNUC_CONST;
 PkSecurity	*pk_security_new		(void);
 
+gboolean	 pk_security_uid_from_dbus_sender (PkSecurity	*security,
+						 const gchar	*dbus_name,
+						 guint		*uid)
+						 G_GNUC_WARN_UNUSED_RESULT;
 gboolean	 pk_security_action_is_allowed	(PkSecurity	*security,
 						 const gchar	*dbus_sender,
 						 gboolean	 trusted,
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index e26070c..35d1b35 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -191,6 +191,7 @@ pk_transaction_error_get_type (void)
 			ENUM_ENTRY (PK_TRANSACTION_ERROR_NOT_SUPPORTED, "NotSupported"),
 			ENUM_ENTRY (PK_TRANSACTION_ERROR_NO_SUCH_TRANSACTION, "NoSuchTransaction"),
 			ENUM_ENTRY (PK_TRANSACTION_ERROR_NO_SUCH_FILE, "NoSuchFile"),
+			ENUM_ENTRY (PK_TRANSACTION_ERROR_NO_SUCH_DIRECTORY, "NoSuchDirectory"),
 			ENUM_ENTRY (PK_TRANSACTION_ERROR_TRANSACTION_EXISTS_WITH_ROLE, "TransactionExistsWithRole"),
 			ENUM_ENTRY (PK_TRANSACTION_ERROR_REFUSED_BY_POLICY, "RefusedByPolicy"),
 			ENUM_ENTRY (PK_TRANSACTION_ERROR_PACKAGE_ID_INVALID, "PackageIdInvalid"),
@@ -1260,6 +1261,8 @@ pk_transaction_download_packages (PkTransaction *transaction, gchar **package_id
 	gboolean ret;
 	GError *error;
 	gchar *package_ids_temp;
+	guint uid;
+	const gchar *dbus_name;
 
 	g_return_if_fail (PK_IS_TRANSACTION (transaction));
 	g_return_if_fail (transaction->priv->tid != NULL);
@@ -1272,6 +1275,35 @@ pk_transaction_download_packages (PkTransaction *transaction, gchar **package_id
 	                             "Operation not yet supported by backend");
 		pk_transaction_list_remove (transaction->priv->transaction_list,
 					    transaction->priv->tid);
+	        dbus_g_method_return_error (context, error);
+	        return;
+	}
+
+	/* does directory exist? */
+	ret = g_file_test (directory, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR);
+	if (!ret) {
+	        error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_NO_SUCH_DIRECTORY,
+	                             "directory '%s' cannot be found", directory);
+	        dbus_g_method_return_error (context, error);
+	        return;
+	}
+
+	/* get the UID of the sender */
+	dbus_name = dbus_g_method_get_sender (context);
+	ret = pk_security_uid_from_dbus_sender (transaction->priv->security, dbus_name, &uid);
+	if (!ret) {
+	        error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_REFUSED_BY_POLICY,
+	                             "cannot get uid from dbus sender: %s", dbus_name);
+	        dbus_g_method_return_error (context, error);
+	        return;
+	}
+
+	/* check for write access on the directory */
+	ret = pk_client_check_permissions (directory, uid, uid, W_OK);
+	if (!ret) {
+	        error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_DENIED,
+	                             "cannot get write to %s with uid %i", directory, uid);
+	        dbus_g_method_return_error (context, error);
 	        return;
 	}
 
diff --git a/src/pk-transaction.h b/src/pk-transaction.h
index 5e77a79..1dce619 100644
--- a/src/pk-transaction.h
+++ b/src/pk-transaction.h
@@ -61,6 +61,7 @@ typedef enum
 	PK_TRANSACTION_ERROR_NOT_SUPPORTED,
 	PK_TRANSACTION_ERROR_NO_SUCH_TRANSACTION,
 	PK_TRANSACTION_ERROR_NO_SUCH_FILE,
+	PK_TRANSACTION_ERROR_NO_SUCH_DIRECTORY,
 	PK_TRANSACTION_ERROR_TRANSACTION_EXISTS_WITH_ROLE,
 	PK_TRANSACTION_ERROR_REFUSED_BY_POLICY,
 	PK_TRANSACTION_ERROR_PACKAGE_ID_INVALID,
commit b42de6a7415d9a6d9c8a010fc82d1587c02aaddc
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Aug 15 12:27:59 2008 +0100

    bugfix: fix pkcon download foo

diff --git a/client/pk-console.c b/client/pk-console.c
index a221f28..f483904 100644
--- a/client/pk-console.c
+++ b/client/pk-console.c
@@ -778,13 +778,12 @@ pk_console_download_packages (PkClient *client, gchar **packages, const gchar *d
 	guint length;
 	GPtrArray *array_packages;
 
-
 	array_packages = g_ptr_array_new ();
 	length = g_strv_length (packages);
-	for (i=2; i<length; i++) {
+	for (i=3; i<length; i++) {
 			package_id = pk_console_perhaps_resolve (client, PK_FILTER_ENUM_NONE, packages[i], error);
 			if (package_id == NULL) {
-				*error = g_error_new (1, 0, "%s: packages[i]", _("Could not find package to download:"));
+				*error = g_error_new (1, 0, "%s: %s", _("Could not find package to download"), packages[i]);
 				ret = FALSE;
 				break;
 			}
@@ -1220,7 +1219,7 @@ pk_console_get_summary (PkRoleEnum roles)
 		g_string_append_printf (string, "  %s\n", "install [packages|files]");
 	}
 	if (pk_enums_contain (roles, PK_ROLE_ENUM_DOWNLOAD_PACKAGES)) {
-		g_string_append_printf (string, "  %s\n", "download [packages] [directory]");
+		g_string_append_printf (string, "  %s\n", "download [directory] [packages]");
 	}
 	if (pk_enums_contain (roles, PK_ROLE_ENUM_INSTALL_SIGNATURE)) {
 		g_string_append_printf (string, "  %s\n", "install-sig [type] [key_id] [package_id]");
@@ -1299,7 +1298,6 @@ main (int argc, char *argv[])
 	const gchar *value = NULL;
 	const gchar *details = NULL;
 	const gchar *parameter = NULL;
-	const gchar *directory = "/tmp";
 	PkGroupEnum groups;
 	gchar *text;
 	ret = FALSE;
@@ -1486,11 +1484,16 @@ main (int argc, char *argv[])
 		}
 		ret = pk_console_remove_packages (client, argv, &error);
 	} else if (strcmp (mode, "download") == 0) {
-		if (value == NULL || directory == NULL) {
-			error = g_error_new (1, 0, "%s", _("You need to specify the package to download and the destination directory"));
+		if (value == NULL || details == NULL) {
+			error = g_error_new (1, 0, "%s", _("You need to specify the destination directory and then the packages to download"));
+			goto out;
+		}
+		ret = g_file_test (value, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR);
+		if (!ret) {
+			error = g_error_new (1, 0, "%s: %s", _("Directory not found"), value);
 			goto out;
 		}
-		ret = pk_console_download_packages (client, argv, directory, &error);
+		ret = pk_console_download_packages (client, argv, value, &error);
 	} else if (strcmp (mode, "accept-eula") == 0) {
 		if (value == NULL) {
 			error = g_error_new (1, 0, "%s", _("You need to specify a eula-id"));
diff --git a/contrib/pk-completion.bash b/contrib/pk-completion.bash
index 4561791..ec61a6d 100755
--- a/contrib/pk-completion.bash
+++ b/contrib/pk-completion.bash
@@ -25,7 +25,7 @@ __pkcon_commandlist="
     get-filters
     get-groups
     get-packages
-    download-packages
+    download
     get-requires
     get-time
     get-transactions
commit d961f79241c1ccdc4fe44ff12ee64b4d63cc6e5b
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Aug 15 10:49:36 2008 +0100

    trivial: a few trivial fixes to make check complete

diff --git a/libpackagekit/pk-common.c b/libpackagekit/pk-common.c
index df971f0..e56e192 100644
--- a/libpackagekit/pk-common.c
+++ b/libpackagekit/pk-common.c
@@ -1522,7 +1522,7 @@ libst_common (LibSelfTest *test)
 
 	/************************************************************/
 	libst_title (test, "test replace unsafe (multiple invalid)");
-	text_safe = pk_strsafe ("'Richard\"Hughes\"");
+	text_safe = pk_strsafe (" Richard\"Hughes\"");
 	if (pk_strequal (text_safe, " Richard Hughes ")) {
 		libst_success (test, NULL);
 	} else {
diff --git a/src/Makefile.am b/src/Makefile.am
index 5dbfe67..58e6cf7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -185,6 +185,7 @@ pk_self_test_LDADD =					\
 	$(PK_LIBS)					\
 	$(POLKIT_LIBS)					\
 	$(GIO_LIBS)					\
+	$(TAR_LIBS)					\
 	$(NULL)
 
 TESTS = pk-self-test
diff --git a/src/pk-security-polkit.c b/src/pk-security-polkit.c
index 6d6a1aa..1310cd7 100644
--- a/src/pk-security-polkit.c
+++ b/src/pk-security-polkit.c
@@ -343,7 +343,7 @@ libst_security (LibSelfTest *test)
 	/************************************************************/
 	libst_title (test, "map valid role to action");
 	action = pk_security_role_to_action (security, FALSE, PK_ROLE_ENUM_UPDATE_PACKAGES);
-	if (pk_strequal (action, "org.freedesktop.packagekit.update-package")) {
+	if (pk_strequal (action, "org.freedesktop.packagekit.system-update")) {
 		libst_success (test, NULL, error);
 	} else {
 		libst_failed (test, "did not get correct action '%s'", action);
commit 33f828bd236ccce9363cc35deb1e4448be609344
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Aug 15 09:36:12 2008 +0100

    bugfix: don't blacklist apostrophe characters. fixes rh#459155

diff --git a/libpackagekit/pk-common.c b/libpackagekit/pk-common.c
index 57d057c..df971f0 100644
--- a/libpackagekit/pk-common.c
+++ b/libpackagekit/pk-common.c
@@ -302,7 +302,7 @@ pk_strsafe (const gchar *text)
 	}
 
 	/* rip out any insane characters */
-	delimiters = "\\\f\r\t\"'";
+	delimiters = "\\\f\r\t\"";
 	text_safe = g_strdup (text);
 	g_strdelimit (text_safe, delimiters, ' ');
 	return text_safe;
commit 117aa013669c6ade0cb155669c1776fd04a95ec3
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Aug 15 08:29:00 2008 +0100

    trivial: fix the gtk-doc markup for a couple of signals

diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index 2d0e82b..d5d7de1 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -3386,7 +3386,7 @@ pk_client_class_init (PkClientClass *klass)
 	/**
 	 * PkClient::transaction:
 	 * @client: the #PkClient instance that emitted the signal
-	 * @tid: the moo of the transaction
+	 * @tid: the ID of the transaction
 	 * @timespec: the iso8601 date and time the transaction completed
 	 * @succeeded: if the transaction succeeded
 	 * @role: the #PkRoleEnum of the transaction, e.g. PK_ROLE_ENUM_REFRESH_CACHE
@@ -3406,14 +3406,7 @@ pk_client_class_init (PkClientClass *klass)
 	/**
 	 * PkClient::update-detail:
 	 * @client: the #PkClient instance that emitted the signal
-	 * @package_id: the package_id of the package
-	 * @updates: the list of packages the update updates
-	 * @obsoletes: the list of packages the update obsoletes
-	 * @vendor_url: the list of vendor URL's of the update
-	 * @bugzilla_url: the list of bugzilla URL's of the update
-	 * @cve_url: the list of CVE URL's of the update
-	 * @restart: the #PkRestartEnum of the update, e.g. PK_RESTART_ENUM_SYSTEM
-	 * @update_text: the update summary of the update
+	 * @details: a pointer to a PkUpdateDetailsObj strusture descibing the update
 	 *
 	 * The ::update-detail signal is emitted when GetUpdateDetail() is
 	 * called on a set of package_id's.
@@ -3427,12 +3420,7 @@ pk_client_class_init (PkClientClass *klass)
 	/**
 	 * PkClient::details:
 	 * @client: the #PkClient instance that emitted the signal
-	 * @package_id: the package_id of the package
-	 * @license: the licence of the package, e.g. "GPLv2+"
-	 * @group: the #PkGroupEnum of the package, e.g. PK_GROUP_ENUM_EDUCATION
-	 * @description: the description of the package
-	 * @url: the upstream URL of the package
-	 * @size: the size of the package in bytes
+	 * @detail: a pointer to a PkDetailObj strusture descibing the package
 	 *
 	 * The ::details signal is emitted when GetDetails() is called.
 	 **/
commit 1b89b5585a7fc0d38e70d99bf96bcdbd42d07e15
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Aug 14 17:24:18 2008 +0100

    trivial: fix a segfault in pkgenpack

diff --git a/client/pk-generate-pack.c b/client/pk-generate-pack.c
index a9f037e..84b9900 100644
--- a/client/pk-generate-pack.c
+++ b/client/pk-generate-pack.c
@@ -359,7 +359,7 @@ pk_generate_pack_main (const gchar *pack_filename, const gchar *directory, const
 	const PkPackageObj *obj;
 	GPtrArray *file_array = NULL;
 	PkClient *client;
-	GError *error_local;
+	GError *error_local = NULL;
 	gboolean ret = FALSE;
 	gchar *text;
 
commit 38770118c5301c2782eede024187800a618cde9f
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Aug 14 16:12:51 2008 +0100

    add some error checks in libpackagekit to try to detect invalid errors

diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index bb317f9..2d0e82b 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -376,6 +376,7 @@ gboolean
 pk_client_set_use_buffer (PkClient *client, gboolean use_buffer, GError **error)
 {
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* are we doing this without any need? */
 	if (client->priv->use_buffer) {
@@ -402,6 +403,7 @@ gboolean
 pk_client_set_synchronous (PkClient *client, gboolean synchronous, GError **error)
 {
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* are we doing this without any need? */
 	if (client->priv->synchronous) {
@@ -771,6 +773,7 @@ pk_client_get_allow_cancel (PkClient *client, gboolean *allow_cancel, GError **e
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (client->priv->tid != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -854,6 +857,7 @@ pk_client_get_status (PkClient *client, PkStatusEnum *status, GError **error)
 	g_return_val_if_fail (status != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (client->priv->tid != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -891,6 +895,7 @@ pk_client_get_package (PkClient *client, gchar **package, GError **error)
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (package != NULL, FALSE);
 	g_return_val_if_fail (client->priv->tid != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -929,6 +934,7 @@ pk_client_get_progress (PkClient *client, guint *percentage, guint *subpercentag
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (client->priv->tid != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -967,6 +973,7 @@ pk_client_get_role (PkClient *client, PkRoleEnum *role, gchar **text, GError **e
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (role != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -1018,6 +1025,7 @@ pk_client_cancel (PkClient *client, GError **error)
 	GError *error_local = NULL;
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* we don't need to cancel, so return TRUE */
 	if (client->priv->proxy == NULL) {
@@ -1064,6 +1072,7 @@ pk_client_allocate_transaction_id (PkClient *client, GError **error)
 	GError *error_local = NULL;
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get a new ID */
 	ret = pk_control_allocate_transaction_id (client->priv->control, &tid, &error_local);
@@ -1101,6 +1110,7 @@ pk_client_get_updates (PkClient *client, PkFilterEnum filters, GError **error)
 	gchar *filter_text;
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -1145,6 +1155,7 @@ pk_client_update_system_action (PkClient *client, GError **error)
 
 	g_return_val_if_fail (client != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -1177,6 +1188,7 @@ pk_client_update_system (PkClient *client, GError **error)
 	GError *error_pk = NULL; /* we can't use the same error as we might be NULL */
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -1244,6 +1256,7 @@ pk_client_search_name (PkClient *client, PkFilterEnum filters, const gchar *sear
 	gchar *filter_text;
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -1300,6 +1313,7 @@ pk_client_search_details (PkClient *client, PkFilterEnum filters, const gchar *s
 	gchar *filter_text;
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -1354,6 +1368,7 @@ pk_client_search_group (PkClient *client, PkFilterEnum filters, const gchar *sea
 	gchar *filter_text;
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -1408,6 +1423,7 @@ pk_client_search_file (PkClient *client, PkFilterEnum filters, const gchar *sear
 	gchar *filter_text;
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -1465,6 +1481,7 @@ pk_client_get_depends (PkClient *client, PkFilterEnum filters, gchar **package_i
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (package_ids != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check the PackageIDs here to avoid a round trip if invalid */
 	ret = pk_package_ids_check (package_ids);
@@ -1530,6 +1547,7 @@ pk_client_download_packages (PkClient *client, gchar **package_ids, const gchar
 
         g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
         g_return_val_if_fail (package_ids != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
         /* check the PackageIDs here to avoid a round trip if invalid */
         ret = pk_package_ids_check (package_ids);
@@ -1592,6 +1610,7 @@ pk_client_get_packages (PkClient *client, PkFilterEnum filters, GError **error)
 	gchar *filter_text;
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -1645,6 +1664,7 @@ pk_client_set_locale (PkClient *client, const gchar *code, GError **error)
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (code != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -1679,6 +1699,7 @@ pk_client_get_requires (PkClient *client, PkFilterEnum filters, gchar **package_
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (package_ids != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check the PackageIDs here to avoid a round trip if invalid */
 	ret = pk_package_ids_check (package_ids);
@@ -1752,6 +1773,7 @@ pk_client_what_provides (PkClient *client, PkFilterEnum filters, PkProvidesEnum
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (provides != PK_PROVIDES_ENUM_UNKNOWN, FALSE);
 	g_return_val_if_fail (search != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -1811,6 +1833,7 @@ pk_client_get_update_detail (PkClient *client, gchar **package_ids, GError **err
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (package_ids != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check the PackageIDs here to avoid a round trip if invalid */
 	ret = pk_package_ids_check (package_ids);
@@ -1870,6 +1893,7 @@ pk_client_rollback (PkClient *client, const gchar *transaction_id, GError **erro
 	gboolean ret;
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -1923,6 +1947,7 @@ pk_client_resolve (PkClient *client, PkFilterEnum filters, gchar **packages, GEr
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (packages != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -1978,6 +2003,7 @@ pk_client_get_details (PkClient *client, gchar **package_ids, GError **error)
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (package_ids != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check the PackageIDs here to avoid a round trip if invalid */
 	ret = pk_package_ids_check (package_ids);
@@ -2038,6 +2064,7 @@ pk_client_get_files (PkClient *client, gchar **package_ids, GError **error)
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (package_ids != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check the PackageIDs here to avoid a round trip if invalid */
 	ret = pk_package_ids_check (package_ids);
@@ -2092,6 +2119,7 @@ pk_client_remove_packages_action (PkClient *client, gchar **package_ids,
 
 	g_return_val_if_fail (client != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -2130,6 +2158,7 @@ pk_client_remove_packages (PkClient *client, gchar **package_ids, gboolean allow
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (package_ids != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check the PackageIDs here to avoid a round trip if invalid */
 	ret = pk_package_ids_check (package_ids);
@@ -2195,6 +2224,7 @@ pk_client_refresh_cache_action (PkClient *client, gboolean force, GError **error
 
 	g_return_val_if_fail (client != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -2227,6 +2257,7 @@ pk_client_refresh_cache (PkClient *client, gboolean force, GError **error)
 	GError *error_pk = NULL; /* we can't use the same error as we might be NULL */
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -2280,6 +2311,7 @@ pk_client_install_package_action (PkClient *client, gchar **package_ids, GError
 
 	g_return_val_if_fail (client != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -2311,6 +2343,7 @@ pk_client_install_packages (PkClient *client, gchar **package_ids, GError **erro
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (package_ids != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check the PackageIDs here to avoid a round trip if invalid */
 	ret = pk_package_ids_check (package_ids);
@@ -2376,6 +2409,7 @@ pk_client_install_signature_action (PkClient *client, PkSigTypeEnum type, const
 
 	g_return_val_if_fail (client != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -2412,6 +2446,7 @@ pk_client_install_signature (PkClient *client, PkSigTypeEnum type, const gchar *
 	g_return_val_if_fail (type != PK_SIGTYPE_ENUM_UNKNOWN, FALSE);
 	g_return_val_if_fail (key_id != NULL, FALSE);
 	g_return_val_if_fail (package_id != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check the PackageID here to avoid a round trip if invalid */
 	ret = pk_package_id_check (package_id);
@@ -2474,6 +2509,7 @@ pk_client_update_packages_action (PkClient *client, gchar **package_ids, GError
 
 	g_return_val_if_fail (client != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -2505,6 +2541,7 @@ pk_client_update_packages (PkClient *client, gchar **package_ids, GError **error
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (package_ids != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check the PackageIDs here to avoid a round trip if invalid */
 	ret = pk_package_ids_check (package_ids);
@@ -2572,6 +2609,7 @@ pk_client_install_files_action (PkClient *client, gboolean trusted, gchar **file
 
 	g_return_val_if_fail (client != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -2637,6 +2675,7 @@ pk_client_install_files (PkClient *client, gboolean trusted, gchar **files_rel,
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (files_rel != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -2713,6 +2752,7 @@ pk_client_get_repo_list (PkClient *client, PkFilterEnum filters, GError **error)
 	gchar *filter_text;
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -2757,6 +2797,7 @@ pk_client_accept_eula_action (PkClient *client, const gchar *eula_id, GError **e
 
 	g_return_val_if_fail (client != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -2787,6 +2828,7 @@ pk_client_accept_eula (PkClient *client, const gchar *eula_id, GError **error)
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (eula_id != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -2839,6 +2881,7 @@ pk_client_repo_enable_action (PkClient *client, const gchar *repo_id, gboolean e
 
 	g_return_val_if_fail (client != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -2871,6 +2914,7 @@ pk_client_repo_enable (PkClient *client, const gchar *repo_id, gboolean enabled,
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (repo_id != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -2926,6 +2970,7 @@ pk_client_repo_set_data_action (PkClient *client, const gchar *repo_id,
 
 	g_return_val_if_fail (client != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -2964,6 +3009,7 @@ pk_client_repo_set_data (PkClient *client, const gchar *repo_id, const gchar *pa
 	g_return_val_if_fail (repo_id != NULL, FALSE);
 	g_return_val_if_fail (parameter != NULL, FALSE);
 	g_return_val_if_fail (value != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -3024,6 +3070,7 @@ pk_client_is_caller_active (PkClient *client, gboolean *is_active, GError **erro
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (is_active != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (client->priv->proxy == NULL) {
@@ -3054,6 +3101,7 @@ pk_client_get_old_transactions (PkClient *client, guint number, GError **error)
 	gboolean ret;
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* get and set a new ID */
 	ret = pk_client_allocate_transaction_id (client, error);
@@ -3095,6 +3143,7 @@ pk_client_requeue (PkClient *client, GError **error)
 	PkClientPrivate *priv = PK_CLIENT_GET_PRIVATE (client);
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* we are no longer waiting, we are setting up */
 	if (priv->role == PK_ROLE_ENUM_UNKNOWN) {
@@ -3185,6 +3234,9 @@ pk_client_set_tid (PkClient *client, const gchar *tid, GError **error)
 {
 	DBusGProxy *proxy = NULL;
 
+	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
 	if (client->priv->tid != NULL) {
 		pk_client_error_set (error, PK_CLIENT_ERROR_ALREADY_TID,
 				     "cannot set the tid on an already set client");
@@ -3637,6 +3689,7 @@ pk_client_reset (PkClient *client, GError **error)
 	gboolean ret;
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	if (client->priv->tid != NULL && !client->priv->is_finished) {
 		pk_debug ("not exit status, will try to cancel tid %s", client->priv->tid);
diff --git a/libpackagekit/pk-control.c b/libpackagekit/pk-control.c
index 7132a85..6483112 100644
--- a/libpackagekit/pk-control.c
+++ b/libpackagekit/pk-control.c
@@ -112,6 +112,8 @@ pk_control_error_set (GError **error, gint code, const gchar *format, ...)
 	gchar *buffer = NULL;
 	gboolean ret = TRUE;
 
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
 	va_start (args, format);
 	g_vasprintf (&buffer, format, args);
 	va_end (args);
@@ -378,6 +380,7 @@ pk_control_get_backend_detail (PkControl *control, gchar **name, gchar **author,
 	gchar *tauthor;
 
 	g_return_val_if_fail (PK_IS_CONTROL (control), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (control->priv->proxy == NULL) {
@@ -428,6 +431,7 @@ pk_control_get_time_since_action (PkControl *control, PkRoleEnum role, guint *se
 	const gchar *role_text;
 
 	g_return_val_if_fail (PK_IS_CONTROL (control), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	role_text = pk_role_enum_to_text (role);
 
@@ -455,6 +459,8 @@ pk_control_set_locale (PkControl *control, const gchar *tid, GError **error)
 	gboolean ret;
 	gchar *locale; /* does not need to be freed */
 
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
 	client = pk_client_new ();
 	ret = pk_client_set_tid (client, tid, error);
 	if (!ret) {
@@ -491,6 +497,7 @@ pk_control_allocate_transaction_id (PkControl *control, gchar **tid, GError **er
 	gchar *tid_local = NULL;
 
 	g_return_val_if_fail (PK_IS_CONTROL (control), FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check to see if we have a valid proxy */
 	if (control->priv->proxy == NULL) {
commit f4e5dbe032bb17a2d7dde53ee17b01ae5ecf6ce4
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Aug 14 16:12:01 2008 +0100

    fix make check now we are are only shipping pk_ (i..e non test functions) in the shared library

diff --git a/libpackagekit/Makefile.am b/libpackagekit/Makefile.am
index ab32df8..9a3c619 100644
--- a/libpackagekit/Makefile.am
+++ b/libpackagekit/Makefile.am
@@ -17,10 +17,6 @@ SELFTEST_LIBS =							\
 	$(top_builddir)/libselftest/libselftest.la		\
 	$(NULL)
 
-PK_LIBS =							\
-	$(top_builddir)/libpackagekit/libpackagekit.la		\
-	$(NULL)
-
 lib_LTLIBRARIES =						\
 	libpackagekit.la					\
 	$(NULL)
@@ -111,6 +107,7 @@ check_PROGRAMS =						\
 	pk-self-test
 
 pk_self_test_SOURCES =						\
+	$(libpackagekit_la_SOURCES)				\
 	pk-self-test.c						\
 	$(NULL)
 
@@ -118,9 +115,12 @@ pk_self_test_LDADD =						\
 	$(GLIB_LIBS)						\
 	$(DBUS_LIBS)						\
 	$(SELFTEST_LIBS)					\
-	$(PK_LIBS)						\
+	$(POLKIT_LIBS)						\
+	$(SQLITE_LIBS)						\
 	$(NULL)
 
+pk_self_test_CFLAGS = $(AM_CFLAGS)
+
 TESTS = pk-self-test
 endif
 
commit 51bc414434ebf4cef3bde495da7d20bce9ad02d3
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Thu Aug 14 12:02:21 2008 +0200

    Fix a gcc 4.2.3 oddity

diff --git a/client/pk-generate-pack.c b/client/pk-generate-pack.c
index 3d82bb8..a9f037e 100644
--- a/client/pk-generate-pack.c
+++ b/client/pk-generate-pack.c
@@ -250,7 +250,7 @@ pk_generate_pack_create (const gchar *tarfilename, GPtrArray *file_array, GError
 	gchar *src;
 	gchar *dest;
 	gchar *meta_src;
-	gchar *meta_dest;
+	gchar *meta_dest = NULL;
 
 	/* create a file with metadata in it */
 	meta_src = g_build_filename (g_get_tmp_dir (), "metadata.conf", NULL);
commit adbb3ef7b61457ae123f9c3cea1ec400f19839d4
Merge: 5c361ab... 273fd6f...
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Thu Aug 14 09:39:33 2008 +0200

    Merge branch 'master' of git+ssh://glatzor@git.packagekit.org/srv/git/PackageKit

commit 5c361abcb2993a2236a5a3770a1b84c00df6c7d1
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Thu Aug 14 09:15:29 2008 +0200

    APT: Report packages that are upgradable but cannot be upgraded in GetUpdates

diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index cfef824..ebcf2e3 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -327,6 +327,8 @@ class PackageKitAptBackend(PackageKitBaseBackend):
         self.NoPercentageUpdates()
         self._check_init(progress=False)
         self._cache.upgrade(False)
+        updates = filter(lambda p: self._cache[p].isUpgradable,
+                         self._cache.keys())
         for pkg in self._cache.getChanges():
             if self._canceled.isSet():
                 self.ErrorCode(ERROR_TRANSACTION_CANCELLED,
@@ -335,6 +337,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
                 self._canceled.clear()
                 return
             else:
+                updates.remove(pkg.name)
                 info = INFO_NORMAL
                 archive = pkg.candidateOrigin[0].archive
                 origin = pkg.candidateOrigin[0].origin
@@ -351,6 +354,9 @@ class PackageKitAptBackend(PackageKitBaseBackend):
                 if origin in ["Backports.org archive"] and trusted == True:
                         info = INFO_ENHANCEMENT
                 self._emit_package(pkg, info)
+        # Report packages that are upgradable but cannot be upgraded
+        for missed in updates:
+             self._emit_package(self._cache[missed], INFO_BLOCKED)
         self._cache._depcache.Init()
         self.Finished(EXIT_SUCCESS)
 
commit 2bec9c3ae196da29f5ffbefd26b18a0ca0a1529e
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Thu Aug 14 08:49:48 2008 +0200

    APT: Implement SetLocale. Needs to be tested.

diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index 56c4f2f..cfef824 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -18,6 +18,7 @@ the Free Software Foundation; either version 2 of the License, or
 __author__  = "Sebastian Heinlein <devel at glatzor.de>"
 __state__   = "experimental"
 
+import locale
 import logging
 import optparse
 import os
@@ -898,6 +899,16 @@ class PackageKitAptBackend(PackageKitBaseBackend):
             pkglog.debug("Set ftp proxy to %s" % ftp_proxy)
             apt_pkg.Config.set("ftp::Proxy", ftp_proxy)
 
+    def doSetLocale(self, code):
+        '''
+        Set the locale of the daemon
+
+        '''
+        #FIXME: Needs testing
+        if code != "":
+            pklog.debug("Setting language to %s" % code)
+            locale.setlocale("LANG", code)
+
     # Helpers
 
     def _open_cache(self, prange=(0,100), progress=True):
commit dc4b7c8daf966e975dd3397af45743176ef7b3e8
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Thu Aug 14 08:49:30 2008 +0200

    Implement SetLocale in the python dbus backend

diff --git a/python/packagekit/daemonBackend.py b/python/packagekit/daemonBackend.py
index 3e31d7f..eb2ac8a 100644
--- a/python/packagekit/daemonBackend.py
+++ b/python/packagekit/daemonBackend.py
@@ -837,6 +837,23 @@ class PackageKitBaseBackend(dbus.service.Object):
                        "This function is not implemented in this backend")
         self.Finished(EXIT_FAILED)
 
+    @dbus.service.method(PACKAGEKIT_DBUS_INTERFACE,
+                         in_signature='s',out_signature='')
+    def SetLocale(self, code):
+        '''
+        Allow to set the locale of the backend.
+        '''
+        pklog.info("SetLocale(): %s" % code)
+        self.doSetLocale(code)
+
+    def doSetLocale(self, code):
+        '''
+        Should be replaced in the corresponding backend sub class
+        '''
+        self.ErrorCode(ERROR_NOT_SUPPORTED,
+                       "This function is not implemented in this backend")
+        self.Finished(EXIT_FAILED)
+
 #
 # Utility methods
 #
commit 273fd6f03b752a10bf55ce137ee401143e5cc1d4
Author: Matt Domsch <matt at domsch.com>
Date:   Thu Aug 14 03:43:33 2008 +0000

    Updated Brazilian Portuguese translation
    
    Transmitted-via: Transifex (translate.fedoraproject.org)

diff --git a/po/pt_BR.po b/po/pt_BR.po
index de85150..7be8e0e 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -8,8 +8,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PackageKit\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-08-05 01:21+0000\n"
-"PO-Revision-Date: 2008-08-06 15:19-0300\n"
+"POT-Creation-Date: 2008-08-08 09:21+0000\n"
+"PO-Revision-Date: 2008-08-14 00:42-0300\n"
 "Last-Translator: Igor Pires Soares <igor at projetofedora.org>\n"
 "Language-Team: Brazilian Portuguese <fedora-trans-pt_br at redhat.com>\n"
 "MIME-Version: 1.0\n"
@@ -19,235 +19,273 @@ msgstr ""
 "X-Poedit-Language: Portuguese\n"
 "X-Poedit-Country: BRAZIL\n"
 
-#: ../client/pk-console.c:217
+#: ../client/pk-console.c:220
 msgid "Update detail"
 msgstr "Detalhe da atualização"
 
-#: ../client/pk-console.c:418
+#: ../client/pk-console.c:437
 msgid "A system restart is required"
 msgstr "É necessário reiniciar o sistema"
 
-#: ../client/pk-console.c:420
+#: ../client/pk-console.c:439
 msgid "A logout and login is required"
 msgstr "É necessário sair da sessão e autenticar novamente"
 
-#: ../client/pk-console.c:422
+#: ../client/pk-console.c:441
 msgid "An application restart is required"
 msgstr "É necessário reiniciar a aplicação"
 
-#: ../client/pk-console.c:515
+#: ../client/pk-console.c:534
+#: ../client/pk-generate-pack.c:115
 msgid "There are multiple package matches"
 msgstr "Há múltiplos pacotes correspondentes"
 
 #. find out what package the user wants to use
-#: ../client/pk-console.c:522
+#: ../client/pk-console.c:541
+#: ../client/pk-generate-pack.c:122
 msgid "Please enter the package number: "
 msgstr "Por favor, insira o número do pacote: "
 
-#: ../client/pk-console.c:556
+#: ../client/pk-console.c:575
 msgid "Could not find package to install"
 msgstr "Não foi possível localizar o pacote a ser instalado"
 
-#: ../client/pk-console.c:660
+#: ../client/pk-console.c:679
 msgid "Could not find package to remove"
 msgstr "Não foi possível localizar o pacote a ser removido"
 
-#: ../client/pk-console.c:721
+#: ../client/pk-console.c:740
 msgid "The following packages have to be removed"
 msgstr "Os seguintes pacotes têm que ser removidos"
 
 #. get user input
-#: ../client/pk-console.c:728
+#: ../client/pk-console.c:747
 msgid "Okay to remove additional packages?"
 msgstr "Os pacotes adicionais podem ser removidos?"
 
-#: ../client/pk-console.c:732
+#: ../client/pk-console.c:751
+#: ../client/pk-generate-pack.c:356
+#: ../client/pk-generate-pack.c:487
 msgid "Cancelled!"
 msgstr "Cancelado!"
 
-#: ../client/pk-console.c:766
+#: ../client/pk-console.c:785
 msgid "Could not find package to download:"
 msgstr "Não foi possível localizar o pacote a ser baixado:"
 
-#: ../client/pk-console.c:817
+#: ../client/pk-console.c:836
 msgid "Could not find package to update"
 msgstr "Não foi possível localizar o pacote a ser atualizado"
 
-#: ../client/pk-console.c:839
+#: ../client/pk-console.c:858
 msgid "Could not find what packages require"
 msgstr "Não foi possível localizar quais pacotes necessitam desse pacote"
 
-#: ../client/pk-console.c:860
+#: ../client/pk-console.c:879
 msgid "Could not get dependencies for"
 msgstr "Não foi possível obter as dependências para"
 
-#: ../client/pk-console.c:881
+#: ../client/pk-console.c:900
 msgid "Could not find details for"
 msgstr "Não foi possível localizar os detalhes para"
 
-#: ../client/pk-console.c:904
+#: ../client/pk-console.c:923
 msgid "Could not find the files for this package"
 msgstr "Não foi possível encontrar os arquivos para este pacote"
 
-#: ../client/pk-console.c:911
+#: ../client/pk-console.c:930
 msgid "Could not get the file list"
 msgstr "Não foi possível obter a lista de arquivos"
 
-#: ../client/pk-console.c:930
+#: ../client/pk-console.c:949
 msgid "Could not find the update details for"
 msgstr "Não foi possível localizar os detalhes de atualização para"
 
-#: ../client/pk-console.c:991
+#: ../client/pk-console.c:1010
 msgid "Package description"
 msgstr "Descrição do pacote"
 
-#: ../client/pk-console.c:1014
+#: ../client/pk-console.c:1033
 msgid "Package files"
 msgstr "Arquivos do pacote"
 
-#: ../client/pk-console.c:1022
+#: ../client/pk-console.c:1041
 msgid "No files"
 msgstr "Nenhum arquivo"
 
 #. get user input
-#: ../client/pk-console.c:1054
+#: ../client/pk-console.c:1073
 msgid "Okay to import key?"
 msgstr "A chave pode ser importada?"
 
-#: ../client/pk-console.c:1057
+#: ../client/pk-console.c:1076
 msgid "Did not import key"
 msgstr "Não importar a chave"
 
 #. get user input
-#: ../client/pk-console.c:1097
+#: ../client/pk-console.c:1116
 msgid "Do you agree?"
 msgstr "Você concorda?"
 
-#: ../client/pk-console.c:1100
+#: ../client/pk-console.c:1119
 msgid "Did not agree to licence, task will fail"
 msgstr "Se você não concordar com a licença a tarefa irá falhar"
 
-#: ../client/pk-console.c:1129
+#: ../client/pk-console.c:1148
 msgid "The daemon crashed mid-transaction!"
 msgstr "O daemon travou no meio da transação!"
 
 #. header
-#: ../client/pk-console.c:1182
+#: ../client/pk-console.c:1201
 msgid "PackageKit Console Interface"
 msgstr "Interface em Console do PackageKit"
 
-#: ../client/pk-console.c:1182
+#: ../client/pk-console.c:1201
 msgid "Subcommands:"
 msgstr "Subcomandos:"
 
-#: ../client/pk-console.c:1290
+#: ../client/pk-console.c:1309
+#: ../client/pk-generate-pack.c:420
 #: ../client/pk-monitor.c:104
 #: ../src/pk-main.c:189
 msgid "Show extra debugging information"
 msgstr "Mostrar informações extras de depuração"
 
-#: ../client/pk-console.c:1292
+#: ../client/pk-console.c:1311
 #: ../client/pk-monitor.c:106
 msgid "Show the program version and exit"
 msgstr "Mostrar a versão do programa e sair"
 
-#: ../client/pk-console.c:1294
+#: ../client/pk-console.c:1313
 msgid "Set the filter, e.g. installed"
 msgstr "Definir o filtro, p. ex.: instalados"
 
-#: ../client/pk-console.c:1296
+#: ../client/pk-console.c:1315
 msgid "Exit without waiting for actions to complete"
 msgstr "Sair sem esperar pelo término das ações"
 
-#: ../client/pk-console.c:1319
+#: ../client/pk-console.c:1338
 msgid "Could not connect to system DBUS."
 msgstr "Não foi possível conectar ao DBUS do sistema."
 
-#: ../client/pk-console.c:1413
+#: ../client/pk-console.c:1432
 msgid "You need to specify a search type, e.g. name"
 msgstr "Você precisa especificar um tipo de pesquisa, p. ex. nome"
 
-#: ../client/pk-console.c:1418
-#: ../client/pk-console.c:1425
-#: ../client/pk-console.c:1432
-#: ../client/pk-console.c:1439
-#: ../client/pk-console.c:1545
-#: ../client/pk-console.c:1552
-#: ../client/pk-console.c:1559
-#: ../client/pk-console.c:1566
+#: ../client/pk-console.c:1437
+#: ../client/pk-console.c:1444
+#: ../client/pk-console.c:1451
+#: ../client/pk-console.c:1458
+#: ../client/pk-console.c:1564
+#: ../client/pk-console.c:1571
+#: ../client/pk-console.c:1578
+#: ../client/pk-console.c:1585
 msgid "You need to specify a search term"
 msgstr "Você precisa especificar um termo de pesquisa"
 
-#: ../client/pk-console.c:1444
+#: ../client/pk-console.c:1463
 msgid "Invalid search type"
 msgstr "Tipo de pesquisa inválido"
 
-#: ../client/pk-console.c:1449
+#: ../client/pk-console.c:1468
 msgid "You need to specify a package or file to install"
 msgstr "Você precisa especificar um pacote ou programa a ser instalado"
 
-#: ../client/pk-console.c:1456
+#: ../client/pk-console.c:1475
 msgid "You need to specify a type, key_id and package_id"
 msgstr "Você precisa especificar um tipo, key_id e package_id"
 
-#: ../client/pk-console.c:1463
+#: ../client/pk-console.c:1482
 msgid "You need to specify a package to remove"
 msgstr "Você precisa especificar um pacote a ser removido"
 
-#: ../client/pk-console.c:1469
+#: ../client/pk-console.c:1488
 msgid "You need to specify the package to download and the destination directory"
 msgstr "Você precisa especificar o pacote a ser baixado e o diretório de destino"
 
-#: ../client/pk-console.c:1475
+#: ../client/pk-console.c:1494
 msgid "You need to specify a eula-id"
 msgstr "Você precisa especificar um eula-id"
 
-#: ../client/pk-console.c:1491
+#: ../client/pk-console.c:1510
 msgid "You need to specify a package name to resolve"
 msgstr "Você precisa especificar um nome de pacote a ser analisado"
 
-#: ../client/pk-console.c:1500
-#: ../client/pk-console.c:1507
+#: ../client/pk-console.c:1519
+#: ../client/pk-console.c:1526
 msgid "You need to specify a repo name"
 msgstr "Você precisa especificar um nome de repositório"
 
-#: ../client/pk-console.c:1514
+#: ../client/pk-console.c:1533
 msgid "You need to specify a repo name/parameter and value"
 msgstr "Você precisa especificar um nome/parâmetro de repositório e um valor"
 
-#: ../client/pk-console.c:1527
+#: ../client/pk-console.c:1546
 msgid "You need to specify a time term"
 msgstr "Você precisa especificar um termo de horário"
 
-#: ../client/pk-console.c:1532
+#: ../client/pk-console.c:1551
 msgid "You need to specify a correct role"
 msgstr "Você precisa especificar um papel correto"
 
-#: ../client/pk-console.c:1537
+#: ../client/pk-console.c:1556
 msgid "Failed to get last time"
 msgstr "Falha ao obter o último horário"
 
-#: ../client/pk-console.c:1573
+#: ../client/pk-console.c:1592
 msgid "You need to specify a package to find the details for"
 msgstr "Você precisa especificar o pacote para o qual você quer localizar os detalhes"
 
-#: ../client/pk-console.c:1580
+#: ../client/pk-console.c:1599
 msgid "You need to specify a package to find the files for"
 msgstr "Você precisa especificar o pacote para o qual você quer localizar os arquivos"
 
-#: ../client/pk-console.c:1629
+#: ../client/pk-console.c:1648
 #, c-format
 msgid "Option '%s' not supported"
 msgstr "A opção \"%s\" não é suportada"
 
-#: ../client/pk-console.c:1642
+#: ../client/pk-console.c:1661
 msgid "You don't have the necessary privileges for this operation"
 msgstr "Você não tem os privilégios necessários para esta operação"
 
-#: ../client/pk-console.c:1644
+#: ../client/pk-console.c:1663
 msgid "Command failed"
 msgstr "O comando falhou"
 
+#: ../client/pk-generate-pack.c:106
+msgid "Could not find a package match"
+msgstr "Não foi possível encontrar um pacote correspondente"
+
+#. get user input
+#: ../client/pk-generate-pack.c:352
+msgid "Okay to download the additional packages"
+msgstr "Os pacotes adicionais podem ser baixados"
+
+#: ../client/pk-generate-pack.c:422
+msgid "Set the path of the file with the list of packages/dependencies to be excluded"
+msgstr "Defina o caminho do arquivo com a lista de pacotes/dependências a serem excluídas"
+
+#: ../client/pk-generate-pack.c:467
+msgid "You need to specify the pack name and packages to be packed\n"
+msgstr "Você precisa especificar o nome do conjunto e os pacotes a serem incluídos\n"
+
+#: ../client/pk-generate-pack.c:473
+msgid "Invalid name for the service pack, Specify a name with .pack extension\n"
+msgstr "Nome inválido para o conjunto de atualizações. Especifique um nome com extensão .pack\n"
+
+#: ../client/pk-generate-pack.c:485
+msgid "A pack with the same name already exists, do you want to overwrite it?"
+msgstr "Um conjunto com o mesmo nome já existe, você deseja sobrescrevê-lo?"
+
+#: ../client/pk-generate-pack.c:498
+msgid "Failed to create directory"
+msgstr "Falha ao criar o diretório"
+
+#: ../client/pk-generate-pack.c:505
+msgid "Failed to create pack"
+msgstr "Falha ao criar o conjunto"
+
 #: ../client/pk-import-desktop.c:279
 #: ../client/pk-import-specspo.c:177
 #, c-format
@@ -263,10 +301,102 @@ msgstr "Você provavelmente precisa executar este programa como usuário root"
 msgid "PackageKit Monitor"
 msgstr "Monitor do PackageKit"
 
+#: ../client/pk-tools-common.c:51
+#, c-format
+msgid "Please enter a number from 1 to %i: "
+msgstr "Por favor, insira um número entre 1 e %i: "
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:300
+msgid "Getting package information..."
+msgstr "Obtendo informações do pacote..."
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:304
+#, c-format
+msgid "<span color='#%06x' underline='single' size='larger'>Run %s</span>"
+msgstr "<span color='#%06x' underline='single' size='larger'>Executar %s</span>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:308
+#: ../contrib/packagekit-plugin/src/contents.cpp:313
+#: ../contrib/packagekit-plugin/src/contents.cpp:336
+#: ../contrib/packagekit-plugin/src/contents.cpp:340
+#, c-format
+msgid "<big>%s</big>"
+msgstr "<big>%s</big>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:310
+#, c-format
+msgid ""
+"\n"
+"<small>Installed version: %s</small>"
+msgstr ""
+"\n"
+"<small>Versão instalada: %s</small>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:316
+#, c-format
+msgid ""
+"\n"
+"<span color='#%06x' underline='single'>Run version %s now</span>"
+msgstr ""
+"\n"
+"<span color='#%06x' underline='single'>Executar versão %s agora</span>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:321
+#, c-format
+msgid ""
+"\n"
+"<span color='#%06x' underline='single'>Run now</span>"
+msgstr ""
+"\n"
+"<span color='#%06x' underline='single'>Executar agora</span>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:325
+#, c-format
+msgid ""
+"\n"
+"<span color='#%06x' underline='single'>Upgrade to version %s</span>"
+msgstr ""
+"\n"
+"<span color='#%06x' underline='single'>Atualizar para a versão %s</span>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:330
+#, c-format
+msgid "<span color='#%06x' underline='single' size='larger'>Install %s Now</span>"
+msgstr "<span color='#%06x' underline='single' size='larger'>Instalar %s agora</span>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:333
+#, c-format
+msgid ""
+"\n"
+"<small>Version: %s</small>"
+msgstr ""
+"\n"
+"<small>Versão: %s</small>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:337
+msgid ""
+"\n"
+"<small>No packages found for your system</small>"
+msgstr ""
+"\n"
+"<small>Nenhum pacote localizado para o seu sistema</small>"
+
+#: ../contrib/packagekit-plugin/src/contents.cpp:341
+msgid ""
+"\n"
+"<small>Installing...</small>"
+msgstr ""
+"\n"
+"<small>Instalando...</small>"
+
 #: ../data/packagekit-catalog.xml.in.h:1
 msgid "PackageKit Catalog"
 msgstr "Catálogo do PackageKit"
 
+#: ../data/packagekit-pack.xml.in.h:1
+msgid "PackageKit Service Pack"
+msgstr "Conjunto de Atualizações do PackageKit"
+
 #: ../src/pk-main.c:83
 msgid "Startup failed due to security policies on this machine."
 msgstr "A inicialização falhou devido à políticas de segurança desta máquina"
@@ -320,10 +450,6 @@ msgstr "Não foi possível conectar ao barramento do sistema"
 msgid "Error trying to start: %s\n"
 msgstr "Erro ao tentar iniciar: %s\n"
 
-#~ msgid "Please enter a number from 1 to %i: "
-#~ msgstr "Por favor, insira um número entre 1 e %i: "
-#~ msgid "Could not find a package match"
-#~ msgstr "Não foi possível encontrar um pacote correspondente"
 #~ msgid ""
 #~ "Could not find a package with that name to install, or package already "
 #~ "installed"
commit 26250c5a7e45165fd1c495301a23af8dfd44405a
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Wed Aug 13 22:28:34 2008 +0200

    APT: Implement SetProxy

diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index 275c972..56c4f2f 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -224,6 +224,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
         self._canceled = threading.Event()
         self._canceled.clear()
         self._lock = threading.Lock()
+        apt_pkg.InitConfig()
         PackageKitBaseBackend.__init__(self, bus_name, dbus_path)
 
     # Methods ( client -> engine -> backend )
@@ -886,6 +887,17 @@ class PackageKitAptBackend(PackageKitBaseBackend):
         self._cache._depcache.Init()
         self.Finished(EXIT_SUCCESS)
 
+    def doSetProxy(self, http_proxy, ftp_proxy):
+        '''
+        Set a proxy server for http and ftp transfer
+        '''
+        if http_proxy:
+            pkglog.debug("Set http proxy to %s" % http_proxy)
+            apt_pkg.Config.set("http::Proxy", http_proxy)
+        if ftp_proxy:
+            pkglog.debug("Set ftp proxy to %s" % ftp_proxy)
+            apt_pkg.Config.set("ftp::Proxy", ftp_proxy)
+
     # Helpers
 
     def _open_cache(self, prange=(0,100), progress=True):
commit 6175d61bec690796c04b8f1af106ca14aa41b3b4
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Wed Aug 13 22:02:15 2008 +0200

    Fix an api an incompete api dapation in GetReuires of python dbus backend

diff --git a/python/packagekit/daemonBackend.py b/python/packagekit/daemonBackend.py
index a9337ce..3e31d7f 100644
--- a/python/packagekit/daemonBackend.py
+++ b/python/packagekit/daemonBackend.py
@@ -498,15 +498,15 @@ class PackageKitBaseBackend(dbus.service.Object):
         self.Finished(EXIT_FAILED)
 
     @dbus.service.method(PACKAGEKIT_DBUS_INTERFACE,
-                         in_signature='ssb',out_signature='')
-    def GetRequires(self,filters,package_ids,recursive):
+                         in_signature='ssb', out_signature='')
+    def GetRequires(self, filters, package_ids, recursive):
         '''
         Print a list of requires for a given package
         '''
-        pklog.info("GetRequires(%s,%s,%s)" % (filters,package_ids,recursive))
-        self.doGetRequires(filters,package,recursive)
+        pklog.info("GetRequires(%s,%s,%s)" % (filters, package_ids, recursive))
+        self.doGetRequires(filters, package_ids ,recursive)
 
-    def doGetRequires(self,filters,package,recursive):
+    def doGetRequires(self, filters, package_ids, recursive):
         '''
         Should be replaced in the corresponding backend sub class
         '''
commit 8ddbf5f4fe1d196029c4e83509b23253098abc47
Merge: 04d5e58... bc19dd2...
Author: Stefan Haas <shaas at suse.de>
Date:   Wed Aug 13 14:13:46 2008 +0200

    Merge branch 'master' of git+ssh://shaas@git.packagekit.org/srv/git/PackageKit

commit 04d5e583049e660112ed1fd8e938a0d8bc3c73ee
Author: Stefan Haas <shaas at suse.de>
Date:   Wed Aug 13 14:13:28 2008 +0200

    zypp: pk_backend_require_restart will be send when needed

diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index 4cfe83a..6d53a21 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -912,13 +912,13 @@ backend_update_system_thread (PkBackend *backend)
 
 	zypp::ResPool pool = zypp_build_pool (TRUE);
 	pk_backend_set_percentage (backend, 40);
+	PkRestartEnum restart = PK_RESTART_ENUM_NONE;
 
 	//get all Patches for Update
-	std::set<zypp::PoolItem> *candidates = zypp_get_patches ();
+	std::set<zypp::PoolItem> *candidates = zypp_get_patches (restart);
 	//std::set<zypp::PoolItem> *candidates2 = new std::set<zypp::PoolItem> ();
 	
 	if (_updating_self) {
-		pk_backend_require_restart (backend, PK_RESTART_ENUM_SESSION, "Package Management System updated - restart needed");
 		_updating_self = FALSE;
 	}
 	else {
@@ -935,7 +935,7 @@ backend_update_system_thread (PkBackend *backend)
 
 		//candidates->insert (candidates2->begin (), candidates2->end ());
 	}
-
+	
 	pk_backend_set_percentage (backend, 80);
 	std::set<zypp::PoolItem>::iterator cb = candidates->begin (), ce = candidates->end (), ci;
 	for (ci = cb; ci != ce; ++ci) {
@@ -949,6 +949,9 @@ backend_update_system_thread (PkBackend *backend)
 		pk_backend_finished (backend);
 		return FALSE;
 	}
+	
+	if (restart != PK_RESTART_ENUM_NONE)
+		pk_backend_require_restart (backend, restart, "A restart is needed");
 
 	//delete (candidates2);
 	delete (candidates);
@@ -1538,8 +1541,9 @@ backend_update_packages_thread (PkBackend *backend)
 	gboolean retval;
 	gchar **package_ids;
 	package_ids = pk_backend_get_strv (backend, "package_ids");
+	PkRestartEnum restart = PK_RESTART_ENUM_NONE;
 
-	zypp_get_patches (); // make shure _updating_self is set
+	zypp_get_patches (restart); // make shure _updating_self is set
 
 	if (_updating_self) {
 		pk_debug ("updating self and setting restart");
@@ -1554,6 +1558,10 @@ backend_update_packages_thread (PkBackend *backend)
 
 	retval = zypp_perform_execution (backend, UPDATE, FALSE);
 	pk_backend_finished (backend);
+	
+	if (restart != PK_RESTART_ENUM_NONE)
+		pk_backend_require_restart (backend, restart, "A restart is needed");
+
 	return retval;
 }
 
diff --git a/backends/zypp/zypp-utils.cpp b/backends/zypp/zypp-utils.cpp
index 9870677..751742a 100644
--- a/backends/zypp/zypp-utils.cpp
+++ b/backends/zypp/zypp-utils.cpp
@@ -626,7 +626,7 @@ zypp_get_updates (std::string repo)
 }
 
 std::set<zypp::PoolItem> *
-zypp_get_patches ()
+zypp_get_patches (PkRestartEnum restart)
 {
         std::set<zypp::PoolItem> *patches = new std::set<zypp::PoolItem> ();
 	_updating_self = FALSE;
@@ -648,6 +648,16 @@ zypp_get_patches ()
 			else
 				patches->insert ((*it)->candidateObj ());
 
+			// set the restart flag if a restart is needed
+			if (restart != PK_RESTART_ENUM_SYSTEM && (patch->reloginSuggested () ||
+								  patch->restartSuggested () ||
+								  patch->rebootSuggested ())) {
+					if(patch->reloginSuggested () || patch->restartSuggested ())
+						restart = PK_RESTART_ENUM_SESSION;
+					if(patch->rebootSuggested ())
+						restart = PK_RESTART_ENUM_SYSTEM;
+			}
+
 			// check if the patch updates libzypp or packageKit and show only these
 			if (!_updating_self && patch->restartSuggested ()) {
 				_updating_self = TRUE;
diff --git a/backends/zypp/zypp-utils.h b/backends/zypp/zypp-utils.h
index 4f785cf..4fea6d5 100644
--- a/backends/zypp/zypp-utils.h
+++ b/backends/zypp/zypp-utils.h
@@ -168,7 +168,7 @@ std::set<zypp::PoolItem> * zypp_get_updates (std::string repo);
 /**
   * Returns a set of all patches the could be installed
   */
-std::set<zypp::PoolItem> * zypp_get_patches ();
+std::set<zypp::PoolItem> * zypp_get_patches (PkRestartEnum restart = PK_RESTART_ENUM_NONE);
 
 /**
   * perform changes in pool to the system
commit de7b5449b191bba61347cd5c43914bf6e1a652c3
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Wed Aug 13 13:12:40 2008 +0200

    APT: fixes in GetDepends: report packages to be upgraded and installed, take filter into account, fix an error message

diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index 071ead5..275c972 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -770,7 +770,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
                 self.Finished(EXIT_FAILED)
 
     @threaded
-    def doGetDepends(self, filters, ids, recursive=False):
+    def doGetDepends(self, filter, ids, recursive=False):
         '''
         Implement the apt2-get-depends functionality
 
@@ -783,7 +783,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
         be computed easily. GDebi features this. Perhaps this should be moved
         to python-apt.
         '''
-        pklog.info("Get depends (%s,%s,%s)" % (filters, ids, recursive))
+        pklog.info("Get depends (%s,%s,%s)" % (filter, ids, recursive))
         #FIXME: recursive is not yet implemented
         if recursive == True:
             pklog.warn("Recursive dependencies are not implemented")
@@ -820,8 +820,9 @@ class PackageKitAptBackend(PackageKitBaseBackend):
                                "Remove the package %s before" % p.name)
                 self.Finished(EXIT_FAILED)
                 return
-            elif p.markedUpgrade or p.markedUpgrade:
-                self._emit_package(p)
+            elif p.markedInstall or p.markedUpgrade:
+                if self._is_package_visible(p, filter):
+                    self._emit_package(p)
             else:
                 self.ErrorCode(ERROR_DEP_RESOLUTION_FAILED,
                                "Please use an advanced package management tool "
commit 58af40e5d1fad314fa079b86fe99d6831116e87d
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Wed Aug 13 13:09:15 2008 +0200

    APT: Implement GetRequires

diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index 59d62ad..071ead5 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -833,6 +833,58 @@ class PackageKitAptBackend(PackageKitBaseBackend):
         self._cache._depcache.Init()
         self.Finished(EXIT_SUCCESS)
 
+    @threaded
+    def doGetRequires(self, filter, ids, recursive=False):
+        '''
+        Implement the apt2-get-requires functionality
+        '''
+        pklog.info("Get requires (%s,%s,%s)" % (filter, ids, recursive))
+        #FIXME: recursive is not yet implemented
+        if recursive == True:
+            pklog.warn("Recursive dependencies are not implemented")
+        self.StatusChanged(STATUS_INFO)
+        self.NoPercentageUpdates()
+        self._check_init(progress=False)
+        self.AllowCancel(True)
+        pkgs = []
+
+        # Mark all packages for installation
+        self._cache._depcache.Init()
+        for id in ids:
+            if self._is_canceled(): return
+            pkg = self._find_package_by_id(id)
+            if pkg == None:
+                self.ErrorCode(ERROR_PACKAGE_NOT_FOUND,
+                               "Package %s isn't available" % name)
+                self.Finished(EXIT_FAILED)
+                return
+            pkgs.append(pkg)
+            try:
+                pkg.markDelete()
+            except Exception, e:
+                #FIXME: Introduce a new info enumerate PK_INFO_MISSING for
+                #       missing dependecies
+                self.ErrorCode(ERROR_DEP_RESOLUTION_FAILED,
+                               "Error removing %s: %s" % (pkg.name, e))
+                self.Finished(EXIT_FAILED)
+                return
+        # Check the status of the resulting changes
+        for p in self._cache.getChanges():
+            if self._is_canceled(): return
+            if p.markedDelete:
+                if not p in pkgs and self._is_package_visible(p, filter):
+                    self._emit_package(p)
+            else:
+                self.ErrorCode(ERROR_DEP_RESOLUTION_FAILED,
+                               "Please use an advanced package management tool "
+                               "e.g. Synaptic or aptitude, since there is a "
+                               "complex dependency situation.")
+                self.Finished(EXIT_FAILED)
+                return
+        # Clean up
+        self._cache._depcache.Init()
+        self.Finished(EXIT_SUCCESS)
+
     # Helpers
 
     def _open_cache(self, prange=(0,100), progress=True):
diff --git a/backends/apt/pk-backend-apt.c b/backends/apt/pk-backend-apt.c
index ac4e42e..00b2fee 100644
--- a/backends/apt/pk-backend-apt.c
+++ b/backends/apt/pk-backend-apt.c
@@ -204,6 +204,15 @@ backend_get_packages (PkBackend *backend, PkFilterEnum filters)
 }
 
 /**
+ *  * pk_backend_get_requires:
+ *   */
+static void
+backend_get_requires (PkBackend *backend, PkFilterEnum filters, gchar **package_ids, gboolean recursive)
+{
+	        pk_backend_dbus_get_requires (dbus, filters, package_ids, recursive);
+}
+
+/**
  *  * pk_backend_get_depends:
  *   */
 static void
@@ -236,7 +245,7 @@ PK_BACKEND_OPTIONS (
 	NULL,					/* get_files */
 	backend_get_packages,			/* get_packages */
 	NULL,					/* get_repo_list */
-	NULL,					/* get_requires */
+	backend_get_requires,			/* get_requires */
 	backend_get_update_detail,		/* get_update_detail */
 	backend_get_updates,			/* get_updates */
 	NULL,					/* install_files */
commit bc19dd27ac9d5069320450c56ae3ce6249116833
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Aug 13 12:05:42 2008 +0100

    check service pack's compatibility with the distro before installing it, original patch from Shishir Goel <crazyontheedge at gmail.com>, but reworked by me

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 2837574..b04cb3e 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -883,7 +883,8 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 pack.extract(mem,path = tempdir)
             files = os.listdir(tempdir)
             for file in files:
-                inst_files.append(os.path.join(tempdir, file))
+                if file.endswith('.rpm'):
+                    inst_files.append(os.path.join(tempdir, file))
 
         # remove files of packages that alrady exist
         for inst_file in inst_files:
diff --git a/src/Makefile.am b/src/Makefile.am
index d0e4f94..5dbfe67 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -127,6 +127,7 @@ packagekitd_LDADD =					\
 	$(POLKIT_LIBS)					\
 	$(SELFTEST_LIBS)				\
 	$(GIO_LIBS)					\
+	$(TAR_LIBS)					\
 	$(NULL)
 
 if BACKEND_TYPE_BOX
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index 30c7f51..e26070c 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -34,7 +34,10 @@
 
 #include <sys/wait.h>
 #include <fcntl.h>
+#include <libtar.h>
+#include <sys/stat.h>
 
+#include <glib/gstdio.h>
 #include <glib/gi18n.h>
 #include <pk-dbus-monitor.h>
 #include <dbus/dbus-glib.h>
@@ -197,6 +200,7 @@ pk_transaction_error_get_type (void)
 			ENUM_ENTRY (PK_TRANSACTION_ERROR_INVALID_STATE, "InvalidState"),
 			ENUM_ENTRY (PK_TRANSACTION_ERROR_INITIALIZE_FAILED, "InitializeFailed"),
 			ENUM_ENTRY (PK_TRANSACTION_ERROR_COMMIT_FAILED, "CommitFailed"),
+			ENUM_ENTRY (PK_TRANSACTION_ERROR_PACK_INVALID, "PackInvalid"),
 			ENUM_ENTRY (PK_TRANSACTION_ERROR_INVALID_PROVIDE, "InvalidProvide"),
 			{ 0, NULL, NULL }
 		};
@@ -2005,6 +2009,110 @@ pk_transaction_get_updates (PkTransaction *transaction, const gchar *filter, DBu
 }
 
 /**
+ * pk_transaction_check_metadata_conf:
+ **/
+static gboolean
+pk_transaction_check_metadata_conf (const gchar *full_path)
+{
+	GKeyFile *file;
+	gboolean ret;
+	GError *error = NULL;
+	gchar *distro_id = NULL;
+	gchar *distro_id_us = NULL;
+
+	/* load the file */
+	file = g_key_file_new ();
+	ret = g_key_file_load_from_file (file, full_path, G_KEY_FILE_NONE, &error);
+	if (!ret) {
+		pk_warning ("failed to load file: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+
+	/* read the value */
+	distro_id = g_key_file_get_string (file, PK_SERVICE_PACK_GROUP_NAME, "distro_id", &error);
+	if (!ret) {
+		pk_warning ("failed to get value: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+
+	/* get this system id */
+	distro_id_us = pk_get_distro_id ();
+
+	/* do we match? */
+	ret = pk_strequal (distro_id_us, distro_id);
+
+out:
+	g_key_file_free (file);
+	g_free (distro_id);
+	g_free (distro_id_us);
+	return ret;
+}
+
+/**
+ * pk_transaction_check_pack_distro_id:
+ **/
+static gboolean
+pk_transaction_check_pack_distro_id (const gchar *full_path, gchar **failure)
+{
+	gboolean ret = TRUE;
+	gchar *meta_src = NULL;
+	gchar *metafile = NULL;
+	gboolean retval;
+	TAR *t;
+	GDir *dir = NULL;
+	const gchar *filename;
+
+	/* open */
+	retval = tar_open (&t, (gchar *) full_path, NULL, O_RDONLY, 0, TAR_GNU);
+	if (retval != 0) {
+		*failure = g_strdup_printf ("failed to open tar file: %s", full_path);
+		ret = FALSE;
+		goto out;
+	}
+
+	/* extract */
+	meta_src = g_build_filename (g_get_tmp_dir (), "meta", NULL);
+	retval = tar_extract_all (t, meta_src);
+	if (retval != 0) {
+		*failure = g_strdup_printf ("failed to extract from tar file: %s", full_path);
+		ret = FALSE;
+		goto out;
+	}
+
+	/* close */
+	tar_close (t);
+
+	/* get the files */
+	dir = g_dir_open (meta_src, 0, NULL);
+	if (dir == NULL) {
+		*failure = g_strdup_printf ("failed to get directory for %s", meta_src);
+		ret = FALSE;
+		goto out;
+	}
+
+	/* find the file, and check the metadata */
+	while ((filename = g_dir_read_name (dir))) {
+		metafile = g_build_filename (meta_src, filename, NULL);
+		if (pk_strequal (filename, "metadata.conf")) {
+			ret = pk_transaction_check_metadata_conf (metafile);
+			if (!ret) {
+				*failure = g_strdup_printf ("Service Pack %s not compatible with your distro", full_path);
+				ret = FALSE;
+				goto out;
+			}
+		}
+		g_free (metafile);
+	}
+out:
+	g_rmdir (meta_src);
+	g_free (meta_src);
+	g_dir_close (dir);
+	return ret;
+}
+
+/**
  * pk_transaction_install_files:
  **/
 void
@@ -2015,6 +2123,7 @@ pk_transaction_install_files (PkTransaction *transaction, gboolean trusted,
 	gboolean ret;
 	GError *error;
 	gchar *sender;
+	gchar *failure = NULL;
 	guint length;
 	guint i;
 
@@ -2035,9 +2144,10 @@ pk_transaction_install_files (PkTransaction *transaction, gboolean trusted,
 		return;
 	}
 
-	/* check all files exists */
+	/* check all files exists and are valid */
 	length = g_strv_length (full_paths);
 	for (i=0; i<length; i++) {
+		/* exists */
 		ret = g_file_test (full_paths[i], G_FILE_TEST_EXISTS);
 		if (!ret) {
 			error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_NO_SUCH_FILE,
@@ -2045,6 +2155,16 @@ pk_transaction_install_files (PkTransaction *transaction, gboolean trusted,
 			dbus_g_method_return_error (context, error);
 			return;
 		}
+		/* valid */
+		if (g_str_has_suffix (full_paths[i], ".pack")) {
+			ret = pk_transaction_check_pack_distro_id (full_paths[i], &failure);
+			if (!ret) {
+				error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_PACK_INVALID, failure);
+				dbus_g_method_return_error (context, error);
+				g_free (failure);
+				return;
+			}
+		}
 	}
 
 	/* check if the action is allowed from this client - if not, set an error */
@@ -2078,6 +2198,7 @@ pk_transaction_install_files (PkTransaction *transaction, gboolean trusted,
 	}
 
 	dbus_g_method_return (context);
+	return;
 }
 
 /**
diff --git a/src/pk-transaction.h b/src/pk-transaction.h
index dc1c12a..5e77a79 100644
--- a/src/pk-transaction.h
+++ b/src/pk-transaction.h
@@ -71,6 +71,7 @@ typedef enum
 	PK_TRANSACTION_ERROR_INITIALIZE_FAILED,
 	PK_TRANSACTION_ERROR_COMMIT_FAILED,
 	PK_TRANSACTION_ERROR_INVALID_PROVIDE,
+	PK_TRANSACTION_ERROR_PACK_INVALID,
 	PK_TRANSACTION_ERROR_LAST
 } PkTransactionError;
 
commit c96d42a7712914b73957e5bfc61b82a1742600bb
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Aug 13 12:02:28 2008 +0100

    use g_key_file-* in pkgenpack as we probably need to use a group name too to make this valid

diff --git a/client/pk-generate-pack.c b/client/pk-generate-pack.c
index c3a796c..3d82bb8 100644
--- a/client/pk-generate-pack.c
+++ b/client/pk-generate-pack.c
@@ -188,14 +188,17 @@ out:
 }
 
 /**
- * pk_generate_pack_get_metadata:
+ * pk_generate_pack_set_metadata:
  **/
-static gchar *
-pk_generate_pack_get_metadata (void)
+static gboolean
+pk_generate_pack_set_metadata (const gchar *full_path)
 {
+	gboolean ret = FALSE;
 	gchar *distro_id = NULL;
 	gchar *datetime = NULL;
-	gchar *contents = NULL;
+	GError *error = NULL;
+	GKeyFile *file = NULL;
+	gchar *data = NULL;
 
 	/* get needed data */
 	distro_id = pk_get_distro_id ();
@@ -205,12 +208,32 @@ pk_generate_pack_get_metadata (void)
 	if (datetime == NULL)
 		goto out;
 
-	/* whole file */
-	contents = g_strdup_printf ("distro_id=%s\ncreated=%s\n", distro_id, datetime);
+	file = g_key_file_new ();
+	g_key_file_set_string (file, PK_SERVICE_PACK_GROUP_NAME, "distro_id", distro_id);
+	g_key_file_set_string (file, PK_SERVICE_PACK_GROUP_NAME, "created", datetime);
+
+	/* convert to text */
+	data = g_key_file_to_data (file, NULL, &error);
+	if (data == NULL) {
+		pk_warning ("failed to convert to text: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+
+	/* save contents */
+	ret = g_file_set_contents (full_path, data, -1, &error);
+	if (!ret) {
+		pk_warning ("failed to save file: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+
 out:
+	g_key_file_free (file);
+	g_free (data);
 	g_free (distro_id);
 	g_free (datetime);
-	return contents;
+	return ret;
 }
 
 /**
@@ -228,20 +251,16 @@ pk_generate_pack_create (const gchar *tarfilename, GPtrArray *file_array, GError
 	gchar *dest;
 	gchar *meta_src;
 	gchar *meta_dest;
-	gchar *meta_contents;
-	GError *error_local = NULL;
 
 	/* create a file with metadata in it */
-	meta_contents = pk_generate_pack_get_metadata ();
 	meta_src = g_build_filename (g_get_tmp_dir (), "metadata.conf", NULL);
-	meta_dest = g_path_get_basename (meta_src);
-	ret = g_file_set_contents (meta_src, meta_contents, -1, &error_local);
+	ret = pk_generate_pack_set_metadata (meta_src);
 	if (!ret) {
-		pk_warning ("failed to add metadata: %s", error_local->message);
-		g_error_free (error_local);
+		*error = g_error_new (1, 0, "failed to generate metadata file %s", meta_src);
+		ret = FALSE;
 		goto out;
 	}
-	
+
 	/* create the tar file */
 	file = g_fopen (tarfilename, "a+");
 	retval = tar_open (&t, (gchar *)tarfilename, NULL, O_WRONLY, 0, TAR_GNU);
@@ -252,10 +271,12 @@ pk_generate_pack_create (const gchar *tarfilename, GPtrArray *file_array, GError
 	}
 
 	/* add the metadata first */
+	meta_dest = g_path_get_basename (meta_src);
 	retval = tar_append_file(t, (gchar *)meta_src, meta_dest);
 	if (retval != 0) {
-		 *error = g_error_new (1, 0, "failed to copy %s into %s", meta_src, meta_dest);
+		*error = g_error_new (1, 0, "failed to copy %s into %s", meta_src, meta_dest);
 		ret = FALSE;
+		goto out;
 	}
 
 	/* add each of the files */
@@ -287,8 +308,6 @@ pk_generate_pack_create (const gchar *tarfilename, GPtrArray *file_array, GError
 	fclose (file);
 out:
 	/* delete metadata file */
-	g_remove (meta_contents);
-	g_free (meta_contents);
 	g_remove (meta_src);
 	g_free (meta_src);
 	g_free (meta_dest);
diff --git a/libpackagekit/pk-common.h b/libpackagekit/pk-common.h
index e152678..02a508b 100644
--- a/libpackagekit/pk-common.h
+++ b/libpackagekit/pk-common.h
@@ -54,6 +54,13 @@ G_BEGIN_DECLS
  */
 #define	PK_DBUS_INTERFACE_TRANSACTION	"org.freedesktop.PackageKit.Transaction"
 
+/**
+ * PK_SERVICE_PACK_GROUP_NAME:
+ *
+ * The group name of the Service Pack config file
+ */
+#define	PK_SERVICE_PACK_GROUP_NAME	"PackageKit Service Pack"
+
 guint		 pk_strlen				(const gchar	*text,
 							 guint		 len)
 							 G_GNUC_WARN_UNUSED_RESULT;
commit 50b20c77151f3e17d7e56b7c4430e047a3a67d94
Author: Shishir Goel <crazyontheedge at gmail.com>
Date:   Wed Aug 13 11:06:56 2008 +0100

    bugfix: remove the segmentation fault in pkgenpack

diff --git a/client/pk-generate-pack.c b/client/pk-generate-pack.c
index 08c80ab..c3a796c 100644
--- a/client/pk-generate-pack.c
+++ b/client/pk-generate-pack.c
@@ -229,15 +229,19 @@ pk_generate_pack_create (const gchar *tarfilename, GPtrArray *file_array, GError
 	gchar *meta_src;
 	gchar *meta_dest;
 	gchar *meta_contents;
+	GError *error_local = NULL;
 
 	/* create a file with metadata in it */
 	meta_contents = pk_generate_pack_get_metadata ();
 	meta_src = g_build_filename (g_get_tmp_dir (), "metadata.conf", NULL);
 	meta_dest = g_path_get_basename (meta_src);
-	ret = g_file_set_contents (meta_src, meta_contents, -1, error);
-	if (!ret)
+	ret = g_file_set_contents (meta_src, meta_contents, -1, &error_local);
+	if (!ret) {
+		pk_warning ("failed to add metadata: %s", error_local->message);
+		g_error_free (error_local);
 		goto out;
-
+	}
+	
 	/* create the tar file */
 	file = g_fopen (tarfilename, "a+");
 	retval = tar_open (&t, (gchar *)tarfilename, NULL, O_WRONLY, 0, TAR_GNU);
@@ -284,6 +288,7 @@ pk_generate_pack_create (const gchar *tarfilename, GPtrArray *file_array, GError
 out:
 	/* delete metadata file */
 	g_remove (meta_contents);
+	g_free (meta_contents);
 	g_remove (meta_src);
 	g_free (meta_src);
 	g_free (meta_dest);
commit 1a4cd06c735d7a5014c1793df9d687c4832bc185
Author: Shishir Goel <crazyontheedge at gmail.com>
Date:   Wed Aug 13 11:05:51 2008 +0100

    trivial: fix a minor memory leak in pkcon

diff --git a/client/pk-console.c b/client/pk-console.c
index d5cc590..a221f28 100644
--- a/client/pk-console.c
+++ b/client/pk-console.c
@@ -632,6 +632,8 @@ pk_console_install_stuff (PkClient *client, gchar **packages, GError **error)
 out:
 	g_strfreev (package_ids);
 	g_strfreev (files);
+	g_ptr_array_foreach (array_files, (GFunc) g_free, NULL);
+	g_ptr_array_foreach (array_packages, (GFunc) g_free, NULL);
 	g_ptr_array_free (array_files, TRUE);
 	g_ptr_array_free (array_packages, TRUE);
 	return ret;
commit b1e5399d5c5e550afc9889ae9f76a2a9d59b231e
Merge: 649d694... 13c818e...
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Aug 12 09:51:23 2008 +0100

    Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit

commit 13c818e083fa81555dfad2e510c7bdec07b236d2
Merge: 39def33... 26e0771...
Author: Stefan Haas <shaas at suse.de>
Date:   Tue Aug 12 10:35:04 2008 +0200

    Merge branch 'master' of git+ssh://shaas@git.packagekit.org/srv/git/PackageKit

commit 39def339d01238b0f5fc4556442c8618f31b5016
Author: Stefan Haas <shaas at suse.de>
Date:   Tue Aug 12 10:34:22 2008 +0200

    zypp: added driver search for new hardware

diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index 605dbb8..4cfe83a 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -1687,14 +1687,70 @@ backend_what_provides_thread (PkBackend *backend)
 	zypp::Capability cap (search);
 	zypp::sat::WhatProvides prov (cap);
 
-	for(zypp::sat::WhatProvides::const_iterator it = prov.begin (); it != prov.end (); it++) {
-		gchar *package_id = zypp_build_package_id_from_resolvable (*it);
+	if(g_ascii_strcasecmp("drivers_for_attached_hardware", search) == 0) {
 
-		PkInfoEnum info = PK_INFO_ENUM_AVAILABLE;
-		if( it->isSystem ())
-			info = PK_INFO_ENUM_INSTALLED;
 
-		pk_backend_package (backend, info, package_id, it->lookupStrAttribute (zypp::sat::SolvAttr::summary).c_str ());
+		// solver run
+		zypp::ResPool pool = zypp::ResPool::instance ();
+		zypp::Resolver solver(pool);
+
+		if (solver.resolvePool () == FALSE) {
+			std::list<zypp::ResolverProblem_Ptr> problems = solver.problems ();
+			for (std::list<zypp::ResolverProblem_Ptr>::iterator it = problems.begin (); it != problems.end (); it++){
+				pk_warning("Solver problem (This should never happen): '%s'", (*it)->description ().c_str ());
+			}
+			pk_backend_error_code (backend, PK_ERROR_ENUM_DEP_RESOLUTION_FAILED, "Resolution failed");
+			pk_backend_finished (backend);
+			return FALSE;
+		}
+
+		// look for packages which would be installed
+		for (zypp::ResPool::byKind_iterator it = pool.byKindBegin (zypp::ResKind::package);
+				it != pool.byKindEnd (zypp::ResKind::package); it++) {
+			PkInfoEnum status = PK_INFO_ENUM_UNKNOWN;
+
+			gboolean hit = FALSE;
+
+			if (it->status ().isToBeUninstalled ()) {
+				status = PK_INFO_ENUM_REMOVING;
+				hit = TRUE;
+			}else if (it->status ().isToBeInstalled ()) {
+				status = PK_INFO_ENUM_INSTALLING;
+				hit = TRUE;
+			}else if (it->status ().isToBeUninstalledDueToUpgrade ()) {
+				status = PK_INFO_ENUM_UPDATING;
+				hit = TRUE;
+			}else if (it->status ().isToBeUninstalledDueToObsolete ()) {
+				status = PK_INFO_ENUM_OBSOLETING;
+				hit = TRUE;
+			}
+
+			if (hit) {
+				gchar *package_id;
+				package_id = pk_package_id_build ( it->resolvable ()->name ().c_str(),
+						it->resolvable ()->edition ().asString ().c_str(),
+						it->resolvable ()->arch ().c_str(),
+						it->resolvable ()->repoInfo().alias ().c_str ());
+
+				pk_backend_package (backend, status, package_id, it->resolvable ()->description ().c_str ());
+
+				g_free (package_id);
+			}
+			it->statusReset ();
+		}
+
+
+
+	}else{
+		for(zypp::sat::WhatProvides::const_iterator it = prov.begin (); it != prov.end (); it++) {
+			gchar *package_id = zypp_build_package_id_from_resolvable (*it);
+
+			PkInfoEnum info = PK_INFO_ENUM_AVAILABLE;
+			if( it->isSystem ())
+				info = PK_INFO_ENUM_INSTALLED;
+
+			pk_backend_package (backend, info, package_id, it->lookupStrAttribute (zypp::sat::SolvAttr::summary).c_str ());
+		}
 	}
 
 	pk_backend_finished (backend);
commit 8ce2505a4b5444d4e05e6d8b0a08853988ea1a48
Author: Stefan Haas <shaas at suse.de>
Date:   Tue Aug 12 10:24:25 2008 +0200

    zypp: added relogin-flag for patches

diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index 86ee577..605dbb8 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -844,6 +844,8 @@ backend_get_update_detail_thread (PkBackend *backend)
 				restart = PK_RESTART_ENUM_SYSTEM;
 			} else if (patch->restartSuggested ()) {
 				restart = PK_RESTART_ENUM_SESSION;
+			} else if (patch->reloginSuggested()) {
+				restart = PK_RESTART_ENUM_SESSION;
 			}
 
 			// Building links like "http://www.distro-update.org/page?moo;Bugfix release for kernel;http://www.test.de/bgz;test domain"
commit 8fbf0b8da89e906a8ac60bc1cde05dc51533d267
Author: Stefan Haas <shaas at suse.de>
Date:   Tue Aug 12 10:20:17 2008 +0200

    zypp: changes for zypp 5.4.0

diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index ade4c5d..86ee577 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -828,10 +828,8 @@ backend_get_update_detail_thread (PkBackend *backend)
 		zypp::sat::Solvable solvable = zypp_get_package_by_id (package_ids[i]);
 
 		zypp::Capabilities obs = solvable.obsoletes ();
-		zypp::Capabilities upd = solvable.freshens ();
 
 		gchar *obsoletes = zypp_build_package_id_capabilities (obs);
-		gchar *updates = zypp_build_package_id_capabilities (upd);
 
 		PkRestartEnum restart = PK_RESTART_ENUM_NONE;
 
@@ -868,26 +866,27 @@ backend_get_update_detail_thread (PkBackend *backend)
 			zypp::sat::SolvableSet content = patch->contents ();
 
 			for (zypp::sat::SolvableSet::const_iterator it = content.begin (); it != content.end (); it++) {
-				obsoletes = g_strconcat (obsoletes, zypp_build_package_id_capabilities (it->obsoletes ()), " ", (gchar *)NULL);
-				updates = g_strconcat (updates, zypp_build_package_id_capabilities (it->freshens ()), " ", (gchar *)NULL);
+				obsoletes = g_strconcat (obsoletes, zypp_build_package_id_capabilities (it->obsoletes ()), "^", (gchar *)NULL);
 			}
 		}
 
 		pk_backend_update_detail (backend,
 					  package_ids[i],
-					  updates,	// updates
+					  NULL,		// updates TODO with Resolver.installs
 					  obsoletes,	// CURRENTLY CAUSES SEGFAULT obsoletes,
 					  "",		// CURRENTLY CAUSES SEGFAULT solvable.vendor ().c_str (),
 					  bugzilla,	// bugzilla
 					  cve,		// cve
-					  restart,
-					  solvable.lookupStrAttribute (zypp::sat::SolvAttr::description).c_str (),
-					  NULL, PK_UPDATE_STATE_ENUM_UNKNOWN, NULL, NULL);
+					  restart,	// restart -flag
+					  solvable.lookupStrAttribute (zypp::sat::SolvAttr::description).c_str (),	// update-text
+					  NULL,		// ChangeLog text
+					  PK_UPDATE_STATE_ENUM_UNKNOWN,		// state of the update
+					  NULL, // date that the update was issued
+					  NULL);	// date that the update was updated
 
 		g_free (bugzilla);
 		g_free (cve);
 		g_free (obsoletes);
-		g_free (updates);
 	}
 
 	pk_backend_finished (backend);
@@ -1361,8 +1360,7 @@ backend_get_repo_list (PkBackend *backend, PkFilterEnum filters)
 	std::list <zypp::RepoInfo> repos;
 	try
 	{
-		repos = manager.knownRepositories();
-		//repos = std::list<zypp::RepoInfo>(manager.repoBegin(),manager.repoEnd());
+		repos = std::list<zypp::RepoInfo>(manager.repoBegin(),manager.repoEnd());
 	}
 	catch ( const zypp::Exception &e)
 	{
diff --git a/backends/zypp/zypp-utils.cpp b/backends/zypp/zypp-utils.cpp
index 168c476..9870677 100644
--- a/backends/zypp/zypp-utils.cpp
+++ b/backends/zypp/zypp-utils.cpp
@@ -165,8 +165,7 @@ zypp_build_pool (gboolean include_local)
 	zypp::RepoManager manager;
 	std::list<zypp::RepoInfo> repos;
 	try {
-		repos = manager.knownRepositories ();
-		//repos = std::list<zypp::RepoInfo>(manager.repoBegin(),manager.repoEnd());
+		repos = std::list<zypp::RepoInfo>(manager.repoBegin(),manager.repoEnd());
 		for (std::list<zypp::RepoInfo>::iterator it = repos.begin(); it != repos.end (); it++) {
 			zypp::RepoInfo repo (*it);
 
@@ -862,8 +861,7 @@ zypp_refresh_cache (PkBackend *backend, gboolean force)
 	std::list <zypp::RepoInfo> repos;
 	try
 	{
-		repos = manager.knownRepositories();
-		//repos = std::list<zypp::RepoInfo>(manager.repoBegin(),manager.repoEnd());
+		repos = std::list<zypp::RepoInfo>(manager.repoBegin(),manager.repoEnd());
 	}
 	catch ( const zypp::Exception &e)
 	{
diff --git a/configure.ac b/configure.ac
index d132365..828c7dd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -493,7 +493,7 @@ if test x$enable_poldek = xyes; then
 fi
 
 if test x$enable_zypp = xyes; then
-	PKG_CHECK_MODULES(ZYPP, libzypp >= 4.25.0)
+	PKG_CHECK_MODULES(ZYPP, libzypp >= 5.4.0)
 	AC_SUBST(ZYPP_CFLAGS)
 	AC_SUBST(ZYPP_LIBS)
 fi


More information about the PackageKit-commit mailing list