From 0945405bedb03d9929243e2eab30f6555de281ae Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 9 Jan 2016 11:42:21 -0600 Subject: [PATCH] wimlib-imagex: tweaks to write progress messages --- NEWS | 3 +++ programs/imagex.c | 23 ++++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/NEWS b/NEWS index 7ce0ccc3..e20b859f 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,9 @@ Version 1.9.0-BETA: architecture, system root, and version details. This information is now automatically set in newly captured WIM images, when appropriate. + The progress messages printed by wimlib-imagex while writing WIM files + have been slightly tweaked. + Added a new '--image-property' option to 'wimcapture', 'wimappend', and 'wiminfo'. This option lets you assign values to elements in a WIM file's XML document by name. diff --git a/programs/imagex.c b/programs/imagex.c index 682a1420..b21de01b 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -1159,23 +1159,24 @@ imagex_progress_func(enum wimlib_progress_msg msg, switch (msg) { case WIMLIB_PROGRESS_MSG_WRITE_STREAMS: { - static bool first = true; - if (first) { - imagex_printf(T("Writing %"TS"-compressed data " - "using %u thread%"TS"\n"), - wimlib_get_compression_type_string( - info->write_streams.compression_type), - info->write_streams.num_threads, - (info->write_streams.num_threads == 1) ? T("") : T("s")); - first = false; + static bool started; + if (!started) { + if (info->write_streams.compression_type != WIMLIB_COMPRESSION_TYPE_NONE) { + imagex_printf(T("Using %"TS" compression " + "with %u thread%"TS"\n"), + wimlib_get_compression_type_string( + info->write_streams.compression_type), + info->write_streams.num_threads, + (info->write_streams.num_threads == 1) ? T("") : T("s")); + } + started = true; } } unit_shift = get_unit(info->write_streams.total_bytes, &unit_name); percent_done = TO_PERCENT(info->write_streams.completed_bytes, info->write_streams.total_bytes); - imagex_printf(T("\r%"PRIu64" %"TS" of %"PRIu64" %"TS" (uncompressed) " - "written (%u%% done)"), + imagex_printf(T("\rArchiving file data: %"PRIu64" %"TS" of %"PRIu64" %"TS" (%u%%) done"), info->write_streams.completed_bytes >> unit_shift, unit_name, info->write_streams.total_bytes >> unit_shift, -- 2.43.0