[gnome-software] fwupd: Use the remote metadata file age rather than the cache file
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] fwupd: Use the remote metadata file age rather than the cache file
- Date: Mon, 19 Jun 2017 13:51:47 +0000 (UTC)
commit cf54ccc07241102e7bd850e046bdfd016f9515c8
Author: Richard Hughes <richard hughsie com>
Date: Mon Jun 19 14:09:55 2017 +0100
fwupd: Use the remote metadata file age rather than the cache file
This means on a multi-user system we don't download and deploy more often than
we have to.
plugins/fwupd/gs-plugin-fwupd.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/plugins/fwupd/gs-plugin-fwupd.c b/plugins/fwupd/gs-plugin-fwupd.c
index 7c9759b..53ea239 100644
--- a/plugins/fwupd/gs-plugin-fwupd.c
+++ b/plugins/fwupd/gs-plugin-fwupd.c
@@ -746,8 +746,13 @@ gs_plugin_fwupd_refresh_remote (GsPlugin *plugin,
GS_UTILS_CACHE_FLAG_WRITEABLE,
error);
if (cache_age > 0) {
+#if FWUPD_CHECK_VERSION(0,9,5)
+ guint64 age = fwupd_remote_get_age (remote);
+ guint tmp = age < G_MAXUINT ? (guint) age : G_MAXUINT;
+#else
g_autoptr(GFile) file = g_file_new_for_path (filename_asc);
guint tmp = gs_utils_get_file_age (file);
+#endif
if (tmp < cache_age) {
g_debug ("%s is only %u seconds old, so ignoring refresh",
filename_asc, tmp);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]