diff --git a/community/coreutils/build b/community/coreutils/build new file mode 100755 index 0000000..343d90f --- /dev/null +++ b/community/coreutils/build @@ -0,0 +1,11 @@ +#!/bin/sh -e + +patch -p0 < ls.patch + +export CFLAGS="$CFLAGS -static" + +./configure \ + --prefix=/usr + +make +make DESTDIR="$1" install diff --git a/community/coreutils/checksums b/community/coreutils/checksums new file mode 100644 index 0000000..f9287e6 --- /dev/null +++ b/community/coreutils/checksums @@ -0,0 +1,2 @@ +4458d8de7849df44ccab15e16b1548b285224dbba5f08fac070c1c0e0bcc4cfa coreutils-8.32.tar.xz +b333ebef4bce552c6666c88e2a7507ce73d2cef24b7583625db7c933a4e3556e ls.patch diff --git a/community/coreutils/patches/ls.patch b/community/coreutils/patches/ls.patch new file mode 100644 index 0000000..ef07de7 --- /dev/null +++ b/community/coreutils/patches/ls.patch @@ -0,0 +1,84 @@ +diff --git src/ls.c src/ls.c +index 24b983287..4acf5f44d 100644 +--- src/ls.c ++++ src/ls.c +@@ -49,10 +49,6 @@ + # include + #endif + +-#ifdef __linux__ +-# include +-#endif +- + #include + #include + #include +@@ -2896,7 +2892,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg) + struct dirent *next; + uintmax_t total_blocks = 0; + static bool first = true; +- bool found_any_entries = false; + + errno = 0; + dirp = opendir (name); +@@ -2972,7 +2967,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg) + next = readdir (dirp); + if (next) + { +- found_any_entries = true; + if (! file_ignored (next->d_name)) + { + enum filetype type = unknown; +@@ -3018,22 +3012,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg) + if (errno != EOVERFLOW) + break; + } +-#ifdef __linux__ +- else if (! found_any_entries) +- { +- /* If readdir finds no directory entries at all, not even "." or +- "..", then double check that the directory exists. */ +- if (syscall (SYS_getdents, dirfd (dirp), NULL, 0) == -1 +- && errno != EINVAL) +- { +- /* We exclude EINVAL as that pertains to buffer handling, +- and we've passed NULL as the buffer for simplicity. +- ENOENT is returned if appropriate before buffer handling. */ +- file_failure (command_line_arg, _("reading directory %s"), name); +- } +- break; +- } +-#endif + else + break; + +diff --git tests/ls/removed-directory.sh tests/ls/removed-directory.sh +index e8c835dab..fe8f929a1 100755 +--- tests/ls/removed-directory.sh ++++ tests/ls/removed-directory.sh +@@ -26,20 +26,14 @@ case $host_triplet in + *) skip_ 'non linux kernel' ;; + esac + +-LS_FAILURE=2 +- +-cat <<\EOF >exp-err || framework_failure_ +-ls: reading directory '.': No such file or directory +-EOF +- + cwd=$(pwd) + mkdir d || framework_failure_ + cd d || framework_failure_ + rmdir ../d || framework_failure_ + +-returns_ $LS_FAILURE ls >../out 2>../err || fail=1 ++ls >../out 2>../err || fail=1 + cd "$cwd" || framework_failure_ + compare /dev/null out || fail=1 +-compare exp-err err || fail=1 ++compare /dev/null err || fail=1 + + Exit $fail +-- +2.24.0.375.geb5ae68d41 + diff --git a/community/coreutils/sources b/community/coreutils/sources new file mode 100644 index 0000000..dbe8139 --- /dev/null +++ b/community/coreutils/sources @@ -0,0 +1,2 @@ +https://ftp.gnu.org/gnu/coreutils/coreutils-8.32.tar.xz +patches/ls.patch diff --git a/community/coreutils/version b/community/coreutils/version new file mode 100644 index 0000000..381e198 --- /dev/null +++ b/community/coreutils/version @@ -0,0 +1 @@ +8.32 1