sysroot: Add _require_booted_deployment() API

This is a common pattern that is replicated both in our code
and in rpm-ostree a lot.  Let's add a canonical API.
This commit is contained in:
Colin Walters committed 2021-03-17 19:55:56 +00:00
1 parent d522f261db
commit 1b28e6041c
8 files changed
+33 -15

No files matched your search

+2 -2
View File
@@ -3066,9 +3066,9 @@ ostree_sysroot_stage_tree_with_options (OstreeSysroot *self,
if (!_ostree_sysroot_ensure_writable (self, error))
return FALSE;
OstreeDeployment *booted_deployment = ostree_sysroot_get_booted_deployment (self);
OstreeDeployment *booted_deployment = ostree_sysroot_require_booted_deployment (self, error);
if (booted_deployment == NULL)
return glnx_throw (error, "Cannot stage a deployment when not currently booted into an OSTree system");
return glnx_prefix_error (error, "Cannot stage deployment");
/* This is used by the testsuite to exercise the path unit, until it becomes the default
* (which is pending on the preset making it everywhere). */