pull: Drop some g_print(), replace others with async progress
We shouldn't g_print() from a library, particularly when the expectation is that the client has an async progress set up. This should fix the pull output extending the status line.
This commit is contained in:
parent
c2123bfc71
commit
5c839f0267
|
|
@ -989,7 +989,6 @@ request_static_delta_meta_sync (OtPullData *pull_data,
|
||||||
|
|
||||||
if (delta_meta_data)
|
if (delta_meta_data)
|
||||||
{
|
{
|
||||||
g_print ("Using static delta\n");
|
|
||||||
ret_delta_meta = ot_variant_new_from_bytes ((GVariantType*)OSTREE_STATIC_DELTA_META_FORMAT,
|
ret_delta_meta = ot_variant_new_from_bytes ((GVariantType*)OSTREE_STATIC_DELTA_META_FORMAT,
|
||||||
delta_meta_data, FALSE);
|
delta_meta_data, FALSE);
|
||||||
}
|
}
|
||||||
|
|
@ -1217,13 +1216,11 @@ ostree_repo_pull (OstreeRepo *self,
|
||||||
|
|
||||||
if (original_rev && strcmp (checksum, original_rev) == 0)
|
if (original_rev && strcmp (checksum, original_rev) == 0)
|
||||||
{
|
{
|
||||||
g_print ("remote %s is unchanged from %s\n", remote_ref, original_rev);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ostree_repo_transaction_set_ref (pull_data->repo, pull_data->remote_name, ref, checksum);
|
ostree_repo_transaction_set_ref (pull_data->repo, pull_data->remote_name, ref, checksum);
|
||||||
|
|
||||||
g_print ("remote %s is now %s\n", remote_ref, checksum);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1236,15 +1233,19 @@ ostree_repo_pull (OstreeRepo *self,
|
||||||
if (bytes_transferred > 0)
|
if (bytes_transferred > 0)
|
||||||
{
|
{
|
||||||
guint shift;
|
guint shift;
|
||||||
|
gs_free char *msg = NULL;
|
||||||
|
|
||||||
if (bytes_transferred < 1024)
|
if (bytes_transferred < 1024)
|
||||||
shift = 1;
|
shift = 1;
|
||||||
else
|
else
|
||||||
shift = 1024;
|
shift = 1024;
|
||||||
g_print ("%u metadata, %u content objects fetched; %" G_GUINT64_FORMAT " %s transferred in %u seconds\n",
|
|
||||||
pull_data->n_fetched_metadata, pull_data->n_fetched_content,
|
msg = g_strdup_printf ("%u metadata, %u content objects fetched; %" G_GUINT64_FORMAT " %s transferred in %u seconds",
|
||||||
(guint64)(bytes_transferred / shift),
|
pull_data->n_fetched_metadata, pull_data->n_fetched_content,
|
||||||
shift == 1 ? "B" : "KiB",
|
(guint64)(bytes_transferred / shift),
|
||||||
(guint) ((end_time - start_time) / G_USEC_PER_SEC));
|
shift == 1 ? "B" : "KiB",
|
||||||
|
(guint) ((end_time - start_time) / G_USEC_PER_SEC));
|
||||||
|
ostree_async_progress_set_status (pull_data->progress, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue