sysroot: Add a flag to suppress post-deploy cleanup

I noticed seeing the output of `prune` twice in rpm-ostree, and had
always wondered why.  When reading the rpm-ostree code to fix
something else, reasons, I noticed the reason - we were pruning once
here, and then once after rpm-ostree regenerates its "base" refs.

There's no reason to clean twice, so let's add a flag so rpm-ostree
can suppress doing it inside libostree.

Closes: #474
Approved by: giuseppe
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2016-08-29 07:45:24 +00:00
1 parent cfc3934e81
commit 8ece4d6d51
2 files changed
+8 -3

No files matched your search

+6 -2
View File
@@ -1540,6 +1540,7 @@ ostree_sysroot_simple_write_deployment (OstreeSysroot *sysroot,
OstreeDeployment *booted_deployment = NULL;
g_autoptr(GPtrArray) deployments = NULL;
g_autoptr(GPtrArray) new_deployments = g_ptr_array_new_with_free_func (g_object_unref);
const gboolean postclean = (flags & OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NO_CLEAN) == 0;
gboolean retain = (flags & OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN) > 0;
const gboolean make_default = !((flags & OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NOT_DEFAULT) > 0);
gboolean added_new = FALSE;
@@ -1593,8 +1594,11 @@ ostree_sysroot_simple_write_deployment (OstreeSysroot *sysroot,
if (!ostree_sysroot_write_deployments (sysroot, new_deployments, cancellable, error))
goto out;
if (!ostree_sysroot_cleanup (sysroot, cancellable, error))
goto out;
if (postclean)
{
if (!ostree_sysroot_cleanup (sysroot, cancellable, error))
goto out;
}
ret = TRUE;
out: