summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2015-03-04 14:18:34 +0000
committerRichard Hughes <richard@hughsie.com>2015-03-04 14:18:34 +0000
commitf8642889bc5e179126bef3f33dcfb163e0bd0ef7 (patch)
tree38bb87f146d7d9411e1653c21392fa68cc62a206
parent4b3dc543bd7a0bb33e77181f69278d3036d0f7c1 (diff)
downloadappstream-glib-f8642889bc5e179126bef3f33dcfb163e0bd0ef7.tar.gz
trivial: Set the timestamp when subsuming if unset
-rw-r--r--libappstream-glib/as-app.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c
index 8755075..915860d 100644
--- a/libappstream-glib/as-app.c
+++ b/libappstream-glib/as-app.c
@@ -2135,10 +2135,13 @@ as_app_subsume_release (AsRelease *release, AsRelease *donor)
/* this is high quality metadata */
tmp = as_release_get_description (donor, NULL);
- if (tmp != NULL) {
+ if (tmp != NULL)
as_release_set_description (release, NULL, tmp, -1);
+
+ /* overwrite the timestamp if the metadata is high quality,
+ * or if no timestamp has already been set */
+ if (tmp != NULL || as_release_get_timestamp (release) == 0)
as_release_set_timestamp (release, as_release_get_timestamp (donor));
- }
/* copy all locations */
locations = as_release_get_locations (donor);