[gnome-software/gnome-3-20] Use UNAVAILABLE state to denote packages-to-be-removed
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-20] Use UNAVAILABLE state to denote packages-to-be-removed
- Date: Tue, 12 Jul 2016 13:34:07 +0000 (UTC)
commit 0ba1d476f79e4d1f30f285c966d3a5c11aae1660
Author: Kalev Lember <klember redhat com>
Date: Tue Jul 12 14:43:50 2016 +0200
Use UNAVAILABLE state to denote packages-to-be-removed
... as per hughsie's suggestion.
src/plugins/gs-plugin-packagekit-refine.c | 4 ++--
src/plugins/packagekit-common.c | 5 ++++-
2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/gs-plugin-packagekit-refine.c b/src/plugins/gs-plugin-packagekit-refine.c
index 2ac9d9a..3246178 100644
--- a/src/plugins/gs-plugin-packagekit-refine.c
+++ b/src/plugins/gs-plugin-packagekit-refine.c
@@ -806,7 +806,7 @@ gs_plugin_packagekit_refine_distro_upgrade (GsPlugin *plugin,
/* add each of these as related applications */
for (l = list; l != NULL; l = l->next) {
app2 = GS_APP (l->data);
- if (gs_app_get_state (app2) != AS_APP_STATE_AVAILABLE)
+ if (gs_app_get_state (app2) != AS_APP_STATE_UNAVAILABLE)
continue;
gs_app_add_related (app, app2);
}
@@ -834,7 +834,7 @@ gs_plugin_refine (GsPlugin *plugin,
/* when we need the cannot-be-upgraded applications, we implement this
* by doing a UpgradeSystem(SIMULATE) which adds the removed packages
- * to the related-apps list with a state of %AS_APP_STATE_AVAILABLE */
+ * to the related-apps list with a state of %AS_APP_STATE_UNAVAILABLE */
if (flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_UPGRADE_REMOVED) {
for (l = *list; l != NULL; l = l->next) {
app = GS_APP (l->data);
diff --git a/src/plugins/packagekit-common.c b/src/plugins/packagekit-common.c
index f67ce1a..cdf9633 100644
--- a/src/plugins/packagekit-common.c
+++ b/src/plugins/packagekit-common.c
@@ -260,7 +260,6 @@ gs_plugin_packagekit_add_results (GsPlugin *plugin,
gs_app_set_state (app, AS_APP_STATE_INSTALLED);
break;
case PK_INFO_ENUM_AVAILABLE:
- case PK_INFO_ENUM_REMOVING:
gs_app_set_state (app, AS_APP_STATE_AVAILABLE);
break;
case PK_INFO_ENUM_INSTALLING:
@@ -268,6 +267,10 @@ gs_plugin_packagekit_add_results (GsPlugin *plugin,
case PK_INFO_ENUM_DOWNGRADING:
case PK_INFO_ENUM_OBSOLETING:
break;
+ case PK_INFO_ENUM_UNAVAILABLE:
+ case PK_INFO_ENUM_REMOVING:
+ gs_app_set_state (app, AS_APP_STATE_UNAVAILABLE);
+ break;
default:
gs_app_set_state (app, AS_APP_STATE_UNKNOWN);
g_warning ("unknown info state of %s",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]