summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-repo.c
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2020-08-10 12:05:06 +0100
committerPhilip Withnall <pwithnall@endlessos.org>2020-10-01 11:06:56 +0100
commit206f1d3a13189e55027ffadd0b8b434768c3ec0f (patch)
treead4ee8a0c12f729340771feeefcf254bde664a5f /src/libostree/ostree-repo.c
parenta5f9651dabb2abab27acd8aa311c351b839a892f (diff)
downloadostree-206f1d3a13189e55027ffadd0b8b434768c3ec0f.tar.gz
lib/repo: Add mode and tombstone config options to the summary file
Currently, they are set in the `config` file and cause that to be downloaded on every pull. Given that the client is already pulling the `summary` file, it makes sense to avoid an additional network round trip and cache those options in the `summary` file. Signed-off-by: Philip Withnall <withnall@endlessm.com> Helps: #2165
Diffstat (limited to 'src/libostree/ostree-repo.c')
-rw-r--r--src/libostree/ostree-repo.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 4283f68e..ba3e877f 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -5816,6 +5816,24 @@ ostree_repo_regenerate_summary (OstreeRepo *self,
g_variant_new_uint64 (GUINT64_TO_BE (g_get_real_time () / G_USEC_PER_SEC)));
}
+ {
+ g_autofree char *remote_mode_str = NULL;
+ if (!ot_keyfile_get_value_with_default (self->config, "core", "mode", "bare",
+ &remote_mode_str, error))
+ return FALSE;
+ g_variant_dict_insert_value (&additional_metadata_builder, OSTREE_SUMMARY_MODE,
+ g_variant_new_string (remote_mode_str));
+ }
+
+ {
+ gboolean tombstone_commits = FALSE;
+ if (!ot_keyfile_get_boolean_with_default (self->config, "core", "tombstone-commits", FALSE,
+ &tombstone_commits, error))
+ return FALSE;
+ g_variant_dict_insert_value (&additional_metadata_builder, OSTREE_SUMMARY_TOMBSTONE_COMMITS,
+ g_variant_new_boolean (tombstone_commits));
+ }
+
/* Add refs which have a collection specified, which could be in refs/mirrors,
* refs/heads, and/or refs/remotes. */
{