update to 8.32

This commit is contained in:
liquor 2020-07-29 13:51:18 +08:00
parent 06016a7efe
commit 6ff1b21a23
9 changed files with 520 additions and 372 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,17 @@
From 28499fa6b233ffe0db6f406b8210ab89c51ca9e8 Mon Sep 17 00:00:00 2001
From: openEuler Buildteam <buildteam@openeuler.org>
Date: Wed, 29 Jul 2020 11:59:54 +0800
Subject: [PATCH] bugfix remove usr local lib from m4
---
m4/getloadavg.m4 | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4 diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4
index c9f5a6d..e8f94dd 100644 index 8e96965..63782a2 100644
--- a/m4/getloadavg.m4 --- a/m4/getloadavg.m4
+++ b/m4/getloadavg.m4 +++ b/m4/getloadavg.m4
@@ -41,16 +41,6 @@ AC_CHECK_FUNC([getloadavg], [], @@ -41,18 +41,6 @@ AC_CHECK_FUNC([getloadavg], [],
[LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes]) [LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes])
fi fi
@ -10,7 +19,9 @@ index c9f5a6d..e8f94dd 100644
- # There is a commonly available library for RS/6000 AIX. - # There is a commonly available library for RS/6000 AIX.
- # Since it is not a standard part of AIX, it might be installed locally. - # Since it is not a standard part of AIX, it might be installed locally.
- gl_getloadavg_LIBS=$LIBS - gl_getloadavg_LIBS=$LIBS
- if test $cross_compiling != yes; then
- LIBS="-L/usr/local/lib $LIBS" - LIBS="-L/usr/local/lib $LIBS"
- fi
- AC_CHECK_LIB([getloadavg], [getloadavg], - AC_CHECK_LIB([getloadavg], [getloadavg],
- [LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes], - [LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes],
- [LIBS=$gl_getloadavg_LIBS]) - [LIBS=$gl_getloadavg_LIBS])
@ -19,3 +30,6 @@ index c9f5a6d..e8f94dd 100644
# Set up the replacement function if necessary. # Set up the replacement function if necessary.
if test $gl_func_getloadavg_done = no; then if test $gl_func_getloadavg_done = no; then
HAVE_GETLOADAVG=0 HAVE_GETLOADAVG=0
--
2.23.0

View File

