After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 732526 - don't prune repository before a deploy
don't prune repository before a deploy
Status: RESOLVED FIXED
Product: ostree
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: OSTree maintainer(s)
OSTree maintainer(s)
Depends on: 733030
Blocks:
 
 
Reported: 2014-06-30 22:42 UTC by Colin Walters
Modified: 2015-09-16 13:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Trivial patch (1.53 KB, patch)
2015-09-09 18:59 UTC, Matthew Barnes
reviewed Details | Review

Description Colin Walters 2014-06-30 22:42:22 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.
Comment 1 Colin Walters 2014-07-10 19:41:00 UTC
After bug 733030 we can just delete the cleanup call in ot-admin-builtin-deploy.c.
Comment 2 Matthew Barnes 2015-09-09 18:59:41 UTC
Created attachment 311021 [details] [review]
Trivial patch

Did I explain it right?
Comment 3 Colin Walters 2015-09-09 19:11:03 UTC
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?
Comment 4 Matthew Barnes 2015-09-14 00:47:24 UTC
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.
Comment 5 Matthew Barnes 2015-09-16 13:25:47 UTC
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