summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2018-04-27 15:33:02 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-04-27 19:41:19 +0000
commitcd17e364ae34c161641e8fe973fd1c11702a0d81 (patch)
treed471422f4906f377b07c459649b228505c866b37
parent06d39efcb5ad52216a2a47b5eff71af82c0dae49 (diff)
downloadostree-cd17e364ae34c161641e8fe973fd1c11702a0d81.tar.gz
deploy: Return staged deployment
Today rpm-ostree has some code to run a "sanitycheck" on a deployment. I had initially deleted that when adapting it to use the staging code, but I realized it should work fine; we just won't see the merged config, but that's OK. When I readded that code it started crashing because we didn't actually return the new deployment object. We'll gain some coverage here as I'll land the code to have rpm-ostree use staging, then bump the rpm-ostree tests here. Closes: #1559 Approved by: jlebon
-rw-r--r--src/libostree/ostree-sysroot-deploy.c1
-rw-r--r--src/ostree/ot-admin-builtin-deploy.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c
index b573325c..4314520a 100644
--- a/src/libostree/ostree-sysroot-deploy.c
+++ b/src/libostree/ostree-sysroot-deploy.c
@@ -2736,6 +2736,7 @@ ostree_sysroot_stage_tree (OstreeSysroot *self,
if (!ostree_sysroot_load (self, cancellable, error))
return FALSE;
+ ot_transfer_out_value (out_new_deployment, &deployment);
return TRUE;
}
diff --git a/src/ostree/ot-admin-builtin-deploy.c b/src/ostree/ot-admin-builtin-deploy.c
index 0a1755fd..38ec923f 100644
--- a/src/ostree/ot-admin-builtin-deploy.c
+++ b/src/ostree/ot-admin-builtin-deploy.c
@@ -178,12 +178,14 @@ ot_admin_builtin_deploy (int argc, char **argv, OstreeCommandInvocation *invocat
if (!ostree_sysroot_stage_tree (sysroot, opt_osname, revision, origin, merge_deployment,
kargs_strv, &new_deployment, cancellable, error))
return FALSE;
+ g_assert (new_deployment);
}
else
{
if (!ostree_sysroot_deploy_tree (sysroot, opt_osname, revision, origin, merge_deployment,
kargs_strv, &new_deployment, cancellable, error))
return FALSE;
+ g_assert (new_deployment);
OstreeSysrootSimpleWriteDeploymentFlags flags = OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NO_CLEAN;
if (opt_retain)