From 74d4d4b70eda3ab6e5f30e9d8c019034ce8fba15 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 28 Apr 2014 12:47:49 -0500 Subject: [PATCH] Remove broken completed_parts write progress Since "raw copy" resources are separated from resources that need to be compressed, the write may not proceed simply one part after another. For now, leave completed_parts as 0, and in wimlib-imagex use the generic write message when doing a join. --- include/wimlib.h | 5 ++--- programs/imagex.c | 29 +++++++---------------------- src/write.c | 17 +---------------- 3 files changed, 10 insertions(+), 41 deletions(-) diff --git a/include/wimlib.h b/include/wimlib.h index 9d3c9616..b54682aa 100644 --- a/include/wimlib.h +++ b/include/wimlib.h @@ -653,11 +653,10 @@ union wimlib_progress_info { int32_t compression_type; /** Number of split WIM parts from which streams are being - * written (may be 0 if irrelevant). */ + * written (may be 0 if irrelevant). */ uint32_t total_parts; - /** Number of split WIM parts from which streams have been - * written (may be 0 if irrelevant). */ + /** This is currently broken and will always be 0. */ uint32_t completed_parts; } write_streams; diff --git a/programs/imagex.c b/programs/imagex.c index 2a474d7e..43ca5d2e 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -1055,28 +1055,13 @@ imagex_progress_func(enum wimlib_progress_msg msg, percent_done = TO_PERCENT(info->write_streams.completed_bytes, info->write_streams.total_bytes); - if (info->write_streams.total_parts <= 1) { - imagex_printf(T("\r%"PRIu64" %"TS" of %"PRIu64" %"TS" (uncompressed) " - "written (%u%% done)"), - info->write_streams.completed_bytes >> unit_shift, - unit_name, - info->write_streams.total_bytes >> unit_shift, - unit_name, - percent_done); - } else { - imagex_printf(T("\rWriting resources from part %u of %u: " - "%"PRIu64 " %"TS" of %"PRIu64" %"TS" (%u%%) written"), - (info->write_streams.completed_parts == - info->write_streams.total_parts) ? - info->write_streams.completed_parts : - info->write_streams.completed_parts + 1, - info->write_streams.total_parts, - info->write_streams.completed_bytes >> unit_shift, - unit_name, - info->write_streams.total_bytes >> unit_shift, - unit_name, - percent_done); - } + imagex_printf(T("\r%"PRIu64" %"TS" of %"PRIu64" %"TS" (uncompressed) " + "written (%u%% done)"), + info->write_streams.completed_bytes >> unit_shift, + unit_name, + info->write_streams.total_bytes >> unit_shift, + unit_name, + percent_done); if (info->write_streams.completed_bytes >= info->write_streams.total_bytes) imagex_printf(T("\n")); break; diff --git a/src/write.c b/src/write.c index bfa5d2ed..292aa7d1 100644 --- a/src/write.c +++ b/src/write.c @@ -278,7 +278,6 @@ struct write_streams_progress_data { wimlib_progress_func_t progress_func; union wimlib_progress_info progress; uint64_t next_progress; - WIMStruct *prev_wim_part; }; static void @@ -289,7 +288,6 @@ do_write_streams_progress(struct write_streams_progress_data *progress_data, bool discarded) { union wimlib_progress_info *progress = &progress_data->progress; - bool new_wim_part; if (discarded) { progress->write_streams.total_bytes -= complete_size; @@ -304,20 +302,8 @@ do_write_streams_progress(struct write_streams_progress_data *progress_data, progress->write_streams.completed_streams += complete_count; } - new_wim_part = false; - if (cur_stream->resource_location == RESOURCE_IN_WIM && - cur_stream->rspec->wim != progress_data->prev_wim_part) - { - if (progress_data->prev_wim_part) { - new_wim_part = true; - progress->write_streams.completed_parts++; - } - progress_data->prev_wim_part = cur_stream->rspec->wim; - } - if (progress_data->progress_func - && (progress->write_streams.completed_bytes >= progress_data->next_progress - || new_wim_part)) + && (progress->write_streams.completed_bytes >= progress_data->next_progress)) { progress_data->progress_func(WIMLIB_PROGRESS_MSG_WRITE_STREAMS, progress); @@ -1061,7 +1047,6 @@ compute_stream_list_stats(struct list_head *stream_list, ctx->progress_data.progress.write_streams.total_parts = total_parts; ctx->progress_data.progress.write_streams.completed_parts = 0; ctx->progress_data.next_progress = 0; - ctx->progress_data.prev_wim_part = NULL; } /* Find streams in @stream_list that can be copied to the output WIM in raw form -- 2.43.0