summaryrefslogtreecommitdiffstats
path: root/src/scripts/xzdiff.in
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/scripts/xzdiff.in19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/scripts/xzdiff.in b/src/scripts/xzdiff.in
index c17d78b..179218d 100644
--- a/src/scripts/xzdiff.in
+++ b/src/scripts/xzdiff.in
@@ -1,4 +1,5 @@
#!@POSIX_SHELL@
+# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 1998, 2002, 2006, 2007 Free Software Foundation
# Copyright (C) 1993 Jean-loup Gailly
@@ -30,7 +31,7 @@ case ${0##*/} in
*) prog=xzdiff; cmp=${DIFF:-diff};;
esac
-version="$prog (@PACKAGE_NAME@) @VERSION@"
+version="$prog (@PACKAGE_NAME@) @PACKAGE_VERSION@"
usage="Usage: ${0##*/} [OPTION]... FILE1 [FILE2]
Compare FILE1 to FILE2, using their uncompressed contents if they are
@@ -83,13 +84,15 @@ if test $# -eq 1; then
xz1=lzop;;
*[-.]zst | *.tzst)
xz1='zstd -q';;
+ *[-.]lz4)
+ xz1=lz4;;
*)
printf '%s\n' "$0: $1: Unknown compressed file name suffix" >&2
exit 2;;
esac
case $1 in
- *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *[-.]lz | *[-.]lzo | *[-.]zst)
- FILE=`expr "X$1" : 'X\(.*\)[-.][abglmostxzZ2]*$'`;;
+ *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *[-.]lz | *[-.]lzo | *[-.]zst | *[-.]lz4)
+ FILE=`expr "X$1" : 'X\(.*\)[-.][abglmostxzZ24]*$'`;;
*.t[abglx]z)
FILE=`expr "X$1" : 'X\(.*[-.]t\)[abglx]z$'`ar;;
*.tbz2)
@@ -109,17 +112,19 @@ elif test $# -eq 2; then
*[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) xz1=gzip;;
*[-.]lzo | *.tzo) xz1=lzop;;
*[-.]zst | *.tzst) xz1='zstd -q';;
+ *[-.]lz4) xz1=lz4;;
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';;
+ *[-.]lz4) xz2=lz4;;
esac
case $1 in
- *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *[-.]lz | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | *[-.]zst | *.tzst | -)
+ *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *[-.]lz | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | *[-.]zst | *.tzst | *[-.]lz4 | -)
case "$2" in
- *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *[-.]lz | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | *[-.]zst | *.tzst | -)
+ *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *[-.]lz | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | *[-.]zst | *.tzst | *[-.]lz4 | -)
if test "$1$2" = --; then
xz_status=$(
exec 4>&1
@@ -183,7 +188,7 @@ elif test $# -eq 2; then
esac;;
*)
case "$2" in
- *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *[-.]lz | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | *[-.]zst | *.tzst | -)
+ *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *[-.]lz | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | *[-.]zst | *.tzst | *[-.]lz4 | -)
xz_status=$(
exec 4>&1
($xz2 -cdf -- "$2" 4>&-; echo $? >&4) 3>&- |
@@ -194,7 +199,7 @@ elif test $# -eq 2; then
esac;;
esac
else
- printf '%s\n' "$0: Invalid number of operands; try \`${0##*/} --help' for help" >&2
+ printf '%s\n' "$0: Invalid number of operands; try '${0##*/} --help' for help" >&2
exit 2
fi