Blame SOURCES/0002-trivial-Add-some-error-prefixes-to-better-chase-down.patch

c68504
From 67f10091c97f5c5975fe620948803cec2e81aa34 Mon Sep 17 00:00:00 2001
c68504
From: Richard Hughes <richard@hughsie.com>
c68504
Date: Tue, 19 Sep 2017 11:50:41 +0100
c68504
Subject: [PATCH 2/2] trivial: Add some error prefixes to better chase down
c68504
 bugs
c68504
c68504
---
c68504
 src/plugins/gs-plugin-packagekit-local.c   |  8 ++++++--
c68504
 src/plugins/gs-plugin-packagekit-origin.c  |  4 +++-
c68504
 src/plugins/gs-plugin-packagekit-refine.c  | 24 ++++++++++++++++++------
c68504
 src/plugins/gs-plugin-packagekit-refresh.c |  5 ++++-
c68504
 src/plugins/gs-plugin-packagekit-upgrade.c |  1 +
c68504
 src/plugins/gs-plugin-packagekit.c         | 28 ++++++++++++++++++++++------
c68504
 6 files changed, 54 insertions(+), 16 deletions(-)
c68504
c68504
diff --git a/src/plugins/gs-plugin-packagekit-local.c b/src/plugins/gs-plugin-packagekit-local.c
c68504
index 7d76c702..5e8d8022 100644
c68504
--- a/src/plugins/gs-plugin-packagekit-local.c
c68504
+++ b/src/plugins/gs-plugin-packagekit-local.c
c68504
@@ -102,8 +102,10 @@ gs_plugin_packagekit_refresh_guess_app_id (GsPlugin *plugin,
c68504
 					     cancellable,
c68504
 					     gs_plugin_packagekit_progress_cb, &data,
c68504
 					     error);
c68504
-	if (!gs_plugin_packagekit_results_valid (results, error))
c68504
+	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to get files local: ");
c68504
 		return FALSE;
c68504
+	}
c68504
 	array = pk_results_get_files_array (results);
c68504
 	if (array->len == 0) {
c68504
 		g_set_error (error,
c68504
@@ -180,8 +182,10 @@ gs_plugin_file_to_app (GsPlugin *plugin,
c68504
 					       cancellable,
c68504
 					       gs_plugin_packagekit_progress_cb, &data,
c68504
 					       error);
c68504
-	if (!gs_plugin_packagekit_results_valid (results, error))
c68504
+	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to get details local: ");
c68504
 		return FALSE;
c68504
+	}
c68504
 
c68504
 	/* get results */
c68504
 	array = pk_results_get_details_array (results);
c68504
diff --git a/src/plugins/gs-plugin-packagekit-origin.c b/src/plugins/gs-plugin-packagekit-origin.c
c68504
index 4d81963c..4e6b3d14 100644
c68504
--- a/src/plugins/gs-plugin-packagekit-origin.c
c68504
+++ b/src/plugins/gs-plugin-packagekit-origin.c
c68504
@@ -86,8 +86,10 @@ gs_plugin_packagekit_origin_ensure_sources (GsPlugin *plugin,
c68504
 					   cancellable,
c68504
 					   NULL, plugin,
c68504
 					   error);
c68504
-	if (!gs_plugin_packagekit_results_valid (results, error))
c68504
+	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to get repo list: ");
c68504
 		return FALSE;
c68504
+	}
c68504
 	array = pk_results_get_repo_detail_array (results);
c68504
 	for (i = 0; i < array->len; i++) {
c68504
 		rd = g_ptr_array_index (array, i);
c68504
diff --git a/src/plugins/gs-plugin-packagekit-refine.c b/src/plugins/gs-plugin-packagekit-refine.c
c68504
index b5c6f990..ec471f83 100644
c68504
--- a/src/plugins/gs-plugin-packagekit-refine.c
c68504
+++ b/src/plugins/gs-plugin-packagekit-refine.c
c68504
@@ -276,8 +276,10 @@ gs_plugin_packagekit_resolve_packages (GsPlugin *plugin,
c68504
 				     cancellable,
c68504
 				     gs_plugin_packagekit_progress_cb, &data,
c68504
 				     error);
c68504
-	if (!gs_plugin_packagekit_results_valid (results, error))
c68504
+	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to resolve packages: ");
c68504
 		return FALSE;
c68504
+	}
c68504
 
c68504
 	/* get results */
c68504
 	packages = pk_results_get_package_array (results);
c68504
@@ -315,8 +317,10 @@ gs_plugin_packagekit_refine_from_desktop (GsPlugin *plugin,
c68504
 					  cancellable,
c68504
 					  gs_plugin_packagekit_progress_cb, &data,
c68504
 					  error);
c68504
-	if (!gs_plugin_packagekit_results_valid (results, error))
c68504
+	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to refine from desktop file: ");
c68504
 		return FALSE;
