From ce81b1490c131f0be20c21661bc8f954d45c417c Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 22 Nov 2012 14:27:48 -0600 Subject: [PATCH] Note imagex-export alternatives --- doc/imagex-join.1.in | 12 +++++++----- doc/imagex-optimize.1.in | 8 ++++++++ programs/imagex.c | 36 +++++++++++++++++++----------------- src/extract.c | 4 +++- 4 files changed, 37 insertions(+), 23 deletions(-) diff --git a/doc/imagex-join.1.in b/doc/imagex-join.1.in index b23f49db..131aed37 100644 --- a/doc/imagex-join.1.in +++ b/doc/imagex-join.1.in @@ -30,12 +30,14 @@ imagex join windows.wim windows*.swm .RE .SH NOTES -You can also use \fBimagex export\fR to export all images from a split WIM. -This would be nearly the same as \fBimagex join\fR, although some information in -the XML data could be discarded. +\fBimagex join\fR is roughly equivalent to: +.RS +.PP +\fBimagex export\fR \fISWM_PART_1\fR --ref="\fISWM_GLOB\fR" [--check] all \fIOUT_WIMFILE\fR +.RE +.PP -Perhaps for this reason, Microsoft's implementation of imagex does not provide a -\fB/join\fR option. .SH SEE ALSO .BR imagex (1) +.BR imagex-export (1) diff --git a/doc/imagex-optimize.1.in b/doc/imagex-optimize.1.in index a0ce30d1..9074fb41 100644 --- a/doc/imagex-optimize.1.in +++ b/doc/imagex-optimize.1.in @@ -34,6 +34,14 @@ that the WIM is intact (equivalent to applying all the images from it). \fBimagex optimize\fR does not support split WIMs. +\fBimagex optimize\fR is roughly equivalent to: +.RS +.PP +\fBimagex export\fR \fIWIMFILE\fR all tmp.wim [--check] && mv tmp.wim \fIWIMFILE\fR +.RE +.PP + .SH SEE ALSO .BR imagex (1) +.BR imagex-export (1) diff --git a/programs/imagex.c b/programs/imagex.c index f2757820..96f9a934 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -101,7 +101,7 @@ static const char *usage_strings[] = { " [--check] [--debug] [--streams-interface=INTERFACE]\n" " [--staging-dir=DIR]\n", [OPTIMIZE] = -"imagex optimize WIMFILE [--check] [--recompress]\n", +"imagex optimize WIMFILE [--check] [--recompress] [--compress=TYPE]\n", [SPLIT] = "imagex split WIMFILE SPLIT_WIMFILE PART_SIZE_MB [--check]\n", [UNMOUNT] = @@ -398,10 +398,10 @@ static int imagex_progress_func(enum wimlib_progress_msg msg, putchar('\n'); break; case WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN: - /*printf("Applying image %d (%s) to `%s'\n",*/ - /*info->extract.image,*/ - /*info->extract.image_name,*/ - /*info->extract.target);*/ + printf("Applying image %d (%s) to `%s'\n", + info->extract.image, + info->extract.image_name, + info->extract.target); break; /*case WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_END:*/ /*printf("Done applying image %d!\n",*/ @@ -1539,19 +1539,21 @@ static int imagex_optimize(int argc, const char **argv) ret = wimlib_overwrite(w, write_flags, 0, imagex_progress_func); - new_size = file_get_size(argv[0]); - printf("`%s' optimized size: ", wimfile); - if (new_size == -1) - puts("Unknown"); - else - printf("%"PRIu64" KiB\n", new_size >> 10); + if (ret == 0) { + new_size = file_get_size(argv[0]); + printf("`%s' optimized size: ", wimfile); + if (new_size == -1) + puts("Unknown"); + else + printf("%"PRIu64" KiB\n", new_size >> 10); - fputs("Space saved: ", stdout); - if (new_size != -1 && old_size != -1) { - printf("%lld KiB\n", - ((long long)old_size - (long long)new_size) >> 10); - } else { - puts("Unknown"); + fputs("Space saved: ", stdout); + if (new_size != -1 && old_size != -1) { + printf("%lld KiB\n", + ((long long)old_size - (long long)new_size) >> 10); + } else { + puts("Unknown"); + } } wimlib_free(w); diff --git a/src/extract.c b/src/extract.c index 8e809608..b7a15c04 100644 --- a/src/extract.c +++ b/src/extract.c @@ -549,7 +549,9 @@ static int apply_stream_list(struct list_head *stream_list, ret = ops->apply_dentry(dentry, args); if (ret != 0) goto out; - if (args->progress.extract.completed_bytes >= next_progress) { + if (args->progress.extract.completed_bytes >= next_progress + && args->progress.extract.total_bytes != 0) + { progress_func(WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS, &args->progress); next_progress += bytes_per_progress; -- 2.43.0