Update to latest version (#1919119)

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
This commit is contained in:
Stephen Gallagher 2021-01-22 09:53:58 -05:00
parent 2183298a17
commit f8ee9b5849
No known key found for this signature in database
GPG Key ID: 45DB85A568286D11
3 changed files with 69 additions and 40 deletions

View File

@ -1,38 +0,0 @@
diff -ur less-418.orig/configure.ac less-418/configure.ac
--- less-418.orig/configure.ac 2008-12-22 07:10:44.000000000 -0500
+++ less-418/configure.ac 2008-12-22 07:28:58.000000000 -0500
@@ -203,6 +203,8 @@
[Define HAVE_TIME_T if your system supports the "time_t" type.])
AH_TEMPLATE([HAVE_STRERROR],
[Define HAVE_STRERROR if you have the strerror() function.])
+AH_TEMPLATE([HAVE_FSYNC],
+ [Define HAVE_FSYNC if fsync() on a tty works.])
AH_TEMPLATE([HAVE_FILENO],
[Define HAVE_FILENO if you have the fileno() macro.])
AH_TEMPLATE([HAVE_ERRNO],
@@ -251,7 +253,7 @@
# Checks for library functions.
AC_TYPE_SIGNAL
-AC_CHECK_FUNCS([fsync popen _setjmp sigprocmask sigsetmask snprintf stat system fchmod realpath])
+AC_CHECK_FUNCS([popen _setjmp sigprocmask sigsetmask snprintf stat system fchmod realpath])
# AC_CHECK_FUNCS may not work for inline functions, so test these separately.
AC_MSG_CHECKING(for memcpy)
@@ -298,6 +300,16 @@
#endif], [static char *x; x = strerror(0);],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRERROR)], [AC_MSG_RESULT(no)])
+AC_MSG_CHECKING(for fsync)
+AC_TRY_RUN([
+#include <fcntl.h>
+#include <unistd.h>
+int main(void)
+{
+ int fd = open("/dev/tty", O_RDWR);
+ return fsync(fd);
+}], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FSYNC)], [AC_MSG_RESULT(no)])
+
AC_MSG_CHECKING(for sys_errlist)
AC_TRY_LINK(, [extern char *sys_errlist[]; static char **x; x = sys_errlist;],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST)], [AC_MSG_RESULT(no)])

64
less-475-fsync.patch Normal file
View File

@ -0,0 +1,64 @@
From 5396b6b77d0248678f716038dc747d6898acb0b3 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Fri, 22 Jan 2021 09:49:13 -0500
Subject: [PATCH] Test for fsync on tty
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
---
configure.ac | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 918807967473e01af6c5d78b1737c2d06f96b426..ce478adc1ea2d37c2b22eb46fc2b55d2ba49244e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -219,10 +219,12 @@ AH_TEMPLATE([HAVE_STAT_INO],
[Define HAVE_STAT_INO if your struct stat has st_ino and st_dev.])
AH_TEMPLATE([HAVE_TIME_T],
[Define HAVE_TIME_T if your system supports the "time_t" type.])
AH_TEMPLATE([HAVE_STRERROR],
[Define HAVE_STRERROR if you have the strerror() function.])
+AH_TEMPLATE([HAVE_FSYNC],
+ [Define HAVE_FSYNC if fsync() on a tty works.])
AH_TEMPLATE([HAVE_FILENO],
[Define HAVE_FILENO if you have the fileno() macro.])
AH_TEMPLATE([HAVE_ERRNO],
[Define HAVE_ERRNO if you have the errno variable.])
AH_TEMPLATE([MUST_DEFINE_ERRNO],
@@ -272,11 +274,11 @@ AC_MSG_CHECKING(for ANSI function prototypes)
AC_TRY_COMPILE([], [int f(int a) { return a; }],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ANSI_PROTOS)], [AC_MSG_RESULT(no)])
# Checks for library functions.
AC_TYPE_SIGNAL
-AC_CHECK_FUNCS([fchmod fsync nanosleep poll popen realpath _setjmp sigprocmask sigsetmask snprintf stat system usleep])
+AC_CHECK_FUNCS([fchmod nanosleep poll popen realpath _setjmp sigprocmask sigsetmask snprintf stat system usleep])
# AC_CHECK_FUNCS may not work for inline functions, so test these separately.
AC_MSG_CHECKING(for memcpy)
AC_TRY_LINK([
#if HAVE_STRING_H
@@ -319,10 +321,20 @@ AC_TRY_LINK([
#if HAVE_ERRNO_H
#include <errno.h>
#endif], [static char *x; x = strerror(0);],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRERROR)], [AC_MSG_RESULT(no)])
+AC_MSG_CHECKING(for fsync)
+AC_TRY_RUN([
+#include <fcntl.h>
+#include <unistd.h>
+int main(void)
+{
+ int fd = open("/dev/tty", O_RDWR);
+ return fsync(fd);
+}], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FSYNC)], [AC_MSG_RESULT(no)])
+
AC_MSG_CHECKING(for sys_errlist)
AC_TRY_LINK(, [extern char *sys_errlist[]; static char **x; x = sys_errlist;],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST)], [AC_MSG_RESULT(no)])
AC_CHECK_TYPES([sigset_t],,,[#include <signal.h>])
--
2.29.2

View File

@ -1,6 +1,6 @@
Summary: A text file browser similar to more, but better
Name: less
Version: 568
Version: 575
Release: 1%{?dist}
License: GPLv3+ or BSD
Source0: https://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz
@ -8,7 +8,7 @@ Source1: lesspipe.sh
Source2: less.sh
Source3: less.csh
Patch4: less-394-time.patch
Patch5: less-418-fsync.patch
Patch5: less-475-fsync.patch
Patch6: less-436-manpage-add-old-bot-option.patch
Patch7: less-436-help.patch
Patch8: less-458-lessecho-usage.patch
@ -63,6 +63,9 @@ install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d
%{_mandir}/man1/*
%changelog
* Fri Jan 22 2021 Stephen Gallagher <sgallagh@redhat.com> - 575-1
- Update to latest version (#1919119)
* Mon Nov 30 2020 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 568-1
- Update to latest version (#1818534)