#1 add zstd and brotli support to lesspipe.sh
Opened 2 months ago by ajschorr. Modified 2 months ago
rpms/ ajschorr/less master  into  master

add zstd and brotli support to lesspipe.sh
Andrew J. Schorr • 2 months ago  
file modified
+4 -1

@@ -1,7 +1,7 @@ 

  Summary: A text file browser similar to more, but better

  Name: less

  Version: 550

- Release: 1%{?dist}

+ Release: 2%{?dist}

  License: GPLv3+ or BSD

  Source: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz

  Source1: lesspipe.sh

@@ -62,6 +62,9 @@ 

  %{_mandir}/man1/*

  

  %changelog

+ * Thu Jul 11 2019 Andrew Schorr <ajschorr@fedoraproject.org> - 5550-2

+ - Add zstd and brotli support to lesspipe.sh

+ 

  * Tue Jun 04 2019 Matej Mužila <mmuzila@redhat.com> - 550-1

  - Update to new upstream release

  - Resolves: #1674080

file modified
+7 -1

@@ -51,11 +51,13 @@ 

  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 @@ 

  *.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 $? ;;

patch lesspipe.sh to add support for zstd and brotli

Metadata