diff options
author | Jonathan Lebon <jonathan@jlebon.com> | 2022-01-21 11:28:25 -0500 |
---|---|---|
committer | Jonathan Lebon <jonathan@jlebon.com> | 2022-01-21 11:30:23 -0500 |
commit | 88dca03967ede45c4be475eafd005b6c881e6a56 (patch) | |
tree | 60a415e9803ac43eb93670bd150a3f45524389bd | |
parent | 0713ad32599441b5861dac05a8413e0d25454b8a (diff) | |
download | ostree-88dca03967ede45c4be475eafd005b6c881e6a56.tar.gz |
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.
-rw-r--r-- | src/libostree/ostree-sysroot-deploy.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index 726379d6..d3f277a7 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -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); |