lib/sysroot: Add wrapper API to prune system repository

The initial motivation for this is that the "staging" code currently
didn't rewrite the deployment refs, meaning that the staged commit
could be pruned.

Hence first, this new API ensures that deployments also
hold a strong ref to their commit, without relying on the magical
"deployment refs" that we inject.  That has always been a weird
artifact of the strict layering separation between OstreeSysroot
and OstreeRepo.

I also plan to change rpm-ostree to start using this API to
hold references to base layers for client-side layering; it also
today generates various refs.

That said, if we still want to support multiple processes
writing to a single repo (as happens on EndlessOS today) we
still need to write refs; perhaps later we could add a concept
of "generators" or something that create refs based on whatever
logic?

Another minor thing this fixes is that we had a printf inside
the library; this propagates the pruned data to the higher level
which can log however it likes.

Closes: #1566
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2018-05-24 12:56:11 +00:00
1 parent 371081d123
commit 9131d8a4cc
4 files changed
+92 -15

No files matched your search

+1
View File
@@ -509,6 +509,7 @@ ostree_sysroot_get_deployment_dirpath
ostree_sysroot_get_deployment_origin_path
ostree_sysroot_cleanup
ostree_sysroot_prepare_cleanup
ostree_sysroot_cleanup_prune_repo
ostree_sysroot_repo
ostree_sysroot_get_repo
ostree_sysroot_get_staged_deployment