Note imagex-export alternatives
authorEric Biggers <ebiggers3@gmail.com>
Thu, 22 Nov 2012 20:27:48 +0000 (14:27 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 22 Nov 2012 20:27:48 +0000 (14:27 -0600)
doc/imagex-join.1.in
doc/imagex-optimize.1.in
programs/imagex.c
src/extract.c

index b23f49db54fe6702cf1f5f15b803abd8f47b1be1..131aed377137dc5becae138970cd57e93bd41873 100644 (file)
@@ -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)
index a0ce30d108e01ffcb989e2b96616034ba8b09091..9074fb41c7c8fb6e54b106e54bbb4fe9c8e9073f 100644 (file)
@@ -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)
 
index f2757820fcaeea7a1b3670a4f53113c151a13f81..96f9a9342926734c7e47bf469b8414491075c31f 100644 (file)
@@ -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);
index 8e809608a864f218d726f27572d544a879079596..b7a15c04306941f483bc6bc450b13976236bcb85 100644 (file)
@@ -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;