lib/sysroot-deploy: Nuke `finalize-failure.stamp` on successful finalization
authorJonathan Lebon <jonathan@jlebon.com>
Fri, 14 Apr 2023 16:11:05 +0000 (12:11 -0400)
committerJonathan Lebon <jonathan@jlebon.com>
Fri, 14 Apr 2023 19:19:17 +0000 (15:19 -0400)
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.

src/libostree/ostree-sysroot-deploy.c

index 5b126d89df4435733b3e769a0ecd0ac3e61ac1bd..d2056cdf6ac9d24a207a4b5d50a9c9eafaebc745 100644 (file)
@@ -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;
 }