@ -1,13 +1,21 @@
From 1e764c5b9a3eb9a73370dbcbc04c2462c31aaf45 Mon Sep 17 00:00:00 2001
From: openEuler Buildteam <buildteam@openeuler.org>
Date: Wed, 29 Jul 2020 11:55:45 +0800
Subject: [PATCH] bugfix selinux flask
---
m4/gnulib-comp.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 1401e52..e98db6f 100644 index dead90e..0abf0bd 100644
--- a/m4/gnulib-comp.m4 --- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4
@@ -1751,11 +1751,11 @@ AC_DEFUN([gl_INIT], @@ -1860,10 +1860,10 @@ AC_DEFUN([gl_INIT],
AC_LIBOBJ([select]) AC_LIBOBJ([select])
fi fi
gl_SYS_SELECT_MODULE_INDICATOR([select]) gl_SYS_SELECT_MODULE_INDICATOR([select])
- AC_CHECK_HEADERS([selinux/flask.h]) - AC_CHECK_HEADERS([selinux/flask.h])
AC_LIBOBJ([selinux-at])
gl_HEADERS_SELINUX_SELINUX_H gl_HEADERS_SELINUX_SELINUX_H
gl_HEADERS_SELINUX_CONTEXT_H gl_HEADERS_SELINUX_CONTEXT_H
if test "$with_selinux" != no && test "$ac_cv_header_selinux_selinux_h" = yes; then if test "$with_selinux" != no && test "$ac_cv_header_selinux_selinux_h" = yes; then
@ -15,3 +23,6 @@ index 1401e52..e98db6f 100644
AC_LIBOBJ([getfilecon]) AC_LIBOBJ([getfilecon])
fi fi
gl_SERVENT gl_SERVENT
--
2.23.0

Binary file not shown.

View File

@ -0,0 +1,164 @@
From b9f9ed14bda93ecb407129b69e6476813c250046 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 15 Apr 2020 20:50:32 -0700
Subject: [PATCH] fts: remove NOSTAT_LEAF_OPTIMIZATION
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
It caused find and du to dump core, and it was useful
only for obsolescent Linux filesystems anyway. Problem reported in:
https://lists.gnu.org/r/bug-gnulib/2020-04/msg00068.html
Quite possibly there is still a serious underlying fts bug with
tight-loop-check and mutating file systems, but if so this patch
should cause the bug to be triggered less often.
* lib/fts.c (enum leaf_optimization): Remove
NOSTAT_LEAF_OPTIMIZATION, as its problematic.
(S_MAGIC_REISERFS, S_MAGIC_XFS): Remove; no longer needed.
(leaf_optimization): Remove special cases for ReiserFS and XFS.
(fts_read): Remove NOSTAT_LEAF_OPTIMIZATION code.
* lib/fts_.h (struct _ftsent.fts_n_dirs_remaining):
Remove. All uses removed.
Upstream-commit: 47bf2cf3184027c1eb9c1dfeea5c5b8b2d69710d
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
lib/fts.c | 56 ++++++++-------------------------------------------
lib/fts_.h | 5 -----
2 files changed, 8 insertions(+), 53 deletions(-)
diff --git a/lib/fts.c b/lib/fts.c
index 1093ce5..dfe3fef 100644
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -445,7 +445,6 @@ fts_open (char * const *argv,
if ((parent = fts_alloc(sp, "", 0)) == NULL)
goto mem2;
parent->fts_level = FTS_ROOTPARENTLEVEL;
- parent->fts_n_dirs_remaining = -1;
}
/* The classic fts implementation would call fts_stat with
@@ -634,9 +633,8 @@ fts_close (FTS *sp)
}
/* Minimum link count of a traditional Unix directory. When leaf
- optimization is OK and MIN_DIR_NLINK <= st_nlink, then st_nlink is
- an upper bound on the number of subdirectories (counting "." and
- ".."). */
+ optimization is OK and a directory's st_nlink == MIN_DIR_NLINK,
+ then the directory has no subdirectories. */
enum { MIN_DIR_NLINK = 2 };
/* Whether leaf optimization is OK for a directory. */
@@ -645,12 +643,8 @@ enum leaf_optimization
/* st_nlink is not reliable for this directory's subdirectories. */
NO_LEAF_OPTIMIZATION,
- /* Leaf optimization is OK, but is not useful for avoiding stat calls. */
- OK_LEAF_OPTIMIZATION,
-
- /* Leaf optimization is not only OK: it is useful for avoiding
- stat calls, because dirent.d_type does not work. */
- NOSTAT_LEAF_OPTIMIZATION
+ /* st_nlink == 2 means the directory lacks subdirectories. */
+ OK_LEAF_OPTIMIZATION
};
#if (defined __linux__ || defined __ANDROID__) \
@@ -663,9 +657,7 @@ enum leaf_optimization
# define S_MAGIC_CIFS 0xFF534D42
# define S_MAGIC_NFS 0x6969
# define S_MAGIC_PROC 0x9FA0
-# define S_MAGIC_REISERFS 0x52654973
# define S_MAGIC_TMPFS 0x1021994
-# define S_MAGIC_XFS 0x58465342
# ifdef HAVE___FSWORD_T
typedef __fsword_t fsword;
@@ -786,23 +778,15 @@ dirent_inode_sort_may_be_useful (FTSENT const *p, int dir_fd)
}
/* Given an FTS entry P for a directory with descriptor DIR_FD,
- return true if it is both useful and valid to apply leaf optimization.
- The optimization is useful only for file systems that lack usable
- dirent.d_type info. The optimization is valid if an st_nlink value
- of at least MIN_DIR_NLINK is an upper bound on the number of
- subdirectories of D, counting "." and ".." as subdirectories.
+ return whether it is valid to apply leaf optimization.
+ The optimization is valid if a directory's st_nlink value equal
+ to MIN_DIR_NLINK means the directory has no subdirectories.
DIR_FD is negative if unavailable. */
static enum leaf_optimization
leaf_optimization (FTSENT const *p, int dir_fd)
{
switch (filesystem_type (p, dir_fd))
{
- /* List here the file system types that may lack usable dirent.d_type
- info, yet for which the optimization does apply. */
- case S_MAGIC_REISERFS:
- case S_MAGIC_XFS: /* XFS lacked it until 2013-08-22 commit. */
- return NOSTAT_LEAF_OPTIMIZATION;
-
case 0:
/* Leaf optimization is unsafe if the file system type is unknown. */
FALLTHROUGH;
@@ -1027,26 +1011,7 @@ check_for_dir:
if (p->fts_info == FTS_NSOK)
{
if (p->fts_statp->st_size == FTS_STAT_REQUIRED)
- {
- FTSENT *parent = p->fts_parent;
- if (parent->fts_n_dirs_remaining == 0
- && ISSET(FTS_NOSTAT)
- && ISSET(FTS_PHYSICAL)
- && (leaf_optimization (parent, sp->fts_cwd_fd)
- == NOSTAT_LEAF_OPTIMIZATION))
- {
- /* nothing more needed */
- }
- else
- {
- p->fts_info = fts_stat(sp, p, false);
- if (S_ISDIR(p->fts_statp->st_mode)
- && p->fts_level != FTS_ROOTLEVEL
- && 0 < parent->fts_n_dirs_remaining
- && parent->fts_n_dirs_remaining != (nlink_t) -1)
- parent->fts_n_dirs_remaining--;
- }
- }
+ p->fts_info = fts_stat(sp, p, false);
else
fts_assert (p->fts_statp->st_size == FTS_NO_STAT_REQUIRED);
}
@@ -1830,11 +1795,6 @@ err: memset(sbp, 0, sizeof(struct stat));
}
if (S_ISDIR(sbp->st_mode)) {
- p->fts_n_dirs_remaining
- = ((sbp->st_nlink < MIN_DIR_NLINK
- || p->fts_level <= FTS_ROOTLEVEL)
- ? -1
- : sbp->st_nlink - (ISSET (FTS_SEEDOT) ? 0 : MIN_DIR_NLINK));
if (ISDOT(p->fts_name)) {
/* Command-line "." and ".." are real directories. */
return (p->fts_level == FTS_ROOTLEVEL ? FTS_D : FTS_DOT);
diff --git a/lib/fts_.h b/lib/fts_.h
index d40a116..2e76cc4 100644
--- a/lib/fts_.h
+++ b/lib/fts_.h
@@ -227,11 +227,6 @@ typedef struct _ftsent {
size_t fts_namelen; /* strlen(fts_name) */
- /* If not (nlink_t) -1, an upper bound on the number of
- remaining subdirectories of interest. If this becomes
- zero, some work can be avoided. */
- nlink_t fts_n_dirs_remaining;
-
# define FTS_D 1 /* preorder directory */
# define FTS_DC 2 /* directory that causes cycles */
# define FTS_DEFAULT 3 /* none of the above */
--
2.21.1

View File

@ -0,0 +1,153 @@
From 8c022656320592dbad146f5d3a3ae1875f419446 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 5 Mar 2020 17:25:29 -0800
Subject: [PATCH 1/2] ls: restore 8.31 behavior on removed directories
* NEWS: Mention this.
* src/ls.c: Do not include <sys/sycall.h>
(print_dir): Don't worry about whether the directory is removed.
* tests/ls/removed-directory.sh: Adjust to match new (i.e., old)
behavior.
Upstream-commit: 10fcb97bd728f09d4a027eddf8ad2900f0819b0a
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
src/ls.c | 22 ----------------------
tests/ls/removed-directory.sh | 10 ++--------
2 files changed, 2 insertions(+), 30 deletions(-)
diff --git a/src/ls.c b/src/ls.c
index 9d25f62..850ecc2 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -49,10 +49,6 @@
# include <sys/ptem.h>
#endif
-#ifdef __linux__
-# include <sys/syscall.h>
-#endif
-
#include <stdio.h>
#include <assert.h>
#include <setjmp.h>
@@ -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 a/tests/ls/removed-directory.sh b/tests/ls/removed-directory.sh
index e8c835d..fe8f929 100755
--- a/tests/ls/removed-directory.sh
+++ b/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.21.1
From 847324a0debd9d12062c79e7a7a9d3d8ce76390d Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 7 Mar 2020 10:29:51 -0800
Subject: [PATCH 2/2] ls: improve removed-directory test
* tests/ls/removed-directory.sh: Remove host_triplet test.
Skip this test if one cannot remove the working directory.
From a suggestion by Bernhard Voelker (Bug#39929).
Upstream-commit: 672819c73f2e94e61386dc0584bddf9da860cc26
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
tests/ls/removed-directory.sh | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/tests/ls/removed-directory.sh b/tests/ls/removed-directory.sh
index fe8f929..63b209d 100755
--- a/tests/ls/removed-directory.sh
+++ b/tests/ls/removed-directory.sh
@@ -1,7 +1,7 @@
#!/bin/sh
-# If ls is asked to list a removed directory (e.g. the parent process's
-# current working directory that has been removed by another process), it
-# emits an error message.
+# If ls is asked to list a removed directory (e.g., the parent process's
+# current working directory has been removed by another process), it
+# should not emit an error message merely because the directory is removed.
# Copyright (C) 2020 Free Software Foundation, Inc.
@@ -21,15 +21,10 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ ls
-case $host_triplet in
- *linux*) ;;
- *) skip_ 'non linux kernel' ;;
-esac
-
cwd=$(pwd)
mkdir d || framework_failure_
cd d || framework_failure_
-rmdir ../d || framework_failure_
+rmdir ../d || skip_ "can't remove working directory on this platform"
ls >../out 2>../err || fail=1
cd "$cwd" || framework_failure_
--
2.21.1

BIN
coreutils-8.32.tar.xz Normal file

Binary file not shown.

View File

@ -21,7 +21,15 @@ diff --git a/lib/mgetgroups.c b/lib/mgetgroups.c
index 76474c2..0a9d221 100644 index 76474c2..0a9d221 100644
--- a/lib/mgetgroups.c --- a/lib/mgetgroups.c
+++ b/lib/mgetgroups.c +++ b/lib/mgetgroups.c
@@ -121,9 +121,17 @@ mgetgroups (char const *username, gid_t gid, gid_t **groups) @@ -31,6 +31,7 @@
#endif
#include "getugroups.h"
+#include "xalloc.h"
#include "xalloc-oversized.h"
/* Work around an incompatibility of OS X 10.11: getgrouplist
@@ -121,9 +122,17 @@ mgetgroups (char const *username, gid_t gid, gid_t **groups)
/* else no username, so fall through and use getgroups. */ /* else no username, so fall through and use getgroups. */
#endif #endif
@ -42,7 +50,7 @@ index 76474c2..0a9d221 100644
/* If we failed to count groups because there is no supplemental /* If we failed to count groups because there is no supplemental
group support, then return an array containing just GID. group support, then return an array containing just GID.
@@ -145,10 +153,25 @@ mgetgroups (char const *username, gid_t gid, gid_t **groups) @@ -145,10 +154,25 @@ mgetgroups (char const *username, gid_t gid, gid_t **groups)
if (g == NULL) if (g == NULL)
return -1; return -1;

View File

@ -1,6 +1,6 @@
Name: coreutils Name: coreutils
Version: 8.31 Version: 8.32
Release: 5 Release: 1
License: GPLv3+ License: GPLv3+
Summary: A set of basic GNU tools commonly used in shell scripts Summary: A set of basic GNU tools commonly used in shell scripts
Url: https://www.gnu.org/software/coreutils/ Url: https://www.gnu.org/software/coreutils/
@ -10,18 +10,22 @@ Source0: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
%global __requires_exclude ^%{_bindir}/coreutils$ %global __requires_exclude ^%{_bindir}/coreutils$
%global user `ls -ld $USR_SCONF|awk '{print $3}'` %global user `ls -ld $USR_SCONF|awk '{print $3}'`
Patch1: 0001-coreutils-8.31-i18n.patch Patch0: 0001-coreutils-8.31-i18n.patch
Patch2: 0001-disable-test-of-rwlock.patch Patch1: 0001-disable-test-of-rwlock.patch
# uname -p/-i to display processor type # uname -p/-i to display processor type
Patch3: coreutils-8.2-uname-processortype.patch Patch2: coreutils-8.2-uname-processortype.patch
# df --direct # df --direct
Patch4: coreutils-df-direct.patch Patch3: coreutils-df-direct.patch
Patch4: coreutils-getgrouplist.patch
Patch5: bugfix-remove-usr-local-lib-from-m4.patch Patch5: bugfix-remove-usr-local-lib-from-m4.patch
Patch6: bugfix-dummy_help2man.patch Patch6: bugfix-dummy_help2man.patch
Patch7: bugfix-selinux-flask.patch Patch7: bugfix-selinux-flask.patch
Patch8: skip-the-tests-that-require-selinux-if-selinux-is-di.patch Patch8: skip-the-tests-that-require-selinux-if-selinux-is-di.patch
Patch9: coreutils-8.32-ls-removed-dir.patch
Patch10: coreutils-8.32-leaf-opt-xfs.patch
Conflicts: filesystem < 3 Conflicts: filesystem < 3
# To avoid clobbering installs # To avoid clobbering installs
Provides: /bin/sh Provides: /bin/sh
@ -131,6 +135,9 @@ fi
%{_mandir}/man*/* %{_mandir}/man*/*
%changelog %changelog
* Wed Jul 29 2020 Liquor <lirui130@hauwei.com> - 8.32-1
- update to 8.32
* Thu Apr 30 2020 openEuler Buildteam <buildteam@openeuler.org> - 8.31-5 * Thu Apr 30 2020 openEuler Buildteam <buildteam@openeuler.org> - 8.31-5
- Judge if selinux is enabled for the tests that requires selinux - Judge if selinux is enabled for the tests that requires selinux