From 35010bcd202cd5256c935b671e24635e10b50e4e4fa179c7d86a93da6fe36ba8 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 13 Dec 2016 09:12:40 +0000 Subject: [PATCH] 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 --- grep.changes | 6 ++++++ grep.spec | 4 ++-- proc-lseek-glitch.patch | 45 +++++++++++++++++++++++++++++++++++++++++ testsuite.patch | 35 -------------------------------- 4 files changed, 53 insertions(+), 37 deletions(-) create mode 100644 proc-lseek-glitch.patch delete mode 100644 testsuite.patch diff --git a/grep.changes b/grep.changes index a594fe6..c807cbc 100644 --- a/grep.changes +++ b/grep.changes @@ -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 diff --git a/grep.spec b/grep.spec index b9a5aca..64c5160 100644 --- a/grep.spec +++ b/grep.spec @@ -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 diff --git a/proc-lseek-glitch.patch b/proc-lseek-glitch.patch new file mode 100644 index 0000000..e337685 --- /dev/null +++ b/proc-lseek-glitch.patch @@ -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 diff --git a/testsuite.patch b/testsuite.patch deleted file mode 100644 index 5513cf3..0000000 --- a/testsuite.patch +++ /dev/null @@ -1,35 +0,0 @@ -From e938d22e2131972a6e9eaddbf850c6a04a4f750c Mon Sep 17 00:00:00 2001 -From: Jim Meyering -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.