]> wimlib.net Git - wimlib/blobdiff - programs/imagex.c
Remove WIMLIB_WRITE_FLAG_NO_PACK_STREAMS
[wimlib] / programs / imagex.c
index b2164402749e57b8b6f94a6804ef7a1909fb33fd..9d68acc9fe9512fe84407c74819b887f8e591477 100644 (file)
@@ -142,7 +142,6 @@ enum {
        IMAGEX_NORPFIX_OPTION,
        IMAGEX_NOCHECK_OPTION,
        IMAGEX_NO_ACLS_OPTION,
-       IMAGEX_NO_PACK_STREAMS_OPTION,
        IMAGEX_NOT_PIPABLE_OPTION,
        IMAGEX_PACK_STREAMS_OPTION,
        IMAGEX_PATH_OPTION,
@@ -293,7 +292,6 @@ static const struct option optimize_options[] = {
        {T("recompress-slow"), no_argument,     NULL, IMAGEX_COMPRESS_SLOW_OPTION},
        {T("chunk-size"),  required_argument, NULL, IMAGEX_CHUNK_SIZE_OPTION},
        {T("pack-streams"),no_argument,       NULL, IMAGEX_PACK_STREAMS_OPTION},
-       {T("no-pack-streams"), no_argument,   NULL, IMAGEX_NO_PACK_STREAMS_OPTION},
        {T("threads"),     required_argument, NULL, IMAGEX_THREADS_OPTION},
        {T("pipable"),     no_argument,       NULL, IMAGEX_PIPABLE_OPTION},
        {T("not-pipable"), no_argument,       NULL, IMAGEX_NOT_PIPABLE_OPTION},
@@ -434,8 +432,10 @@ static int
 set_compress_slow(void)
 {
        int ret;
-       static const struct wimlib_lzx_params slow_params = {
-               .size_of_this = sizeof(struct wimlib_lzx_params),
+       static const struct wimlib_lzx_compressor_params slow_params = {
+               .hdr = {
+                       .size = sizeof(struct wimlib_lzx_compressor_params),
+               },
                .algorithm = WIMLIB_LZX_ALGORITHM_SLOW,
                .alg_params = {
                        .slow = {
@@ -450,7 +450,8 @@ set_compress_slow(void)
                        },
                },
        };
-       ret = wimlib_lzx_set_default_params(&slow_params);
+       ret = wimlib_set_default_compressor_params(WIMLIB_COMPRESSION_TYPE_LZX,
+                                                  &slow_params.hdr);
        if (ret)
                imagex_error(T("Couldn't set slow compression parameters.!"));
        return ret;
@@ -1866,13 +1867,14 @@ imagex_capture_or_append(int argc, tchar **argv, int cmd)
 
        /* Set default compression type.  */
        if (compression_type == WIMLIB_COMPRESSION_TYPE_INVALID) {
-               struct wimlib_lzx_params params;
+               struct wimlib_lzx_compressor_params params;
                memset(&params, 0, sizeof(params));
-               params.size_of_this = sizeof(params);
+               params.hdr.size = sizeof(params);
                params.algorithm = WIMLIB_LZX_ALGORITHM_FAST;
                params.use_defaults = 1;
 
-               wimlib_lzx_set_default_params(&params);
+               wimlib_set_default_compressor_params(WIMLIB_COMPRESSION_TYPE_LZX,
+                                                    &params.hdr);
                compression_type = WIMLIB_COMPRESSION_TYPE_LZX;
        }
 
@@ -2543,7 +2545,9 @@ imagex_export(int argc, tchar **argv, int cmd)
                if (ret)
                        goto out_free_src_wim;
 
-               wimlib_set_output_chunk_size(dest_wim, src_info.chunk_size);
+               /* Use same chunk size if compression type is the same.  */
+               if (compression_type == src_info.compression_type)
+                       wimlib_set_output_chunk_size(dest_wim, src_info.chunk_size);
        }
 
        image = wimlib_resolve_image(src_wim, src_image_num_or_name);
@@ -3361,9 +3365,6 @@ imagex_optimize(int argc, tchar **argv, int cmd)
                        write_flags |= WIMLIB_WRITE_FLAG_PACK_STREAMS;
                        write_flags |= WIMLIB_WRITE_FLAG_RECOMPRESS;
                        break;
-               case IMAGEX_NO_PACK_STREAMS_OPTION:
-                       write_flags |= WIMLIB_WRITE_FLAG_NO_PACK_STREAMS;
-                       break;
                case IMAGEX_THREADS_OPTION:
                        num_threads = parse_num_threads(optarg);
                        if (num_threads == UINT_MAX)