summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Lebon <jonathan@jlebon.com>2023-04-14 12:11:05 -0400
committerJonathan Lebon <jonathan@jlebon.com>2023-04-14 15:19:17 -0400
commit45772ede3e63b1fffef47860e69f3e1b6d2f56cd (patch)
tree9046a580f789e6f639426a852e512d814ae6166d
parent90f7c7bd9f98ebcdff81e0363a4d0117b876d5c3 (diff)
downloadostree-45772ede3e63b1fffef47860e69f3e1b6d2f56cd.tar.gz
lib/sysroot-deploy: Nuke `finalize-failure.stamp` on successful finalization
In the unusual case where one is manually finalizing staged deployments, as can happen in testing, we expect a successful finalization to remove the failure stamp file.
-rw-r--r--src/libostree/ostree-sysroot-deploy.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c
index 5b126d89..d2056cdf 100644
--- a/src/libostree/ostree-sysroot-deploy.c
+++ b/src/libostree/ostree-sysroot-deploy.c
@@ -3573,6 +3573,13 @@ _ostree_sysroot_finalize_staged (OstreeSysroot *self,
g_propagate_error (error, g_steal_pointer (&finalization_error));
return FALSE;
}
+ else
+ {
+ /* we may have failed in a previous invocation on this boot, but we were
+ * rerun again (likely manually) and passed this time; nuke any stamp */
+ if (!glnx_shutil_rm_rf_at (self->boot_fd, _OSTREE_FINALIZE_STAGED_FAILURE_PATH, cancellable, error))
+ return FALSE;
+ }
return TRUE;
}