SHA256
1
0
forked from pool/grep

Accepting request 445548 from home:Andreas_Schwab:Factory

- testsuite.patch: remove
- proc-lseek-glitch.patch: work around proc lseek glitch

OBS-URL: https://build.opensuse.org/request/show/445548
OBS-URL: https://build.opensuse.org/package/show/Base:System/grep?expand=0&rev=75
This commit is contained in:
Andreas Schwab 2016-12-13 09:12:40 +00:00 committed by Git OBS Bridge
parent 234f2ddb7d
commit 35010bcd20
4 changed files with 53 additions and 37 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Dec 12 16:51:24 UTC 2016 - schwab@suse.de
- testsuite.patch: remove
- proc-lseek-glitch.patch: work around proc lseek glitch
-------------------------------------------------------------------
Wed Dec 7 14:25:49 UTC 2016 - schwab@suse.de

View File

@ -26,7 +26,7 @@ Url: http://www.gnu.org/software/grep/
Source0: http://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
Source2: http://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig
Source3: http://savannah.gnu.org/project/memberlist-gpgkeys.php?group=grep&download=1#/%{name}.keyring
Patch0: testsuite.patch
Patch1: proc-lseek-glitch.patch
BuildRequires: makeinfo
BuildRequires: pcre-devel
BuildRequires: xz
@ -45,7 +45,7 @@ the matching lines.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%if 0%{?suse_version} < 1120
echo "ac_cv_search_pcre_compile=\${ac_cv_search_pcre_compile=%{_libdir}/libpcre.a}" >config.cache
%endif

45
proc-lseek-glitch.patch Normal file
View File

@ -0,0 +1,45 @@
Index: grep-2.27/src/grep.c
===================================================================
--- grep-2.27.orig/src/grep.c
+++ grep-2.27/src/grep.c
@@ -1758,29 +1758,17 @@ drain_input (int fd, struct stat const *
static void
finalize_input (int fd, struct stat const *st, bool ineof)
{
- if (fd != STDIN_FILENO)
- return;
-
- if (outleft)
- {
- if (ineof)
- return;
- if (seek_failed)
- {
- if (drain_input (fd, st))
- return;
- }
- else if (0 <= lseek (fd, 0, SEEK_END))
- return;
- }
- else
- {
- if (seek_failed || bufoffset == after_last_match
- || 0 <= lseek (fd, after_last_match, SEEK_SET))
- return;
- }
-
- suppressible_error (errno);
+ if (fd == STDIN_FILENO
+ && (outleft
+ ? (!ineof
+ && (seek_failed
+ || (lseek (fd, 0, SEEK_END) < 0
+ /* Linux proc file system has EINVAL (Bug#25180). */
+ && errno != EINVAL))
+ && ! drain_input (fd, st))
+ : (bufoffset != after_last_match && !seek_failed
+ && lseek (fd, after_last_match, SEEK_SET) < 0)))
+ suppressible_error (errno);
}
static bool

View File

@ -1,35 +0,0 @@
From e938d22e2131972a6e9eaddbf850c6a04a4f750c Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Wed, 4 Nov 2015 10:57:07 -0800
Subject: [PATCH] tests: mark performance-related tests as expensive
These performance-related tests are slightly failure prone due to
varying system load during the two runs.
Marking these tests as "expensive" makes it so they are no longer run
via "make check". You can still run them via make "check-expensive".
This makes them less likely to be run by regular users.
* tests/long-pattern-perf: Use expensive_.
* tests/mb-non-UTF8-performance: Likewise.
Reported by Jaroslav Skarvada in http://debbugs.gnu.org/21826
and by Andreas Schwab in http://debbugs.gnu.org/21812.
---
tests/long-pattern-perf | 5 +++++
tests/mb-non-UTF8-performance | 5 +++++
2 files changed, 10 insertions(+)
Index: grep-2.24/tests/long-pattern-perf
===================================================================
--- grep-2.24.orig/tests/long-pattern-perf
+++ grep-2.24/tests/long-pattern-perf
@@ -25,6 +25,11 @@ fail=0
# "expensive", making it less likely to be run by regular users.
expensive_
+# This test is susceptible to failure due to differences in
+# system load during the two test runs, so we'll mark it as
+# "expensive", making it less likely to be run by regular users.
+expensive_
+
echo x > in || framework_failure_
# We could use seq -s '' (avoiding the tr filter), but I
# suspect some version of seq does not honor that option.