wimexport: Add --recompress option
authorEric Biggers <ebiggers3@gmail.com>
Wed, 25 Jun 2014 02:48:43 +0000 (21:48 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Wed, 25 Jun 2014 02:50:21 +0000 (21:50 -0500)
doc/man1/imagex-export.1.in
programs/imagex.c

index 236afee..73e01f6 100644 (file)
@@ -79,6 +79,10 @@ and "LZX", instead of "fast" and "maximum", respectively.
 reduced compatibility.  See the documentation for this option to
 \fB@IMAGEX_PROGNAME@ capture\fR (1) for more details.
 .TP
+\fB--recompress\fR
+Force all exported data to be recompressed, even if the destination WIM will use
+the same compression type as the source WIM.
+.TP
 \fB--compress-slow\fR
 Spend even more time compressing the data to achieve a very slightly better
 compression ratio.  This currently only has an effect for LZX ("maximum") and
index 5080301..1c077b7 100644 (file)
@@ -271,6 +271,7 @@ static const struct option export_options[] = {
        {T("nocheck"),     no_argument,       NULL, IMAGEX_NOCHECK_OPTION},
        {T("no-check"),    no_argument,       NULL, IMAGEX_NOCHECK_OPTION},
        {T("compress"),    required_argument, NULL, IMAGEX_COMPRESS_OPTION},
+       {T("recompress"),  no_argument,       NULL, IMAGEX_RECOMPRESS_OPTION},
        {T("compress-slow"), no_argument,     NULL, IMAGEX_COMPRESS_SLOW_OPTION},
        {T("pack-streams"),no_argument,       NULL, IMAGEX_PACK_STREAMS_OPTION},
        {T("solid"),       no_argument,       NULL, IMAGEX_PACK_STREAMS_OPTION},
@@ -2612,6 +2613,9 @@ imagex_export(int argc, tchar **argv, int cmd)
                        if (compression_type == WIMLIB_COMPRESSION_TYPE_INVALID)
                                goto out_err;
                        break;
+               case IMAGEX_RECOMPRESS_OPTION:
+                       write_flags |= WIMLIB_WRITE_FLAG_RECOMPRESS;
+                       break;
                case IMAGEX_COMPRESS_SLOW_OPTION:
                        write_flags |= WIMLIB_WRITE_FLAG_RECOMPRESS;
                        set_compress_slow();