diff --git a/less.csh b/less.csh index ba2b82b..c3dae53 100755 --- a/less.csh +++ b/less.csh @@ -1,4 +1,8 @@ # less initialization script (csh) if ( -x /usr/bin/lesspipe.sh ) then - setenv LESSOPEN "||/usr/bin/lesspipe.sh %s" + if ( $?LESSOPEN && { eval 'test ! -z $LESSOPEN' }) then + setenv LESSOPEN "$LESSOPEN | /usr/bin/lesspipe.sh %s" + else + setenv LESSOPEN "/usr/bin/lesspipe.sh %s" + endif endif diff --git a/less.sh b/less.sh index 14f6fde..c8066ec 100755 --- a/less.sh +++ b/less.sh @@ -1,2 +1,9 @@ +#!/bin/sh # less initialization script (sh) -[ -x /usr/bin/lesspipe.sh ] && export LESSOPEN="${LESSOPEN-||/usr/bin/lesspipe.sh %s}" +if [ -x /usr/bin/lesspipe.sh ]; then + if [ -z "$LESSOPEN" ]; then + export LESSOPEN="/usr/bin/lesspipe.sh %s" + else + export LESSOPEN="$LESSOPEN | /usr/bin/lesspipe.sh %s" + fi +fi diff --git a/less.spec b/less.spec index 3c4acd2..eb34fb2 100644 --- a/less.spec +++ b/less.spec @@ -8,6 +8,7 @@ Source: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz Source1: lesspipe.sh Source2: less.sh Source3: less.csh +Source4: less.zsh Patch1: less-444-Foption.v2.patch Patch2: less-394-search.patch Patch4: less-394-time.patch @@ -59,6 +60,7 @@ mkdir -p $RPM_BUILD_ROOT/etc/profile.d install -p %{SOURCE1} $RPM_BUILD_ROOT/%{_bindir} install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT/etc/profile.d install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d +install -p -m 644 %{SOURCE4} $RPM_BUILD_ROOT/etc/profile.d %files %doc README NEWS INSTALL COPYING @@ -68,9 +70,10 @@ install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d %{_mandir}/man1/* %changelog -* Mon Aug 03 2015 Viktor Jancik - 479-2 +* Mon Aug 21 2015 Viktor Jancik - 479-2 - Updated spec file to comply with current Fedora Packaging Guidelines Added missing documentation files +- Fixed less profile.d scripts * Tue Jul 07 2015 Fedora Release Monitoring - 479-1 - Update to 479 (#1240456) diff --git a/less.zsh b/less.zsh new file mode 100755 index 0000000..7949583 --- /dev/null +++ b/less.zsh @@ -0,0 +1,11 @@ +#!/bin/zsh +# less initialization script (sh) +if [[ -x /usr/bin/lesspipe.sh ]] ; then + if [[ -z "$LESSOPEN" ]] ; then + export LESSOPEN="/usr/bin/lesspipe.sh %s" + else + export LESSOPEN="$LESSOPEN | /usr/bin/lesspipe.sh %s" + fi +fi + +echo $LESSOPEN