[gnome-software/gnome-41: 1/2] gs-update-monitor: Recognize security updates




commit f9ec0ef60240f588da56f89a79c79ab7e30b9016
Author: Milan Crha <mcrha redhat com>
Date:   Wed Nov 24 10:37:04 2021 +0100

    gs-update-monitor: Recognize security updates
    
    There was used a metadata item "is-security", but it's not used anywhere
    in the code. Rather than that check for the update urgency of the app
    and whether it's already downloaded.

 src/gs-update-monitor.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-update-monitor.c b/src/gs-update-monitor.c
index a8421fcc4..7e673790f 100644
--- a/src/gs-update-monitor.c
+++ b/src/gs-update-monitor.c
@@ -536,7 +536,9 @@ get_updates_finished_cb (GObject *object, GAsyncResult *res, gpointer data)
                        "security-timestamp", "x", &security_timestamp_old);
        for (guint i = 0; i < gs_app_list_length (apps); i++) {
                GsApp *app = gs_app_list_index (apps, i);
-               if (gs_app_get_metadata_item (app, "is-security") != NULL) {
+               if (gs_app_get_update_urgency (app) == AS_URGENCY_KIND_CRITICAL &&
+                   gs_app_get_size_download (app) > 0 &&
+                   gs_app_get_size_download (app) != GS_APP_SIZE_UNKNOWABLE) {
                        security_timestamp = (guint64) g_get_monotonic_time ();
                        break;
                }


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