mirror of
https://github.com/ostreedev/ostree.git
synced 2025-03-14 04:59:00 +03:00
bin/delta-compilation: Add a "progress bar" for bsdiff generation
It's the slowest part, let's show admins something. This "update every 10%" code was copied from the fsck command; obviously a better approach would be "progress every N seconds" but doing that somewhat accurately requires making things async; not worth it here yet. Closes: #1314 Approved by: jlebon
This commit is contained in:
parent
62445166fc
commit
e885d029aa
@ -1145,18 +1145,27 @@ generate_delta_lowlatency (OstreeRepo *repo,
|
||||
|
||||
/* Now do bsdiff'ed objects */
|
||||
|
||||
g_hash_table_iter_init (&hashiter, bsdiff_optimized_content_objects);
|
||||
while (g_hash_table_iter_next (&hashiter, &key, &value))
|
||||
const guint n_bsdiff = g_hash_table_size (bsdiff_optimized_content_objects);
|
||||
if (n_bsdiff > 0)
|
||||
{
|
||||
const char *checksum = key;
|
||||
ContentBsdiff *bsdiff = value;
|
||||
const guint mod = n_bsdiff / 10;
|
||||
g_hash_table_iter_init (&hashiter, bsdiff_optimized_content_objects);
|
||||
while (g_hash_table_iter_next (&hashiter, &key, &value))
|
||||
{
|
||||
const char *checksum = key;
|
||||
ContentBsdiff *bsdiff = value;
|
||||
|
||||
if (!process_one_bsdiff (repo, builder, ¤t_part,
|
||||
checksum, bsdiff,
|
||||
cancellable, error))
|
||||
return FALSE;
|
||||
if (opts & DELTAOPT_FLAG_VERBOSE &&
|
||||
(mod == 0 || builder->n_bsdiff % mod == 0))
|
||||
g_printerr ("processing bsdiff: [%u/%u]\n", builder->n_bsdiff, n_bsdiff);
|
||||
|
||||
builder->n_bsdiff++;
|
||||
if (!process_one_bsdiff (repo, builder, ¤t_part,
|
||||
checksum, bsdiff,
|
||||
cancellable, error))
|
||||
return FALSE;
|
||||
|
||||
builder->n_bsdiff++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Scan for large objects, so we can fall back to plain HTTP-based
|
||||
|
Loading…
x
Reference in New Issue
Block a user