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

Richard Hughes hughsient at kemper.freedesktop.org
Sat Dec 29 08:13:08 PST 2007


 Makefile.am                       |    2 --
 backends/dummy/pk-backend-dummy.c |    9 +++++++++
 data/Makefile.am                  |    2 ++
 python/packagekit/backend.py      |    7 +++----
 src/pk-backend.c                  |    9 ++++++++-
 src/pk-spawn.c                    |    4 +++-
 6 files changed, 25 insertions(+), 8 deletions(-)

New commits:
commit 726f9521e6cdd3d0ec8a44d622caecd4390f9d26
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Dec 29 16:04:43 2007 +0000

    remove some whitespace

diff --git a/python/packagekit/backend.py b/python/packagekit/backend.py
index 84f6a5e..87c718f 100644
--- a/python/packagekit/backend.py
+++ b/python/packagekit/backend.py
@@ -244,7 +244,7 @@ class PackageKitBaseBackend:
             return False
 
         return True
-       
+
 #
 # Backend Action Methods
 #
@@ -484,8 +484,8 @@ def exceptionHandler(typ, value, tb, base):
         errmsg += '    %s;' % c
     # send the traceback to PackageKit
     base.error(ERROR_INTERNAL_ERROR,errmsg,exit=True)
-    
-    
+
+
 def installExceptionHandler(base):
     sys.excepthook = lambda typ, value, tb: exceptionHandler(typ, value, tb,base)
     
commit 404adc4b5fddc5e80bae82260545f4e5c9fad0bc
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Dec 29 16:02:58 2007 +0000

    don't print the error message to the screen, only use the handler

diff --git a/python/packagekit/backend.py b/python/packagekit/backend.py
index 170d9cc..84f6a5e 100644
--- a/python/packagekit/backend.py
+++ b/python/packagekit/backend.py
@@ -483,7 +483,6 @@ def exceptionHandler(typ, value, tb, base):
         errmsg += '  File : %s , line %s, in %s;' % (f,str(l),m)
         errmsg += '    %s;' % c
     # send the traceback to PackageKit
-    print errmsg
     base.error(ERROR_INTERNAL_ERROR,errmsg,exit=True)
     
     
commit 31565122f6cc3adf0ee36d403236d25af95f57e1
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Dec 29 15:56:14 2007 +0000

    add in a utf8 test to the dummy backend

diff --git a/backends/dummy/pk-backend-dummy.c b/backends/dummy/pk-backend-dummy.c
index 60621c4..b527a35 100644
--- a/backends/dummy/pk-backend-dummy.c
+++ b/backends/dummy/pk-backend-dummy.c
@@ -353,6 +353,9 @@ backend_search_group (PkBackend *backend, const gchar *filter, const gchar *sear
 	pk_backend_package (backend, PK_INFO_ENUM_AVAILABLE,
 			    "vips-doc;7.12.4-2.fc8;noarch;linva",
 			    "The vips documentation package.");
+	pk_backend_package (backend, PK_INFO_ENUM_AVAILABLE,
+			    "bǣwulf-utf8;0.1;noarch;hughsie",
+			    "The bǣwulf server test name.");
 	pk_backend_finished (backend);
 }
 
commit a7f68f45d4273a69ec509411ae8378622fc384c8
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Dec 29 15:25:38 2007 +0000

    only emit error codes that converted okay

diff --git a/src/pk-backend.c b/src/pk-backend.c
index c53ad40..73a8eae 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -406,7 +406,14 @@ pk_backend_parse_common_error (PkBackend *backend, const gchar *line)
 			goto out;
 		}
 		error_enum = pk_error_enum_from_text (sections[1]);
