Skip to content
This repository was archived by the owner on Oct 11, 2021. It is now read-only.

Commit 9a7272f

Browse files
committed
Add coreutils with patch.
1 parent 63c26cc commit 9a7272f

File tree

5 files changed

+100
-0
lines changed

5 files changed

+100
-0
lines changed

community/coreutils/build

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh -e
2+
3+
patch -p0 < ls.patch
4+
5+
export CFLAGS="$CFLAGS -static"
6+
7+
./configure \
8+
--prefix=/usr
9+
10+
make
11+
make DESTDIR="$1" install

community/coreutils/checksums

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
4458d8de7849df44ccab15e16b1548b285224dbba5f08fac070c1c0e0bcc4cfa coreutils-8.32.tar.xz
2+
b333ebef4bce552c6666c88e2a7507ce73d2cef24b7583625db7c933a4e3556e ls.patch

community/coreutils/patches/ls.patch

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
diff --git src/ls.c src/ls.c
2+
index 24b983287..4acf5f44d 100644
3+
--- src/ls.c
4+
+++ src/ls.c
5+
@@ -49,10 +49,6 @@
6+
# include <sys/ptem.h>
7+
#endif
8+
9+
-#ifdef __linux__
10+
-# include <sys/syscall.h>
11+
-#endif
12+
-
13+
#include <stdio.h>
14+
#include <assert.h>
15+
#include <setjmp.h>
16+
@@ -2896,7 +2892,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
17+
struct dirent *next;
18+
uintmax_t total_blocks = 0;
19+
static bool first = true;
20+
- bool found_any_entries = false;
21+
22+
errno = 0;
23+
dirp = opendir (name);
24+
@@ -2972,7 +2967,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
25+
next = readdir (dirp);
26+
if (next)
27+
{
28+
- found_any_entries = true;
29+
if (! file_ignored (next->d_name))
30+
{
31+
enum filetype type = unknown;
32+
@@ -3018,22 +3012,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
33+
if (errno != EOVERFLOW)
34+
break;
35+
}
36+
-#ifdef __linux__
37+
- else if (! found_any_entries)
38+
- {
39+
- /* If readdir finds no directory entries at all, not even "." or
40+
- "..", then double check that the directory exists. */
41+
- if (syscall (SYS_getdents, dirfd (dirp), NULL, 0) == -1
42+
- && errno != EINVAL)
43+
- {
44+
- /* We exclude EINVAL as that pertains to buffer handling,
45+
- and we've passed NULL as the buffer for simplicity.
46+
- ENOENT is returned if appropriate before buffer handling. */
47+
- file_failure (command_line_arg, _("reading directory %s"), name);
48+
- }
49+
- break;
50+
- }
51+
-#endif
52+
else
53+
break;
54+
55+
diff --git tests/ls/removed-directory.sh tests/ls/removed-directory.sh
56+
index e8c835dab..fe8f929a1 100755
57+
--- tests/ls/removed-directory.sh
58+
+++ tests/ls/removed-directory.sh
59+
@@ -26,20 +26,14 @@ case $host_triplet in
60+
*) skip_ 'non linux kernel' ;;
61+
esac
62+
63+
-LS_FAILURE=2
64+
-
65+
-cat <<\EOF >exp-err || framework_failure_
66+
-ls: reading directory '.': No such file or directory
67+
-EOF
68+
-
69+
cwd=$(pwd)
70+
mkdir d || framework_failure_
71+
cd d || framework_failure_
72+
rmdir ../d || framework_failure_
73+
74+
-returns_ $LS_FAILURE ls >../out 2>../err || fail=1
75+
+ls >../out 2>../err || fail=1
76+
cd "$cwd" || framework_failure_
77+
compare /dev/null out || fail=1
78+
-compare exp-err err || fail=1
79+
+compare /dev/null err || fail=1
80+
81+
Exit $fail
82+
--
83+
2.24.0.375.geb5ae68d41
84+

community/coreutils/sources

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
https://ftp.gnu.org/gnu/coreutils/coreutils-8.32.tar.xz
2+
patches/ls.patch

community/coreutils/version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8.32 1

0 commit comments

Comments
 (0)