summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2015-01-21 09:13:12 -0500
committerColin Walters <walters@verbum.org>2015-01-22 09:07:13 -0500
commite40b86221a7416fb61c08aba7e1ef84589298856 (patch)
treea9dcf36af78d2d6c1f06acb43ae9b2fd0665c35a
parent549f1ec7df58b9e9adcd25a0825f47fc71d2dd9e (diff)
downloadostree-e40b86221a7416fb61c08aba7e1ef84589298856.tar.gz
pull: Distingiush delta pulls from loose better
-rw-r--r--src/libostree/ostree-repo-pull.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
index b5b780eb..7fc1eb58 100644
--- a/src/libostree/ostree-repo-pull.c
+++ b/src/libostree/ostree-repo-pull.c
@@ -2025,22 +2025,28 @@ ostree_repo_pull_with_options (OstreeRepo *self,
if (bytes_transferred > 0 && pull_data->progress)
{
guint shift;
- gs_free char *msg = NULL;
+ GString *buf = g_string_new ("");
if (bytes_transferred < 1024)
shift = 1;
else
shift = 1024;
- msg = g_strdup_printf ("%u metadata, %u content objects fetched; %" G_GUINT64_FORMAT " %s; %u delta parts fetched, "
- "transferred in %u seconds",
- pull_data->n_fetched_metadata, pull_data->n_fetched_content,
- (guint64)(bytes_transferred / shift),
- shift == 1 ? "B" : "KiB",
- pull_data->n_fetched_deltaparts,
- (guint) ((end_time - pull_data->start_time) / G_USEC_PER_SEC));
+ if (pull_data->n_fetched_deltaparts > 0)
+ g_string_append_printf (buf, "%u delta parts, %u loose fetched",
+ pull_data->n_fetched_deltaparts,
+ pull_data->n_fetched_metadata + pull_data->n_fetched_content);
+ else
+ g_string_append_printf (buf, "%u metadata, %u content objects fetched",
+ pull_data->n_fetched_metadata, pull_data->n_fetched_content);
+
+ g_string_append_printf (buf, "; %" G_GUINT64_FORMAT " %s transferred in %u seconds",
+ (guint64)(bytes_transferred / shift),
+ shift == 1 ? "B" : "KiB",
+ (guint) ((end_time - pull_data->start_time) / G_USEC_PER_SEC));
- ostree_async_progress_set_status (pull_data->progress, msg);
+ ostree_async_progress_set_status (pull_data->progress, buf->str);
+ g_string_free (buf, TRUE);
}
/* iterate over commits fetched and delete any commitpartial files */