diff --git a/debian/changelog b/debian/changelog index 7f7b64d02fa15214e37ce0d119babaebcb8daaff..2dd1fcd77850503c1fb5286d7ccceba7d7a352a2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ostree (2024.5-1ok1.11) nile; urgency=medium + + * I9U7AE - 更新包下载实际大小大于总大小,增加增量大小属性设置 + * Add increment size settings + + -- wudan Fri, 19 Jul 2024 11:17:05 +0800 + ostree (2024.5-1ok1.10) nile; urgency=medium * I9TKDM - 历史版本中存在的版本数量多于5个 diff --git a/src/ostree/ot-builtin-commit.c b/src/ostree/ot-builtin-commit.c index 7c6d63e4df9cc82e63180007243151a5bcf30367..101f9add710154f1de2cc430127778404556318c 100644 --- a/src/ostree/ot-builtin-commit.c +++ b/src/ostree/ot-builtin-commit.c @@ -907,7 +907,42 @@ ostree_builtin_commit (int argc, char **argv, OstreeCommandInvocation *invocatio metadata = g_variant_ref_sink (g_variant_dict_end (&newmeta)); } - + // if (repo->txn.stats.content_bytes_written >= 0) + // { + // g_debug("Content Bytes Written: %s", g_format_size(repo->txn.stats.content_bytes_written)); + // g_autoptr(GVariant) old_metadata = g_steal_pointer(&metadata); + // g_auto(GVariantDict) newmeta; + // g_variant_dict_init(&newmeta, old_metadata); + // //GString *str = g_string_new(NULL); + // if (repo->txn.stats.content_bytes_written == 0) + // { + // //g_string_append_printf(str, "10"); + // guint64 content_bytes=10; + // g_variant_dict_insert(&newmeta, "ostree.incrementsize", "t", content_bytes); + // } + // else + // { + // //g_autofree char *bytes_written = g_format_size (repo->txn.stats.content_bytes_written); + // //g_string_append_printf (str, "%s", bytes_written); + // g_variant_dict_insert(&newmeta, "ostree.incrementsize", "t", repo->txn.stats.content_bytes_written); + // } + // metadata = g_variant_ref_sink(g_variant_dict_end(&newmeta)); + // g_string_free(str, TRUE); + // } + if (repo->txn.stats.content_bytes_written >= 0) + { + g_debug("Content Bytes Written: %s", g_format_size(repo->txn.stats.content_bytes_written)); + g_autoptr(GVariant) old_metadata = g_steal_pointer(&metadata); + g_auto(GVariantDict) newmeta; + g_variant_dict_init(&newmeta, old_metadata); + GString *str = g_string_new(NULL); + guint64 content_bytes = repo->txn.stats.content_bytes_written == 0 ? 10 : repo->txn.stats.content_bytes_written; + g_string_append_printf (str, "%" G_GUINT64_FORMAT, content_bytes); + g_variant_dict_insert(&newmeta, "ostree.incrementsize", "s",str->str); + + metadata = g_variant_ref_sink(g_variant_dict_end(&newmeta)); + g_string_free(str, TRUE); + } if (!opt_timestamp) { if (!ostree_repo_write_commit (repo, parent, opt_subject, commit_body, metadata,