sysroot: Add API to clean up transient keys in origin files

The `origin/unlocked` and `origin/override-commit` keys are examples of state
that's really transient; we don't want to maintain them across upgrades. Right
now there are bits for this in both `ostree admin upgrade` as well as in
rpm-ostree.

This new API will slightly clean up both cases, but it's really prep for adding
a concept of deployment "pinning" that will live in the new
`libostree-transient` group.

Closes: #1464
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2018-02-26 19:06:59 +00:00
1 parent 2f5a34bed9
commit c40a47e965
5 files changed
+50 -19

No files matched your search

+15
View File
@@ -27,6 +27,17 @@ G_BEGIN_DECLS
#define OSTREE_DEPLOYMENT(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), OSTREE_TYPE_DEPLOYMENT, OstreeDeployment))
#define OSTREE_IS_DEPLOYMENT(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), OSTREE_TYPE_DEPLOYMENT))
/**
* OSTREE_ORIGIN_TRANSIENT_GROUP:
*
* The name of a `GKeyFile` group for data that should not
* be carried across upgrades. For more information,
* see ostree_deployment_origin_remove_transient_state().
*
* Since: 2018.3
*/
#define OSTREE_ORIGIN_TRANSIENT_GROUP "libostree-transient"
typedef struct _OstreeDeployment OstreeDeployment;
_OSTREE_PUBLIC
@@ -62,6 +73,7 @@ OstreeBootconfigParser *ostree_deployment_get_bootconfig (OstreeDeployment *self
_OSTREE_PUBLIC
GKeyFile *ostree_deployment_get_origin (OstreeDeployment *self);
_OSTREE_PUBLIC
void ostree_deployment_set_index (OstreeDeployment *self, int index);
_OSTREE_PUBLIC
@@ -71,6 +83,9 @@ void ostree_deployment_set_bootconfig (OstreeDeployment *self, OstreeBootconfigP
_OSTREE_PUBLIC
void ostree_deployment_set_origin (OstreeDeployment *self, GKeyFile *origin);
_OSTREE_PUBLIC
void ostree_deployment_origin_remove_transient_state (GKeyFile *origin);
_OSTREE_PUBLIC
OstreeDeployment *ostree_deployment_clone (OstreeDeployment *self);