From 589227e13abb99fbe23667203eace3c37b4d12a9 Mon Sep 17 00:00:00 2001
From: Curtis Doty <Curtis@GreenKey.net>
Date: Sun, 22 Dec 2024 21:33:22 +0000
Subject: [PATCH] Use all cores for zstd compression
- only slight size penalty
---
misc/ext.d/archive.sh | 8 ++++----
misc/ext.d/text.sh.in | 2 +-
misc/mc.menu.in | 4 ++--
src/editor/edit.c | 2 +-
src/vfs/extfs/helpers/iso9660.in | 2 +-
src/vfs/extfs/helpers/lslR.in | 2 +-
src/vfs/extfs/helpers/mailfs.in | 2 +-
src/vfs/extfs/helpers/patchfs.in | 2 +-
src/vfs/sfs/sfs.ini | 4 ++--
9 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/misc/ext.d/archive.sh b/misc/ext.d/archive.sh
index 12beb0158..8c84f8862 100755
a
|
b
|
do_view_action() { |
39 | 39 | xz -dc "${MC_EXT_FILENAME}" 2>/dev/null |
40 | 40 | ;; |
41 | 41 | zst) |
42 | | zstd -dc "${MC_EXT_FILENAME}" 2>/dev/null |
| 42 | pzstd -dc "${MC_EXT_FILENAME}" 2>/dev/null |
43 | 43 | ;; |
44 | 44 | tar) |
45 | 45 | tar tvvf - < "${MC_EXT_FILENAME}" |
… |
… |
do_view_action() { |
77 | 77 | tar tvvf - |
78 | 78 | ;; |
79 | 79 | tar.zst|tzst) |
80 | | zstd -dc "${MC_EXT_FILENAME}" 2>/dev/null | \ |
| 80 | pzstd -dc "${MC_EXT_FILENAME}" 2>/dev/null | \ |
81 | 81 | tar tvvf - |
82 | 82 | ;; |
83 | 83 | tar.F) |
… |
… |
do_view_action() { |
130 | 130 | cpio -itv 2>/dev/null |
131 | 131 | ;; |
132 | 132 | cpio.zst) |
133 | | zstd -dc "${MC_EXT_FILENAME}" | \ |
| 133 | pzstd -dc "${MC_EXT_FILENAME}" | \ |
134 | 134 | cpio -itv 2>/dev/null |
135 | 135 | ;; |
136 | 136 | cpio) |
… |
… |
do_open_action() { |
195 | 195 | xz -dc "${MC_EXT_FILENAME}" | ${pager} |
196 | 196 | ;; |
197 | 197 | zst) |
198 | | zstd -dc "${MC_EXT_FILENAME}" | ${pager} |
| 198 | pzstd -dc "${MC_EXT_FILENAME}" | ${pager} |
199 | 199 | ;; |
200 | 200 | par2) |
201 | 201 | par2 r "${MC_EXT_FILENAME}" |
diff --git a/misc/ext.d/text.sh.in b/misc/ext.d/text.sh.in
index 38d64c40e..fff0de8d8 100644
a
|
b
|
get_unpacker() { |
38 | 38 | unpacker="xz -dc" |
39 | 39 | ;; |
40 | 40 | man.zst) |
41 | | unpacker="zstd -dc" |
| 41 | unpacker="pzstd -dc" |
42 | 42 | ;; |
43 | 43 | esac |
44 | 44 | echo ${unpacker} |
diff --git a/misc/mc.menu.in b/misc/mc.menu.in
index 9d37e378a..0f0d16c10 100644
a
|
b
|
shell_patterns=0 |
90 | 90 | read tar |
91 | 91 | [ "$tar"x = x ] && tar="$Pwd" |
92 | 92 | cd .. && \ |
93 | | tar cf - "$Pwd" | zstd -f > "$tar.tar.zst" && \ |
| 93 | tar cf - "$Pwd" | pzstd -f > "$tar.tar.zst" && \ |
94 | 94 | echo "../$tar.tar.zst created." |
95 | 95 | |
96 | 96 | 8 Compress the current subdirectory (tar.lzo) |
… |
… |
x Extract the contents of a compressed tar file |
249 | 249 | *.tar.lzma) PRG="lzma -dc";; |
250 | 250 | *.tar.lzo) PRG="lzop -dc";; |
251 | 251 | *.tar.xz) PRG="xz -dc";; |
252 | | *.tar.zst) PRG="zstd -dc";; |
| 252 | *.tar.zst) PRG="pzstd -dc";; |
253 | 253 | *) exit 1;; |
254 | 254 | esac |
255 | 255 | $PRG %f | tar xvf - |
diff --git a/src/editor/edit.c b/src/editor/edit.c
index 9ff1a1054..7961cc263 100644
a
|
b
|
static const struct edit_filters |
137 | 137 | } all_filters[] = { |
138 | 138 | /* *INDENT-OFF* */ |
139 | 139 | { "xz -cd %s 2>&1", "xz > %s", ".xz"}, |
140 | | { "zstd -cd %s 2>&1", "zstd > %s", ".zst"}, |
| 140 | { "pzstd -cd %s 2>&1", "pzstd > %s", ".zst"}, |
141 | 141 | { "lz4 -cd %s 2>&1", "lz4 > %s", ".lz4" }, |
142 | 142 | { "lzip -cd %s 2>&1", "lzip > %s", ".lz"}, |
143 | 143 | { "lzma -cd %s 2>&1", "lzma > %s", ".lzma" }, |
diff --git a/src/vfs/extfs/helpers/iso9660.in b/src/vfs/extfs/helpers/iso9660.in
index e5d41dafe..2d940b10a 100644
a
|
b
|
mcisofs_list () ( |
182 | 182 | *.lzma) MYCAT="lzma -dc";; |
183 | 183 | *.lzo) MYCAT="lzop -dc";; |
184 | 184 | *.xz) MYCAT="xz -dc";; |
185 | | *.zst) MYCAT="zstd -dc";; |
| 185 | *.zst) MYCAT="pzstd -dc";; |
186 | 186 | *.bz2) MYCAT="bzip2 -dc";; |
187 | 187 | *.gz) MYCAT="gzip -dc";; |
188 | 188 | *.z) MYCAT="gzip -dc";; |
diff --git a/src/vfs/extfs/helpers/lslR.in b/src/vfs/extfs/helpers/lslR.in
index 52b0b6a18..9e745e4c6 100644
a
|
b
|
case "$1" in |
17 | 17 | *.lzma) MYCAT="lzma -dc";; |
18 | 18 | *.lzo) MYCAT="lzop -dc";; |
19 | 19 | *.xz) MYCAT="xz -dc";; |
20 | | *.zst) MYCAT="zstd -dc";; |
| 20 | *.zst) MYCAT="pzstd -dc";; |
21 | 21 | *.bz2) MYCAT="bzip2 -dc";; |
22 | 22 | *.gz) MYCAT="gzip -dc";; |
23 | 23 | *.z) MYCAT="gzip -dc";; |
diff --git a/src/vfs/extfs/helpers/mailfs.in b/src/vfs/extfs/helpers/mailfs.in
index 20cfae317..2d801894f 100644
a
|
b
|
$lz4cat="lz4 -dc"; # unlz4 to stdout |
13 | 13 | $lzcat="lzma -dc"; # unlzma to stdout |
14 | 14 | $lzocat="lzop -dc"; # unlzo to stdout |
15 | 15 | $xzcat="xz -dc"; # unxz to stdout |
16 | | $zstdcat="zstd -dc"; # unzstd to stdout |
| 16 | $zstdcat="pzstd -dc"; # unzstd to stdout |
17 | 17 | $file="file"; # "file" command |
18 | 18 | $TZ='GMT'; # default timezone (for Date module) |
19 | 19 | |
diff --git a/src/vfs/extfs/helpers/patchfs.in b/src/vfs/extfs/helpers/patchfs.in
index 59fdde1fc..b2a1f169b 100644
a
|
b
|
my $lz4 = 'lz4'; |
19 | 19 | my $lzma = 'lzma'; |
20 | 20 | my $lzo = 'lzop'; |
21 | 21 | my $xz = 'xz'; |
22 | | my $zstd = 'zstd'; |
| 22 | my $zstd = 'pzstd'; |
23 | 23 | my $bzip = 'bzip2'; |
24 | 24 | my $gzip = 'gzip'; |
25 | 25 | my $fileutil = 'file -b'; |
diff --git a/src/vfs/sfs/sfs.ini b/src/vfs/sfs/sfs.ini
index a7b059be0..021cd3a18 100644
a
|
b
|
lzo/1 lzop < %1 > %3 |
20 | 20 | ulzo/1 lzop -d < %1 > %3 |
21 | 21 | xz/1 xz < %1 > %3 |
22 | 22 | uxz/1 xz -d < %1 > %3 |
23 | | zst/1 zstd < %1 > %3 |
24 | | uzst/1 zstd -d < %1 > %3 |
| 23 | zst/1 pzstd < %1 > %3 |
| 24 | uzst/1 pzstd -d < %1 > %3 |
25 | 25 | tar/1 tar cf %3 %1 |
26 | 26 | tgz/1 tar czf %3 %1 |
27 | 27 | uhtml/1 lynx -force_html -dump %1 > %3 |