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

Richard Hughes hughsient at kemper.freedesktop.org
Sun Oct 14 01:32:07 PDT 2007


 client/pk-console.c |    4 ----
 client/pk-monitor.c |    4 ----
 src/pk-engine.c     |   13 ++++++++++++-
 3 files changed, 12 insertions(+), 9 deletions(-)

New commits:
commit dd7303f33fbbdc70dd4ed00992831af11013cd35
Author: Richard Hughes <richard at hughsie.com>
Date:   Sun Oct 14 09:30:38 2007 +0100

    invalidate the updates_cache and suggest a client GetUpdates call when we enable or disable a repo

diff --git a/TODO b/TODO
index 93da12a..aba873c 100644
--- a/TODO
+++ b/TODO
@@ -6,7 +6,6 @@ TimeRemaining()
 *** the backends will have repo controls ***
 Add the callback and methods in PkBackend
 Add methods and signals to the client library
-After changing the repos, trigger a refresh-cache
 
 *** Prepare download to refresh system ***
 Either use a flag or a new method. I'm not sure which yet.
diff --git a/src/pk-engine.c b/src/pk-engine.c
index 9bdc835..d603ec9 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -1792,9 +1792,20 @@ pk_engine_repo_enable (PkEngine	*engine, const gchar *repo_id, gboolean enabled,
 		return;
 	}
 
+	/* this has to be done as different repos might have different updates */
+	if (engine->priv->updates_cache != NULL) {
+		pk_debug ("unreffing updates cache as we have just enabled/disabled a repo");
+		g_object_unref (engine->priv->updates_cache);
+		engine->priv->updates_cache = NULL;
+	}
+
 	//ret = pk_backend_repo_enable (item->backend, repo_id, enabled);
 	ret = FALSE;
-	if (ret == FALSE) {
+	if (ret == TRUE) {
+		/* this should cause the client program to requeue an update */
+		pk_debug ("emitting updates-changed tid:(null)");
+		g_signal_emit (engine, signals [PK_ENGINE_UPDATES_CHANGED], 0, NULL);
+	} else {
 		error = g_error_new (PK_ENGINE_ERROR, PK_ENGINE_ERROR_NOT_SUPPORTED,
 				     "Operation not yet supported by backend");
 		dbus_g_method_return_error (context, error);
commit 9b924f42f021b13db7aeccd58df39e335ba834f1
Author: James Bowes <jbowes at dangerouslyinc.com>
Date:   Sat Oct 13 21:07:51 2007 -0400

    Remove duplicate thread_init code from pkcon and pkmon

diff --git a/client/pk-console.c b/client/pk-console.c
index b724e82..c7cc842 100644
--- a/client/pk-console.c
+++ b/client/pk-console.c
@@ -467,10 +467,6 @@ main (int argc, char *argv[])
 	dbus_g_thread_init ();
 	g_type_init ();
 
-	if (!g_thread_supported ())
-		g_thread_init (NULL);
-	dbus_g_thread_init ();
-
 	/* check dbus connections, exit if not valid */
 	system_connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
 	if (error) {
diff --git a/client/pk-monitor.c b/client/pk-monitor.c
index ae6f4e9..c98f261 100644
--- a/client/pk-monitor.c
+++ b/client/pk-monitor.c
@@ -80,10 +80,6 @@ main (int argc, char *argv[])
 	g_type_init ();
 	pk_debug_init (TRUE);
 
-	if (!g_thread_supported ())
-		g_thread_init (NULL);
-	dbus_g_thread_init ();
-
 	loop = g_main_loop_new (NULL, FALSE);
 
 	pconnection = pk_connection_new ();
commit 811231653f7ba1843086156a18e1b45480950af7
Author: Ken VanDine <ken at vandine.org>
Date:   Sat Oct 13 20:59:23 2007 -0400

    Updated TODO

diff --git a/TODO b/TODO
index aba873c..93da12a 100644
--- a/TODO
+++ b/TODO
@@ -6,6 +6,7 @@ TimeRemaining()
 *** the backends will have repo controls ***
 Add the callback and methods in PkBackend
 Add methods and signals to the client library
+After changing the repos, trigger a refresh-cache
 
 *** Prepare download to refresh system ***
 Either use a flag or a new method. I'm not sure which yet.



More information about the PackageKit mailing list