Skip to content

Commit

Permalink
commit: Always enable generation pf composefs metadata if possible
Browse files Browse the repository at this point in the history
There is no particular cost to always adding composefs metadata to
rpm-ostree composes, so always do so if libostree is new enough and has
the support compiled in.
  • Loading branch information
alexlarsson authored and cgwalters committed Aug 15, 2023
1 parent 538ea10 commit e2103c5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/libpriv/rpmostree-postprocess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,21 @@ rpmostree_compose_commit (int rootfs_fd, OstreeRepo *repo, const char *parent_re
if (!ostree_repo_write_mtree (repo, mtree, &root_tree, cancellable, error))
return glnx_prefix_error (error, "While writing tree");

// Unfortunately this API takes GVariantDict, not GVariantBuilder, so convert
// Unfortunately these API takes GVariantDict, not GVariantBuilder, so convert
g_autoptr (GVariantDict) metadata_dict = g_variant_dict_new (src_metadata);

#if OSTREE_CHECK_VERSION(2023, 4)
g_autoptr (GError) local_error = NULL;
if (!ostree_repo_commit_add_composefs_metadata (
repo, 0, metadata_dict, (OstreeRepoFile *)root_tree, cancellable, &local_error)
&& !g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED))
{
g_propagate_prefixed_error (error, util::move_nullify (local_error),
"Adding composefs metadata");
return FALSE;
}
#endif

if (!container)
{
if (!ostree_commit_metadata_for_bootable (root_tree, metadata_dict, cancellable, error))
Expand Down

0 comments on commit e2103c5

Please sign in to comment.