diff options
author | Alexander Larsson <alexl@redhat.com> | 2016-01-20 15:14:01 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2016-01-20 15:14:01 +0100 |
commit | 8da9d592bab37a6636beeb7234b6e6d009ecfdd8 (patch) | |
tree | 3f6d0e78f14a3496db07192a6fe94a224035159b /lib | |
parent | 472405ff7fd67e58f68ef5c865899d2a84a4c0f8 (diff) | |
download | xdg-app-8da9d592bab37a6636beeb7234b6e6d009ecfdd8.tar.gz |
appstream: Add timestamp which is updated each time the appstream is pulled
Diffstat (limited to 'lib')
-rw-r--r-- | lib/xdg-app-remote.c | 16 | ||||
-rw-r--r-- | lib/xdg-app-remote.h | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/xdg-app-remote.c b/lib/xdg-app-remote.c index 6087b61..8d45a78 100644 --- a/lib/xdg-app-remote.c +++ b/lib/xdg-app-remote.c @@ -145,6 +145,22 @@ xdg_app_remote_get_appstream_dir (XdgAppRemote *self, subdir); } +GFile * +xdg_app_remote_get_appstream_timestamp (XdgAppRemote *self, + const char *arch) +{ + XdgAppRemotePrivate *priv = xdg_app_remote_get_instance_private (self); + g_autoptr(GFile) dir = NULL; + g_autofree char *subdir = NULL; + + if (arch == NULL) + arch = xdg_app_get_arch (); + + subdir = g_strdup_printf ("appstream/%s/%s/.timestamp", priv->name, arch); + return g_file_resolve_relative_path (xdg_app_dir_get_path (priv->dir), + subdir); +} + char * xdg_app_remote_get_url (XdgAppRemote *self) { diff --git a/lib/xdg-app-remote.h b/lib/xdg-app-remote.h index ee10773..a50bbac 100644 --- a/lib/xdg-app-remote.h +++ b/lib/xdg-app-remote.h @@ -51,6 +51,8 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(XdgAppRemote, g_object_unref) XDG_APP_EXTERN const char * xdg_app_remote_get_name (XdgAppRemote *self); XDG_APP_EXTERN GFile * xdg_app_remote_get_appstream_dir (XdgAppRemote *self, const char *arch); +XDG_APP_EXTERN GFile * xdg_app_remote_get_appstream_timestamp (XdgAppRemote *self, + const char *arch); XDG_APP_EXTERN char * xdg_app_remote_get_url (XdgAppRemote *self); XDG_APP_EXTERN char * xdg_app_remote_get_title (XdgAppRemote *self); XDG_APP_EXTERN gboolean xdg_app_remote_get_gpg_verify (XdgAppRemote *self); |