-		pk_backend_error_code (backend, error_enum, sections[2]);
+		if (error_enum == PK_ERROR_ENUM_UNKNOWN) {
+			command = g_strdup_printf ("Error enum not recognised, and hence ignored: '%s'", sections[1]);
+			pk_backend_message (backend, PK_MESSAGE_ENUM_DAEMON, command);
+			g_free (command);
+		} else {
+			/* only emit if known */
+			pk_backend_error_code (backend, error_enum, sections[2]);
+		}
 	} else if (pk_strequal (command, "requirerestart") == TRUE) {
 		if (size != 3) {
 			g_warning ("invalid command '%s'", command);
commit 2c80dba28530a413abac4f14074250854e388797
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Dec 29 15:06:53 2007 +0000

    add soem change status calls into the dummy backend to avoid being nagged when debugging

diff --git a/backends/dummy/pk-backend-dummy.c b/backends/dummy/pk-backend-dummy.c
index ed68746..60621c4 100644
--- a/backends/dummy/pk-backend-dummy.c
+++ b/backends/dummy/pk-backend-dummy.c
@@ -286,6 +286,7 @@ static void
 backend_resolve (PkBackend *backend, const gchar *filter, const gchar *package_id)
 {
 	g_return_if_fail (backend != NULL);
+	pk_backend_change_status (backend, PK_STATUS_ENUM_QUERY);
 	pk_backend_package (backend, PK_INFO_ENUM_INSTALLED,
 			    "glib2;2.14.0;i386;fedora", "The GLib library");
 	pk_backend_finished (backend);
@@ -308,6 +309,7 @@ static void
 backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps)
 {
 	g_return_if_fail (backend != NULL);
+	pk_backend_change_status (backend, PK_STATUS_ENUM_REMOVE);
 	pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "No network connection available");
 	pk_backend_finished (backend);
 }
@@ -319,6 +321,7 @@ static void
 backend_search_details (PkBackend *backend, const gchar *filter, const gchar *search)
 {
 	g_return_if_fail (backend != NULL);
+	pk_backend_change_status (backend, PK_STATUS_ENUM_QUERY);
 	pk_backend_package (backend, PK_INFO_ENUM_AVAILABLE,
 			    "vips-doc;7.12.4-2.fc8;noarch;linva",
 			    "The vips \"documentation\" package.");
@@ -332,6 +335,7 @@ static void
 backend_search_file (PkBackend *backend, const gchar *filter, const gchar *search)
 {
 	g_return_if_fail (backend != NULL);
+	pk_backend_change_status (backend, PK_STATUS_ENUM_QUERY);
 	pk_backend_package (backend, PK_INFO_ENUM_AVAILABLE,
 			    "vips-doc;7.12.4-2.fc8;noarch;linva",
 			    "The vips documentation package.");
@@ -345,6 +349,7 @@ static void
 backend_search_group (PkBackend *backend, const gchar *filter, const gchar *search)
 {
 	g_return_if_fail (backend != NULL);
+	pk_backend_change_status (backend, PK_STATUS_ENUM_QUERY);
 	pk_backend_package (backend, PK_INFO_ENUM_AVAILABLE,
 			    "vips-doc;7.12.4-2.fc8;noarch;linva",
 			    "The vips documentation package.");
@@ -382,6 +387,7 @@ backend_search_name (PkBackend *backend, const gchar *filter, const gchar *searc
 {
 	g_return_if_fail (backend != NULL);
 	pk_backend_no_percentage_updates (backend);
+	pk_backend_change_status (backend, PK_STATUS_ENUM_QUERY);
 	g_timeout_add (2000, backend_search_name_timeout, backend);
 }
 
commit e86a0ea1dfbf01d24e496797325b68bb4e4ce052
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Dec 29 15:05:40 2007 +0000

    only emit if we could covert the locale line into UTF8

diff --git a/src/pk-spawn.c b/src/pk-spawn.c
index f7816c7..f7f9094 100644
--- a/src/pk-spawn.c
+++ b/src/pk-spawn.c
@@ -128,7 +128,9 @@ pk_spawn_emit_whole_lines (PkSpawn *spawn, GString *string, gboolean is_stdout)
 	/* we only emit n-1 strings */
 	for (i=0; i<(size-1); i++) {
 		message = g_locale_to_utf8 (lines[i], -1, NULL, NULL, NULL);
-		if (is_stdout == TRUE) {
+		if (message == NULL) {
+			pk_warning ("cannot covert line to UTF8: %s", lines[i]);
+		} else if (is_stdout == TRUE) {
 			pk_debug ("emitting stdout %s", message);
 			g_signal_emit (spawn, signals [PK_SPAWN_STDOUT], 0, message);
 		} else {
commit a08a0ef242fd9504421a6e25e4477fb63a21e030
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Dec 29 11:33:45 2007 +0000

    never hack late at night - fix make dist

diff --git a/Makefile.am b/Makefile.am
index 57f5517..1ea49a9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,8 +19,6 @@ SUBDIRS = 						\
 	$(NULL)
 
 EXTRA_DIST =						\
-	org.freedesktop.PackageKit.conf.in		\
-	packagekit.pc.in				\
 	COPYING						\
 	MAINTAINERS					\
 	AUTHORS						\
diff --git a/data/Makefile.am b/data/Makefile.am
index 118d6f8..8bc0ed7 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -31,6 +31,8 @@ database_DATA =						\
 	$(NULL)
 
 EXTRA_DIST =						\
+	org.freedesktop.PackageKit.conf.in		\
+	packagekit.pc.in				\
 	$(service_in_files)				\
 	$(localcache_DATA)				\
 	$(database_DATA)				\



More information about the PackageKit mailing list