GNOME Bugzilla – Bug 732526
don't prune repository before a deploy
Last modified: 2015-09-16 13:25:47 UTC
Right now if I do: ostree pull <checksum> ostree admin deploy <checksum> The data pointed to by <checksum> will be gc'd as there's no ref pointing to it. We should just not do a repository prune before doing a deploy by default.
After bug 733030 we can just delete the cleanup call in ot-admin-builtin-deploy.c.
Created attachment 311021 [details] [review] Trivial patch Did I explain it right?
Review of attachment 311021 [details] [review]: I think we need at least: diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index da6816a..daa8640 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -489,6 +489,9 @@ checkout_deployment_tree (OstreeSysroot *sysroot, if (!glnx_opendirat (sysroot->sysroot_fd, osdeploy_path, TRUE, &osdeploy_dfd, error)) goto out; + if (!glnx_shutil_rm_rf_at (osdeploy_dfd, checkout_target_name, cancellable, error)) + goto out; + if (!ostree_repo_checkout_tree_at (repo, &checkout_opts, osdeploy_dfd, checkout_target_name, csum, cancellable, error)) There might be other cases with the bootloader configs and such that _cleanup() takes care of today. Simplest might be an internal _ostree_sysroot_cleanup (CLEANUP_DO_NOT_PRUNE_REPO) or something?
My tolerance for static patch attachments is pretty low nowadays, so here's a pull request: https://github.com/GNOME/ostree/pull/140 I squashed your extra hunk into the first commit, and added a private "piecemeal" sysroot cleanup function in a separate commit... though, it might be overkill and I'm not yet sure where we need to use it.
Discussion continued on the pull request. Pushed final solution to master: https://git.gnome.org/browse/ostree/commit/?id=b0bd16ec1181cee880810088e481642ae67cf037 and https://git.gnome.org/browse/ostree/commit/?id=36d65b3cfcc9557552314d112493516437d6fcd4