From 5d07804f5cab24bc867b97a8028b65f03d0ff81d Mon Sep 17 00:00:00 2001 From: Rafael Fonseca Date: Fri, 22 Nov 2019 22:50:41 +0100 Subject: [PATCH] fixup! deploy: Keep last deployment version during stage Don't modify current public API. Add new one instead --- src/libostree/libostree-devel.sym | 1 + src/libostree/ostree-sysroot-deploy.c | 43 ++++++++++++++++++++++++- src/libostree/ostree-sysroot-upgrader.c | 1 - src/libostree/ostree-sysroot.h | 13 +++++++- 4 files changed, 55 insertions(+), 3 deletions(-) diff --git a/src/libostree/libostree-devel.sym b/src/libostree/libostree-devel.sym index 646a4a21a0..d770949cf6 100644 --- a/src/libostree/libostree-devel.sym +++ b/src/libostree/libostree-devel.sym @@ -20,6 +20,7 @@ /* Add new symbols here. Release commits should copy this section into -released.sym. */ LIBOSTREE_2019.6 { ostree_async_progress_copy_state; + ostree_sysroot_stage_tree_with_flags; } LIBOSTREE_2019.4; /* Stub section for the stable release *after* this development one; don't diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index 60f08ccfaa..2481b32117 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -2798,9 +2798,50 @@ ostree_sysroot_stage_tree (OstreeSysroot *self, OstreeDeployment *merge_deployment, char **override_kernel_argv, OstreeDeployment **out_new_deployment, - OstreeSysrootSimpleWriteDeploymentFlags flags, GCancellable *cancellable, GError **error) +{ + return ostree_sysroot_stage_tree_with_flags (self, + osname, + revision, + origin, + merge_deployment, + override_kernel_argv, + out_new_deployment, + OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NONE, + cancellable, + error); +} + +/** + * ostree_sysroot_stage_tree_with_flags: + * @self: Sysroot + * @osname: (allow-none): osname to use for merge deployment + * @revision: Checksum to add + * @origin: (allow-none): Origin to use for upgrades + * @merge_deployment: (allow-none): Use this deployment for merge path + * @override_kernel_argv: (allow-none) (array zero-terminated=1) (element-type utf8): Use these as kernel arguments; if %NULL, inherit options from provided_merge_deployment + * @out_new_deployment: (out): The new deployment path + * @flags: flags to control how the deployment is written + * @cancellable: Cancellable + * @error: Error + * + * Like ostree_sysroot_deploy_tree(), but "finalization" only occurs at OS + * shutdown time. + * + * Since: 2019.? + */ +gboolean +ostree_sysroot_stage_tree_with_flags (OstreeSysroot *self, + const char *osname, + const char *revision, + GKeyFile *origin, + OstreeDeployment *merge_deployment, + char **override_kernel_argv, + OstreeDeployment **out_new_deployment, + OstreeSysrootSimpleWriteDeploymentFlags flags, + GCancellable *cancellable, + GError **error) { OstreeDeployment *booted_deployment = ostree_sysroot_get_booted_deployment (self); if (booted_deployment == NULL) diff --git a/src/libostree/ostree-sysroot-upgrader.c b/src/libostree/ostree-sysroot-upgrader.c index 3336669893..8fb231a3f7 100644 --- a/src/libostree/ostree-sysroot-upgrader.c +++ b/src/libostree/ostree-sysroot-upgrader.c @@ -654,7 +654,6 @@ ostree_sysroot_upgrader_deploy (OstreeSysrootUpgrader *self, self->merge_deployment, NULL, &new_deployment, - OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NONE, cancellable, error)) return FALSE; } diff --git a/src/libostree/ostree-sysroot.h b/src/libostree/ostree-sysroot.h index 79615559a9..bc3175d4aa 100644 --- a/src/libostree/ostree-sysroot.h +++ b/src/libostree/ostree-sysroot.h @@ -204,10 +204,21 @@ gboolean ostree_sysroot_stage_tree (OstreeSysroot *self, OstreeDeployment *merge_deployment, char **override_kernel_argv, OstreeDeployment **out_new_deployment, - OstreeSysrootSimpleWriteDeploymentFlags flags, GCancellable *cancellable, GError **error); +_OSTREE_PUBLIC +gboolean ostree_sysroot_stage_tree_with_flags (OstreeSysroot *self, + const char *osname, + const char *revision, + GKeyFile *origin, + OstreeDeployment *merge_deployment, + char **override_kernel_argv, + OstreeDeployment **out_new_deployment, + OstreeSysrootSimpleWriteDeploymentFlags flags, + GCancellable *cancellable, + GError **error); + _OSTREE_PUBLIC gboolean ostree_sysroot_deployment_set_mutable (OstreeSysroot *self, OstreeDeployment *deployment,