aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2021-01-11 23:57:11 +0200
committerLasse Collin <lasse.collin@tukaani.org>2022-07-12 18:42:21 +0300
commit11ceecb5e2999ff96989915120e63a2e7e130057 (patch)
tree8689e909cf367e70100b5b915ed46769d202a1ce
parentScripts: Fix exit status of xzgrep. (diff)
downloadxz-11ceecb5e2999ff96989915120e63a2e7e130057.tar.xz
Scripts: Add zstd support to xzdiff.
-rw-r--r--src/scripts/xzdiff.16
-rw-r--r--src/scripts/xzdiff.in16
2 files changed, 15 insertions, 7 deletions
diff --git a/src/scripts/xzdiff.1 b/src/scripts/xzdiff.1
index b33670ca..90619119 100644
--- a/src/scripts/xzdiff.1
+++ b/src/scripts/xzdiff.1
@@ -6,7 +6,7 @@
.\"
.\" License: GNU GPLv2+
.\"
-.TH XZDIFF 1 "2011-03-19" "Tukaani" "XZ Utils"
+.TH XZDIFF 1 "2021-01-11" "Tukaani" "XZ Utils"
.SH NAME
xzcmp, xzdiff, lzcmp, lzdiff \- compare compressed files
.SH SYNOPSIS
@@ -34,8 +34,9 @@ on files compressed with
.BR lzma (1),
.BR gzip (1),
.BR bzip2 (1),
+.BR lzop (1),
or
-.BR lzop (1).
+.BR zstd (1).
All options specified are passed directly to
.BR cmp (1)
or
@@ -68,6 +69,7 @@ are provided for backward compatibility with LZMA Utils.
.BR gzip (1),
.BR bzip2 (1),
.BR lzop (1),
+.BR zstd (1),
.BR zdiff (1)
.SH BUGS
Messages from the
diff --git a/src/scripts/xzdiff.in b/src/scripts/xzdiff.in
index 98ac0e5d..78d75c09 100644
--- a/src/scripts/xzdiff.in
+++ b/src/scripts/xzdiff.in
@@ -80,19 +80,23 @@ if test $# -eq 1; then
xz1=gzip;;
*[-.]lzo | *.tzo)
xz1=lzop;;
+ *[-.]zst | *.tzst)
+ xz1='zstd -q';;
*)
echo >&2 "$0: $1: Unknown compressed file name suffix"
exit 2;;
esac
case $1 in
- *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *[-.]lzo)
- FILE=`expr "X$1" : 'X\(.*\)[-.][abglmoxzZ2]*$'`;;
+ *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *[-.]lzo | *[-.]zst)
+ FILE=`expr "X$1" : 'X\(.*\)[-.][abglmostxzZ2]*$'`;;
*.t[abglx]z)
FILE=`expr "X$1" : 'X\(.*[-.]t\)[abglx]z$'`ar;;
*.tbz2)
FILE=`expr "X$1" : 'X\(.*[-.]t\)bz2$'`ar;;
*.tzo)
FILE=`expr "X$1" : 'X\(.*[-.]t\)zo$'`ar;;
+ *.tzst)
+ FILE=`expr "X$1" : 'X\(.*[-.]t\)zst$'`ar;;
esac
xz_status=$(
exec 4>&1
@@ -103,16 +107,18 @@ elif test $# -eq 2; then
*[-.]bz2 | *.tbz | *.tbz2) xz1=bzip2;;
*[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) xz1=gzip;;
*[-.]lzo | *.tzo) xz1=lzop;;
+ *[-.]zst | *.tzst) xz1='zstd -q';;
esac
case $2 in
*[-.]bz2 | *.tbz | *.tbz2) xz2=bzip2;;
*[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) xz2=gzip;;
*[-.]lzo | *.tzo) xz2=lzop;;
+ *[-.]zst | *.tzst) xz2='zstd -q';;
esac
case $1 in
- *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | -)
+ *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | *[-.]zst | *.tzst | -)
case "$2" in
- *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | -)
+ *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | *[-.]zst | *.tzst | -)
if test "$1$2" = --; then
xz_status=$(
exec 4>&1
@@ -176,7 +182,7 @@ elif test $# -eq 2; then
esac;;
*)
case "$2" in
- *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | -)
+ *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | *[-.]zst | *.tzst | -)
xz_status=$(
exec 4>&1
($xz2 -cdf -- "$2" 4>&-; echo $? >&4) 3>&- |