]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
xz: Update xz -lvv for RISC-V filter.
authorJia Tan <jiat0218@gmail.com>
Mon, 22 Jan 2024 15:33:39 +0000 (23:33 +0800)
committerJia Tan <jiat0218@gmail.com>
Tue, 23 Jan 2024 15:05:47 +0000 (23:05 +0800)
Version 5.6.0 will be shown, even though upcoming alphas and betas
will be able to support this filter. 5.6.0 looks nicer in the output and
people shouldn't be encouraged to use an unstable version in production
in any way.

src/xz/list.c

index 86c3a762f5603d78e218a18355abcd4861ae10b5..9693376016e3f3bac2ce7e0450a428d950e2f15c 100644 (file)
@@ -544,11 +544,21 @@ parse_block_header(file_pair *pair, const lzma_index_iter *iter,
                xfi->memusage_max = bhi->memusage;
 
        // Determine the minimum XZ Utils version that supports this Block.
+       //   - RISC-V filter needs 5.6.0.
        //
        //   - ARM64 filter needs 5.4.0.
        //
        //   - 5.0.0 doesn't support empty LZMA2 streams and thus empty
        //     Blocks that use LZMA2. This decoder bug was fixed in 5.0.2.
+       if (xfi->min_version < 50060002U) {
+               for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i) {
+                       if (filters[i].id == LZMA_FILTER_RISCV) {
+                               xfi->min_version = 50060002U;
+                               break;
+                       }
+               }
+       }
+
        if (xfi->min_version < 50040002U) {
                for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i) {
                        if (filters[i].id == LZMA_FILTER_ARM64) {