libostree/upgrader: Add an API to retrieve an origin description

This will be used by "rpm-ostree upgrade".
This commit is contained in:
Colin Walters 2014-03-25 16:46:24 -04:00
parent 90883674a9
commit 9389b7961c
2 changed files with 16 additions and 0 deletions

View File

@ -329,6 +329,20 @@ ostree_sysroot_upgrader_set_origin (OstreeSysrootUpgrader *self,
return ret;
}
/**
* ostree_sysroot_upgrader_get_origin_description:
* @self: Upgrader
*
* Returns: A one-line descriptive summary of the origin, or %NULL if unknown
*/
char *
ostree_sysroot_upgrader_get_origin_description (OstreeSysrootUpgrader *self)
{
if (!self->origin)
return NULL;
return g_key_file_get_string (self->origin, "origin", "refspec", NULL);
}
/**
* ostree_sysroot_upgrader_check_timestamps:
* @repo: Repo

View File

@ -45,6 +45,8 @@ GKeyFile *ostree_sysroot_upgrader_get_origin (OstreeSysrootUpgrader *self);
gboolean ostree_sysroot_upgrader_set_origin (OstreeSysrootUpgrader *self, GKeyFile *origin,
GCancellable *cancellable, GError **error);
char *ostree_sysroot_upgrader_get_origin_description (OstreeSysrootUpgrader *self);
gboolean ostree_sysroot_upgrader_check_timestamps (OstreeRepo *repo,
const char *from_rev,
const char *to_rev,