Skip to content

Commit

Permalink
fixup! deploy: Keep last deployment version during stage
Browse files Browse the repository at this point in the history
Don't modify current public API. Add new one instead
  • Loading branch information
r4f4 committed Nov 22, 2019
1 parent 480ce5f commit 5d07804
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/libostree/libostree-devel.sym
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 42 additions & 1 deletion src/libostree/ostree-sysroot-deploy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/libostree/ostree-sysroot-upgrader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
13 changes: 12 additions & 1 deletion src/libostree/ostree-sysroot.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5d07804

Please sign in to comment.