deltas: Add and document no-deltas-in-summary config option
By default this is FALSE to keep existing clients working.
This commit is contained in:
parent
effde3d513
commit
024ef1d756
|
|
@ -249,6 +249,20 @@ Boston, MA 02111-1307, USA.
|
||||||
costly).
|
costly).
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>no-deltas-in-summary</varname></term>
|
||||||
|
<listitem><para>Boolean value controlling whether OSTree should skip
|
||||||
|
putting an index of available deltas in the summary file. Defaults to false.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Since 2020.7 OSTree can use delta indexes outside the summary file,
|
||||||
|
making the summary file smaller (especially for larger repositories). However
|
||||||
|
by default we still create the index in the summary file to make older clients
|
||||||
|
work. If you know all clients will be 2020.7 later you can enable this to
|
||||||
|
save network bandwidth.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5749,6 +5749,8 @@ ostree_repo_regenerate_summary (OstreeRepo *self,
|
||||||
* commits from working.
|
* commits from working.
|
||||||
*/
|
*/
|
||||||
g_autoptr(OstreeRepoAutoLock) lock = NULL;
|
g_autoptr(OstreeRepoAutoLock) lock = NULL;
|
||||||
|
gboolean no_deltas_in_summary = FALSE;
|
||||||
|
|
||||||
lock = _ostree_repo_auto_lock_push (self, OSTREE_REPO_LOCK_EXCLUSIVE,
|
lock = _ostree_repo_auto_lock_push (self, OSTREE_REPO_LOCK_EXCLUSIVE,
|
||||||
cancellable, error);
|
cancellable, error);
|
||||||
if (!lock)
|
if (!lock)
|
||||||
|
|
@ -5781,35 +5783,41 @@ ostree_repo_regenerate_summary (OstreeRepo *self,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
if (!ot_keyfile_get_boolean_with_default (self->config, "core",
|
||||||
g_autoptr(GPtrArray) delta_names = NULL;
|
"no-deltas-in-summary", FALSE,
|
||||||
g_auto(GVariantDict) deltas_builder = OT_VARIANT_BUILDER_INITIALIZER;
|
&no_deltas_in_summary, error))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (!ostree_repo_list_static_delta_names (self, &delta_names, cancellable, error))
|
if (!no_deltas_in_summary)
|
||||||
return FALSE;
|
{
|
||||||
|
g_autoptr(GPtrArray) delta_names = NULL;
|
||||||
|
g_auto(GVariantDict) deltas_builder = OT_VARIANT_BUILDER_INITIALIZER;
|
||||||
|
|
||||||
g_variant_dict_init (&deltas_builder, NULL);
|
if (!ostree_repo_list_static_delta_names (self, &delta_names, cancellable, error))
|
||||||
for (guint i = 0; i < delta_names->len; i++)
|
return FALSE;
|
||||||
{
|
|
||||||
g_autofree char *from = NULL;
|
|
||||||
g_autofree char *to = NULL;
|
|
||||||
GVariant *digest;
|
|
||||||
|
|
||||||
if (!_ostree_parse_delta_name (delta_names->pdata[i], &from, &to, error))
|
g_variant_dict_init (&deltas_builder, NULL);
|
||||||
return FALSE;
|
for (guint i = 0; i < delta_names->len; i++)
|
||||||
|
{
|
||||||
|
g_autofree char *from = NULL;
|
||||||
|
g_autofree char *to = NULL;
|
||||||
|
GVariant *digest;
|
||||||
|
|
||||||
digest = _ostree_repo_static_delta_superblock_digest (self,
|
if (!_ostree_parse_delta_name (delta_names->pdata[i], &from, &to, error))
|
||||||
(from && from[0]) ? from : NULL,
|
return FALSE;
|
||||||
to, cancellable, error);
|
|
||||||
if (digest == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
g_variant_dict_insert_value (&deltas_builder, delta_names->pdata[i], digest);
|
digest = _ostree_repo_static_delta_superblock_digest (self,
|
||||||
}
|
(from && from[0]) ? from : NULL,
|
||||||
|
to, cancellable, error);
|
||||||
|
if (digest == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (delta_names->len > 0)
|
g_variant_dict_insert_value (&deltas_builder, delta_names->pdata[i], digest);
|
||||||
g_variant_dict_insert_value (&additional_metadata_builder, OSTREE_SUMMARY_STATIC_DELTAS, g_variant_dict_end (&deltas_builder));
|
}
|
||||||
}
|
|
||||||
|
if (delta_names->len > 0)
|
||||||
|
g_variant_dict_insert_value (&additional_metadata_builder, OSTREE_SUMMARY_STATIC_DELTAS, g_variant_dict_end (&deltas_builder));
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
g_variant_dict_insert_value (&additional_metadata_builder, OSTREE_SUMMARY_LAST_MODIFIED,
|
g_variant_dict_insert_value (&additional_metadata_builder, OSTREE_SUMMARY_LAST_MODIFIED,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue