[gnome-packagekit] trivial: Print any error from pk_desktop_get_files_for_package() to the console to help debugging
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-packagekit] trivial: Print any error from pk_desktop_get_files_for_package() to the console to help debugging
- Date: Fri, 15 Oct 2010 13:57:41 +0000 (UTC)
commit 28d1aabb4536c2c2c5248f0c318df59b2ea13318
Author: Richard Hughes <richard hughsie com>
Date: Fri Oct 15 14:57:31 2010 +0100
trivial: Print any error from pk_desktop_get_files_for_package() to the console to help debugging
src/gpk-helper-run.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/gpk-helper-run.c b/src/gpk-helper-run.c
index de24416..9eda7d8 100644
--- a/src/gpk-helper-run.c
+++ b/src/gpk-helper-run.c
@@ -351,6 +351,7 @@ gpk_helper_run_add_package_ids (GpkHelperRun *helper, gchar **package_ids)
gchar **parts;
gboolean ret;
PkDesktop *desktop;
+ GError *error = NULL;
/* open database */
desktop = pk_desktop_new ();
@@ -364,7 +365,7 @@ gpk_helper_run_add_package_ids (GpkHelperRun *helper, gchar **package_ids)
length = g_strv_length (package_ids);
for (i=0; i<length; i++) {
parts = g_strsplit (package_ids[i], ";", 0);
- array = pk_desktop_get_files_for_package (desktop, parts[0], NULL);
+ array = pk_desktop_get_files_for_package (desktop, parts[0], &error);
if (array != NULL) {
for (j=0; j<array->len; j++) {
filename = g_ptr_array_index (array, j);
@@ -373,6 +374,9 @@ gpk_helper_run_add_package_ids (GpkHelperRun *helper, gchar **package_ids)
added++;
}
g_ptr_array_unref (array);
+ } else {
+ egg_warning ("failed to get files for %s: %s", parts[0], error->message);
+ g_clear_error (&error);
}
g_strfreev (parts);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]