X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=programs%2Fimagex.c;h=90b53dd6bd815165ca30cb6ede5ee4b29d400338;hb=ca1be480fd209d8c24e19350e440c01832310a2d;hp=e99202b1effdbf659a43b4b38096844bfeca8570;hpb=3d84c998673ba7acf82ec5c26769a41e28a2cc7b;p=wimlib diff --git a/programs/imagex.c b/programs/imagex.c index e99202b1..90b53dd6 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -146,6 +146,7 @@ enum { IMAGEX_RECOMPRESS_OPTION, IMAGEX_RECURSIVE_OPTION, IMAGEX_REF_OPTION, + IMAGEX_RESUME_OPTION, IMAGEX_RPFIX_OPTION, IMAGEX_SOFT_OPTION, IMAGEX_SOURCE_LIST_OPTION, @@ -173,6 +174,7 @@ static const struct option apply_options[] = { {T("rpfix"), no_argument, NULL, IMAGEX_RPFIX_OPTION}, {T("norpfix"), no_argument, NULL, IMAGEX_NORPFIX_OPTION}, {T("include-invalid-names"), no_argument, NULL, IMAGEX_INCLUDE_INVALID_NAMES_OPTION}, + {T("resume"), no_argument, NULL, IMAGEX_RESUME_OPTION}, {NULL, 0, NULL, 0}, }; @@ -985,6 +987,7 @@ imagex_progress_func(enum wimlib_progress_msg msg, 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); + if (info->write_streams.completed_streams == 0) { const tchar *data_type; @@ -993,13 +996,28 @@ imagex_progress_func(enum wimlib_progress_msg msg, data_type, info->write_streams.num_threads, (info->write_streams.num_threads == 1) ? T("") : T("s")); } - 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.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); + } if (info->write_streams.completed_bytes >= info->write_streams.total_bytes) imagex_printf(T("\n")); break; @@ -1019,8 +1037,6 @@ imagex_progress_func(enum wimlib_progress_msg msg, else imagex_printf(T("Scanning \"%"TS"\"\n"), info->scan.cur_path); break; - /*case WIMLIB_PROGRESS_MSG_SCAN_END:*/ - /*break;*/ case WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY: unit_shift = get_unit(info->integrity.total_bytes, &unit_name); percent_done = TO_PERCENT(info->integrity.completed_bytes, @@ -1070,10 +1086,6 @@ imagex_progress_func(enum wimlib_progress_msg msg, info->extract.wimfile_name, info->extract.target); break; - /*case WIMLIB_PROGRESS_MSG_EXTRACT_DIR_STRUCTURE_BEGIN:*/ - /*imagex_printf(T("Applying directory structure to %"TS"\n"),*/ - /*info->extract.target);*/ - /*break;*/ case WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS: percent_done = TO_PERCENT(info->extract.completed_bytes, info->extract.total_bytes); @@ -1088,6 +1100,11 @@ imagex_progress_func(enum wimlib_progress_msg msg, if (info->extract.completed_bytes >= info->extract.total_bytes) imagex_printf(T("\n")); break; + case WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN: + imagex_printf(T("\nReading split pipable WIM part %u of %u\n"), + info->extract.part_number, + info->extract.total_parts); + break; case WIMLIB_PROGRESS_MSG_APPLY_TIMESTAMPS: if (info->extract.extract_root_wim_source_path[0] == T('\0')) imagex_printf(T("Setting timestamps on all extracted files...\n")); @@ -1098,21 +1115,6 @@ imagex_progress_func(enum wimlib_progress_msg msg, info->extract.target); } break; - case WIMLIB_PROGRESS_MSG_JOIN_STREAMS: - percent_done = TO_PERCENT(info->join.completed_bytes, - info->join.total_bytes); - unit_shift = get_unit(info->join.total_bytes, &unit_name); - imagex_printf(T("Writing resources from part %u of %u: " - "%"PRIu64 " %"TS" of %"PRIu64" %"TS" (%u%%) written\n"), - (info->join.completed_parts == info->join.total_parts) ? - info->join.completed_parts : info->join.completed_parts + 1, - info->join.total_parts, - info->join.completed_bytes >> unit_shift, - unit_name, - info->join.total_bytes >> unit_shift, - unit_name, - percent_done); - break; case WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART: percent_done = TO_PERCENT(info->split.completed_bytes, info->split.total_bytes); @@ -1130,7 +1132,7 @@ imagex_progress_func(enum wimlib_progress_msg msg, break; case WIMLIB_PROGRESS_MSG_SPLIT_END_PART: if (info->split.completed_bytes == info->split.total_bytes) { - imagex_printf(T("Finished writing part %u of %u WIM parts\n"), + imagex_printf(T("Finished writing split WIM part %u of %u\n"), info->split.cur_part_number, info->split.total_parts); } @@ -1501,6 +1503,9 @@ imagex_apply(int argc, tchar **argv, int cmd) extract_flags |= WIMLIB_EXTRACT_FLAG_REPLACE_INVALID_FILENAMES; extract_flags |= WIMLIB_EXTRACT_FLAG_ALL_CASE_CONFLICTS; break; + case IMAGEX_RESUME_OPTION: + extract_flags |= WIMLIB_EXTRACT_FLAG_RESUME; + break; default: goto out_usage; } @@ -3454,7 +3459,7 @@ T( " (DIRECTORY | NTFS_VOLUME) [--check] [--hardlink]\n" " [--symlink] [--verbose] [--ref=\"GLOB\"] [--unix-data]\n" " [--no-acls] [--strict-acls] [--rpfix] [--norpfix]\n" -" [--include-invalid-names]\n" +" [--include-invalid-names] [--resume]\n" ), [CMD_CAPTURE] = T(