[ostree] pull: Distingiush delta pulls from loose better



commit e40b86221a7416fb61c08aba7e1ef84589298856
Author: Colin Walters <walters verbum org>
Date:   Wed Jan 21 09:13:12 2015 -0500

    pull: Distingiush delta pulls from loose better

 src/libostree/ostree-repo-pull.c |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
index b5b780e..7fc1eb5 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 */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]