lib/deploy: When deleting staged deployment, delete any lock

Otherwise, any future staged deployment will also automatically be
locked even if not requested. Likely we should fold the locking into the
primary `staged-deployment` serialized GVariant instead.
This commit is contained in:
Jonathan Lebon 2022-01-21 11:28:25 -05:00
parent 0713ad3259
commit 88dca03967
1 changed files with 4 additions and 0 deletions

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)) if (!_ostree_sysroot_rmrf_deployment (self, self->staged_deployment, cancellable, error))
return FALSE; 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 */ /* Clear it out of the *current* deployments list to maintain invariants */
self->staged_deployment = NULL; self->staged_deployment = NULL;
g_ptr_array_remove_index (self->deployments, 0); g_ptr_array_remove_index (self->deployments, 0);