[packagekit] packagekit: Branch 'master' - 17 commits

Richard Hughes hughsient at kemper.freedesktop.org
Mon Mar 24 10:34:09 PDT 2008


 backends/poldek/pk-backend-poldek.c     |  106 ++++++++++++++++++++------------
 backends/yum2/helpers/yumDBUSBackend.py |    2 
 configure.ac                            |    1 
 etc/PackageKit.conf.in                  |    2 
 libpackagekit/Makefile.am               |    1 
 libpackagekit/pk-debug.c                |   56 ++++++++++++++++
 libpackagekit/pk-debug.h                |    1 
 libpackagekit/pk-enum.c                 |    4 +
 src/pk-conf.c                           |   16 ++++
 src/pk-conf.h                           |    2 
 src/pk-main.c                           |    8 ++
 11 files changed, 159 insertions(+), 40 deletions(-)

New commits:
commit 94bb6c9d161013ce5400b74ed74f123858ee946e
Merge: 4709911... b9edb51...
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Mar 24 17:33:27 2008 +0000

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

commit b9edb51002f81b3ce8bd68a9ade088f36d886678
Merge: 14e0230... 1ce5155...
Author: Marcin Banasiak <megabajt at pld-linux.org>
Date:   Mon Mar 24 18:24:39 2008 +0100

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

commit 14e0230eb7320f5b130c02035e4556b76267d99e
Author: Marcin Banasiak <megabajt at pld-linux.org>
Date:   Mon Mar 24 18:22:32 2008 +0100

    poldek: improve percentage updates in UpdatePackages

diff --git a/backends/poldek/pk-backend-poldek.c b/backends/poldek/pk-backend-poldek.c
index 9087979..d9965f4 100644
--- a/backends/poldek/pk-backend-poldek.c
+++ b/backends/poldek/pk-backend-poldek.c
@@ -86,6 +86,8 @@ typedef struct {
 	gint		filesdownload;
 
 	gint		percentage;
+	float		stepvalue;
+
 	gint		subpercentage;
 } PercentageData;
 
@@ -225,6 +227,7 @@ poldek_vf_progress_new (void *data, const gchar *label)
 
 		poclidek_rcmd_free (rcmd);
 
+		g_free (command);
 		g_free (pkgname);
 		g_free (filename);
 	}
@@ -238,35 +241,56 @@ poldek_vf_progress (void *bar, long total, long amount)
 	TsData		*td = (TsData*) bar;
 	PercentageData	*pd = td->pd;
 	PkBackend	*backend;
+	guint		percentage = 0;
 
 	backend = pk_backend_thread_get_backend (thread);
 
