Fixed profile.d less init scripts

This commit is contained in:
Viktor Jancik 2015-08-21 22:16:14 +02:00
parent 396e286dd3
commit 3f003aa67c
4 changed files with 28 additions and 3 deletions

View File

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

View File

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

View File

@ -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 <vjancik@redhat.com> - 479-2
* Mon Aug 21 2015 Viktor Jancik <vjancik@redhat.com> - 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 <release-monitoring@fedoraproject.org> - 479-1
- Update to 479 (#1240456)

11
less.zsh Executable file
View File

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