diff options
author | Richard Hughes <richard@hughsie.com> | 2014-08-12 09:18:40 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-08-12 12:24:36 +0100 |
commit | e0ef6ffeff3bd473669edbbd50ec383a483a23f4 (patch) | |
tree | bad91e6488c1f2384c5d3d5486a565ba1f1bb3be | |
parent | f98532289a64f02c7d9a7ae7bec36b8b13645714 (diff) | |
download | appstream-glib-e0ef6ffeff3bd473669edbbd50ec383a483a23f4.tar.gz |
trivial: Do not blacklist apps that were released the same day
RPM returns us a UNIX epoch set at 12:00am, so if we build the metadata before
this on a very new package, we detect it over 100 years old due to the overflow.
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-hardcoded.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libappstream-builder/plugins/asb-plugin-hardcoded.c b/libappstream-builder/plugins/asb-plugin-hardcoded.c index e5b6653..5a7e4ff 100644 --- a/libappstream-builder/plugins/asb-plugin-hardcoded.c +++ b/libappstream-builder/plugins/asb-plugin-hardcoded.c @@ -153,7 +153,7 @@ asb_plugin_process_app (AsbPlugin *plugin, gchar **filelist; GPtrArray *releases; guint i; - guint secs; + gint64 secs; guint days; /* add extra categories */ @@ -268,7 +268,7 @@ asb_plugin_process_app (AsbPlugin *plugin, secs = (g_get_real_time () / G_USEC_PER_SEC) - as_release_get_timestamp (release); days = secs / (60 * 60 * 24); - if (days < 365) { + if (secs > 0 && days < 365) { as_app_add_metadata (AS_APP (app), "X-Kudo-RecentRelease", "", -1); break; @@ -283,9 +283,8 @@ asb_plugin_process_app (AsbPlugin *plugin, secs = (g_get_real_time () / G_USEC_PER_SEC) - as_release_get_timestamp (release); days = secs / (60 * 60 * 24); - /* we need AppData if the app needs saving */ - if (days > 365 * 5) { + if (secs > 0 && days > 365 * 5) { asb_app_add_requires_appdata (app, "Dead upstream for > %i years", 5); } |