From 4e0b4397a0025cbd16d8a657d1bc4c2ba6453f16 Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Tue, 15 Dec 2020 22:58:56 +0800 Subject: [PATCH 1/4] [patch tracking] 20201215225849748592 - https://github.com/coreutils/coreutils/commit/b0d527fb40bd7a36ab90af891a1934daff1f3475 --- ...27fb40bd7a36ab90af891a1934daff1f3475.patch | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 b0d527fb40bd7a36ab90af891a1934daff1f3475.patch diff --git a/b0d527fb40bd7a36ab90af891a1934daff1f3475.patch b/b0d527fb40bd7a36ab90af891a1934daff1f3475.patch new file mode 100644 index 0000000..b695d34 --- /dev/null +++ b/b0d527fb40bd7a36ab90af891a1934daff1f3475.patch @@ -0,0 +1,63 @@ +diff --git a/src/nl.c b/src/nl.c +index 959909f05..a1b38a7e2 100644 +--- a/src/nl.c ++++ b/src/nl.c +@@ -54,7 +54,7 @@ static char const FORMAT_RIGHT_LZ[] = "%0*" PRIdMAX "%s"; + static char const FORMAT_LEFT[] = "%-*" PRIdMAX "%s"; + + /* Default section delimiter characters. */ +-static char const DEFAULT_SECTION_DELIMITERS[] = "\\:"; ++static char DEFAULT_SECTION_DELIMITERS[] = "\\:"; + + /* Types of input lines: either one of the section delimiters, + or text to output. */ +@@ -96,7 +96,7 @@ static struct re_pattern_buffer *current_regex = NULL; + static char const *separator_str = "\t"; + + /* Input section delimiter string (-d). */ +-static char const *section_del = DEFAULT_SECTION_DELIMITERS; ++static char *section_del = DEFAULT_SECTION_DELIMITERS; + + /* Header delimiter string. */ + static char *header_del = NULL; +@@ -388,7 +388,8 @@ check_section (void) + { + size_t len = line_buf.length - 1; + +- if (len < 2 || memcmp (line_buf.buffer, section_del, 2)) ++ if (len < 2 || footer_del_len < 2 ++ || memcmp (line_buf.buffer, section_del, 2)) + return Text; + if (len == header_del_len + && !memcmp (line_buf.buffer, header_del, header_del_len)) +@@ -553,7 +554,14 @@ main (int argc, char **argv) + } + break; + case 'd': +- section_del = optarg; ++ if (strlen (optarg) == 2) /* POSIX. */ ++ { ++ char *p = section_del; ++ while (*optarg) ++ *p++ = *optarg++; ++ } ++ else ++ section_del = optarg; /* GNU extension. */ + break; + case_GETOPT_HELP_CHAR; + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); +@@ -574,12 +582,10 @@ main (int argc, char **argv) + stpcpy (stpcpy (stpcpy (header_del, section_del), section_del), section_del); + + body_del_len = len * 2; +- body_del = xmalloc (body_del_len + 1); +- stpcpy (stpcpy (body_del, section_del), section_del); ++ body_del = header_del + len; + + footer_del_len = len; +- footer_del = xmalloc (footer_del_len + 1); +- stpcpy (footer_del, section_del); ++ footer_del = body_del + len; + + /* Initialize the input buffer. */ + initbuffer (&line_buf); -- Gitee From c06695f57161870ea60084c3ada9141c174614ce Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Tue, 15 Dec 2020 22:58:57 +0800 Subject: [PATCH 2/4] [patch tracking] 20201215225849748592 - https://github.com/coreutils/coreutils/commit/1935528ce9eba1df285dc05fbb8cf3c083334078 --- ...528ce9eba1df285dc05fbb8cf3c083334078.patch | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 1935528ce9eba1df285dc05fbb8cf3c083334078.patch diff --git a/1935528ce9eba1df285dc05fbb8cf3c083334078.patch b/1935528ce9eba1df285dc05fbb8cf3c083334078.patch new file mode 100644 index 0000000..c81c6ae --- /dev/null +++ b/1935528ce9eba1df285dc05fbb8cf3c083334078.patch @@ -0,0 +1,71 @@ +diff --git a/doc/coreutils.texi b/doc/coreutils.texi +index 5ac3745bd..df0655c20 100644 +--- a/doc/coreutils.texi ++++ b/doc/coreutils.texi +@@ -1805,9 +1805,9 @@ start of body; + start of footer. + @end table + +-The two characters from which these strings are made can be changed from +-@samp{\} and @samp{:} via options (see below), but the pattern and +-length of each string cannot be changed. ++The characters from which these strings are made can be changed from ++@samp{\} and @samp{:} via options (see below), but the pattern ++of each string cannot be changed. + + A section delimiter is replaced by an empty line on output. Any text + that comes before the first section delimiter string in the input file +@@ -1847,6 +1847,9 @@ expression @var{bre}. + @cindex section delimiters of pages + Set the section delimiter characters to @var{cd}; default is + @samp{\:}. If only @var{c} is given, the second remains @samp{:}. ++As a GNU extension more than two characters can be specified, ++and also if @var{cd} is empty (@option{-d ''}), then section ++matching is disabled. + (Remember to protect @samp{\} or other metacharacters from shell + expansion with quotes or extra backslashes.) + +diff --git a/src/nl.c b/src/nl.c +index a1b38a7e2..23219b609 100644 +--- a/src/nl.c ++++ b/src/nl.c +@@ -211,7 +211,9 @@ Write each FILE to standard output, with line numbers added.\n\ + Default options are: -bt -d'\\:' -fn -hn -i1 -l1 -n'rn' -s -v1 -w6\n\ + \n\ + CC are two delimiter characters used to construct logical page delimiters;\n\ +-a missing second character implies ':'.\n\ ++a missing second character implies ':'. As a GNU extension one can specify\n\ ++more than two characters, and also specifying the empty string (-d '')\n\ ++disables section matching.\n\ + "), stdout); + fputs (_("\ + \n\ +diff --git a/tests/misc/nl.sh b/tests/misc/nl.sh +index fd9c5326c..0d57f3443 100755 +--- a/tests/misc/nl.sh ++++ b/tests/misc/nl.sh +@@ -79,4 +79,24 @@ compare exp out || fail=1 + printf '%s\n' a b c > in.txt || framework_failure_ + returns_ 1 nl -v$INTMAX_MAX -i$INTMAX_MIN in.txt > out || fail=1 + ++# Test GNU extension to --section-delimiter, of disabling section matching ++printf '%s\n' a '\:\:' c > in.txt || framework_failure_ ++nl -d '' in.txt > out || fail=1 ++cat <<\EOF > exp ++ 1 a ++ 2 \:\: ++ 3 c ++EOF ++compare exp out || fail=1 ++ ++# Test GNU extension to --section-delimiter, of supporting strings longer than 2 ++printf '%s\n' a foofoo c > in.txt || framework_failure_ ++nl -d 'foo' in.txt > out || fail=1 ++cat < exp ++ 1 a ++ ++ 1 c ++EOF ++compare exp out || fail=1 ++ + Exit $fail -- Gitee From d4c26f36105ddaf698f3d74467b78a8cec65aa05 Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Tue, 15 Dec 2020 22:58:57 +0800 Subject: [PATCH 3/4] [patch tracking] 20201215225849748592 - https://github.com/coreutils/coreutils/commit/567fc2c2ad7b70d9c053413bd1a918f93bc41670 --- ...c2c2ad7b70d9c053413bd1a918f93bc41670.patch | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 567fc2c2ad7b70d9c053413bd1a918f93bc41670.patch diff --git a/567fc2c2ad7b70d9c053413bd1a918f93bc41670.patch b/567fc2c2ad7b70d9c053413bd1a918f93bc41670.patch new file mode 100644 index 0000000..cae16b3 --- /dev/null +++ b/567fc2c2ad7b70d9c053413bd1a918f93bc41670.patch @@ -0,0 +1,49 @@ +diff --git a/NEWS b/NEWS +index d2cb9ae48..dfc7bfa41 100644 +--- a/NEWS ++++ b/NEWS +@@ -20,6 +20,10 @@ GNU coreutils NEWS -*- outline -*- + ls no longer crashes when printing the SELinux context for unstatable files. + [bug introduced in coreutils-6.9.91] + ++ nl now handles single character --section-delimiter arguments, ++ by assuming a second ':' character has been specified, as specified by POSIX. ++ [This bug was present in "the beginning".] ++ + rm no longer skips an extra file when the removal of an empty directory fails. + [bug introduced by the rewrite to use fts in coreutils-8.0] + +diff --git a/src/nl.c b/src/nl.c +index 23219b609..d1f45b29c 100644 +--- a/src/nl.c ++++ b/src/nl.c +@@ -556,7 +556,8 @@ main (int argc, char **argv) + } + break; + case 'd': +- if (strlen (optarg) == 2) /* POSIX. */ ++ len = strlen (optarg); ++ if (len == 1 || len == 2) /* POSIX. */ + { + char *p = section_del; + while (*optarg) +diff --git a/tests/misc/nl.sh b/tests/misc/nl.sh +index 0d57f3443..b64ab8e11 100755 +--- a/tests/misc/nl.sh ++++ b/tests/misc/nl.sh +@@ -99,4 +99,15 @@ cat < exp + EOF + compare exp out || fail=1 + ++# Ensure single char delimiters assume a following ':' character (as per POSIX) ++# coreutils <= v8.32 didn't match single char delimiters at all ++printf '%s\n' a x:x: c > in.txt || framework_failure_ ++nl -d 'x' in.txt > out || fail=1 ++cat < exp ++ 1 a ++ ++ 1 c ++EOF ++compare exp out || fail=1 ++ + Exit $fail -- Gitee From 64de94ef0cf15a58d58c4c4e83d1af6124248e81 Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Tue, 15 Dec 2020 22:58:58 +0800 Subject: [PATCH 4/4] [patch tracking] 20201215225849748592 - update spec file --- coreutils.spec | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/coreutils.spec b/coreutils.spec index f5a08aa..8272fc0 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,6 +1,6 @@ Name: coreutils Version: 8.32 -Release: 2 +Release: 3 License: GPLv3+ Summary: A set of basic GNU tools commonly used in shell scripts Url: https://www.gnu.org/software/coreutils/ @@ -25,6 +25,9 @@ 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 +Patch6000: b0d527fb40bd7a36ab90af891a1934daff1f3475.patch +Patch6001: 1935528ce9eba1df285dc05fbb8cf3c083334078.patch +Patch6002: 567fc2c2ad7b70d9c053413bd1a918f93bc41670.patch Conflicts: filesystem < 3 # To avoid clobbering installs @@ -135,6 +138,9 @@ fi %{_mandir}/man*/* %changelog +* 20201215225849748592 patch-tracking 8.32-3 +- append patch file of upstream repository from to <567fc2c2ad7b70d9c053413bd1a918f93bc41670> + * Wed Aug 26 2020 chenbo pan - 8.32-2 - fix patch error @@ -221,4 +227,4 @@ fi - reintroduce very old Provides (mktemp, sh-utils, textwrap, fileutils, stat) * Thu Jul 12 2018 hexiaowen - 8.30-1 -- Pacakge init +- Pacakge init \ No newline at end of file -- Gitee