[gnome-software/wip/mcrha/gs-update-monitor-recognize-security-updates] gs-update-monitor: Recognize security updates



commit 7d6ddbc3cb988c992bef618bbb1be81a8584fc4c
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]