[gnome-software] Use UNAVAILABLE state to denote packages-to-be-removed



commit 05354194a40abc222117aed0ce71151a9547e1c8
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           |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/gs-plugin-packagekit-refine.c b/src/plugins/gs-plugin-packagekit-refine.c
index f5b4402..1a64738 100644
--- a/src/plugins/gs-plugin-packagekit-refine.c
+++ b/src/plugins/gs-plugin-packagekit-refine.c
@@ -765,7 +765,7 @@ gs_plugin_packagekit_refine_distro_upgrade (GsPlugin *plugin,
        /* add each of these as related applications */
        for (i = 0; i < gs_app_list_length (list); i++) {
                app2 = gs_app_list_index (list, i);
-               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);
        }
@@ -798,7 +798,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 (i = 0; i < gs_app_list_length (list); i++) {
                        app = gs_app_list_index (list, i);
diff --git a/src/plugins/packagekit-common.c b/src/plugins/packagekit-common.c
index 6da73f4..6f6392d 100644
--- a/src/plugins/packagekit-common.c
+++ b/src/plugins/packagekit-common.c
@@ -253,7 +253,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:
@@ -262,6 +261,7 @@ gs_plugin_packagekit_add_results (GsPlugin *plugin,
                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:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]