xzless: better check the less version

Resolves: #1015924
Version: 5.1.2-8alpha
This commit is contained in:
Pavel Raiskup 2014-04-02 10:20:22 +02:00
parent 21e8be418c
commit c7e91236f6
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,13 @@
diff --git a/src/scripts/xzless.in b/src/scripts/xzless.in
index a3da697..288dd87 100644
--- a/src/scripts/xzless.in
+++ b/src/scripts/xzless.in
@@ -46,7 +46,7 @@ if test "${LESSMETACHARS+set}" != set; then
LESSMETACHARS="$space$tab$nl'"';*?"()<>[|&^`#\$%=~'
fi
-if test "$(less -V | { read ver && echo ${ver#less }; })" -ge 429; then
+if test "$(less -V | { read less ver re && echo ${ver}; })" -ge 429; then
# less 429 or later: LESSOPEN pipe will be used on
# standard input if $LESSOPEN begins with |-.
LESSOPEN="|-$xz -cdfq -- %s"

View File

@ -24,6 +24,11 @@ Patch0: xz-5.1.2alpha-man-page-day.patch
# ~> #850898
Patch1: xz-5.1.2alpha-xzgrep-and-h-option.patch
# fix less version checking
# ~> upstream (db5c1817fa, 9e6dabcf22)
# ~> #1015924
Patch2: xz-5.1.2alpha-less-version-check.patch
%description
XZ Utils are an attempt to make LZMA compression easy to use on free (as in
freedom) operating systems. This is achieved by providing tools and libraries
@ -78,6 +83,7 @@ commands that deal with the older LZMA format.
%setup -q -a1 -n %{name}-%{version}alpha
%patch0 -p1 -b .man-page-day
%patch1 -p1 -b .xzgrep-and-h-option
%patch2 -p1 -b .less-version-check
for i in `find . -name config.sub`; do
perl -pi -e "s/ppc64-\*/ppc64-\* \| ppc64p7-\*/" $i
@ -157,6 +163,7 @@ rm -rf %{buildroot}
%changelog
* Wed Apr 02 2014 Pavel Raiskup <praiskup@redhat.com> - 5.1.2-8alpha
- add _isa requirements where appropriate
- better check the version of less binary (#1015924)
* Fri Jan 10 2014 Pavel Raiskup <praiskup@redhat.com> - 5.1.2-7alpha
- build with -O3 on ppc64 (private #1051078)