]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
Scripts: Ignore warnings from xz.
authorLasse Collin <lasse.collin@tukaani.org>
Fri, 11 Nov 2022 10:23:58 +0000 (12:23 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Fri, 11 Nov 2022 11:50:56 +0000 (13:50 +0200)
In practice this means making the scripts work when
the input files have an unsupported check type which
isn't a problem in practice unless support for
some check types has been disabled at build time.

src/scripts/xzdiff.in
src/scripts/xzgrep.in
src/scripts/xzless.in
src/scripts/xzmore.in

index 234d6c70db31821038112efaf0b21a26ceb906ea..389921d8b9c860d250bd19cd903f2a4ee3b0e0c5 100644 (file)
@@ -65,8 +65,9 @@ for file; do
   test "X$file" = X- || <"$file" || exit 2
 done
 
-xz1=$xz
-xz2=$xz
+# xz needs -qQ to ignore warnings like unsupported check type.
+xz1="$xz -qQ"
+xz2="$xz -qQ"
 xz_status=0
 exec 3>&1
 
index 449f0e61154d68e34bd842fb455fa0e495eb9f98..490e47d7b50335851575070b36a7ad59f45fa328 100644 (file)
@@ -180,7 +180,7 @@ for i; do
     *[-.]bz2 | *[-.]tbz | *.tbz2) uncompress="bzip2 -cdf";;
     *[-.]lzo | *[-.]tzo) uncompress="lzop -cdf";;
     *[-.]zst | *[-.]tzst) uncompress="zstd -cdfq";; # zstd needs -q.
-    *) uncompress="$xz -cdf";;
+    *) uncompress="$xz -cdfqQ";; # -qQ to ignore warnings like unsupp. check.
   esac
   # xz_status will hold the decompressor's exit status.
   # Exit status of grep (and in rare cases, printf or sed) is
index 0fc9176343115de47cfebd49983f7f2a91d4345b..79a849e2e2fdcd06b3deea1919ed90da0cc833b1 100644 (file)
@@ -50,9 +50,9 @@ fi
 if test "$(less -V | { read _ ver _ && echo ${ver%%.*}; })" -ge 429; then
        # less 429 or later: LESSOPEN pipe will be used on
        # standard input if $LESSOPEN begins with |-.
-       LESSOPEN="|-$xz -cdfq -- %s"
+       LESSOPEN="|-$xz -cdfqQ -- %s"
 else
-       LESSOPEN="|$xz -cdfq -- %s"
+       LESSOPEN="|$xz -cdfqQ -- %s"
 fi
 export LESSMETACHARS LESSOPEN
 
index 6ba1344dda98754759c237c0605e18af1f6441b0..5188fdab2c6483b410ec89a0f35b7baa550f7d98 100644 (file)
@@ -52,7 +52,7 @@ if test $# = 0; then
        if test -t 0; then
                printf '%s\n' "$usage"; exit 1
        else
-               $xz -cdfq | eval "${PAGER:-more}"
+               $xz -cdfqQ | eval "${PAGER:-more}"
        fi
 else
        FIRST=1
@@ -70,7 +70,7 @@ else
                fi
                if test "$ANS" != 's'; then
                        printf '%s\n' "------> $FILE <------"
-                       $xz -cdfq -- "$FILE" | eval "${PAGER:-more}"
+                       $xz -cdfqQ -- "$FILE" | eval "${PAGER:-more}"
                fi
                if test -t 1; then
                        FIRST=0