-	if (td->type == TS_TYPE_ENUM_REFRESH_CACHE) {
-		if (pd->step == 0)
-			pd->percentage = 1;
-		else
-			pd->percentage = (gint)(((float)pd->step / (float)pd->nsources) * 100);
-	} else {
-		gint	tmp_subpercentage = (gint)(((float)amount / (float)total) * 100);
+	if (td->type == TS_TYPE_ENUM_INSTALL) {
+		float	frac = (float)amount / (float)total;
 
-		if (tmp_subpercentage >= pd->subpercentage) {
-			pd->percentage = (gint)(((float)(pd->bytesget + amount) / (float)pd->bytesdownload) * 100);
-			pd->subpercentage = tmp_subpercentage;
-		} else {
+		/* file already downloaded */
+		if (frac < 0) {
 			pd->bytesget += total;
 			pd->filesget++;
+
+			pd->percentage = (gint)((float)(pd->bytesget) / (float)pd->bytesdownload * 100);
 			pd->subpercentage = 100;
+		} else {
+			pd->percentage = (gint)(((float)(pd->bytesget + amount) / (float)pd->bytesdownload) * 100);
+			pd->subpercentage = (gint)(frac * 100);
 		}
+	} else if (td->type == TS_TYPE_ENUM_UPDATE) {
+		float	stepfrac = pd->stepvalue / (float)pd->filesdownload;
+
+		/* file already downloaded */
+		if ((float)amount / (float)total < 0) {
+			pd->bytesget += total;
+			pd->filesget++;
+
+			pd->subpercentage = (gint)((float)pd->bytesget / (float)pd->bytesdownload * 100);
+			percentage = (guint)(stepfrac * (float)pd->filesget);
+		} else {
+			pd->subpercentage = (gint)((float)(pd->bytesget + amount) / (float)pd->bytesdownload * 100);
+			percentage = (guint)(stepfrac * ((float)pd->filesget + ((float)pd->subpercentage / (float)100)));
+		}
+	} else if (td->type == TS_TYPE_ENUM_REFRESH_CACHE) {
+		if (pd->step == 0)
+			pd->percentage = 1;
+		else
+			pd->percentage = (gint)(((float)pd->step / (float)pd->nsources) * 100);
 	}
 
-	if (td->type != TS_TYPE_ENUM_UPDATE)
+	if (td->type == TS_TYPE_ENUM_INSTALL ||
+	    td->type == TS_TYPE_ENUM_REFRESH_CACHE)
 		pk_backend_set_percentage (backend, pd->percentage);
+	else if (td->type == TS_TYPE_ENUM_UPDATE)
+		if ((pd->percentage + percentage) > 1)
+			pk_backend_set_percentage (backend, pd->percentage + percentage);
 
-	if (td->type == TS_TYPE_ENUM_INSTALL)
+	/* RefreshCache doesn't use subpercentage */
+	if (td->type == TS_TYPE_ENUM_INSTALL ||
+	    td->type == TS_TYPE_ENUM_UPDATE)
 		pk_backend_set_sub_percentage (backend, pd->subpercentage);
-	else if (td->type == TS_TYPE_ENUM_UPDATE)
-		/* UpdatePackages uses pd->percentage as sub_percentage */
-		pk_backend_set_sub_percentage (backend, pd->percentage);
 
 	if (td->type != TS_TYPE_ENUM_REFRESH_CACHE) {
 		if (pd->filesget == pd->filesdownload) {
@@ -1808,10 +1832,10 @@ backend_update_packages_thread (PkBackendThread *thread, gpointer data)
 	poldek_configure (ctx, POLDEK_CONF_TSCONFIRM_CB, ts_confirm, td);
 
 	pk_backend_set_percentage (backend, 1);
+	td->pd->stepvalue = (float)100 / (float)g_strv_length (td->package_ids);
 
 	for (i = 0; i < g_strv_length (td->package_ids); i++) {
 		struct pkg	*pkg = NULL;
-		guint	percentage;
 
 		pk_backend_set_status (backend, PK_STATUS_ENUM_DEP_RESOLVE);
 
@@ -1846,10 +1870,10 @@ backend_update_packages_thread (PkBackendThread *thread, gpointer data)
 			poldek_ts_free (ts);
 		}
 
-		percentage = (gint)(((float)(i + 1) / (float)g_strv_length (td->package_ids)) * 100);
+		td->pd->percentage = (gint)((float)(i + 1) * td->pd->stepvalue);
 
-		if (percentage > 1)
-			pk_backend_set_percentage (backend, percentage);
+		if (td->pd->percentage > 1)
+			pk_backend_set_percentage (backend, td->pd->percentage);
 
 		pkg_free (pkg);
 	}
@@ -1884,7 +1908,6 @@ backend_update_packages (PkBackend *backend, gchar **package_ids)
 		return;
 	}
 
-	data->package_id = NULL;
 	data->package_ids = g_strdupv (package_ids);
 	data->pd = g_new0 (PercentageData, 1);
 	data->type = TS_TYPE_ENUM_UPDATE;
commit 1ce5155ddd78b21acac1468c94e9512a40c2ac57
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Mon Mar 24 12:59:03 2008 -0400

    Add some new licenses to the free/nonfree list.

diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index 2c87d5a..6f38d55 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -253,6 +253,7 @@ static PkEnumMatch enum_free_licenses[] = {
 	{PK_LICENSE_ENUM_GLIDE,                "Glide"},
 	{PK_LICENSE_ENUM_AFL,                  "AFL"},
 	{PK_LICENSE_ENUM_AMPAS_BSD,            "AMPAS BSD"},
+	{PK_LICENSE_ENUM_AMAZON_DSL,           "ADSL"},
 	{PK_LICENSE_ENUM_ADOBE,                "Adobe"},
 	{PK_LICENSE_ENUM_AGPLV1,               "AGPLv1"},
 	{PK_LICENSE_ENUM_AGPLV3,               "AGPLv3"},
@@ -274,6 +275,7 @@ static PkEnumMatch enum_free_licenses[] = {
 	{PK_LICENSE_ENUM_COPYRIGHT_ONLY,       "Copyright only"},
 	{PK_LICENSE_ENUM_CRYPTIX,              "Cryptix"},
 	{PK_LICENSE_ENUM_CRYSTAL_STACKER,      "Crystal Stacker"},
+	{PK_LICENSE_ENUM_DOC,                  "DOC"},
 	{PK_LICENSE_ENUM_WTFPL,                "WTFPL"},
 	{PK_LICENSE_ENUM_EPL,                  "EPL"},
 	{PK_LICENSE_ENUM_ECOS,                 "eCos"},
@@ -311,6 +313,7 @@ static PkEnumMatch enum_free_licenses[] = {
 	{PK_LICENSE_ENUM_NCSA,                 "NCSA"},
 	{PK_LICENSE_ENUM_NGPL,                 "NGPL"},
 	{PK_LICENSE_ENUM_NOSL,                 "NOSL"},
+	{PK_LICENSE_ENUM_NETCDF,               "NetCDF"},
 	{PK_LICENSE_ENUM_NETSCAPE,             "Netscape"},
 	{PK_LICENSE_ENUM_NOKIA,                "Nokia"},
 	{PK_LICENSE_ENUM_OPENLDAP,             "OpenLDAP"},
@@ -328,6 +331,7 @@ static PkEnumMatch enum_free_licenses[] = {
 	{PK_LICENSE_ENUM_QPL,                  "QPL"},
 	{PK_LICENSE_ENUM_RPSL,                 "RPSL"},
 	{PK_LICENSE_ENUM_RUBY,                 "Ruby"},
+	{PK_LICENSE_ENUM_SENDMAIL,             "Sendmail"},
 	{PK_LICENSE_ENUM_SLEEPYCAT,            "Sleepycat"},
 	{PK_LICENSE_ENUM_SLIB,                 "SLIB"},
 	{PK_LICENSE_ENUM_SISSL,                "SISSL"},
commit 4709911adc366a33ad0fdf8bcffb902cf9eac17b
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Mar 24 01:04:43 2008 +0000

    fix a compile error2

diff --git a/libpackagekit/pk-debug.c b/libpackagekit/pk-debug.c
index 724ad3d..e8e4af5 100644
--- a/libpackagekit/pk-debug.c
+++ b/libpackagekit/pk-debug.c
@@ -93,7 +93,7 @@ pk_log_line (const gchar *buffer)
 	/* open a file */
 	if (fd == -1) {
 		mkdir (PK_LOG_DIR, 0777);
-		fd = open (PK_LOG_DIR "/PackageKit", O_WRONLY|O_APPEND|O_CREAT);
+		fd = open (PK_LOG_DIR "/PackageKit", O_WRONLY|O_APPEND|O_CREAT, 0777);
 		if (fd == -1) {
 			g_error ("could not open log");
 		}
commit c1f97f93e1fae414626dd962c2988698a474c07c
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Mar 24 00:59:27 2008 +0000

    fix a compile error

diff --git a/libpackagekit/pk-debug.c b/libpackagekit/pk-debug.c
index f9a8059..724ad3d 100644
--- a/libpackagekit/pk-debug.c
+++ b/libpackagekit/pk-debug.c
@@ -104,7 +104,10 @@ pk_log_line (const gchar *buffer)
 		g_warning ("could not write %s", buffer);
 	}
 	/* newline */
-	write (fd, "\n", 1);
+	count = write (fd, "\n", 1);
+	if (count == -1) {
+		g_warning ("could not write newline");
+	}
 }
 
 /**
commit 52d8c92f0813d4b3b1739fff4c01775d66517670
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Mar 24 00:55:10 2008 +0000

    log to a file if we have TransactionLogging specified in the config file. This needs some cleanup, but I need this to debug a crasher at startup under some conditions

diff --git a/libpackagekit/pk-debug.c b/libpackagekit/pk-debug.c
index 1c2b9c9..f9a8059 100644
--- a/libpackagekit/pk-debug.c
+++ b/libpackagekit/pk-debug.c
@@ -35,6 +35,9 @@
 #include <stdlib.h>
 #include <signal.h>
 #include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 #include <time.h>
 
 #include "pk-debug.h"
@@ -50,7 +53,18 @@
 #define CONSOLE_WHITE		37
 
 static gboolean do_verbose = FALSE;	/* if we should print out debugging */
+static gboolean do_logging = FALSE;	/* if we should write to a file */
 static gboolean is_console = FALSE;
+static gint fd = -1;
+
+/**
+ * pk_debug_set_logging:
+ **/
+void
+pk_debug_set_logging (gboolean enabled)
+{
+	do_logging = enabled;
+}
 
 /**
  * pk_set_console_mode:
@@ -70,12 +84,37 @@ pk_set_console_mode (guint console_code)
 }
 
 /**
+ * pk_log_line:
+ **/
+static void
+pk_log_line (const gchar *buffer)
+{
+	ssize_t count;
+	/* open a file */
+	if (fd == -1) {
+		mkdir (PK_LOG_DIR, 0777);
+		fd = open (PK_LOG_DIR "/PackageKit", O_WRONLY|O_APPEND|O_CREAT);
+		if (fd == -1) {
+			g_error ("could not open log");
+		}
+	}
+	/* whole line */
+	count = write (fd, buffer, strlen (buffer));
+	if (count == -1) {
+		g_warning ("could not write %s", buffer);
+	}
+	/* newline */
+	write (fd, "\n", 1);
+}
+
+/**
  * pk_print_line:
  **/
 static void
 pk_print_line (const gchar *func, const gchar *file, const int line, const gchar *buffer, guint color)
 {
 	gchar *str_time;
+	gchar *header;
 	time_t the_time;
 	GThread *thread;
 
@@ -84,19 +123,29 @@ pk_print_line (const gchar *func, const gchar *file, const int line, const gchar
 	strftime (str_time, 254, "%H:%M:%S", localtime (&the_time));
 	thread = g_thread_self ();
 
+	/* generate header text */
+	header = g_strdup_printf ("TI:%s\tTH:%p\tFI:%s\tFN:%s,%d", str_time, thread, file, func, line);
+	g_free (str_time);
+
 	/* always in light green */
 	pk_set_console_mode (CONSOLE_GREEN);
-	printf ("TI:%s\tTH:%p\tFI:%s\tFN:%s,%d\n", str_time, thread, file, func, line);
+	printf ("%s\n", header);
 
 	/* different colours according to the severity */
 	pk_set_console_mode (color);
 	printf (" - %s\n", buffer);
 	pk_set_console_mode (CONSOLE_RESET);
 
+	/* log to a file */
+	if (do_logging) {
+		pk_log_line (header);
+		pk_log_line (buffer);
+	}
+
 	/* flush this output, as we need to debug */
 	fflush (stdout);
 
-	g_free (str_time);
+	g_free (header);
 }
 
 /**
diff --git a/libpackagekit/pk-debug.h b/libpackagekit/pk-debug.h
index 1fade7c..733dbb9 100644
--- a/libpackagekit/pk-debug.h
+++ b/libpackagekit/pk-debug.h
@@ -60,6 +60,7 @@ G_BEGIN_DECLS
 #endif
 
 void		pk_debug_init			(gboolean	 debug);
+void		pk_debug_set_logging		(gboolean	 enabled);
 gboolean	pk_debug_enabled		(void);
 void		pk_debug_real			(const gchar	*func,
 						 const gchar	*file,
diff --git a/src/pk-main.c b/src/pk-main.c
index 415c081..f4dae72 100644
--- a/src/pk-main.c
+++ b/src/pk-main.c
@@ -172,6 +172,7 @@ main (int argc, char *argv[])
 	gboolean use_daemon = FALSE;
 	gboolean timed_exit = FALSE;
 	gboolean immediate_exit = FALSE;
+	gboolean do_logging = FALSE;
 	gchar *backend_name = NULL;
 	PkConf *conf = NULL;
 	GError *error = NULL;
@@ -241,6 +242,13 @@ main (int argc, char *argv[])
 
 	/* get values from the config file */
 	conf = pk_conf_new ();
+
+	/* do we log? */
+	do_logging = pk_conf_get_bool (conf, "TransactionLogging");
+	pk_debug ("Log all transactions: %i", do_logging);
+	pk_debug_set_logging (do_logging);
+
+	/* after how long do we timeout? */
 	exit_idle_time = pk_conf_get_int (conf, "ShutdownTimeout");
 	pk_debug ("daemon shutdown set to %i seconds", exit_idle_time);
 
commit 5d03a631c8464b9e18ef39e43effa67f8b264033
Merge: 0226edb... 77893cd...
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Mar 24 00:53:22 2008 +0000

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

commit 0226edbb604cb3c90c265ec286aa497ad16018aa
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Mar 24 00:53:04 2008 +0000

    add a logging directory define

diff --git a/configure.ac b/configure.ac
index fb6457c..cd2f50e 100755
--- a/configure.ac
+++ b/configure.ac
@@ -520,6 +520,7 @@ fi
 
 AC_SUBST(PK_CONF_DIR, "\$(sysconfdir)/PackageKit")
 AC_SUBST(PK_DB_DIR, "\$(localstatedir)/lib/PackageKit")
+AC_SUBST(PK_LOG_DIR, "\$(localstatedir)/log")
 AC_SUBST(PK_PLUGIN_DIR, "\$(libdir)/packagekit-backend")
 AC_SUBST(PK_PLUGIN_CFLAGS, "-I\$(top_srcdir)/src -I\$(top_srcdir)/libpackagekit $GLIB_CFLAGS $DBUS_CFLAGS $GMODULE_CFLAGS")
 AC_SUBST(PK_PLUGIN_LIBS, "$GLIB_LIBS $DBUS_LIBS $GMODULE_LIBS")
diff --git a/libpackagekit/Makefile.am b/libpackagekit/Makefile.am
index 7f81bf1..97fc768 100644
--- a/libpackagekit/Makefile.am
+++ b/libpackagekit/Makefile.am
@@ -10,6 +10,7 @@ INCLUDES = \
 	-I$(top_srcdir)/libgbus					\
 	-I$(top_srcdir)/libselftest				\
 	-DPK_DB_DIR=\""$(PK_DB_DIR)"\" 				\
+	-DPK_LOG_DIR=\""$(PK_LOG_DIR)"\" 			\
 	-DPACKAGE_DATA_DIR=\""$(datadir)"\"			\
 	-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
 
commit b7ce8a1a470fb3edd39805dcec5d1256b971235d
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Mar 24 00:42:06 2008 +0000

    add pk_conf_get_bool to the internal API

diff --git a/src/pk-conf.c b/src/pk-conf.c
index b9b2669..9f6d6ec 100644
--- a/src/pk-conf.c
+++ b/src/pk-conf.c
@@ -82,6 +82,22 @@ pk_conf_get_int (PkConf *conf, const gchar *key)
 }
 
 /**
+ * pk_conf_get_bool:
+ **/
+gint
+pk_conf_get_bool (PkConf *conf, const gchar *key)
+{
+	gboolean value;
+	GError *error = NULL;
+	value = g_key_file_get_boolean (conf->priv->keyfile, "Daemon", key, &error);
+	if (error != NULL) {
+		pk_debug ("%s read error: %s", key, error->message);
+		g_error_free (error);
+	}
+	return value;
+}
+
+/**
  * pk_conf_finalize:
  **/
 static void
diff --git a/src/pk-conf.h b/src/pk-conf.h
index 672d03a..68cd904 100644
--- a/src/pk-conf.h
+++ b/src/pk-conf.h
@@ -57,6 +57,8 @@ gchar		*pk_conf_get_string		(PkConf		*conf,
 						 G_GNUC_WARN_UNUSED_RESULT;
 gint		 pk_conf_get_int		(PkConf		*conf,
 						 const gchar	*key);
+gboolean	 pk_conf_get_bool		(PkConf		*conf,
+						 const gchar	*key);
 
 G_END_DECLS
 
commit ca33f9a7e5005fa800445e15461b272072efa64e
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Mar 24 00:41:26 2008 +0000

    correct a key value we will use soon

diff --git a/etc/PackageKit.conf.in b/etc/PackageKit.conf.in
index 2cfe648..7d6fca8 100644
--- a/etc/PackageKit.conf.in
+++ b/etc/PackageKit.conf.in
@@ -5,7 +5,7 @@
 
 # Log transactions to the database
 # default=yes
-TransactionLogging=yes
+TransactionLogging=true
 
 # Shut down the daemon after this many seconds idle. 0 means don't shutdown.
 # default=300
commit 77893cdb7f04e3927c3987f68d89383e7e845121
Merge: a1f2827... 85e631e...
Author: Marcin Banasiak <megabajt at pld-linux.org>
Date:   Mon Mar 24 01:00:35 2008 +0100

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

commit a1f2827b8f95a514399d868cd02604f9013968fe
Author: Marcin Banasiak <megabajt at pld-linux.org>
Date:   Mon Mar 24 00:58:53 2008 +0100

    poldek: don't try to update blocked package

diff --git a/backends/poldek/pk-backend-poldek.c b/backends/poldek/pk-backend-poldek.c
index 403f820..9087979 100644
--- a/backends/poldek/pk-backend-poldek.c
+++ b/backends/poldek/pk-backend-poldek.c
@@ -1810,27 +1810,40 @@ backend_update_packages_thread (PkBackendThread *thread, gpointer data)
 	pk_backend_set_percentage (backend, 1);
 
 	for (i = 0; i < g_strv_length (td->package_ids); i++) {
-		gchar	*command, *nvra;
+		struct pkg	*pkg = NULL;
 		guint	percentage;
 
 		pk_backend_set_status (backend, PK_STATUS_ENUM_DEP_RESOLVE);
 
-		ts = poldek_ts_new (ctx, 0);
-		rcmd = poclidek_rcmd_new (cctx, ts);
-
 		pk_backend_set_sub_percentage (backend, 0);
 
-		nvra = poldek_get_nvra_from_package_id (td->package_ids[i]);
-		command = g_strdup_printf ("upgrade %s", nvra);
+		pkg = poldek_get_pkg_from_package_id (td->package_ids[i]);
+
+		/* don't try to update blocked packages */
+		if (!(pkg->flags & PKG_HELD)) {
+			gchar	*command, *nvra;
+
+			ts = poldek_ts_new (ctx, 0);
+			rcmd = poclidek_rcmd_new (cctx, ts);
+
+			nvra = poldek_get_nvra_from_package_id (td->package_ids[i]);
+			command = g_strdup_printf ("upgrade %s", nvra);
+
+			if (!poclidek_rcmd_execline (rcmd, command)) {
+				gchar	*error;
 
-		if (!poclidek_rcmd_execline (rcmd, command)) {
-			gchar	*error;
+				error = g_strdup_printf ("Cannot update %s", nvra);
 
-			error = g_strdup_printf ("Cannot update %s", nvra);
+				pk_backend_error_code (backend, PK_ERROR_ENUM_TRANSACTION_ERROR, error);
 
-			pk_backend_error_code (backend, PK_ERROR_ENUM_TRANSACTION_ERROR, error);
+				g_free (error);
+			}
+
+			g_free (nvra);
+			g_free (command);
 
-			g_free (error);
+			poclidek_rcmd_free (rcmd);
+			poldek_ts_free (ts);
 		}
 
 		percentage = (gint)(((float)(i + 1) / (float)g_strv_length (td->package_ids)) * 100);
@@ -1838,11 +1851,7 @@ backend_update_packages_thread (PkBackendThread *thread, gpointer data)
 		if (percentage > 1)
 			pk_backend_set_percentage (backend, percentage);
 
-		g_free (nvra);
-		g_free (command);
-
-		poclidek_rcmd_free (rcmd);
-		poldek_ts_free (ts);
+		pkg_free (pkg);
 	}
 
 	pk_backend_set_percentage (backend, 100);
commit 85e631e548589085e11a9dfe10586138d381bd88
Merge: 5372cd2... dfe2976...
Author: Matthias Clasen <mclasen at redhat.com>
Date:   Sun Mar 23 19:50:06 2008 -0400

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

commit 5372cd2c0b954fbed2995f8b655d25b4978675b5
Merge: 637c0c5... b9833af...
Author: Matthias Clasen <mclasen at redhat.com>
Date:   Sat Mar 22 23:25:57 2008 -0400

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

commit 637c0c54433910d4c0f53ea8f3d1750927c89e14
Merge: b8ea3ce... 30d2c35...
Author: Matthias Clasen <mclasen at redhat.com>
Date:   Fri Mar 21 22:15:55 2008 -0400

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

commit b8ea3cebdccdeeab21e72f49ccfa39f3accf86bd
Author: Matthias Clasen <mclasen at redhat.com>
Date:   Fri Mar 21 22:15:41 2008 -0400

    Set status

diff --git a/backends/yum2/helpers/yumDBUSBackend.py b/backends/yum2/helpers/yumDBUSBackend.py
index 69a8959..71664be 100755
--- a/backends/yum2/helpers/yumDBUSBackend.py
+++ b/backends/yum2/helpers/yumDBUSBackend.py
@@ -794,6 +794,8 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 successful = self._runYumTransaction()
                 if not successful:
                     return
+	    else:
+		self.StatusChanged(STATUS_CLEANUP)
         except yum.Errors.InstallError,e:
             msgs = '\n'.join(e)
             self._unlock_yum()



More information about the PackageKit mailing list