Merge pull request #2524 from jlebon/pr/unlink-lock

lib/deploy: When deleting staged deployment, delete any lock
This commit is contained in:
Luca Bruno authored and GitHub committed 2022-01-26 08:36:45 +00:00
commit 10ddf6e25f
9 files changed
+36 -6

No files matched your search

+4
View File
@@ -2493,6 +2493,10 @@ ostree_sysroot_write_deployments_with_options (OstreeSysroot *self,
if (!_ostree_sysroot_rmrf_deployment (self, self->staged_deployment, cancellable, error))
return FALSE;
/* Delete the lock if there was any. */
if (!ot_ensure_unlinked_at (AT_FDCWD, _OSTREE_SYSROOT_RUNSTATE_STAGED_LOCKED, error))
return FALSE;
/* Clear it out of the *current* deployments list to maintain invariants */
self->staged_deployment = NULL;
g_ptr_array_remove_index (self->deployments, 0);