From d1e520db96ab414da01b348aeef94b9e06d7e1721b14fc3dda0501074a4f2cd1 Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Sun, 30 Aug 2015 22:45:45 +0000 Subject: [PATCH] Accepting request 328052 from home:berny:branches:Base:System - coreutils-tests-avoid-FP-of-ls-stat-free-color.patch: Add upstream patch on top of v8.24 to avoid a FP test failure with glibc>=2.22. OBS-URL: https://build.opensuse.org/request/show/328052 OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=265 --- ...tests-avoid-FP-of-ls-stat-free-color.patch | 84 +++++++++++++++++++ coreutils-testsuite.changes | 6 ++ coreutils-testsuite.spec | 5 ++ coreutils.changes | 6 ++ coreutils.spec | 5 ++ 5 files changed, 106 insertions(+) create mode 100644 coreutils-tests-avoid-FP-of-ls-stat-free-color.patch diff --git a/coreutils-tests-avoid-FP-of-ls-stat-free-color.patch b/coreutils-tests-avoid-FP-of-ls-stat-free-color.patch new file mode 100644 index 0000000..39b00a9 --- /dev/null +++ b/coreutils-tests-avoid-FP-of-ls-stat-free-color.patch @@ -0,0 +1,84 @@ +Upstream patch on top of v8.24 to avoid a FP test failure with glibc>=2.22: + http://git.sv.gnu.org/cgit/coreutils.git/commit/?id=fd5f2b1569 +Patch to be removed with v8.25. + +From fd5f2b1569e2e0b31be755e14e236a7a02478fc0 Mon Sep 17 00:00:00 2001 +From: Bernhard Voelker +Date: Sun, 30 Aug 2015 22:49:35 +0200 +Subject: [PATCH] tests: avoid FP of ls/stat-free-color.sh with newer glibc + +Since glibc-2.22, specifically commit [0], the opendir() implementation +implicitly makes an additional stat call thus leading to a FP. +Seen on openSUSE:Tumbleweed since snapshot 20150821. + +[0] +https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=46f894d8c60a + +* tests/ls/stat-free-color.sh: Change the test to verify that ls(1) +needs the same number of stat-like calls for a single, empty directory +argument as for one with a few directory entries (sub-directory, +regular file, symlink, etc.). +--- + tests/ls/stat-free-color.sh | 39 ++++++++++++++++++++++++--------------- + 1 file changed, 24 insertions(+), 15 deletions(-) + +Index: tests/ls/stat-free-color.sh +=================================================================== +--- tests/ls/stat-free-color.sh.orig ++++ tests/ls/stat-free-color.sh +@@ -27,8 +27,6 @@ stats='stat,lstat,stat64,lstat64,newfsta + require_strace_ $stats + require_dirent_d_type_ + +-ln -s nowhere dangle || framework_failure_ +- + # Disable enough features via LS_COLORS so that ls --color + # can do its job without calling stat (other than the obligatory + # one-call-per-command-line argument). +@@ -54,22 +52,33 @@ EOF + eval $(dircolors -b color-without-stat) + + # The system may perform additional stat-like calls before main. +-# To avoid counting those, first get a baseline count by running +-# ls with only the --help option. Then, compare that with the ++# Furthermore, underlying library functions may also implicitly ++# add an extra stat call, e.g. opendir since glibc-2.21-360-g46f894d. ++# To avoid counting those, first get a baseline count for running ++# ls with one empty directory argument. Then, compare that with the + # invocation under test. +-strace -o log-help -e $stats ls --help >/dev/null || fail=1 +-n_lines_help=$(wc -l < log-help) ++mkdir d || framework_failure_ + +-strace -o log -e $stats ls --color=always . || fail=1 +-n_lines=$(wc -l < log) ++strace -o log1 -e $stats ls --color=always d || fail=1 ++n_stat1=$(wc -l < log1) || framework_failure_ + +-n_stat=$(expr $n_lines - $n_lines_help) ++test $n_stat1 = 0 \ ++ && skip_ 'No stat calls recognized on this platform' + +-# Expect one stat call. +-case $n_stat in +- 0) skip_ 'No stat calls recognized on this platform' ;; +- 1) ;; # Corresponding to stat(".") +- *) fail=1; head -n30 log* ;; +-esac ++# Populate the test directory. ++mkdir d/subdir \ ++ && touch d/regf \ ++ && ln d/regf d/hlink \ ++ && ln -s regf d/slink \ ++ && ln -s nowhere d/dangle \ ++ || framework_failure_ ++ ++# Invocation under test. ++strace -o log2 -e $stats ls --color=always d || fail=1 ++n_stat2=$(wc -l < log2) || framework_failure_ ++ ++# Expect the same number of stat calls. ++test $n_stat1 = $n_stat2 \ ++ || { fail=1; head -n30 log*; } + + Exit $fail diff --git a/coreutils-testsuite.changes b/coreutils-testsuite.changes index ba5d7f7..85d6096 100644 --- a/coreutils-testsuite.changes +++ b/coreutils-testsuite.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Aug 30 21:52:13 UTC 2015 - mail@bernhard-voelker.de + +- coreutils-tests-avoid-FP-of-ls-stat-free-color.patch: Add upstream +patch on top of v8.24 to avoid a FP test failure with glibc>=2.22. + ------------------------------------------------------------------- Thu Jul 16 01:28:36 UTC 2015 - mail@bernhard-voelker.de diff --git a/coreutils-testsuite.spec b/coreutils-testsuite.spec index d8cf7e1..c370d5c 100644 --- a/coreutils-testsuite.spec +++ b/coreutils-testsuite.spec @@ -128,6 +128,8 @@ Patch303: coreutils-tests-shorten-extreme-factor-tests.patch Patch500: coreutils-disable_tests.patch Patch501: coreutils-test_without_valgrind.patch +Patch600: coreutils-tests-avoid-FP-of-ls-stat-free-color.patch + # ================================================ %description These are the GNU core utilities. This package is the union of @@ -170,6 +172,9 @@ the GNU fileutils, sh-utils, and textutils packages. %patch500 %patch501 +# Upstream patch on top of v8.24 to fix a FP test failure with glibc>=2.22. +%patch600 + #???## We need to statically link to gmp, otherwise we have a build loop #???#sed -i s,'$(LIB_GMP)',%%{_libdir}/libgmp.a,g Makefile.in diff --git a/coreutils.changes b/coreutils.changes index ba5d7f7..85d6096 100644 --- a/coreutils.changes +++ b/coreutils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Aug 30 21:52:13 UTC 2015 - mail@bernhard-voelker.de + +- coreutils-tests-avoid-FP-of-ls-stat-free-color.patch: Add upstream +patch on top of v8.24 to avoid a FP test failure with glibc>=2.22. + ------------------------------------------------------------------- Thu Jul 16 01:28:36 UTC 2015 - mail@bernhard-voelker.de diff --git a/coreutils.spec b/coreutils.spec index 2d4f81f..08ca9b0 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -128,6 +128,8 @@ Patch303: coreutils-tests-shorten-extreme-factor-tests.patch Patch500: coreutils-disable_tests.patch Patch501: coreutils-test_without_valgrind.patch +Patch600: coreutils-tests-avoid-FP-of-ls-stat-free-color.patch + # ================================================ %description These are the GNU core utilities. This package is the union of @@ -170,6 +172,9 @@ the GNU fileutils, sh-utils, and textutils packages. %patch500 %patch501 +# Upstream patch on top of v8.24 to fix a FP test failure with glibc>=2.22. +%patch600 + #???## We need to statically link to gmp, otherwise we have a build loop #???#sed -i s,'$(LIB_GMP)',%%{_libdir}/libgmp.a,g Makefile.in