Update to 40.3

This commit is contained in:
Milan Crha 2021-07-12 11:52:52 +02:00
parent 0f8fa87137
commit ad5b2dba08
3 changed files with 6 additions and 93 deletions

View File

@ -1,89 +0,0 @@
From 69ba099e9d49979a6dacdcd879d98f72744d298a Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Tue, 11 May 2021 11:13:52 +0200
Subject: [PATCH] gs-update-monitor: Automatically install application updates
The application updates, so called online updates, should be installed immediately
when found, when the user has enabled automatic updates.
Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1248
---
src/gs-update-monitor.c | 47 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 45 insertions(+), 2 deletions(-)
diff --git a/src/gs-update-monitor.c b/src/gs-update-monitor.c
index b3209185d..234c7de95 100644
--- a/src/gs-update-monitor.c
+++ b/src/gs-update-monitor.c
@@ -475,6 +475,7 @@ get_updates_finished_cb (GObject *object, GAsyncResult *res, gpointer data)
guint64 security_timestamp_old = 0;
g_autoptr(GError) error = NULL;
g_autoptr(GsAppList) apps = NULL;
+ gboolean should_download;
/* get result */
apps = gs_plugin_loader_job_process_finish (GS_PLUGIN_LOADER (object), res, &error);
@@ -509,7 +510,9 @@ get_updates_finished_cb (GObject *object, GAsyncResult *res, gpointer data)
g_debug ("got %u updates", gs_app_list_length (apps));
- if (should_download_updates (monitor) &&
+ should_download = should_download_updates (monitor);
+
+ if (should_download &&
(security_timestamp_old != security_timestamp ||
check_if_timestamp_more_than_days_ago (monitor, "install-timestamp", 14))) {
g_autoptr(GsPluginJob) plugin_job = NULL;
@@ -528,8 +531,48 @@ get_updates_finished_cb (GObject *object, GAsyncResult *res, gpointer data)
download_finished_cb,
monitor);
} else {
- notify_about_pending_updates (monitor, apps);
+ g_autoptr(GsAppList) update_online = NULL;
+ g_autoptr(GsAppList) update_offline = NULL;
+ GsAppList *notify_list;
+
+ update_online = gs_app_list_new ();
+ update_offline = gs_app_list_new ();
+ for (guint i = 0; i < gs_app_list_length (apps); i++) {
+ GsApp *app = gs_app_list_index (apps, i);
+ if (_should_auto_update (app)) {
+ g_debug ("download for auto-update %s", gs_app_get_unique_id (app));
+ gs_app_list_add (update_online, app);
+ } else {
+ gs_app_list_add (update_offline, app);
+ }
+ }
+
+ g_debug ("Received %u apps to update, %u are online and %u offline updates; will%s download online updates",
+ gs_app_list_length (apps),
+ gs_app_list_length (update_online),
+ gs_app_list_length (update_offline),
+ should_download ? "" : " not");
+
+ if (should_download && gs_app_list_length (update_online) > 0) {
+ g_autoptr(GsPluginJob) plugin_job = NULL;
+
+ plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_DOWNLOAD,
+ "list", update_online,
+ NULL);
+ g_debug ("Getting %u online updates", gs_app_list_length (update_online));
+ gs_plugin_loader_job_process_async (monitor->plugin_loader,
+ plugin_job,
+ monitor->cancellable,
+ download_finished_cb,
+ monitor);
+ }
+
+ if (should_download)
+ notify_list = update_offline;
+ else
+ notify_list = apps;
+ notify_about_pending_updates (monitor, notify_list);
reset_update_notification_timestamp (monitor);
}
}
--
GitLab

View File

@ -11,8 +11,8 @@
%global tarball_version %%(echo %{version} | tr '~' '.')
Name: gnome-software
Version: 40.2
Release: 2%{?dist}
Version: 40.3
Release: 1%{?dist}
Summary: A software center for GNOME
License: GPLv2+
@ -20,7 +20,6 @@ URL: https://wiki.gnome.org/Apps/Software
Source0: https://download.gnome.org/sources/gnome-software/40/%{name}-%{tarball_version}.tar.xz
Patch01: 0001-crash-with-broken-theme.patch
Patch02: 0002-gs-update-monitor_automatically_install_application_updates.patch
BuildRequires: appstream-devel >= %{appstream_version}
BuildRequires: gcc
@ -203,6 +202,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
%{_datadir}/gtk-doc/html/gnome-software
%changelog
* Mon Jul 12 2021 Milan Crha <mcrha@redhat.com> - 40.3-1
- Update to 40.3
* Wed Jun 23 2021 Milan Crha <mcrha@redhat.com> - 40.2-2
- Add patch to automatically install application updates (i#1248)

View File

@ -1 +1 @@
SHA512 (gnome-software-40.2.tar.xz) = ded29be4c59130a4016d43d3e18a67c8cf3fec4761a7a57c067bf075a6f1da5b7726000172e2303ba129b3b5cb8bd22ebfad8fbf0e3248285a4864350f3a1679
SHA512 (gnome-software-40.3.tar.xz) = 6070f8f59fa9872282a081b6ba4f740616a799cffae43a8a541ebf4e0d7b189710dbdce679b1e5136a3fff5f8da29ec8e1ed9df7289c0a6ed697eb0ad693271f