From 17dae2cc2e353a7b90b4461356bdedad0e319d01 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Wed, 14 Aug 2024 21:14:00 +0800 Subject: [PATCH] do not use bashisms in lesspipe.sh --- less.spec | 5 ++++- lesspipe.sh | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/less.spec b/less.spec index 52c7089..cca0d14 100644 --- a/less.spec +++ b/less.spec @@ -1,6 +1,6 @@ Name: less Version: 661 -Release: 1 +Release: 2 Summary: Less is a pager that displays text files. License: GPL-3.0-only and BSD-2-Clause URL: http://www.greenwoodsoftware.com/less @@ -51,6 +51,9 @@ install -p -m 644 %{S:3} %{buildroot}%{_sysconfdir}/profile.d %{_mandir}/man1/* %changelog +* Wed Aug 14 2024 Funda Wang - 661-2 +- do not use bashisms in lesspipe.sh + * Sun Jul 14 2024 Funda Wang - 661-1 - Update to 661 - add lesspipe as most other distros do diff --git a/lesspipe.sh b/lesspipe.sh index f2df6a1..71b75c7 100644 --- a/lesspipe.sh +++ b/lesspipe.sh @@ -63,12 +63,16 @@ case "$1" in if [ -n "$DECOMPRESSOR" ] && $DECOMPRESSOR -- "$1" | file - | grep -q troff; then $DECOMPRESSOR -- "$1" | manfilter - exit $? - fi ;;& + fi +esac +case "$1" in *.[1-9n]|*.[1-9]x|*.man) if file "$1" | grep -q troff; then manfilter "$1" exit $? - fi ;;& + fi +esac +case "$1" in *.tar) tar tvvf "$1"; exit $? ;; *.tgz|*.tar.gz|*.tar.[zZ]) tar tzvvf "$1"; exit $? ;; *.tar.xz) tar Jtvvf "$1"; exit $? ;; -- Gitee