c68504
+	}
c68504
 
c68504
 	/* get results */
c68504
 	packages = pk_results_get_package_array (results);
c68504
@@ -393,8 +397,10 @@ gs_plugin_packagekit_refine_updatedetails (GsPlugin *plugin,
c68504
 					       cancellable,
c68504
 					       gs_plugin_packagekit_progress_cb, &data,
c68504
 					       error);
c68504
-	if (!gs_plugin_packagekit_results_valid (results, error))
c68504
+	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to refine update details: ");
c68504
 		return FALSE;
c68504
+	}
c68504
 
c68504
 	/* set the update details for the update */
c68504
 	array = pk_results_get_update_detail_array (results);
c68504
@@ -535,8 +541,10 @@ gs_plugin_packagekit_refine_details (GsPlugin *plugin,
c68504
 					 cancellable,
c68504
 					 gs_plugin_packagekit_progress_cb, &data,
c68504
 					 error);
c68504
-	if (!gs_plugin_packagekit_results_valid (results, error))
c68504
+	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to refine details: ");
c68504
 		return FALSE;
c68504
+	}
c68504
 
c68504
 	/* set the update details for the update */
c68504
 	array = pk_results_get_details_array (results);
c68504
@@ -574,8 +582,10 @@ gs_plugin_packagekit_refine_update_urgency (GsPlugin *plugin,
c68504
 					 cancellable,
c68504
 					 gs_plugin_packagekit_progress_cb, &data,
c68504
 					 error);
c68504
-	if (!gs_plugin_packagekit_results_valid (results, error))
c68504
+	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to get updates: ");
c68504
 		return FALSE;
c68504
+	}
c68504
 
c68504
 	/* set the update severity for the app */
c68504
 	sack = pk_results_get_package_sack (results);
c68504
@@ -765,8 +775,10 @@ gs_plugin_packagekit_refine_distro_upgrade (GsPlugin *plugin,
c68504
 					    error);
c68504
 	pk_client_set_cache_age (priv->client, cache_age_save);
c68504
 
c68504
-	if (!gs_plugin_packagekit_results_valid (results, error))
c68504
+	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to refine distro upgrades: ");
c68504
 		return FALSE;
c68504
+	}
c68504
 	list = gs_app_list_new ();
c68504
 	if (!gs_plugin_packagekit_add_results (plugin, list, results, error))
c68504
 		return FALSE;
c68504
diff --git a/src/plugins/gs-plugin-packagekit-refresh.c b/src/plugins/gs-plugin-packagekit-refresh.c
c68504
index 68b81c5f..71c4d6fa 100644
c68504
--- a/src/plugins/gs-plugin-packagekit-refresh.c
c68504
+++ b/src/plugins/gs-plugin-packagekit-refresh.c
c68504
@@ -124,8 +124,10 @@ gs_plugin_refresh (GsPlugin *plugin,
c68504
 						 cancellable,
c68504
 						 gs_plugin_packagekit_progress_cb, &data,
c68504
 						 error);
c68504
-		if (!gs_plugin_packagekit_results_valid (results, error))
c68504
+		if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+			g_prefix_error (error, "failed to get updates: ");
c68504
 			return FALSE;
c68504
+		}
c68504
 	}
c68504
 
c68504
 	/* download all the packages themselves */
c68504
@@ -145,6 +147,7 @@ gs_plugin_refresh (GsPlugin *plugin,
c68504
 							 gs_plugin_packagekit_progress_cb, &data,
c68504
 							 error);
c68504
 		if (results2 == NULL) {
c68504
+			g_prefix_error (error, "failed to update packages: ");
c68504
 			gs_plugin_packagekit_convert_gerror (error);
c68504
 			return FALSE;
c68504
 		}
c68504
diff --git a/src/plugins/gs-plugin-packagekit-upgrade.c b/src/plugins/gs-plugin-packagekit-upgrade.c
c68504
index 6791efc4..7a35df11 100644
c68504
--- a/src/plugins/gs-plugin-packagekit-upgrade.c
c68504
+++ b/src/plugins/gs-plugin-packagekit-upgrade.c
c68504
@@ -104,6 +104,7 @@ gs_plugin_app_upgrade_download (GsPlugin *plugin,
c68504
 					       gs_plugin_packagekit_progress_cb, &data,
c68504
 					       error);
c68504
 	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to upgrade system: ");
c68504
 		gs_app_set_state_recover (app);
c68504
 		return FALSE;
c68504
 	}
c68504
diff --git a/src/plugins/gs-plugin-packagekit.c b/src/plugins/gs-plugin-packagekit.c
c68504
index d0aecbc5..2059e117 100644
c68504
--- a/src/plugins/gs-plugin-packagekit.c
c68504
+++ b/src/plugins/gs-plugin-packagekit.c
c68504
@@ -132,8 +132,10 @@ gs_plugin_add_sources_related (GsPlugin *plugin,
c68504
 					   cancellable,
c68504
 					   gs_plugin_packagekit_progress_cb, &data,
c68504
 					   error);
