Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/coreutils/, sys-apps/coreutils/files/
Date: Sun, 08 Mar 2020 01:19:05
Message-Id: 1583630281.693d9c9b8bbe2e33b4a6ba757fe6b969e25ee1bd.floppym@gentoo
1 commit: 693d9c9b8bbe2e33b4a6ba757fe6b969e25ee1bd
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 8 01:18:01 2020 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 8 01:18:01 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=693d9c9b
7
8 sys-apps/coreutils: restore ls behavior from 8.31
9
10 Closes: https://bugs.gentoo.org/711722
11 Package-Manager: Portage-2.3.92_p3, Repoman-2.3.20_p118
12 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
13
14 ...eutils-8.32.ebuild => coreutils-8.32-r1.ebuild} | 15 +++-
15 .../coreutils-8.32-ls-restore-8.31-behavior.patch | 94 ++++++++++++++++++++++
16 2 files changed, 105 insertions(+), 4 deletions(-)
17
18 diff --git a/sys-apps/coreutils/coreutils-8.32.ebuild b/sys-apps/coreutils/coreutils-8.32-r1.ebuild
19 similarity index 95%
20 rename from sys-apps/coreutils/coreutils-8.32.ebuild
21 rename to sys-apps/coreutils/coreutils-8.32-r1.ebuild
22 index af07c9b8cb1..392344c990c 100644
23 --- a/sys-apps/coreutils/coreutils-8.32.ebuild
24 +++ b/sys-apps/coreutils/coreutils-8.32-r1.ebuild
25 @@ -11,8 +11,11 @@ PATCH="${PN}-8.30-patches-01"
26 DESCRIPTION="Standard GNU utilities (chmod, cp, dd, ls, sort, tr, head, wc, who,...)"
27 HOMEPAGE="https://www.gnu.org/software/coreutils/"
28 SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
29 - mirror://gentoo/${PATCH}.tar.xz
30 - https://dev.gentoo.org/~polynomial-c/dist/${PATCH}.tar.xz"
31 + !vanilla? (
32 + mirror://gentoo/${PATCH}.tar.xz
33 + https://dev.gentoo.org/~polynomial-c/dist/${PATCH}.tar.xz
34 + )
35 +"
36
37 LICENSE="GPL-3"
38 SLOT="0"
39 @@ -62,11 +65,15 @@ pkg_setup() {
40 }
41
42 src_prepare() {
43 + local PATCHES=(
44 + "${FILESDIR}"/coreutils-8.32-ls-restore-8.31-behavior.patch
45 + )
46 +
47 if ! use vanilla ; then
48 - eapply "${WORKDIR}"/patch/*.patch
49 + PATCHES+=( "${WORKDIR}"/patch )
50 fi
51
52 - eapply_user
53 + default
54
55 # Since we've patched many .c files, the make process will try to
56 # re-build the manpages by running `./bin --help`. When doing a
57
58 diff --git a/sys-apps/coreutils/files/coreutils-8.32-ls-restore-8.31-behavior.patch b/sys-apps/coreutils/files/coreutils-8.32-ls-restore-8.31-behavior.patch
59 new file mode 100644
60 index 00000000000..62a35cd85ad
61 --- /dev/null
62 +++ b/sys-apps/coreutils/files/coreutils-8.32-ls-restore-8.31-behavior.patch
63 @@ -0,0 +1,94 @@
64 +From 10fcb97bd728f09d4a027eddf8ad2900f0819b0a Mon Sep 17 00:00:00 2001
65 +From: Paul Eggert <eggert@×××××××.edu>
66 +Date: Thu, 5 Mar 2020 17:25:29 -0800
67 +Subject: ls: restore 8.31 behavior on removed directories
68 +
69 +* src/ls.c: Do not include <sys/sycall.h>
70 +(print_dir): Don't worry about whether the directory is removed.
71 +* tests/ls/removed-directory.sh: Adjust to match new (i.e., old)
72 +behavior.
73 +
74 +diff --git a/src/ls.c b/src/ls.c
75 +index 24b983287..4acf5f44d 100644
76 +--- a/src/ls.c
77 ++++ b/src/ls.c
78 +@@ -49,10 +49,6 @@
79 + # include <sys/ptem.h>
80 + #endif
81 +
82 +-#ifdef __linux__
83 +-# include <sys/syscall.h>
84 +-#endif
85 +-
86 + #include <stdio.h>
87 + #include <assert.h>
88 + #include <setjmp.h>
89 +@@ -2896,7 +2892,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
90 + struct dirent *next;
91 + uintmax_t total_blocks = 0;
92 + static bool first = true;
93 +- bool found_any_entries = false;
94 +
95 + errno = 0;
96 + dirp = opendir (name);
97 +@@ -2972,7 +2967,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
98 + next = readdir (dirp);
99 + if (next)
100 + {
101 +- found_any_entries = true;
102 + if (! file_ignored (next->d_name))
103 + {
104 + enum filetype type = unknown;
105 +@@ -3018,22 +3012,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
106 + if (errno != EOVERFLOW)
107 + break;
108 + }
109 +-#ifdef __linux__
110 +- else if (! found_any_entries)
111 +- {
112 +- /* If readdir finds no directory entries at all, not even "." or
113 +- "..", then double check that the directory exists. */
114 +- if (syscall (SYS_getdents, dirfd (dirp), NULL, 0) == -1
115 +- && errno != EINVAL)
116 +- {
117 +- /* We exclude EINVAL as that pertains to buffer handling,
118 +- and we've passed NULL as the buffer for simplicity.
119 +- ENOENT is returned if appropriate before buffer handling. */
120 +- file_failure (command_line_arg, _("reading directory %s"), name);
121 +- }
122 +- break;
123 +- }
124 +-#endif
125 + else
126 + break;
127 +
128 +diff --git a/tests/ls/removed-directory.sh b/tests/ls/removed-directory.sh
129 +index e8c835dab..fe8f929a1 100755
130 +--- a/tests/ls/removed-directory.sh
131 ++++ b/tests/ls/removed-directory.sh
132 +@@ -26,20 +26,14 @@ case $host_triplet in
133 + *) skip_ 'non linux kernel' ;;
134 + esac
135 +
136 +-LS_FAILURE=2
137 +-
138 +-cat <<\EOF >exp-err || framework_failure_
139 +-ls: reading directory '.': No such file or directory
140 +-EOF
141 +-
142 + cwd=$(pwd)
143 + mkdir d || framework_failure_
144 + cd d || framework_failure_
145 + rmdir ../d || framework_failure_
146 +
147 +-returns_ $LS_FAILURE ls >../out 2>../err || fail=1
148 ++ls >../out 2>../err || fail=1
149 + cd "$cwd" || framework_failure_
150 + compare /dev/null out || fail=1
151 +-compare exp-err err || fail=1
152 ++compare /dev/null err || fail=1
153 +
154 + Exit $fail
155 +--
156 +cgit v1.2.1
157 +