From 272509e536116b12c1fcc1135e6c5890ec5f64cc Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Thu, 20 Aug 2020 07:59:52 +0200 Subject: [PATCH] #1 add zstd and brotli support to lesspipe.sh --- less.spec | 5 ++++- lesspipe.sh | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/less.spec b/less.spec index d9c8e8d..7f40572 100644 --- a/less.spec +++ b/less.spec @@ -1,7 +1,7 @@ Summary: A text file browser similar to more, but better Name: less Version: 551 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv3+ or BSD Source: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz Source1: lesspipe.sh @@ -62,6 +62,9 @@ install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d %{_mandir}/man1/* %changelog +* Thu Aug 20 2020 Andrew Schorr - 551-5 +- Add zstd and brotli support to lesspipe.sh + * Tue Jul 28 2020 Fedora Release Engineering - 551-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/lesspipe.sh b/lesspipe.sh index ddd9480..f2df6a1 100755 --- a/lesspipe.sh +++ b/lesspipe.sh @@ -51,11 +51,13 @@ manfilter () export MAN_KEEP_FORMATTING=1 case "$1" in -*.[1-9n].bz2|*.[1-9]x.bz2|*.man.bz2|*.[1-9n].[glx]z|*.[1-9]x.[glx]z|*.man.[glx]z|*.[1-9n].lzma|*.[1-9]x.lzma|*.man.lzma) +*.[1-9n].bz2|*.[1-9]x.bz2|*.man.bz2|*.[1-9n].[glx]z|*.[1-9]x.[glx]z|*.man.[glx]z|*.[1-9n].lzma|*.[1-9]x.lzma|*.man.lzma|*.[1-9n].zst|*.[1-9]x.zst|*.man.zst|*.[1-9n].br|*.[1-9]x.br|*.man.br) case "$1" in *.gz) DECOMPRESSOR="gzip -dc" ;; *.bz2) DECOMPRESSOR="bzip2 -dc" ;; *.lz) DECOMPRESSOR="lzip -dc" ;; + *.zst) DECOMPRESSOR="zstd -dcq" ;; + *.br) DECOMPRESSOR="brotli -dc" ;; *.xz|*.lzma) DECOMPRESSOR="xz -dc" ;; esac if [ -n "$DECOMPRESSOR" ] && $DECOMPRESSOR -- "$1" | file - | grep -q troff; then @@ -73,6 +75,10 @@ case "$1" in *.xz|*.lzma) xz -dc -- "$1"; exit $? ;; *.tar.lz) tar --lzip -tvvf "$1"; exit $? ;; *.lz) lzip -dc -- "$1"; exit $? ;; +*.tar.zst) tar --zstd -tvvf "$1"; exit $? ;; +*.zst) zstd -dcq -- "$1"; exit $? ;; +*.tar.br) brotli -dc -- "$1" | tar tvvf -; exit $? ;; +*.br) brotli -dc -- "$1"; exit $? ;; *.tar.bz2|*.tbz2) bzip2 -dc -- "$1" | tar tvvf -; exit $? ;; *.[zZ]|*.gz) gzip -dc -- "$1"; exit $? ;; *.bz2) bzip2 -dc -- "$1"; exit $? ;;