c68504
-	if (!gs_plugin_packagekit_results_valid (results, error))
c68504
+	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to get packages: ");
c68504
 		return FALSE;
c68504
+	}
c68504
 	ret = gs_plugin_packagekit_add_results (plugin,
c68504
 						installed,
c68504
 						results,
c68504
@@ -186,8 +188,10 @@ gs_plugin_add_sources (GsPlugin *plugin,
c68504
 					   cancellable,
c68504
 					   gs_plugin_packagekit_progress_cb, &data,
c68504
 					   error);
c68504
-	if (!gs_plugin_packagekit_results_valid (results, error))
c68504
+	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to get repo list: ");
c68504
 		return FALSE;
c68504
+	}
c68504
 	hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
c68504
 	array = pk_results_get_repo_detail_array (results);
c68504
 	for (i = 0; i < array->len; i++) {
c68504
@@ -238,8 +242,10 @@ gs_plugin_app_source_enable (GsPlugin *plugin,
c68504
 					 cancellable,
c68504
 					 gs_plugin_packagekit_progress_cb, &data,
c68504
 					 error);
c68504
-	if (!gs_plugin_packagekit_results_valid (results, error))
c68504
+	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to enable repo: ");
c68504
 		return FALSE;
c68504
+	}
c68504
 	return TRUE;
c68504
 }
c68504
 
c68504
@@ -302,6 +308,7 @@ gs_plugin_app_install (GsPlugin *plugin,
c68504
 							 gs_plugin_packagekit_progress_cb, &data,
c68504
 							 error);
c68504
 		if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+			g_prefix_error (error, "failed to install packages: ");
c68504
 			gs_app_set_state_recover (app);
c68504
 			return FALSE;
c68504
 		}
c68504
@@ -371,6 +378,7 @@ gs_plugin_app_install (GsPlugin *plugin,
c68504
 							 gs_plugin_packagekit_progress_cb, &data,
c68504
 							 error);
c68504
 		if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+			g_prefix_error (error, "failed to install packages: ");
c68504
 			gs_app_set_state_recover (app);
c68504
 			return FALSE;
c68504
 		}
c68504
@@ -396,6 +404,7 @@ gs_plugin_app_install (GsPlugin *plugin,
c68504
 						      gs_plugin_packagekit_progress_cb, &data,
c68504
 						      error);
c68504
 		if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+			g_prefix_error (error, "failed to install files: ");
c68504
 			gs_app_set_state_recover (app);
c68504
 			return FALSE;
c68504
 		}
c68504
@@ -445,8 +454,10 @@ gs_plugin_app_source_disable (GsPlugin *plugin,
c68504
 					 cancellable,
c68504
 					 gs_plugin_packagekit_progress_cb, &data,
c68504
 					 error);
c68504
-	if (!gs_plugin_packagekit_results_valid (results, error))
c68504
+	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to disable source: ");
c68504
 		return FALSE;
c68504
+	}
c68504
 	return TRUE;
c68504
 }
c68504
 
c68504
@@ -547,6 +558,7 @@ gs_plugin_app_remove (GsPlugin *plugin,
c68504
 						gs_plugin_packagekit_progress_cb, &data,
c68504
 						error);
c68504
 	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to remove packages: ");
c68504
 		gs_app_set_state_recover (app);
c68504
 		return FALSE;
c68504
 	}
c68504
@@ -587,8 +599,10 @@ gs_plugin_add_search_files (GsPlugin *plugin,
c68504
 	                                  cancellable,
c68504
 	                                  gs_plugin_packagekit_progress_cb, &data,
c68504
 	                                  error);
c68504
-	if (!gs_plugin_packagekit_results_valid (results, error))
c68504
+	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to search for files: ");
c68504
 		return FALSE;
c68504
+	}
c68504
 
c68504
 	/* add results */
c68504
 	return gs_plugin_packagekit_add_results (plugin, list, results, error);
c68504
@@ -621,8 +635,10 @@ gs_plugin_add_search_what_provides (GsPlugin *plugin,
c68504
 	                                   cancellable,
c68504
 	                                   gs_plugin_packagekit_progress_cb, &data,
c68504
 	                                   error);
c68504
-	if (!gs_plugin_packagekit_results_valid (results, error))
c68504
+	if (!gs_plugin_packagekit_results_valid (results, error)) {
c68504
+		g_prefix_error (error, "failed to search what provides: ");
c68504
 		return FALSE;
c68504
+	}
c68504
 
c68504
 	/* add results */
c68504
 	return gs_plugin_packagekit_add_results (plugin, list, results, error);
c68504
-- 
c68504
2.13.5
c68504