From 8d9eac4093e3f6c24f5659f64775cb81cb535b57 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Dec 01 2016 18:14:56 +0000 Subject: new upstream release 8.26 --- diff --git a/.gitignore b/.gitignore index b8fffbf..de62e8f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1 @@ -/coreutils-8.10.tar.xz -/coreutils-8.11.tar.xz -/coreutils-8.12.tar.xz -/coreutils-8.13.tar.xz -/coreutils-8.14.tar.xz -/coreutils-8.15.tar.xz -/coreutils-8.16.tar.xz -/coreutils-8.17.tar.xz -/coreutils-8.18.tar.xz -/coreutils-8.19.tar.xz -/coreutils-8.20.tar.xz -/coreutils-8.21.tar.xz -/coreutils-8.22.tar.xz -/coreutils-8.23.tar.xz -/coreutils-8.23.tar.xz.sig -/coreutils-8.24.tar.xz -/coreutils-8.24.tar.xz.sig -/coreutils-8.25.tar.xz -/coreutils-8.25.tar.xz.sig +/coreutils-[0-9.]*.tar.xz diff --git a/coreutils-4.5.3-langinfo.patch b/coreutils-4.5.3-langinfo.patch index 48e0624..a8af3bd 100644 --- a/coreutils-4.5.3-langinfo.patch +++ b/coreutils-4.5.3-langinfo.patch @@ -1,6 +1,8 @@ ---- coreutils-5.92/src/date.c.langinfo 2005-09-16 09:06:57.000000000 +0100 -+++ coreutils-5.92/src/date.c 2005-10-24 18:09:16.000000000 +0100 -@@ -474,14 +474,7 @@ main (int argc, char **argv) +diff --git a/src/date.c b/src/date.c +index ddb011e..619a72b 100644 +--- a/src/date.c ++++ b/src/date.c +@@ -490,14 +490,7 @@ main (int argc, char **argv) format = DATE_FMT_LANGINFO (); if (! *format) { diff --git a/coreutils-6.10-configuration.patch b/coreutils-6.10-configuration.patch index 7468ba2..c34fd99 100644 --- a/coreutils-6.10-configuration.patch +++ b/coreutils-6.10-configuration.patch @@ -1,6 +1,22 @@ -diff -urNp coreutils-8.21-orig/gnulib-tests/gnulib.mk coreutils-8.21/gnulib-tests/gnulib.mk ---- coreutils-8.21-orig/gnulib-tests/gnulib.mk 2013-02-07 17:58:44.000000000 +0100 -+++ coreutils-8.21/gnulib-tests/gnulib.mk 2013-02-15 10:12:28.110593165 +0100 +From 54ef056964da3d0987afd9f1e96b9419db0d653a Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Thu, 1 Dec 2016 14:32:46 +0100 +Subject: [PATCH] coreutils-6.10-configuration.patch + +TODO: check whether still necessary +--- + gnulib-tests/gnulib.mk | 60 +++++++++++++++++++++---------------------- + man/local.mk | 2 +- + tests/df/skip-duplicates.sh | 3 +++ + tests/local.mk | 2 +- + tests/misc/nohup.sh | 2 ++ + tests/touch/no-dereference.sh | 2 ++ + 6 files changed, 39 insertions(+), 32 deletions(-) + +diff --git a/gnulib-tests/gnulib.mk b/gnulib-tests/gnulib.mk +index fee978f..8f32431 100644 +--- a/gnulib-tests/gnulib.mk ++++ b/gnulib-tests/gnulib.mk @@ -279,9 +279,9 @@ EXTRA_DIST += nap.h test-chown.h test-chown.c signature.h macros.h ## begin gnulib module cloexec-tests @@ -55,7 +71,7 @@ diff -urNp coreutils-8.21-orig/gnulib-tests/gnulib.mk coreutils-8.21/gnulib-test ## end gnulib module getlogin-tests -@@ -1147,10 +1147,10 @@ EXTRA_DIST += test-link.h test-link.c signature.h macros.h +@@ -1148,10 +1148,10 @@ EXTRA_DIST += test-link.h test-link.c signature.h macros.h ## begin gnulib module linkat-tests @@ -70,7 +86,7 @@ diff -urNp coreutils-8.21-orig/gnulib-tests/gnulib.mk coreutils-8.21/gnulib-test ## end gnulib module linkat-tests -@@ -1359,9 +1359,9 @@ EXTRA_DIST += test-memcoll.c macros.h +@@ -1360,9 +1360,9 @@ EXTRA_DIST += test-memcoll.c macros.h ## begin gnulib module memrchr-tests @@ -83,7 +99,7 @@ diff -urNp coreutils-8.21-orig/gnulib-tests/gnulib.mk coreutils-8.21/gnulib-test ## end gnulib module memrchr-tests -@@ -1912,9 +1912,9 @@ EXTRA_DIST += test-statat.c +@@ -1913,9 +1913,9 @@ EXTRA_DIST += test-statat.c ## begin gnulib module stdalign-tests @@ -96,7 +112,7 @@ diff -urNp coreutils-8.21-orig/gnulib-tests/gnulib.mk coreutils-8.21/gnulib-test ## end gnulib module stdalign-tests -@@ -2269,9 +2269,9 @@ EXTRA_DIST += test-uname.c signature.h macros.h +@@ -2270,9 +2270,9 @@ EXTRA_DIST += test-uname.c signature.h macros.h ## begin gnulib module unistd-safer-tests @@ -109,7 +125,7 @@ diff -urNp coreutils-8.21-orig/gnulib-tests/gnulib.mk coreutils-8.21/gnulib-test ## end gnulib module unistd-safer-tests -@@ -2367,10 +2367,10 @@ EXTRA_DIST += test-userspec.c +@@ -2368,10 +2368,10 @@ EXTRA_DIST += test-userspec.c ## begin gnulib module utimens-tests @@ -124,9 +140,37 @@ diff -urNp coreutils-8.21-orig/gnulib-tests/gnulib.mk coreutils-8.21/gnulib-test ## end gnulib module utimens-tests -diff -urNp coreutils-8.21-orig/tests/local.mk coreutils-8.21/tests/local.mk ---- coreutils-8.21-orig/tests/local.mk 2013-02-11 11:30:12.000000000 +0100 -+++ coreutils-8.21/tests/local.mk 2013-02-15 10:10:55.890532258 +0100 +diff --git a/man/local.mk b/man/local.mk +index a39bb65..535690c 100644 +--- a/man/local.mk ++++ b/man/local.mk +@@ -41,7 +41,7 @@ distclean-local: + test x$(srcdir) = x$(builddir) || rm -f $(ALL_MANS) + + # Dependencies common to all man pages. Updated below. +-mandeps = ++mandeps = $(PROGRAMS) + + # Depend on this to get version number changes. + mandeps += .version +diff --git a/tests/df/skip-duplicates.sh b/tests/df/skip-duplicates.sh +index f349263..9854f8d 100755 +--- a/tests/df/skip-duplicates.sh ++++ b/tests/df/skip-duplicates.sh +@@ -26,6 +26,9 @@ require_gcc_shared_ + df --local --output=target >LOCAL_FS || skip_ 'df fails' + grep '^/$' LOCAL_FS || skip_ 'no root file system found' + ++# mark it expensive, to temporarily skip the test in koji ++expensive_ ++ + # Get real targets to substitute for /NONROOT and /REMOTE below. + export CU_NONROOT_FS=$(grep /. LOCAL_FS | head -n1) + export CU_REMOTE_FS=$(grep /. LOCAL_FS | tail -n+2 | head -n1) +diff --git a/tests/local.mk b/tests/local.mk +index 3335002..568944e 100644 +--- a/tests/local.mk ++++ b/tests/local.mk @@ -134,6 +134,7 @@ all_root_tests = \ tests/rm/no-give-up.sh \ tests/rm/one-file-system.sh \ @@ -143,21 +187,10 @@ diff -urNp coreutils-8.21-orig/tests/local.mk coreutils-8.21/tests/local.mk tests/tail-2/inotify-hash-abuse2.sh \ tests/tail-2/F-vs-missing.sh \ tests/tail-2/F-vs-rename.sh \ -diff -urNp coreutils-8.21-orig/tests/touch/no-dereference.sh coreutils-8.21/tests/touch/no-dereference.sh ---- coreutils-8.21-orig/tests/touch/no-dereference.sh 2013-01-31 01:46:25.000000000 +0100 -+++ coreutils-8.21/tests/touch/no-dereference.sh 2013-02-15 10:10:55.889593383 +0100 -@@ -42,6 +42,8 @@ test -f nowhere && fail=1 - grep '^#define HAVE_UTIMENSAT 1' "$CONFIG_HEADER" > /dev/null || - grep '^#define HAVE_LUTIMES 1' "$CONFIG_HEADER" > /dev/null || - skip_ 'this system lacks the utimensat function' -+grep '^#define HAVE_WORKINGKOJI 1' "$CONFIG_HEADER" > /dev/null || -+ skip_ 'rest of the test disabled due to koji lack of utimensat function' - - # Changing time of dangling symlink is okay. - # Skip the test if this fails, but the error text corresponds to -diff -urNp coreutils-8.22-orig/tests/misc/nohup.sh coreutils-8.22/tests/misc/nohup.sh ---- coreutils-8.22-orig/tests/misc/nohup.sh 2013-12-04 15:48:30.000000000 +0100 -+++ coreutils-8.22/tests/misc/nohup.sh 2014-03-02 21:51:01.972887749 +0100 +diff --git a/tests/misc/nohup.sh b/tests/misc/nohup.sh +index 1b43b60..3fd29e7 100755 +--- a/tests/misc/nohup.sh ++++ b/tests/misc/nohup.sh @@ -19,6 +19,8 @@ . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src print_ver_ nohup @@ -167,29 +200,19 @@ diff -urNp coreutils-8.22-orig/tests/misc/nohup.sh coreutils-8.22/tests/misc/noh nohup sh -c 'echo stdout; echo stderr 1>&2' 2>err || fail=1 -diff -urNp coreutils-8.23-orig/tests/df/skip-duplicates.sh coreutils-8.23/tests/df/skip-duplicates.sh ---- coreutils-8.23-orig/tests/df/skip-duplicates.sh 2014-07-14 00:09:52.000000000 +0200 -+++ coreutils-8.23/tests/df/skip-duplicates.sh 2014-07-24 15:53:33.473031545 +0200 -@@ -25,6 +25,10 @@ require_gcc_shared_ - # potentially very many remote mounts. - df --local || skip_ 'df fails' - -+#mark it expensive, to temporarily skip the test in koji -+expensive_ -+ -+ - export CU_NONROOT_FS=$(df --local --output=target 2>&1 | grep /. | head -n1) - export CU_REMOTE_FS=$(df --local --output=target 2>&1 | grep /. | - tail -n+2 | head -n1) -diff -urNp coreutils-8.23-orig/man/local.mk coreutils-8.23/man/local.mk ---- coreutils-8.23-orig/man/local.mk 2014-07-18 03:40:57.000000000 +0200 -+++ coreutils-8.23/man/local.mk 2014-08-05 12:18:20.477524009 +0200 -@@ -41,7 +41,7 @@ distclean-local: - test x$(srcdir) = x$(builddir) || rm -f $(ALL_MANS) - - # Dependencies common to all man pages. Updated below. --mandeps = -+mandeps = $(PROGRAMS) +diff --git a/tests/touch/no-dereference.sh b/tests/touch/no-dereference.sh +index 7994638..72b2222 100755 +--- a/tests/touch/no-dereference.sh ++++ b/tests/touch/no-dereference.sh +@@ -42,6 +42,8 @@ test -f nowhere && fail=1 + grep '^#define HAVE_UTIMENSAT 1' "$CONFIG_HEADER" > /dev/null || + grep '^#define HAVE_LUTIMES 1' "$CONFIG_HEADER" > /dev/null || + skip_ 'this system lacks the utimensat function' ++grep '^#define HAVE_WORKINGKOJI 1' "$CONFIG_HEADER" > /dev/null || ++ skip_ 'rest of the test disabled due to koji lack of utimensat function' - # Depend on this to get version number changes. - mandeps += .version + # Changing time of dangling symlink is okay. + # Skip the test if this fails, but the error text corresponds to +-- +2.7.4 + diff --git a/coreutils-6.10-manpages.patch b/coreutils-6.10-manpages.patch index c795ca5..5f8bdb2 100644 --- a/coreutils-6.10-manpages.patch +++ b/coreutils-6.10-manpages.patch @@ -1,7 +1,8 @@ -diff -urNp coreutils-6.12-orig/src/md5sum.c coreutils-6.12/src/md5sum.c ---- coreutils-6.12-orig/src/md5sum.c 2008-05-26 08:40:33.000000000 +0200 -+++ coreutils-6.12/src/md5sum.c 2008-10-21 16:07:28.000000000 +0200 -@@ -200,6 +200,9 @@ Print or check %s (%d-bit) checksums.\n\ +diff --git a/src/md5sum.c b/src/md5sum.c +index 8e21609..a857d62 100644 +--- a/src/md5sum.c ++++ b/src/md5sum.c +@@ -266,6 +266,9 @@ Print or check %s (%d-bit) checksums.\n\ fputs (_("\ -t, --text read in text mode (default)\n\ "), stdout); diff --git a/coreutils-8.2-uname-processortype.patch b/coreutils-8.2-uname-processortype.patch index 0cb2422..ed01ab8 100644 --- a/coreutils-8.2-uname-processortype.patch +++ b/coreutils-8.2-uname-processortype.patch @@ -1,7 +1,8 @@ -diff -urNp coreutils-8.2-orig/src/uname.c coreutils-8.2/src/uname.c ---- coreutils-8.2-orig/src/uname.c 2009-09-23 10:25:44.000000000 +0200 -+++ coreutils-8.2/src/uname.c 2009-12-19 09:09:11.663607110 +0100 -@@ -299,13 +299,19 @@ main (int argc, char **argv) +diff --git a/src/uname.c b/src/uname.c +index 6371ca2..1ad8fd7 100644 +--- a/src/uname.c ++++ b/src/uname.c +@@ -300,13 +300,19 @@ main (int argc, char **argv) if (toprint & PRINT_PROCESSOR) { @@ -22,7 +23,7 @@ diff -urNp coreutils-8.2-orig/src/uname.c coreutils-8.2/src/uname.c #endif #ifdef UNAME_PROCESSOR if (element == unknown) -@@ -343,7 +349,7 @@ main (int argc, char **argv) +@@ -344,7 +350,7 @@ main (int argc, char **argv) if (toprint & PRINT_HARDWARE_PLATFORM) { @@ -31,7 +32,7 @@ diff -urNp coreutils-8.2-orig/src/uname.c coreutils-8.2/src/uname.c #if HAVE_SYSINFO && defined SI_PLATFORM { static char hardware_platform[257]; -@@ -351,6 +357,14 @@ main (int argc, char **argv) +@@ -352,6 +358,14 @@ main (int argc, char **argv) hardware_platform, sizeof hardware_platform)) element = hardware_platform; } diff --git a/coreutils-8.25-DIR_COLORS.patch b/coreutils-8.25-DIR_COLORS.patch index 54a96eb..a8a2d1a 100644 --- a/coreutils-8.25-DIR_COLORS.patch +++ b/coreutils-8.25-DIR_COLORS.patch @@ -4,10 +4,10 @@ Date: Fri, 17 Jun 2016 16:58:18 +0200 Subject: [PATCH] downstream changes to default DIR_COLORS --- - DIR_COLORS | 44 +++---- - DIR_COLORS.256color | 296 +++++++++++++++++++++++------------------------- - DIR_COLORS.lightbgcolor | 203 +++++++++++++++++---------------- - 3 files changed, 271 insertions(+), 272 deletions(-) + DIR_COLORS | 44 ++++---- + DIR_COLORS.256color | 294 +++++++++++++++++++++++------------------------- + DIR_COLORS.lightbgcolor | 207 +++++++++++++++++----------------- + 3 files changed, 271 insertions(+), 274 deletions(-) diff --git a/DIR_COLORS b/DIR_COLORS index d2ea453..27af9d7 100644 @@ -34,7 +34,7 @@ index d2ea453..27af9d7 100644 # Below are TERM entries, which can be a glob patterns, to match # against the TERM environment variable to determine if it is colorizable. -@@ -62,7 +68,7 @@ DOOR 01;35 # door +@@ -56,7 +62,7 @@ DOOR 01;35 # door BLK 40;33;01 # block device driver CHR 40;33;01 # character device driver ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file ... @@ -43,7 +43,7 @@ index d2ea453..27af9d7 100644 SETUID 37;41 # file that is setuid (u+s) SETGID 30;43 # file that is setgid (g+s) CAPABILITY 30;41 # file with capability -@@ -183,21 +189,21 @@ EXEC 01;32 +@@ -181,21 +187,21 @@ EXEC 01;32 .ogx 01;35 # audio formats @@ -85,7 +85,7 @@ diff --git a/DIR_COLORS.256color b/DIR_COLORS.256color index d2ea453..74c34ba 100644 --- a/DIR_COLORS.256color +++ b/DIR_COLORS.256color -@@ -1,45 +1,22 @@ +@@ -1,39 +1,22 @@ -# Configuration file for dircolors, a utility to help you set the -# LS_COLORS environment variable used by GNU ls with the --color option. +# Configuration file for the 256color ls utility @@ -109,30 +109,24 @@ index d2ea453..74c34ba 100644 # against the TERM environment variable to determine if it is colorizable. -TERM Eterm -TERM ansi --TERM color-xterm +-TERM *color* -TERM con[0-9]*x[0-9]* -TERM cons25 -TERM console -TERM cygwin -TERM dtterm --TERM eterm-color -TERM gnome --TERM gnome-256color -TERM hurd -TERM jfbterm -TERM konsole -TERM kterm -TERM linux -TERM linux-c --TERM mach-color --TERM mach-gnu-color -TERM mlterm -TERM putty --TERM putty-256color -TERM rxvt* -TERM screen* -TERM st --TERM st-256color -TERM terminator -TERM tmux* -TERM vt100 @@ -142,7 +136,7 @@ index d2ea453..74c34ba 100644 # Below are the color init strings for the basic file types. A color init # string consists of one or more of the following numeric codes: -@@ -49,29 +26,40 @@ TERM xterm* +@@ -43,29 +26,40 @@ TERM xterm* # 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white # Background color codes: # 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white @@ -199,7 +193,7 @@ index d2ea453..74c34ba 100644 # List any file extensions like '.gz' or '.tar' that you would like ls # to colorize below. Put the extension, a space, and the color init string. -@@ -89,115 +77,115 @@ EXEC 01;32 +@@ -83,119 +77,115 @@ EXEC 01;32 #.csh 01;32 # archives or compressed (bright red) @@ -225,6 +219,8 @@ index d2ea453..74c34ba 100644 -.lz 01;31 -.lzo 01;31 -.xz 01;31 +-.zst 01;31 +-.tzst 01;31 -.bz2 01;31 -.bz 01;31 -.tbz 01;31 @@ -289,6 +285,8 @@ index d2ea453..74c34ba 100644 # image formats -.jpg 01;35 -.jpeg 01;35 +-.mjpg 01;35 +-.mjpeg 01;35 -.gif 01;35 -.bmp 01;35 -.pbm 01;35 @@ -445,7 +443,7 @@ index d2ea453..95d6879 100644 # Below are TERM entries, which can be a glob patterns, to match # against the TERM environment variable to determine if it is colorizable. -@@ -52,17 +57,17 @@ TERM xterm* +@@ -46,17 +51,17 @@ TERM xterm* #NORMAL 00 # no color code at all #FILE 00 # regular file: use no color at all RESET 0 # reset to "normal" color @@ -468,7 +466,7 @@ index d2ea453..95d6879 100644 SETUID 37;41 # file that is setuid (u+s) SETGID 30;43 # file that is setgid (g+s) CAPABILITY 30;41 # file with capability -@@ -71,7 +76,7 @@ OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky +@@ -65,7 +70,7 @@ OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable # This is for files with execute permission: @@ -477,7 +475,7 @@ index d2ea453..95d6879 100644 # List any file extensions like '.gz' or '.tar' that you would like ls # to colorize below. Put the extension, a space, and the color init string. -@@ -88,99 +93,99 @@ EXEC 01;32 +@@ -82,103 +87,99 @@ EXEC 01;32 #.sh 01;32 #.csh 01;32 @@ -504,6 +502,8 @@ index d2ea453..95d6879 100644 -.lz 01;31 -.lzo 01;31 -.xz 01;31 +-.zst 01;31 +-.tzst 01;31 -.bz2 01;31 -.bz 01;31 -.tbz 01;31 @@ -569,6 +569,8 @@ index d2ea453..95d6879 100644 # image formats -.jpg 01;35 -.jpeg 01;35 +-.mjpg 01;35 +-.mjpeg 01;35 -.gif 01;35 -.bmp 01;35 -.pbm 01;35 diff --git a/coreutils-8.25-intall-Z-selinux.patch b/coreutils-8.25-intall-Z-selinux.patch deleted file mode 100644 index 0f5ef33..0000000 --- a/coreutils-8.25-intall-Z-selinux.patch +++ /dev/null @@ -1,188 +0,0 @@ -From c424bbcb532c5b9924349e3522b3b431eaa7c178 Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Fri, 8 Jul 2016 18:59:35 +0200 -Subject: [PATCH] install: with -Z, set default SELinux context for created - directories - -* doc/coreutils.texi (install invocation): Update -Z documentation. -* src/install.c (make_ancestor): Set default security context before -calling mkdir() if the -Z option is given. -(process_dir): Call restorecon() on the destination directory if the --Z option is given. -(usage): Update -Z documentation. -* tests/install/install-Z-selinux.sh: A new test for 'install -Z -D' -and 'install -Z -d' based on tests/mkdir/restorecon.sh. -* tests/local.mk: Reference the test. -* NEWS: Mention the improvement. -Reported at https://bugzilla.redhat.com/1339135 -Fixes http://bugs.gnu.org/23868 - -Upstream-commit: 502518b44039138d148e2e15157d125c82d02af0 -Signed-off-by: Kamil Dudka ---- - doc/coreutils.texi | 2 +- - src/install.c | 33 ++++++++++++++++++---- - tests/install/install-Z-selinux.sh | 58 ++++++++++++++++++++++++++++++++++++++ - tests/local.mk | 1 + - 4 files changed, 88 insertions(+), 6 deletions(-) - create mode 100644 tests/install/install-Z-selinux.sh - -diff --git a/doc/coreutils.texi b/doc/coreutils.texi -index 092192c..1543f27 100644 ---- a/doc/coreutils.texi -+++ b/doc/coreutils.texi -@@ -9208,7 +9208,7 @@ Print the name of each file before moving it. - @cindex security context - This option functions similarly to the @command{restorecon} command, - by adjusting the SELinux security context according --to the system default type for destination files. -+to the system default type for destination files and each created directory. - - @end table - -diff --git a/src/install.c b/src/install.c -index 089f298..1b7a209 100644 ---- a/src/install.c -+++ b/src/install.c -@@ -39,6 +39,7 @@ - #include "prog-fprintf.h" - #include "quote.h" - #include "savewd.h" -+#include "selinux.h" - #include "stat-time.h" - #include "utimens.h" - #include "xstrtol.h" -@@ -423,6 +424,12 @@ announce_mkdir (char const *dir, void *options) - static int - make_ancestor (char const *dir, char const *component, void *options) - { -+ struct cp_options const *x = options; -+ if (x->set_security_context && defaultcon (dir, S_IFDIR) < 0 -+ && ! ignorable_ctx_err (errno)) -+ error (0, errno, _("failed to set default creation context for %s"), -+ quoteaf (dir)); -+ - int r = mkdir (component, DEFAULT_MODE); - if (r == 0) - announce_mkdir (dir, options); -@@ -433,12 +440,28 @@ make_ancestor (char const *dir, char const *component, void *options) - static int - process_dir (char *dir, struct savewd *wd, void *options) - { -- return (make_dir_parents (dir, wd, -- make_ancestor, options, -- dir_mode, announce_mkdir, -- dir_mode_bits, owner_id, group_id, false) -+ struct cp_options const *x = options; -+ -+ int ret = (make_dir_parents (dir, wd, make_ancestor, options, -+ dir_mode, announce_mkdir, -+ dir_mode_bits, owner_id, group_id, false) - ? EXIT_SUCCESS - : EXIT_FAILURE); -+ -+ /* FIXME: Due to the current structure of make_dir_parents() -+ we don't have the facility to call defaultcon() before the -+ final component of DIR is created. So for now, create the -+ final component with the context from previous component -+ and here we set the context for the final component. */ -+ if (ret == EXIT_SUCCESS && x->set_security_context) -+ { -+ if (! restorecon (last_component (dir), false, false) -+ && ! ignorable_ctx_err (errno)) -+ error (0, errno, _("failed to restore context for %s"), -+ quoteaf (dir)); -+ } -+ -+ return ret; - } - - /* Copy file FROM onto file TO, creating TO if necessary. -@@ -651,7 +674,7 @@ In the 4th form, create all components of the given DIRECTORY(ies).\n\ - fputs (_("\ - -P, --preserve-context preserve SELinux security context (-P deprecated)\n\ - -Z set SELinux security context of destination\n\ -- file to default type\n\ -+ file and each created directory to default type\n\ - --context[=CTX] like -Z, or if CTX is specified then set the\n\ - SELinux or SMACK security context to CTX\n\ - "), stdout); -diff --git a/tests/install/install-Z-selinux.sh b/tests/install/install-Z-selinux.sh -new file mode 100644 -index 0000000..9c3b642 ---- /dev/null -+++ b/tests/install/install-Z-selinux.sh -@@ -0,0 +1,58 @@ -+#!/bin/sh -+# test 'install -Z -D' and 'install -Z -d' -+# based on tests/mkdir/restorecon.sh -+ -+# Copyright (C) 2013-2016 Free Software Foundation, Inc. -+ -+# This program is free software: you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation, either version 3 of the License, or -+# (at your option) any later version. -+ -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+ -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src -+print_ver_ ginstall -+require_selinux_ -+ -+ -+get_selinux_type() { ls -Zd "$1" | sed -n 's/.*:\(.*_t\):.*/\1/p'; } -+ -+mkdir subdir || framework_failure_ -+chcon 'root:object_r:tmp_t:s0' subdir || framework_failure_ -+cd subdir -+ -+# Since in a tmp_t dir, dirs can be created as user_tmp_t ... -+touch standard || framework_failure_ -+mkdir restored || framework_failure_ -+if restorecon restored 2>/dev/null; then -+ # ... but when restored can be set to user_home_t -+ # So ensure the type for these mkdir -Z cases matches -+ # the directory type as set by restorecon. -+ ginstall -Z standard single || fail=1 -+ ginstall -Z -d single_d || fail=1 -+ # Run these as separate processes in case global context -+ # set for an arg, impacts on another arg -+ # TODO: Have the defaultcon() vary over these directories -+ for dst in single_d/existing/file multi/ple/file; do -+ ginstall -Z -D standard "$dst" || fail=1 -+ done -+ restored_type=$(get_selinux_type 'restored') -+ test "$(get_selinux_type 'single')" = "$restored_type" || fail=1 -+ test "$(get_selinux_type 'single_d')" = "$restored_type" || fail=1 -+ test "$(get_selinux_type 'single_d/existing')" = "$restored_type" || fail=1 -+ test "$(get_selinux_type 'multi')" = "$restored_type" || fail=1 -+ test "$(get_selinux_type 'multi/ple')" = "$restored_type" || fail=1 -+fi -+if test "$fail" = '1'; then -+ ls -UZd standard restored -+ ls -UZd single single_d single_d/existing multi multi/ple -+fi -+ -+Exit $fail -diff --git a/tests/local.mk b/tests/local.mk -index ec23448..42d39f2 100644 ---- a/tests/local.mk -+++ b/tests/local.mk -@@ -548,6 +548,7 @@ all_tests = \ - tests/install/d-slashdot.sh \ - tests/install/install-C.sh \ - tests/install/install-C-selinux.sh \ -+ tests/install/install-Z-selinux.sh \ - tests/install/strip-program.sh \ - tests/install/trap.sh \ - tests/ln/backup-1.sh \ --- -2.5.5 - diff --git a/coreutils-8.25-ls-signal.patch b/coreutils-8.25-ls-signal.patch deleted file mode 100644 index 32cfd3a..0000000 --- a/coreutils-8.25-ls-signal.patch +++ /dev/null @@ -1,236 +0,0 @@ -From 9338b244572e07bbff314b3570228e8cf43f1300 Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Tue, 6 Sep 2016 17:38:26 +0200 -Subject: [PATCH] ls: allow interruption when reading slow directories - -Postpone installation of signal handlers until they're needed. -That is right before the first escape sequence is printed. - -* src/ls.c (signal_setup): A new function refactored from main() -to set and restore signal handlers. -(main): Move signal handler setup to put_indicator() -so that the default signal handling is untouched as long as possible. -Adjusted condition for restoring signal handlers to reflect the change. -(put_indicator): Install signal handlers if called for the very first -time. It uses the same code that was in main() prior to this commit. -* NEWS: Mention the improvement. - -See https://bugzilla.redhat.com/1365933 -Fixes http://bugs.gnu.org/24232 - -Upstream-commit: 5445f7811ff945ea13aa2a0fd797eb4c0a0e4db0 -Signed-off-by: Kamil Dudka ---- - src/ls.c | 161 ++++++++++++++++++++++++++++++++++++--------------------------- - 1 file changed, 93 insertions(+), 68 deletions(-) - -diff --git a/src/ls.c b/src/ls.c -index d976036..66df307 100644 ---- a/src/ls.c -+++ b/src/ls.c -@@ -1244,13 +1244,12 @@ process_signals (void) - } - } - --int --main (int argc, char **argv) --{ -- int i; -- struct pending *thispend; -- int n_files; -+/* Setup signal handlers if INIT is true, -+ otherwise restore to the default. */ - -+static void -+signal_setup (bool init) -+{ - /* The signals that are trapped, and the number of such signals. */ - static int const sig[] = - { -@@ -1278,8 +1277,77 @@ main (int argc, char **argv) - enum { nsigs = ARRAY_CARDINALITY (sig) }; - - #if ! SA_NOCLDSTOP -- bool caught_sig[nsigs]; -+ static bool caught_sig[nsigs]; -+#endif -+ -+ int j; -+ -+ if (init) -+ { -+#if SA_NOCLDSTOP -+ struct sigaction act; -+ -+ sigemptyset (&caught_signals); -+ for (j = 0; j < nsigs; j++) -+ { -+ sigaction (sig[j], NULL, &act); -+ if (act.sa_handler != SIG_IGN) -+ sigaddset (&caught_signals, sig[j]); -+ } -+ -+ act.sa_mask = caught_signals; -+ act.sa_flags = SA_RESTART; -+ -+ for (j = 0; j < nsigs; j++) -+ if (sigismember (&caught_signals, sig[j])) -+ { -+ act.sa_handler = sig[j] == SIGTSTP ? stophandler : sighandler; -+ sigaction (sig[j], &act, NULL); -+ } -+#else -+ for (j = 0; j < nsigs; j++) -+ { -+ caught_sig[j] = (signal (sig[j], SIG_IGN) != SIG_IGN); -+ if (caught_sig[j]) -+ { -+ signal (sig[j], sig[j] == SIGTSTP ? stophandler : sighandler); -+ siginterrupt (sig[j], 0); -+ } -+ } - #endif -+ } -+ else /* restore. */ -+ { -+#if SA_NOCLDSTOP -+ for (j = 0; j < nsigs; j++) -+ if (sigismember (&caught_signals, sig[j])) -+ signal (sig[j], SIG_DFL); -+#else -+ for (j = 0; j < nsigs; j++) -+ if (caught_sig[j]) -+ signal (sig[j], SIG_DFL); -+#endif -+ } -+} -+ -+static inline void -+signal_init (void) -+{ -+ signal_setup (true); -+} -+ -+static inline void -+signal_restore (void) -+{ -+ signal_setup (false); -+} -+ -+int -+main (int argc, char **argv) -+{ -+ int i; -+ struct pending *thispend; -+ int n_files; - - initialize_main (&argc, &argv); - set_program_name (argv[0]); -@@ -1314,46 +1382,6 @@ main (int argc, char **argv) - || (is_colored (C_EXEC) && color_symlink_as_referent) - || (is_colored (C_MISSING) && format == long_format)) - check_symlink_color = true; -- -- /* If the standard output is a controlling terminal, watch out -- for signals, so that the colors can be restored to the -- default state if "ls" is suspended or interrupted. */ -- -- if (0 <= tcgetpgrp (STDOUT_FILENO)) -- { -- int j; --#if SA_NOCLDSTOP -- struct sigaction act; -- -- sigemptyset (&caught_signals); -- for (j = 0; j < nsigs; j++) -- { -- sigaction (sig[j], NULL, &act); -- if (act.sa_handler != SIG_IGN) -- sigaddset (&caught_signals, sig[j]); -- } -- -- act.sa_mask = caught_signals; -- act.sa_flags = SA_RESTART; -- -- for (j = 0; j < nsigs; j++) -- if (sigismember (&caught_signals, sig[j])) -- { -- act.sa_handler = sig[j] == SIGTSTP ? stophandler : sighandler; -- sigaction (sig[j], &act, NULL); -- } --#else -- for (j = 0; j < nsigs; j++) -- { -- caught_sig[j] = (signal (sig[j], SIG_IGN) != SIG_IGN); -- if (caught_sig[j]) -- { -- signal (sig[j], sig[j] == SIGTSTP ? stophandler : sighandler); -- siginterrupt (sig[j], 0); -- } -- } --#endif -- } - } - - if (dereference == DEREF_UNDEFINED) -@@ -1466,32 +1494,21 @@ main (int argc, char **argv) - print_dir_name = true; - } - -- if (print_with_color) -+ if (print_with_color && used_color) - { - int j; - -- if (used_color) -- { -- /* Skip the restore when it would be a no-op, i.e., -- when left is "\033[" and right is "m". */ -- if (!(color_indicator[C_LEFT].len == 2 -- && memcmp (color_indicator[C_LEFT].string, "\033[", 2) == 0 -- && color_indicator[C_RIGHT].len == 1 -- && color_indicator[C_RIGHT].string[0] == 'm')) -- restore_default_color (); -- } -+ /* Skip the restore when it would be a no-op, i.e., -+ when left is "\033[" and right is "m". */ -+ if (!(color_indicator[C_LEFT].len == 2 -+ && memcmp (color_indicator[C_LEFT].string, "\033[", 2) == 0 -+ && color_indicator[C_RIGHT].len == 1 -+ && color_indicator[C_RIGHT].string[0] == 'm')) -+ restore_default_color (); -+ - fflush (stdout); - -- /* Restore the default signal handling. */ --#if SA_NOCLDSTOP -- for (j = 0; j < nsigs; j++) -- if (sigismember (&caught_signals, sig[j])) -- signal (sig[j], SIG_DFL); --#else -- for (j = 0; j < nsigs; j++) -- if (caught_sig[j]) -- signal (sig[j], SIG_DFL); --#endif -+ signal_restore (); - - /* Act on any signals that arrived before the default was restored. - This can process signals out of order, but there doesn't seem to -@@ -4482,6 +4499,14 @@ put_indicator (const struct bin_str *ind) - if (! used_color) - { - used_color = true; -+ -+ /* If the standard output is a controlling terminal, watch out -+ for signals, so that the colors can be restored to the -+ default state if "ls" is suspended or interrupted. */ -+ -+ if (0 <= tcgetpgrp (STDOUT_FILENO)) -+ signal_init (); -+ - prep_non_filename_text (); - } - --- -2.7.4 - diff --git a/coreutils-8.25-sort-thousands-sep.patch b/coreutils-8.25-sort-thousands-sep.patch deleted file mode 100644 index b9d2b5c..0000000 --- a/coreutils-8.25-sort-thousands-sep.patch +++ /dev/null @@ -1,332 +0,0 @@ -From c479153d77b419a6cae4551b63d2b73096c1130e Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Mon, 18 Jul 2016 19:04:43 +0200 -Subject: [PATCH 1/3] maint: sort.c: deduplicate code for traversing numbers - -* src/sort.c (traverse_raw_number): New function for traversing numbers. -(find_unit_order): Use traverse_raw_number() instead of open-coding it. -(debug_key): Likewise. ---- - src/sort.c | 63 ++++++++++++++++++++++++++++++++++---------------------------- - 1 file changed, 35 insertions(+), 28 deletions(-) - -diff --git a/src/sort.c b/src/sort.c -index 5b02343..e28bb6c 100644 ---- a/src/sort.c -+++ b/src/sort.c -@@ -2231,18 +2231,16 @@ static char const unit_order[UCHAR_LIM] = - #endif - }; - --/* Return an integer that represents the order of magnitude of the -- unit following the number. The number may contain thousands -- separators and a decimal point, but it may not contain leading blanks. -- Negative numbers get negative orders; zero numbers have a zero order. */ -- --static int _GL_ATTRIBUTE_PURE --find_unit_order (char const *number) -+/* Traverse number given as *number consisting of digits, thousands_sep, and -+ decimal_point chars only. Returns the highest digit found in the number, -+ or '\0' if no digit has been found. Upon return *number points at the -+ character that immediately follows after the given number. */ -+static unsigned char -+traverse_raw_number (char const **number) - { -- bool minus_sign = (*number == '-'); -- char const *p = number + minus_sign; -- int nonzero = 0; -+ char const *p = *number; - unsigned char ch; -+ unsigned char max_digit = '\0'; - - /* Scan to end of number. - Decimals or separators not followed by digits stop the scan. -@@ -2253,16 +2251,34 @@ find_unit_order (char const *number) - do - { - while (ISDIGIT (ch = *p++)) -- nonzero |= ch - '0'; -+ if (max_digit < ch) -+ max_digit = ch; - } - while (ch == thousands_sep); - - if (ch == decimal_point) - while (ISDIGIT (ch = *p++)) -- nonzero |= ch - '0'; -+ if (max_digit < ch) -+ max_digit = ch; -+ -+ *number = p - 1; -+ return max_digit; -+} -+ -+/* Return an integer that represents the order of magnitude of the -+ unit following the number. The number may contain thousands -+ separators and a decimal point, but it may not contain leading blanks. -+ Negative numbers get negative orders; zero numbers have a zero order. */ - -- if (nonzero) -+static int _GL_ATTRIBUTE_PURE -+find_unit_order (char const *number) -+{ -+ bool minus_sign = (*number == '-'); -+ char const *p = number + minus_sign; -+ unsigned char max_digit = traverse_raw_number (&p); -+ if ('0' < max_digit) - { -+ unsigned char ch = *p; - int order = unit_order[ch]; - return (minus_sign ? -order : order); - } -@@ -2655,23 +2671,14 @@ debug_key (struct line const *line, struct keyfield const *key) - ignore_value (strtold (beg, &tighter_lim)); - else if (key->numeric || key->human_numeric) - { -- char *p = beg + (beg < lim && *beg == '-'); -- bool found_digit = false; -- unsigned char ch; -- -- do -+ char const *p = beg + (beg < lim && *beg == '-'); -+ unsigned char max_digit = traverse_raw_number (&p); -+ if ('0' <= max_digit) - { -- while (ISDIGIT (ch = *p++)) -- found_digit = true; -+ unsigned char ch = *p; -+ tighter_lim = (char *) p -+ + (key->human_numeric && unit_order[ch]); - } -- while (ch == thousands_sep); -- -- if (ch == decimal_point) -- while (ISDIGIT (ch = *p++)) -- found_digit = true; -- -- if (found_digit) -- tighter_lim = p - ! (key->human_numeric && unit_order[ch]); - } - else - tighter_lim = lim; --- -2.5.5 - - -From 8c39465a5b0343ff7a21286dd69ed5430685d2f7 Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Mon, 18 Jul 2016 19:04:44 +0200 -Subject: [PATCH 2/3] sort: make -h work with -k and blank used as thousands - separator - -* src/sort.c (traverse_raw_number): Allow to skip only one occurrence -of thousands_sep to avoid finding the unit in the next column in case -thousands_sep matches as blank and is used as column delimiter. -* tests/misc/sort-h-thousands-sep.sh: Add regression test for this bug. -* tests/local.mk: Reference the test. -* NEWS: Mention the bug fix. -Reported at https://bugzilla.redhat.com/1355780 -Fixes http://bugs.gnu.org/24015 ---- - src/sort.c | 14 ++++++++---- - tests/local.mk | 1 + - tests/misc/sort-h-thousands-sep.sh | 47 ++++++++++++++++++++++++++++++++++++++ - 3 files changed, 57 insertions(+), 5 deletions(-) - create mode 100755 tests/misc/sort-h-thousands-sep.sh - -diff --git a/src/sort.c b/src/sort.c -index e28bb6c..dd3ba58 100644 ---- a/src/sort.c -+++ b/src/sort.c -@@ -2248,13 +2248,17 @@ traverse_raw_number (char const **number) - to be lacking in units. - FIXME: add support for multibyte thousands_sep and decimal_point. */ - -- do -+ while (ISDIGIT (ch = *p++)) - { -- while (ISDIGIT (ch = *p++)) -- if (max_digit < ch) -- max_digit = ch; -+ if (max_digit < ch) -+ max_digit = ch; -+ -+ /* Allow to skip only one occurrence of thousands_sep to avoid finding -+ the unit in the next column in case thousands_sep matches as blank -+ and is used as column delimiter. */ -+ if (*p == thousands_sep) -+ ++p; - } -- while (ch == thousands_sep); - - if (ch == decimal_point) - while (ISDIGIT (ch = *p++)) -diff --git a/tests/local.mk b/tests/local.mk -index 42d39f2..dccff8d 100644 ---- a/tests/local.mk -+++ b/tests/local.mk -@@ -344,6 +344,7 @@ all_tests = \ - tests/misc/sort-discrim.sh \ - tests/misc/sort-files0-from.pl \ - tests/misc/sort-float.sh \ -+ tests/misc/sort-h-thousands-sep.sh \ - tests/misc/sort-mb-tests.sh \ - tests/i18n/sort.sh \ - tests/misc/sort-merge.pl \ -diff --git a/tests/misc/sort-h-thousands-sep.sh b/tests/misc/sort-h-thousands-sep.sh -new file mode 100755 -index 0000000..17f1b6c ---- /dev/null -+++ b/tests/misc/sort-h-thousands-sep.sh -@@ -0,0 +1,47 @@ -+#!/bin/sh -+# exercise 'sort -h' in locales where thousands separator is blank -+ -+# Copyright (C) 2016 Free Software Foundation, Inc. -+ -+# This program is free software: you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation, either version 3 of the License, or -+# (at your option) any later version. -+ -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+ -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src -+print_ver_ sort -+test "$(LC_ALL=sv_SE locale thousands_sep)" = ' ' \ -+ || skip_ 'The Swedish locale with blank thousands separator is unavailable.' -+ -+tee exp1 > in << _EOF_ -+1 1k 4 003 1M -+2k 2M 4 002 2 -+3M 3 4 001 3k -+_EOF_ -+ -+cat > exp2 << _EOF_ -+3M 3 4 001 3k -+1 1k 4 003 1M -+2k 2M 4 002 2 -+_EOF_ -+ -+cat > exp3 << _EOF_ -+3M 3 4 001 3k -+2k 2M 4 002 2 -+1 1k 4 003 1M -+_EOF_ -+ -+for i in 1 2 3; do -+ LC_ALL="sv_SE.utf8" sort -h -k $i "in" > "out${i}" || fail=1 -+ compare "exp${i}" "out${i}" || fail=1 -+done -+ -+Exit $fail --- -2.5.5 - - -From 46ef53f558e7bc1c0bc0abd62a86b40b4141e058 Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Mon, 18 Jul 2016 19:04:45 +0200 -Subject: [PATCH 3/3] sort: with -h, disallow thousands separator between - number and unit -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -* src/sort.c (traverse_raw_number): Accept thousands separator only -if it is immediately followed by a digit. -* tests/misc/sort-h-thousands-sep.sh: Cover the fix for this bug. - -Suggested by Pádraig Brady in http://bugs.gnu.org/24015 ---- - src/sort.c | 11 ++++++++++- - tests/misc/sort-h-thousands-sep.sh | 25 +++++++++++++------------ - 2 files changed, 23 insertions(+), 13 deletions(-) - -diff --git a/src/sort.c b/src/sort.c -index dd3ba58..69ef75f 100644 ---- a/src/sort.c -+++ b/src/sort.c -@@ -2241,6 +2241,7 @@ traverse_raw_number (char const **number) - char const *p = *number; - unsigned char ch; - unsigned char max_digit = '\0'; -+ bool ends_with_thousands_sep = false; - - /* Scan to end of number. - Decimals or separators not followed by digits stop the scan. -@@ -2256,10 +2257,18 @@ traverse_raw_number (char const **number) - /* Allow to skip only one occurrence of thousands_sep to avoid finding - the unit in the next column in case thousands_sep matches as blank - and is used as column delimiter. */ -- if (*p == thousands_sep) -+ ends_with_thousands_sep = (*p == thousands_sep); -+ if (ends_with_thousands_sep) - ++p; - } - -+ if (ends_with_thousands_sep) -+ { -+ /* thousands_sep not followed by digit is not allowed. */ -+ *number = p - 2; -+ return max_digit; -+ } -+ - if (ch == decimal_point) - while (ISDIGIT (ch = *p++)) - if (max_digit < ch) -diff --git a/tests/misc/sort-h-thousands-sep.sh b/tests/misc/sort-h-thousands-sep.sh -index 17f1b6c..3ffa89e 100755 ---- a/tests/misc/sort-h-thousands-sep.sh -+++ b/tests/misc/sort-h-thousands-sep.sh -@@ -18,28 +18,29 @@ - - . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src - print_ver_ sort -+ - test "$(LC_ALL=sv_SE locale thousands_sep)" = ' ' \ - || skip_ 'The Swedish locale with blank thousands separator is unavailable.' - --tee exp1 > in << _EOF_ --1 1k 4 003 1M --2k 2M 4 002 2 --3M 3 4 001 3k -+tee exp1 exp3 > in << _EOF_ -+1 1k 1 M 4 003 1M -+2k 2M 2 k 4 002 2 -+3M 3 3 G 4 001 3k - _EOF_ - - cat > exp2 << _EOF_ --3M 3 4 001 3k --1 1k 4 003 1M --2k 2M 4 002 2 -+3M 3 3 G 4 001 3k -+1 1k 1 M 4 003 1M -+2k 2M 2 k 4 002 2 - _EOF_ - --cat > exp3 << _EOF_ --3M 3 4 001 3k --2k 2M 4 002 2 --1 1k 4 003 1M -+cat > exp5 << _EOF_ -+3M 3 3 G 4 001 3k -+2k 2M 2 k 4 002 2 -+1 1k 1 M 4 003 1M - _EOF_ - --for i in 1 2 3; do -+for i in 1 2 3 5; do - LC_ALL="sv_SE.utf8" sort -h -k $i "in" > "out${i}" || fail=1 - compare "exp${i}" "out${i}" || fail=1 - done --- -2.5.5 - diff --git a/coreutils-8.25-sum-ignore-missing.patch b/coreutils-8.25-sum-ignore-missing.patch deleted file mode 100644 index d27d176..0000000 --- a/coreutils-8.25-sum-ignore-missing.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 1e1a69da31b39e4d672ccb8a3ca0e5400d4720ee Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?P=C3=A1draig=20Brady?= -Date: Wed, 26 Oct 2016 15:45:01 +0100 -Subject: [PATCH] md5sum,sha*sum: fix --ignore-missing with checksums starting - with 00 - -* NEWS: Mention the fix. -* src/md5sum.c (digest_file): Add a new MISSING parameter to -return whether the file was missing, separately from the digest. -* tests/misc/md5sum.pl: Add a test case. -Fixes http://bugs.gnu.org/24795 - -Upstream-commit: d0ddfadfb27def2861f35b1a45190a4c1780b257 -Signed-off-by: Kamil Dudka ---- - src/md5sum.c | 20 ++++++++++++-------- - tests/misc/md5sum.pl | 7 +++++++ - 2 files changed, 19 insertions(+), 8 deletions(-) - -diff --git a/src/md5sum.c b/src/md5sum.c -index 933ec99..fee28c7 100644 ---- a/src/md5sum.c -+++ b/src/md5sum.c -@@ -465,15 +465,19 @@ print_filename (char const *file, bool escape) - text because it was a terminal. - - Put the checksum in *BIN_RESULT, which must be properly aligned. -+ Put true in *MISSING if the file can't be opened due to ENOENT. - Return true if successful. */ - - static bool --digest_file (const char *filename, int *binary, unsigned char *bin_result) -+digest_file (const char *filename, int *binary, unsigned char *bin_result, -+ bool *missing) - { - FILE *fp; - int err; - bool is_stdin = STREQ (filename, "-"); - -+ *missing = false; -+ - if (is_stdin) - { - have_read_stdin = true; -@@ -493,7 +497,7 @@ digest_file (const char *filename, int *binary, unsigned char *bin_result) - { - if (ignore_missing && errno == ENOENT) - { -- *bin_result = '\0'; -+ *missing = true; - return true; - } - error (0, errno, "%s", quotef (filename)); -@@ -606,14 +610,14 @@ digest_check (const char *checkfile_name) - '8', '9', 'a', 'b', - 'c', 'd', 'e', 'f' }; - bool ok; -+ bool missing; - /* Only escape in the edge case producing multiple lines, - to ease automatic processing of status output. */ - bool needs_escape = ! status_only && strchr (filename, '\n'); - - properly_formatted_lines = true; - -- *bin_buffer = '\1'; /* flag set to 0 for ignored missing files. */ -- ok = digest_file (filename, &binary, bin_buffer); -+ ok = digest_file (filename, &binary, bin_buffer, &missing); - - if (!ok) - { -@@ -626,10 +630,9 @@ digest_check (const char *checkfile_name) - printf (": %s\n", _("FAILED open or read")); - } - } -- else if (ignore_missing && ! *bin_buffer) -+ else if (ignore_missing && missing) - { -- /* Treat an empty buffer as meaning a missing file, -- which is ignored with --ignore-missing. */ -+ /* Ignore missing files with --ignore-missing. */ - ; - } - else -@@ -879,8 +882,9 @@ main (int argc, char **argv) - else - { - int file_is_binary = binary; -+ bool missing; - -- if (! digest_file (file, &file_is_binary, bin_buffer)) -+ if (! digest_file (file, &file_is_binary, bin_buffer, &missing)) - ok = false; - else - { -diff --git a/tests/misc/md5sum.pl b/tests/misc/md5sum.pl -index 2eb6369..6ea7457 100755 ---- a/tests/misc/md5sum.pl -+++ b/tests/misc/md5sum.pl -@@ -149,6 +149,13 @@ my @Tests = - {ERR=> - "md5sum: f.md5: no file was verified\n"}, - {EXIT=> 1}], -+ # coreutils-8.25 with --ignore-missing treated checksums starting with 00 -+ # as if the file was not present -+ ['check-ignore-missing-6', '--check', '--ignore-missing', -+ {AUX=> {f=> '9t'}}, -+ {IN=> {'f.md5' => -+ "006999e6df389641adf1fa3a74801d9d f\n"}}, -+ {OUT=>"f: OK\n"}], - ['bsd-segv', '--check', {IN=> {'z' => "MD5 ("}}, {EXIT=> 1}, - {ERR=> "$prog: z: no properly formatted MD5 checksum lines found\n"}], - --- -2.7.4 - diff --git a/coreutils-8.26.tar.xz.sig b/coreutils-8.26.tar.xz.sig new file mode 100644 index 0000000..fe1635d --- /dev/null +++ b/coreutils-8.26.tar.xz.sig @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1 + +iQIcBAABAgAGBQJYPyRpAAoJEN9v2XEwYDfZ0I4P/3oaPYXMPEOKuDDpEcLumn26 +gYIMQc1jIMbBNQe120gQmNPkRr5dTKt5Bap9qYkCj0pI/6VxVIWDo0xrOLYZi7AN +Xgr0kX2qLDFEH+EHkC1BpsAdpsgwfvLmVWPHS62CNKgVDgGiP1cRJZe8oVmlBCiR +3ES7pUsBfDn3hbdKNTTmMDtro1rQMOxfHkVCZLAva+JjdzpE+KTvzZzKkVuZZfJ/ +Mi/ZySrXZXFvPBS7GXgop4x8EodyzQMeKO+nvpIUEBY1yLQgCvni5/CBI8w/EViD +DSjj0zWsCQkEjx6HCohi8sBHUYZ+M3lB4rkFk7aevdioPZUGfLkW31LT/cUJC/VV +MIQKWzQtZO/WCJuyEbWP2m25c4MtnnhTm5yoi29yT/CoTRlUWkIQpXm4oD1cJXHy +PpHveu8qM0qRaAtVdXE3pmapIMYUV4g7vxSuCjZRrgiDLhp/K7Lzt5xBhl++kPU2 +U9uc202eah4Towo0pbHsuEJT0vk0GGLq8/17dCa/ss8wV+86ZLxl0kZYy4CNEnIW +vsCN6CJ5AoAEVrMN1F7ZJYnH4hoJedvIczThnAkNTqYYE3wnN9stOe28Oy/a0/tg +bt5/Mn0JbmQei890uU8zcEdUjidHqGV4hKk1E2UC4UCyHG/VcHv9gfr8OaD/xPDr +SoauDCHpBU7J7FT/DX+k +=vkKy +-----END PGP SIGNATURE----- diff --git a/coreutils-8.4-mkdir-modenote.patch b/coreutils-8.4-mkdir-modenote.patch index 1f03c8d..51a129e 100644 --- a/coreutils-8.4-mkdir-modenote.patch +++ b/coreutils-8.4-mkdir-modenote.patch @@ -1,7 +1,8 @@ -diff -urNp coreutils-8.4-orig/doc/coreutils.texi coreutils-8.4/doc/coreutils.texi ---- coreutils-8.4-orig/doc/coreutils.texi 2011-01-07 15:01:18.575654333 +0100 -+++ coreutils-8.4/doc/coreutils.texi 2011-01-07 15:05:38.791655243 +0100 -@@ -9993,6 +9993,8 @@ incorrect. @xref{Directory Setuid and Setgid}, for how the +diff --git a/doc/coreutils.texi b/doc/coreutils.texi +index 400e135..47e4480 100644 +--- a/doc/coreutils.texi ++++ b/doc/coreutils.texi +@@ -10074,6 +10074,8 @@ incorrect. @xref{Directory Setuid and Setgid}, for how the set-user-ID and set-group-ID bits of directories are inherited unless overridden in this way. diff --git a/coreutils-df-direct.patch b/coreutils-df-direct.patch index e69cd2b..a69d896 100644 --- a/coreutils-df-direct.patch +++ b/coreutils-df-direct.patch @@ -1,7 +1,8 @@ -diff -urNp coreutils-8.21-orig/doc/coreutils.texi coreutils-8.21/doc/coreutils.texi ---- coreutils-8.21-orig/doc/coreutils.texi 2013-02-11 10:37:28.000000000 +0100 -+++ coreutils-8.21/doc/coreutils.texi 2013-02-15 10:15:26.497593689 +0100 -@@ -11221,6 +11221,13 @@ some systems (notably SunOS), doing this yields more up to date results, +diff --git a/doc/coreutils.texi b/doc/coreutils.texi +index a507280..400e135 100644 +--- a/doc/coreutils.texi ++++ b/doc/coreutils.texi +@@ -11303,6 +11303,13 @@ some systems (notably SunOS), doing this yields more up to date results, but in general this option makes @command{df} much slower, especially when there are many or very busy file systems. @@ -15,10 +16,11 @@ diff -urNp coreutils-8.21-orig/doc/coreutils.texi coreutils-8.21/doc/coreutils.t @item --total @opindex --total @cindex grand total of disk size, usage and available space -diff -urNp coreutils-8.21-orig/src/df.c coreutils-8.21/src/df.c ---- coreutils-8.21-orig/src/df.c 2013-02-05 00:40:31.000000000 +0100 -+++ coreutils-8.21/src/df.c 2013-02-15 10:26:41.158651782 +0100 -@@ -116,6 +116,9 @@ static bool print_type; +diff --git a/src/df.c b/src/df.c +index 8f760db..a7385fd 100644 +--- a/src/df.c ++++ b/src/df.c +@@ -120,6 +120,9 @@ static bool print_type; /* If true, print a grand total at the end. */ static bool print_grand_total; @@ -28,7 +30,7 @@ diff -urNp coreutils-8.21-orig/src/df.c coreutils-8.21/src/df.c /* Grand total data. */ static struct fs_usage grand_fsu; -@@ -243,13 +246,15 @@ enum +@@ -247,13 +250,15 @@ enum NO_SYNC_OPTION = CHAR_MAX + 1, SYNC_OPTION, TOTAL_OPTION, @@ -45,7 +47,7 @@ diff -urNp coreutils-8.21-orig/src/df.c coreutils-8.21/src/df.c {"inodes", no_argument, NULL, 'i'}, {"human-readable", no_argument, NULL, 'h'}, {"si", no_argument, NULL, 'H'}, -@@ -505,7 +510,10 @@ get_header (void) +@@ -509,7 +514,10 @@ get_header (void) for (col = 0; col < ncolumns; col++) { char *cell = NULL; @@ -57,7 +59,7 @@ diff -urNp coreutils-8.21-orig/src/df.c coreutils-8.21/src/df.c if (columns[col]->field == SIZE_FIELD && (header_mode == DEFAULT_MODE -@@ -1352,6 +1360,19 @@ get_point (const char *point, const struct stat *statp) +@@ -1397,6 +1405,19 @@ get_point (const char *point, const struct stat *statp) static void get_entry (char const *name, struct stat const *statp) { @@ -77,7 +79,7 @@ diff -urNp coreutils-8.21-orig/src/df.c coreutils-8.21/src/df.c if ((S_ISBLK (statp->st_mode) || S_ISCHR (statp->st_mode)) && get_disk (name)) return; -@@ -1422,6 +1443,7 @@ or all file systems by default.\n\ +@@ -1467,6 +1488,7 @@ or all file systems by default.\n\ -B, --block-size=SIZE scale sizes by SIZE before printing them; e.g.,\n\ '-BM' prints sizes in units of 1,048,576 bytes;\n\ see SIZE format below\n\ @@ -85,7 +87,7 @@ diff -urNp coreutils-8.21-orig/src/df.c coreutils-8.21/src/df.c -h, --human-readable print sizes in powers of 1024 (e.g., 1023M)\n\ -H, --si print sizes in powers of 1000 (e.g., 1.1G)\n\ "), stdout); -@@ -1512,6 +1534,9 @@ main (int argc, char **argv) +@@ -1557,6 +1579,9 @@ main (int argc, char **argv) xstrtol_fatal (e, oi, c, long_options, optarg); } break; @@ -95,7 +97,7 @@ diff -urNp coreutils-8.21-orig/src/df.c coreutils-8.21/src/df.c case 'i': if (header_mode == OUTPUT_MODE) { -@@ -1608,6 +1633,13 @@ main (int argc, char **argv) +@@ -1653,6 +1678,13 @@ main (int argc, char **argv) } } @@ -109,9 +111,11 @@ diff -urNp coreutils-8.21-orig/src/df.c coreutils-8.21/src/df.c if (human_output_opts == -1) { if (posix_format) -diff -urNp coreutils-8.21-orig/tests/df/direct.sh coreutils-8.21/tests/df/direct.sh ---- coreutils-8.21-orig/tests/df/direct.sh 1970-01-01 01:00:00.000000000 +0100 -+++ coreutils-8.21/tests/df/direct.sh 2013-02-15 10:15:26.503644446 +0100 +diff --git a/tests/df/direct.sh b/tests/df/direct.sh +new file mode 100644 +index 0000000..8e4cfb8 +--- /dev/null ++++ b/tests/df/direct.sh @@ -0,0 +1,55 @@ +#!/bin/sh +# Ensure "df --direct" works as documented diff --git a/coreutils-i18n-cut-old.patch b/coreutils-i18n-cut-old.patch index 008cecb..7fcc8ff 100644 --- a/coreutils-i18n-cut-old.patch +++ b/coreutils-i18n-cut-old.patch @@ -1,6 +1,7 @@ -diff -urNp coreutils-8.25-orig/src/cut.c coreutils-8.25/src/cut.c ---- coreutils-8.25-orig/src/cut.c 2015-06-26 19:05:22.000000000 +0200 -+++ coreutils-8.25/src/cut.c 2015-07-05 09:04:33.028546950 +0200 +diff --git a/src/cut.c b/src/cut.c +index 7ab6be4..022d0ad 100644 +--- a/src/cut.c ++++ b/src/cut.c @@ -28,6 +28,11 @@ #include #include diff --git a/coreutils-i18n-expand-unexpand.patch b/coreutils-i18n-expand-unexpand.patch index d23e0f0..b5f571f 100644 --- a/coreutils-i18n-expand-unexpand.patch +++ b/coreutils-i18n-expand-unexpand.patch @@ -1,4 +1,4 @@ -From 332e9adf944e4ea232a855b1bf75ea4ddfd7e794 Mon Sep 17 00:00:00 2001 +From e87ab5b991b08092a7e07af82b3ec822a8604151 Mon Sep 17 00:00:00 2001 From: Ondrej Oprala Date: Wed, 5 Aug 2015 09:15:09 +0200 Subject: [PATCH] expand,unexpand: add multibyte support @@ -9,13 +9,7 @@ Content-Transfer-Encoding: 8bit * NEWS: Mention the changes. * bootstrap.conf: Add mbfile to the list of modules. * configure.ac: Properly initialize mbfile. -* po/POTFILES.in: Add new source file. -* src/expand-core.c: Move functions common to both expand and -unexpand to this file. -* src/expand-core.h: Add function prototypes from expand-core.c. * src/expand.c (expand): Iterate over multibyte characters properly. -* src/local.mk: Add expand-core.c to the lists of source codes for -expand and unexpand * src/unexpand.c (unexpand): Iterate over multibyte characters properly. * tests/local.mk: Add new tests. @@ -28,29 +22,23 @@ Co-authored-by: Pádraig Brady lib/mbfile.c | 3 + lib/mbfile.h | 255 +++++++++++++++++++++++++++++++++++++++++++++++++++ m4/mbfile.m4 | 14 +++ - po/POTFILES.in | 1 + - src/expand-core.c | 150 ++++++++++++++++++++++++++++++ - src/expand-core.h | 41 +++++++++ - src/expand.c | 186 ++++++++----------------------------- - src/local.mk | 2 + - src/unexpand.c | 195 ++++++++++----------------------------- + src/expand.c | 43 +++++---- + src/unexpand.c | 54 +++++++---- tests/expand/mb.sh | 98 ++++++++++++++++++++ tests/local.mk | 2 + tests/unexpand/mb.sh | 97 ++++++++++++++++++++ - 14 files changed, 750 insertions(+), 297 deletions(-) + 10 files changed, 535 insertions(+), 34 deletions(-) create mode 100644 lib/mbfile.c create mode 100644 lib/mbfile.h create mode 100644 m4/mbfile.m4 - create mode 100644 src/expand-core.c - create mode 100644 src/expand-core.h create mode 100755 tests/expand/mb.sh create mode 100755 tests/unexpand/mb.sh diff --git a/bootstrap.conf b/bootstrap.conf -index ef1c078..ea8cebc 100644 +index 8a0ff31..a1c78b2 100644 --- a/bootstrap.conf +++ b/bootstrap.conf -@@ -151,6 +151,7 @@ gnulib_modules=" +@@ -152,6 +152,7 @@ gnulib_modules=" maintainer-makefile malloc-gnu manywarnings @@ -59,10 +47,10 @@ index ef1c078..ea8cebc 100644 mbrtowc mbsalign diff --git a/configure.ac b/configure.ac -index 8dc2192..b8b5114 100644 +index 1e74b36..24c9725 100644 --- a/configure.ac +++ b/configure.ac -@@ -425,6 +425,8 @@ fi +@@ -427,6 +427,8 @@ fi # I'm leaving it here for now. This whole thing needs to be modernized... gl_WINSIZE_IN_PTEM @@ -71,30 +59,27 @@ index 8dc2192..b8b5114 100644 gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no && \ -diff --git a/po/POTFILES.in b/po/POTFILES.in -index b3fe668..c594d20 100644 ---- a/po/POTFILES.in -+++ b/po/POTFILES.in -@@ -57,6 +57,7 @@ src/dirname.c - src/du.c - src/echo.c - src/env.c -+src/expand-core.c - src/expand.c - src/expr.c - src/factor.c -diff --git a/src/expand-core.c b/src/expand-core.c +diff --git a/lib/mbfile.c b/lib/mbfile.c +new file mode 100644 +index 0000000..b0a468e +--- /dev/null ++++ b/lib/mbfile.c +@@ -0,0 +1,3 @@ ++#include ++#define MBFILE_INLINE _GL_EXTERN_INLINE ++#include "mbfile.h" +diff --git a/lib/mbfile.h b/lib/mbfile.h new file mode 100644 -index 0000000..c8445db +index 0000000..11f1b12 --- /dev/null -+++ b/src/expand-core.c -@@ -0,0 +1,150 @@ -+/* expand-core.c - elementary functions for the expand and unexpand utilities -+ Copyright (C) 1989-2015 Free Software Foundation, Inc. ++++ b/lib/mbfile.h +@@ -0,0 +1,255 @@ ++/* Multibyte character I/O: macros for multi-byte encodings. ++ Copyright (C) 2001, 2005, 2009-2015 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by -+ the Free Software Foundation, either version 3 of the License, or ++ the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, @@ -105,374 +90,280 @@ index 0000000..c8445db + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + -+#include ++/* Written by Mitsuru Chinen ++ and Bruno Haible . */ + -+#include -+#include ++/* The macros in this file implement multi-byte character input from a ++ stream. + -+#include "system.h" -+#include "error.h" -+#include "fadvise.h" -+#include "quote.h" -+#include "xstrndup.h" ++ mb_file_t ++ is the type for multibyte character input stream, usable for variable ++ declarations. + -+#include "expand-core.h" ++ mbf_char_t ++ is the type for multibyte character or EOF, usable for variable ++ declarations. + -+/* Add the comma or blank separated list of tab stops STOPS -+ to the list of tab stops. */ ++ mbf_init (mbf, stream) ++ initializes the MB_FILE for reading from stream. + -+extern void -+parse_tab_stops (char const *stops, void (*add_tab_stop)(uintmax_t)) -+{ -+ bool have_tabval = false; -+ uintmax_t tabval IF_LINT ( = 0); -+ char const *num_start IF_LINT ( = NULL); -+ bool ok = true; ++ mbf_getc (mbc, mbf) ++ reads the next multibyte character from mbf and stores it in mbc. + -+ for (; *stops; stops++) -+ { -+ if (*stops == ',' || isblank (to_uchar (*stops))) -+ { -+ if (have_tabval) -+ add_tab_stop (tabval); -+ have_tabval = false; -+ } -+ else if (ISDIGIT (*stops)) -+ { -+ if (!have_tabval) -+ { -+ tabval = 0; -+ have_tabval = true; -+ num_start = stops; -+ } ++ mb_iseof (mbc) ++ returns true if mbc represents the EOF value. + -+ /* Detect overflow. */ -+ if (!DECIMAL_DIGIT_ACCUMULATE (tabval, *stops - '0', uintmax_t)) -+ { -+ size_t len = strspn (num_start, "0123456789"); -+ char *bad_num = xstrndup (num_start, len); -+ error (0, 0, _("tab stop is too large %s"), quote (bad_num)); -+ free (bad_num); -+ ok = false; -+ stops = num_start + len - 1; -+ } -+ } -+ else -+ { -+ error (0, 0, _("tab size contains invalid character(s): %s"), -+ quote (stops)); -+ ok = false; -+ break; -+ } -+ } ++ Here are the function prototypes of the macros. + -+ if (!ok) -+ exit (EXIT_FAILURE); ++ extern void mbf_init (mb_file_t mbf, FILE *stream); ++ extern void mbf_getc (mbf_char_t mbc, mb_file_t mbf); ++ extern bool mb_iseof (const mbf_char_t mbc); ++ */ + -+ if (have_tabval) -+ add_tab_stop (tabval); -+} ++#ifndef _MBFILE_H ++#define _MBFILE_H 1 + -+/* Check that the list of tab stops TABS, with ENTRIES entries, -+ contains only nonzero, ascending values. */ ++#include ++#include ++#include ++#include + -+extern void -+validate_tab_stops (uintmax_t const *tabs, size_t entries) -+{ -+ uintmax_t prev_tab = 0; -+ size_t i; ++/* Tru64 with Desktop Toolkit C has a bug: must be included before ++ . ++ BSD/OS 4.1 has a bug: and must be included before ++ . */ ++#include ++#include ++#include + -+ for (i = 0; i < entries; i++) -+ { -+ if (tabs[i] == 0) -+ error (EXIT_FAILURE, 0, _("tab size cannot be 0")); -+ if (tabs[i] <= prev_tab) -+ error (EXIT_FAILURE, 0, _("tab sizes must be ascending")); -+ prev_tab = tabs[i]; -+ } -+} ++#include "mbchar.h" ++ ++#ifndef _GL_INLINE_HEADER_BEGIN ++ #error "Please include config.h first." ++#endif ++_GL_INLINE_HEADER_BEGIN ++#ifndef MBFILE_INLINE ++# define MBFILE_INLINE _GL_INLINE ++#endif + -+/* Close the old stream pointer FP if it is non-NULL, -+ and return a new one opened to read the next input file. -+ Open a filename of '-' as the standard input. -+ Return NULL if there are no more input files. */ ++struct mbfile_multi { ++ FILE *fp; ++ bool eof_seen; ++ bool have_pushback; ++ mbstate_t state; ++ unsigned int bufcount; ++ char buf[MBCHAR_BUF_SIZE]; ++ struct mbchar pushback; ++}; + -+extern FILE * -+next_file (FILE *fp) ++MBFILE_INLINE void ++mbfile_multi_getc (struct mbchar *mbc, struct mbfile_multi *mbf) +{ -+ static char *prev_file; -+ char *file; ++ size_t bytes; ++ ++ /* If EOF has already been seen, don't use getc. This matters if ++ mbf->fp is connected to an interactive tty. */ ++ if (mbf->eof_seen) ++ goto eof; + -+ if (fp) ++ /* Return character pushed back, if there is one. */ ++ if (mbf->have_pushback) + { -+ if (ferror (fp)) -+ { -+ error (0, errno, "%s", prev_file); -+ exit_status = EXIT_FAILURE; -+ } -+ if (STREQ (prev_file, "-")) -+ clearerr (fp); /* Also clear EOF. */ -+ else if (fclose (fp) != 0) ++ mb_copy (mbc, &mbf->pushback); ++ mbf->have_pushback = false; ++ return; ++ } ++ ++ /* Before using mbrtowc, we need at least one byte. */ ++ if (mbf->bufcount == 0) ++ { ++ int c = getc (mbf->fp); ++ if (c == EOF) + { -+ error (0, errno, "%s", prev_file); -+ exit_status = EXIT_FAILURE; ++ mbf->eof_seen = true; ++ goto eof; + } ++ mbf->buf[0] = (unsigned char) c; ++ mbf->bufcount++; ++ } ++ ++ /* Handle most ASCII characters quickly, without calling mbrtowc(). */ ++ if (mbf->bufcount == 1 && mbsinit (&mbf->state) && is_basic (mbf->buf[0])) ++ { ++ /* These characters are part of the basic character set. ISO C 99 ++ guarantees that their wide character code is identical to their ++ char code. */ ++ mbc->wc = mbc->buf[0] = mbf->buf[0]; ++ mbc->wc_valid = true; ++ mbc->ptr = &mbc->buf[0]; ++ mbc->bytes = 1; ++ mbf->bufcount = 0; ++ return; + } + -+ while ((file = *file_list++) != NULL) ++ /* Use mbrtowc on an increasing number of bytes. Read only as many bytes ++ from mbf->fp as needed. This is needed to give reasonable interactive ++ behaviour when mbf->fp is connected to an interactive tty. */ ++ for (;;) + { -+ if (STREQ (file, "-")) ++ /* We don't know whether the 'mbrtowc' function updates the state when ++ it returns -2, - this is the ISO C 99 and glibc-2.2 behaviour - or ++ not - amended ANSI C, glibc-2.1 and Solaris 2.7 behaviour. We ++ don't have an autoconf test for this, yet. ++ The new behaviour would allow us to feed the bytes one by one into ++ mbrtowc. But the old behaviour forces us to feed all bytes since ++ the end of the last character into mbrtowc. Since we want to retry ++ with more bytes when mbrtowc returns -2, we must backup the state ++ before calling mbrtowc, because implementations with the new ++ behaviour will clobber it. */ ++ mbstate_t backup_state = mbf->state; ++ ++ bytes = mbrtowc (&mbc->wc, &mbf->buf[0], mbf->bufcount, &mbf->state); ++ ++ if (bytes == (size_t) -1) ++ { ++ /* An invalid multibyte sequence was encountered. */ ++ /* Return a single byte. */ ++ bytes = 1; ++ mbc->wc_valid = false; ++ break; ++ } ++ else if (bytes == (size_t) -2) + { -+ have_read_stdin = true; -+ fp = stdin; ++ /* An incomplete multibyte character. */ ++ mbf->state = backup_state; ++ if (mbf->bufcount == MBCHAR_BUF_SIZE) ++ { ++ /* An overlong incomplete multibyte sequence was encountered. */ ++ /* Return a single byte. */ ++ bytes = 1; ++ mbc->wc_valid = false; ++ break; ++ } ++ else ++ { ++ /* Read one more byte and retry mbrtowc. */ ++ int c = getc (mbf->fp); ++ if (c == EOF) ++ { ++ /* An incomplete multibyte character at the end. */ ++ mbf->eof_seen = true; ++ bytes = mbf->bufcount; ++ mbc->wc_valid = false; ++ break; ++ } ++ mbf->buf[mbf->bufcount] = (unsigned char) c; ++ mbf->bufcount++; ++ } + } + else -+ fp = fopen (file, "r"); -+ if (fp) + { -+ prev_file = file; -+ fadvise (fp, FADVISE_SEQUENTIAL); -+ return fp; ++ if (bytes == 0) ++ { ++ /* A null wide character was encountered. */ ++ bytes = 1; ++ assert (mbf->buf[0] == '\0'); ++ assert (mbc->wc == 0); ++ } ++ mbc->wc_valid = true; ++ break; + } -+ error (0, errno, "%s", file); -+ exit_status = EXIT_FAILURE; + } -+ return NULL; -+} -diff --git a/src/expand-core.h b/src/expand-core.h -new file mode 100644 -index 0000000..2419407 ---- /dev/null -+++ b/src/expand-core.h -@@ -0,0 +1,41 @@ -+/* expand-core.h - function prototypes for the expand and unexpand utilities -+ Copyright (C) 1989-2015 Free Software Foundation, Inc. -+ -+ This program is free software: you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation, either version 3 of the License, or -+ (at your option) any later version. + -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. ++ /* Return the multibyte sequence mbf->buf[0..bytes-1]. */ ++ mbc->ptr = &mbc->buf[0]; ++ memcpy (&mbc->buf[0], &mbf->buf[0], bytes); ++ mbc->bytes = bytes; + -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ ++ mbf->bufcount -= bytes; ++ if (mbf->bufcount > 0) ++ { ++ /* It's not worth calling memmove() for so few bytes. */ ++ unsigned int count = mbf->bufcount; ++ char *p = &mbf->buf[0]; + -+#ifndef EXPAND_CORE_H_ -+# define EXPAND_CORE_H_ ++ do ++ { ++ *p = *(p + bytes); ++ p++; ++ } ++ while (--count > 0); ++ } ++ return; + -+extern size_t first_free_tab; ++eof: ++ /* An mbchar_t with bytes == 0 is used to indicate EOF. */ ++ mbc->ptr = NULL; ++ mbc->bytes = 0; ++ mbc->wc_valid = false; ++ return; ++} + -+extern size_t n_tabs_allocated; ++MBFILE_INLINE void ++mbfile_multi_ungetc (const struct mbchar *mbc, struct mbfile_multi *mbf) ++{ ++ mb_copy (&mbf->pushback, mbc); ++ mbf->have_pushback = true; ++} + -+extern uintmax_t *tab_list; ++typedef struct mbfile_multi mb_file_t; + -+extern int exit_status; ++typedef mbchar_t mbf_char_t; + -+extern char **file_list; ++#define mbf_init(mbf, stream) \ ++ ((mbf).fp = (stream), \ ++ (mbf).eof_seen = false, \ ++ (mbf).have_pushback = false, \ ++ memset (&(mbf).state, '\0', sizeof (mbstate_t)), \ ++ (mbf).bufcount = 0) + -+extern bool have_read_stdin; ++#define mbf_getc(mbc, mbf) mbfile_multi_getc (&(mbc), &(mbf)) + -+void -+parse_tab_stops (char const *stops, void (*add_tab_stop)(uintmax_t)); ++#define mbf_ungetc(mbc, mbf) mbfile_multi_ungetc (&(mbc), &(mbf)) + -+void -+validate_tab_stops (uintmax_t const *tabs, size_t entries); ++#define mb_iseof(mbc) ((mbc).bytes == 0) + -+FILE * -+next_file (FILE *fp); ++#ifndef _GL_INLINE_HEADER_BEGIN ++ #error "Please include config.h first." ++#endif ++_GL_INLINE_HEADER_BEGIN + -+#endif /* EXPAND_CORE_H_ */ -diff --git a/src/expand.c b/src/expand.c -index 0a40a1a..ed97fd4 100644 ---- a/src/expand.c -+++ b/src/expand.c -@@ -37,12 +37,16 @@ - #include - #include - #include ++#endif /* _MBFILE_H */ +diff --git a/m4/mbfile.m4 b/m4/mbfile.m4 +new file mode 100644 +index 0000000..8589902 +--- /dev/null ++++ b/m4/mbfile.m4 +@@ -0,0 +1,14 @@ ++# mbfile.m4 serial 7 ++dnl Copyright (C) 2005, 2008-2015 Free Software Foundation, Inc. ++dnl This file is free software; the Free Software Foundation ++dnl gives unlimited permission to copy and/or distribute it, ++dnl with or without modifications, as long as this notice is preserved. ++ ++dnl autoconf tests required for use of mbfile.h ++dnl From Bruno Haible. ++ ++AC_DEFUN([gl_MBFILE], ++[ ++ AC_REQUIRE([AC_TYPE_MBSTATE_T]) ++ : ++]) +diff --git a/src/expand.c b/src/expand.c +index 9fa2e10..380e020 100644 +--- a/src/expand.c ++++ b/src/expand.c +@@ -37,6 +37,9 @@ + #include + #include + #include + +#include + #include "system.h" - #include "error.h" - #include "fadvise.h" --#include "quote.h" + #include "die.h" #include "xstrndup.h" - -+#include "expand-core.h" -+ - /* The official name of this program (e.g., no 'g' prefix). */ - #define PROGRAM_NAME "expand" - -@@ -58,17 +62,17 @@ static uintmax_t tab_size; - /* Array of the explicit column numbers of the tab stops; - after 'tab_list' is exhausted, each additional tab is replaced - by a space. The first column is column 0. */ --static uintmax_t *tab_list; -+uintmax_t *tab_list; - - /* The number of allocated entries in 'tab_list'. */ --static size_t n_tabs_allocated; -+size_t n_tabs_allocated; - - /* The index of the first invalid element of 'tab_list', - where the next element can be added. */ --static size_t first_free_tab; -+size_t first_free_tab; - - /* Null-terminated array of input filenames. */ --static char **file_list; -+char **file_list; - - /* Default for 'file_list' if no files are given on the command line. */ - static char *stdin_argv[] = -@@ -77,10 +81,10 @@ static char *stdin_argv[] = - }; - - /* True if we have ever read standard input. */ --static bool have_read_stdin; -+bool have_read_stdin; - - /* The desired exit status. */ --static int exit_status; -+int exit_status; - - static char const shortopts[] = "it:0::1::2::3::4::5::6::7::8::9::"; - -@@ -135,128 +139,6 @@ add_tab_stop (uintmax_t tabval) - tab_list[first_free_tab++] = tabval; - } - --/* Add the comma or blank separated list of tab stops STOPS -- to the list of tab stops. */ -- --static void --parse_tab_stops (char const *stops) --{ -- bool have_tabval = false; -- uintmax_t tabval IF_LINT ( = 0); -- char const *num_start IF_LINT ( = NULL); -- bool ok = true; -- -- for (; *stops; stops++) -- { -- if (*stops == ',' || isblank (to_uchar (*stops))) -- { -- if (have_tabval) -- add_tab_stop (tabval); -- have_tabval = false; -- } -- else if (ISDIGIT (*stops)) -- { -- if (!have_tabval) -- { -- tabval = 0; -- have_tabval = true; -- num_start = stops; -- } -- -- /* Detect overflow. */ -- if (!DECIMAL_DIGIT_ACCUMULATE (tabval, *stops - '0', uintmax_t)) -- { -- size_t len = strspn (num_start, "0123456789"); -- char *bad_num = xstrndup (num_start, len); -- error (0, 0, _("tab stop is too large %s"), quote (bad_num)); -- free (bad_num); -- ok = false; -- stops = num_start + len - 1; -- } -- } -- else -- { -- error (0, 0, _("tab size contains invalid character(s): %s"), -- quote (stops)); -- ok = false; -- break; -- } -- } -- -- if (!ok) -- exit (EXIT_FAILURE); -- -- if (have_tabval) -- add_tab_stop (tabval); --} -- --/* Check that the list of tab stops TABS, with ENTRIES entries, -- contains only nonzero, ascending values. */ -- --static void --validate_tab_stops (uintmax_t const *tabs, size_t entries) --{ -- uintmax_t prev_tab = 0; -- size_t i; -- -- for (i = 0; i < entries; i++) -- { -- if (tabs[i] == 0) -- error (EXIT_FAILURE, 0, _("tab size cannot be 0")); -- if (tabs[i] <= prev_tab) -- error (EXIT_FAILURE, 0, _("tab sizes must be ascending")); -- prev_tab = tabs[i]; -- } --} -- --/* Close the old stream pointer FP if it is non-NULL, -- and return a new one opened to read the next input file. -- Open a filename of '-' as the standard input. -- Return NULL if there are no more input files. */ -- --static FILE * --next_file (FILE *fp) --{ -- static char *prev_file; -- char *file; -- -- if (fp) -- { -- if (ferror (fp)) -- { -- error (0, errno, "%s", quotef (prev_file)); -- exit_status = EXIT_FAILURE; -- } -- if (STREQ (prev_file, "-")) -- clearerr (fp); /* Also clear EOF. */ -- else if (fclose (fp) != 0) -- { -- error (0, errno, "%s", quotef (prev_file)); -- exit_status = EXIT_FAILURE; -- } -- } -- -- while ((file = *file_list++) != NULL) -- { -- if (STREQ (file, "-")) -- { -- have_read_stdin = true; -- fp = stdin; -- } -- else -- fp = fopen (file, "r"); -- if (fp) -- { -- prev_file = file; -- fadvise (fp, FADVISE_SEQUENTIAL); -- return fp; -- } -- error (0, errno, "%s", quotef (file)); -- exit_status = EXIT_FAILURE; -- } -- return NULL; --} -- - /* Change tabs to spaces, writing to stdout. - Read each file in 'file_list', in order. */ - -@@ -265,19 +147,19 @@ expand (void) +@@ -100,19 +103,19 @@ expand (void) { /* Input stream. */ FILE *fp = next_file (NULL); @@ -496,7 +387,7 @@ index 0a40a1a..ed97fd4 100644 /* The following variables have valid values only when CONVERT is true: */ -@@ -287,17 +169,23 @@ expand (void) +@@ -122,17 +125,23 @@ expand (void) /* Index in TAB_LIST of next tab stop to examine. */ size_t tab_index = 0; @@ -524,9 +415,9 @@ index 0a40a1a..ed97fd4 100644 { /* Column the next input tab stop is on. */ uintmax_t next_tab_column; -@@ -328,32 +216,34 @@ expand (void) +@@ -151,32 +160,34 @@ expand (void) if (putchar (' ') < 0) - error (EXIT_FAILURE, errno, _("write error")); + die (EXIT_FAILURE, errno, _("write error")); - c = ' '; + mb_setascii (&c, ' '); @@ -546,7 +437,7 @@ index 0a40a1a..ed97fd4 100644 - column++; + column += mb_width (c); if (!column) - error (EXIT_FAILURE, 0, _("input line is too long")); + die (EXIT_FAILURE, 0, _("input line is too long")); } - convert &= convert_entire_line || !! isblank (c); @@ -560,54 +451,18 @@ index 0a40a1a..ed97fd4 100644 - if (putchar (c) < 0) + mb_putc (c, stdout); + if (ferror (stdout)) - error (EXIT_FAILURE, errno, _("write error")); + die (EXIT_FAILURE, errno, _("write error")); } - while (c != '\n'); + while (!mb_iseq (c, '\n')); } } -@@ -385,19 +275,19 @@ main (int argc, char **argv) - break; - - case 't': -- parse_tab_stops (optarg); -+ parse_tab_stops (optarg, add_tab_stop); - break; - - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - if (optarg) -- parse_tab_stops (optarg - 1); -+ parse_tab_stops (optarg - 1, add_tab_stop); - else - { - char tab_stop[2]; - tab_stop[0] = c; - tab_stop[1] = '\0'; -- parse_tab_stops (tab_stop); -+ parse_tab_stops (tab_stop, add_tab_stop); - } - break; - -diff --git a/src/local.mk b/src/local.mk -index 536b7cc..bfede88 100644 ---- a/src/local.mk -+++ b/src/local.mk -@@ -361,6 +361,8 @@ src_coreutils_SOURCES = src/coreutils.c - - src_cp_SOURCES = src/cp.c $(copy_sources) $(selinux_sources) - src_dir_SOURCES = src/ls.c src/ls-dir.c -+src_expand_SOURCES = src/expand.c src/expand-core.c -+src_unexpand_SOURCES = src/unexpand.c src/expand-core.c - src_vdir_SOURCES = src/ls.c src/ls-vdir.c - src_id_SOURCES = src/id.c src/group-list.c - src_groups_SOURCES = src/groups.c src/group-list.c diff --git a/src/unexpand.c b/src/unexpand.c -index e0f7c22..48fbb32 100644 +index 7801274..569a7ee 100644 --- a/src/unexpand.c +++ b/src/unexpand.c -@@ -38,12 +38,16 @@ +@@ -38,6 +38,9 @@ #include #include #include @@ -615,181 +470,9 @@ index e0f7c22..48fbb32 100644 +#include + #include "system.h" - #include "error.h" - #include "fadvise.h" --#include "quote.h" + #include "die.h" #include "xstrndup.h" - -+#include "expand-core.h" -+ - /* The official name of this program (e.g., no 'g' prefix). */ - #define PROGRAM_NAME "unexpand" - -@@ -62,17 +66,17 @@ static size_t max_column_width; - /* Array of the explicit column numbers of the tab stops; - after 'tab_list' is exhausted, the rest of the line is printed - unchanged. The first column is column 0. */ --static uintmax_t *tab_list; -+uintmax_t *tab_list; - - /* The number of allocated entries in 'tab_list'. */ --static size_t n_tabs_allocated; -+size_t n_tabs_allocated; - - /* The index of the first invalid element of 'tab_list', - where the next element can be added. */ --static size_t first_free_tab; -+size_t first_free_tab; - - /* Null-terminated array of input filenames. */ --static char **file_list; -+char **file_list; - - /* Default for 'file_list' if no files are given on the command line. */ - static char *stdin_argv[] = -@@ -81,10 +85,10 @@ static char *stdin_argv[] = - }; - - /* True if we have ever read standard input. */ --static bool have_read_stdin; -+bool have_read_stdin; - - /* The desired exit status. */ --static int exit_status; -+int exit_status; - - /* For long options that have no equivalent short option, use a - non-character as a pseudo short option, starting with CHAR_MAX + 1. */ -@@ -154,128 +158,6 @@ add_tab_stop (uintmax_t tabval) - } - } - --/* Add the comma or blank separated list of tab stops STOPS -- to the list of tab stops. */ -- --static void --parse_tab_stops (char const *stops) --{ -- bool have_tabval = false; -- uintmax_t tabval IF_LINT ( = 0); -- char const *num_start IF_LINT ( = NULL); -- bool ok = true; -- -- for (; *stops; stops++) -- { -- if (*stops == ',' || isblank (to_uchar (*stops))) -- { -- if (have_tabval) -- add_tab_stop (tabval); -- have_tabval = false; -- } -- else if (ISDIGIT (*stops)) -- { -- if (!have_tabval) -- { -- tabval = 0; -- have_tabval = true; -- num_start = stops; -- } -- -- /* Detect overflow. */ -- if (!DECIMAL_DIGIT_ACCUMULATE (tabval, *stops - '0', uintmax_t)) -- { -- size_t len = strspn (num_start, "0123456789"); -- char *bad_num = xstrndup (num_start, len); -- error (0, 0, _("tab stop is too large %s"), quote (bad_num)); -- free (bad_num); -- ok = false; -- stops = num_start + len - 1; -- } -- } -- else -- { -- error (0, 0, _("tab size contains invalid character(s): %s"), -- quote (stops)); -- ok = false; -- break; -- } -- } -- -- if (!ok) -- exit (EXIT_FAILURE); -- -- if (have_tabval) -- add_tab_stop (tabval); --} -- --/* Check that the list of tab stops TABS, with ENTRIES entries, -- contains only nonzero, ascending values. */ -- --static void --validate_tab_stops (uintmax_t const *tabs, size_t entries) --{ -- uintmax_t prev_tab = 0; -- size_t i; -- -- for (i = 0; i < entries; i++) -- { -- if (tabs[i] == 0) -- error (EXIT_FAILURE, 0, _("tab size cannot be 0")); -- if (tabs[i] <= prev_tab) -- error (EXIT_FAILURE, 0, _("tab sizes must be ascending")); -- prev_tab = tabs[i]; -- } --} -- --/* Close the old stream pointer FP if it is non-NULL, -- and return a new one opened to read the next input file. -- Open a filename of '-' as the standard input. -- Return NULL if there are no more input files. */ -- --static FILE * --next_file (FILE *fp) --{ -- static char *prev_file; -- char *file; -- -- if (fp) -- { -- if (ferror (fp)) -- { -- error (0, errno, "%s", quotef (prev_file)); -- exit_status = EXIT_FAILURE; -- } -- if (STREQ (prev_file, "-")) -- clearerr (fp); /* Also clear EOF. */ -- else if (fclose (fp) != 0) -- { -- error (0, errno, "%s", quotef (prev_file)); -- exit_status = EXIT_FAILURE; -- } -- } -- -- while ((file = *file_list++) != NULL) -- { -- if (STREQ (file, "-")) -- { -- have_read_stdin = true; -- fp = stdin; -- } -- else -- fp = fopen (file, "r"); -- if (fp) -- { -- prev_file = file; -- fadvise (fp, FADVISE_SEQUENTIAL); -- return fp; -- } -- error (0, errno, "%s", quotef (file)); -- exit_status = EXIT_FAILURE; -- } -- return NULL; --} -- - /* Change blanks to tabs, writing to stdout. - Read each file in 'file_list', in order. */ - -@@ -284,11 +166,12 @@ unexpand (void) +@@ -107,11 +110,12 @@ unexpand (void) { /* Input stream. */ FILE *fp = next_file (NULL); @@ -803,7 +486,7 @@ index e0f7c22..48fbb32 100644 if (!fp) return; -@@ -296,12 +179,14 @@ unexpand (void) +@@ -119,12 +123,14 @@ unexpand (void) /* The worst case is a non-blank character, then one blank, then a tab stop, then MAX_COLUMN_WIDTH - 1 blanks, then a non-blank; so allocate MAX_COLUMN_WIDTH bytes to store the blanks. */ @@ -820,7 +503,7 @@ index e0f7c22..48fbb32 100644 /* If true, perform translations. */ bool convert = true; -@@ -335,12 +220,19 @@ unexpand (void) +@@ -158,12 +164,19 @@ unexpand (void) do { @@ -843,9 +526,9 @@ index e0f7c22..48fbb32 100644 if (blank) { -@@ -372,16 +264,16 @@ unexpand (void) +@@ -180,16 +193,16 @@ unexpand (void) if (next_tab_column < column) - error (EXIT_FAILURE, 0, _("input line is too long")); + die (EXIT_FAILURE, 0, _("input line is too long")); - if (c == '\t') + if (mb_iseq (c, '\t')) @@ -863,7 +546,7 @@ index e0f7c22..48fbb32 100644 if (! (prev_blank && column == next_tab_column)) { -@@ -389,13 +281,14 @@ unexpand (void) +@@ -197,13 +210,14 @@ unexpand (void) will be replaced by tabs. */ if (column == next_tab_column) one_blank_before_tab_stop = true; @@ -880,7 +563,7 @@ index e0f7c22..48fbb32 100644 } /* Discard pending blanks, unless it was a single -@@ -403,7 +296,7 @@ unexpand (void) +@@ -211,7 +225,7 @@ unexpand (void) pending = one_blank_before_tab_stop; } } @@ -889,16 +572,16 @@ index e0f7c22..48fbb32 100644 { /* Go back one column, and force recalculation of the next tab stop. */ -@@ -413,7 +306,7 @@ unexpand (void) +@@ -221,7 +235,7 @@ unexpand (void) } else { - column++; + column += mb_width (c); if (!column) - error (EXIT_FAILURE, 0, _("input line is too long")); + die (EXIT_FAILURE, 0, _("input line is too long")); } -@@ -421,9 +314,13 @@ unexpand (void) +@@ -229,8 +243,11 @@ unexpand (void) if (pending) { if (pending > 1 && one_blank_before_tab_stop) @@ -909,12 +592,10 @@ index e0f7c22..48fbb32 100644 + for (int n = 0; n < pending; ++n) + mb_putc (pending_blank[n], stdout); + if (ferror (stdout)) - error (EXIT_FAILURE, errno, _("write error")); -+ + die (EXIT_FAILURE, errno, _("write error")); pending = 0; one_blank_before_tab_stop = false; - } -@@ -432,16 +329,16 @@ unexpand (void) +@@ -240,16 +257,17 @@ unexpand (void) convert &= convert_entire_line || blank; } @@ -924,26 +605,17 @@ index e0f7c22..48fbb32 100644 free (pending_blank); return; } -- + - if (putchar (c) < 0) + mb_putc (c, stdout); + if (ferror (stdout)) - error (EXIT_FAILURE, errno, _("write error")); + die (EXIT_FAILURE, errno, _("write error")); } - while (c != '\n'); + while (!mb_iseq (c, '\n')); } } -@@ -482,7 +379,7 @@ main (int argc, char **argv) - break; - case 't': - convert_entire_line = true; -- parse_tab_stops (optarg); -+ parse_tab_stops (optarg, add_tab_stop); - break; - case CONVERT_FIRST_ONLY_OPTION: - convert_first_only = true; diff --git a/tests/expand/mb.sh b/tests/expand/mb.sh new file mode 100755 index 0000000..7971e18 @@ -1049,10 +721,10 @@ index 0000000..7971e18 + +exit $fail diff --git a/tests/local.mk b/tests/local.mk -index 7df04da..d3462be 100644 +index 192f776..8053397 100644 --- a/tests/local.mk +++ b/tests/local.mk -@@ -536,6 +536,7 @@ all_tests = \ +@@ -544,6 +544,7 @@ all_tests = \ tests/du/threshold.sh \ tests/du/trailing-slash.sh \ tests/du/two-args.sh \ @@ -1060,7 +732,7 @@ index 7df04da..d3462be 100644 tests/id/gnu-zero-uids.sh \ tests/id/no-context.sh \ tests/id/context.sh \ -@@ -674,6 +675,7 @@ all_tests = \ +@@ -684,6 +685,7 @@ all_tests = \ tests/touch/read-only.sh \ tests/touch/relative.sh \ tests/touch/trailing-slash.sh \ @@ -1171,296 +843,6 @@ index 0000000..60d4c1a + +unexpand -a < in > out || fail=1 +compare exp out > /dev/null 2>&1 || fail=1 -diff --git a/m4/mbfile.m4 b/m4/mbfile.m4 -new file mode 100644 -index 0000000..8589902 ---- /dev/null -+++ b/m4/mbfile.m4 -@@ -0,0 +1,14 @@ -+# mbfile.m4 serial 7 -+dnl Copyright (C) 2005, 2008-2015 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+dnl autoconf tests required for use of mbfile.h -+dnl From Bruno Haible. -+ -+AC_DEFUN([gl_MBFILE], -+[ -+ AC_REQUIRE([AC_TYPE_MBSTATE_T]) -+ : -+]) -diff --git a/lib/mbfile.c b/lib/mbfile.c -new file mode 100644 -index 0000000..b0a468e ---- /dev/null -+++ b/lib/mbfile.c -@@ -0,0 +1,3 @@ -+#include -+#define MBFILE_INLINE _GL_EXTERN_INLINE -+#include "mbfile.h" -diff --git a/lib/mbfile.h b/lib/mbfile.h -new file mode 100644 -index 0000000..11f1b12 ---- /dev/null -+++ b/lib/mbfile.h -@@ -0,0 +1,255 @@ -+/* Multibyte character I/O: macros for multi-byte encodings. -+ Copyright (C) 2001, 2005, 2009-2015 Free Software Foundation, Inc. -+ -+ This program is free software: you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+/* Written by Mitsuru Chinen -+ and Bruno Haible . */ -+ -+/* The macros in this file implement multi-byte character input from a -+ stream. -+ -+ mb_file_t -+ is the type for multibyte character input stream, usable for variable -+ declarations. -+ -+ mbf_char_t -+ is the type for multibyte character or EOF, usable for variable -+ declarations. -+ -+ mbf_init (mbf, stream) -+ initializes the MB_FILE for reading from stream. -+ -+ mbf_getc (mbc, mbf) -+ reads the next multibyte character from mbf and stores it in mbc. -+ -+ mb_iseof (mbc) -+ returns true if mbc represents the EOF value. -+ -+ Here are the function prototypes of the macros. -+ -+ extern void mbf_init (mb_file_t mbf, FILE *stream); -+ extern void mbf_getc (mbf_char_t mbc, mb_file_t mbf); -+ extern bool mb_iseof (const mbf_char_t mbc); -+ */ -+ -+#ifndef _MBFILE_H -+#define _MBFILE_H 1 -+ -+#include -+#include -+#include -+#include -+ -+/* Tru64 with Desktop Toolkit C has a bug: must be included before -+ . -+ BSD/OS 4.1 has a bug: and must be included before -+ . */ -+#include -+#include -+#include -+ -+#include "mbchar.h" -+ -+#ifndef _GL_INLINE_HEADER_BEGIN -+ #error "Please include config.h first." -+#endif -+_GL_INLINE_HEADER_BEGIN -+#ifndef MBFILE_INLINE -+# define MBFILE_INLINE _GL_INLINE -+#endif -+ -+struct mbfile_multi { -+ FILE *fp; -+ bool eof_seen; -+ bool have_pushback; -+ mbstate_t state; -+ unsigned int bufcount; -+ char buf[MBCHAR_BUF_SIZE]; -+ struct mbchar pushback; -+}; -+ -+MBFILE_INLINE void -+mbfile_multi_getc (struct mbchar *mbc, struct mbfile_multi *mbf) -+{ -+ size_t bytes; -+ -+ /* If EOF has already been seen, don't use getc. This matters if -+ mbf->fp is connected to an interactive tty. */ -+ if (mbf->eof_seen) -+ goto eof; -+ -+ /* Return character pushed back, if there is one. */ -+ if (mbf->have_pushback) -+ { -+ mb_copy (mbc, &mbf->pushback); -+ mbf->have_pushback = false; -+ return; -+ } -+ -+ /* Before using mbrtowc, we need at least one byte. */ -+ if (mbf->bufcount == 0) -+ { -+ int c = getc (mbf->fp); -+ if (c == EOF) -+ { -+ mbf->eof_seen = true; -+ goto eof; -+ } -+ mbf->buf[0] = (unsigned char) c; -+ mbf->bufcount++; -+ } -+ -+ /* Handle most ASCII characters quickly, without calling mbrtowc(). */ -+ if (mbf->bufcount == 1 && mbsinit (&mbf->state) && is_basic (mbf->buf[0])) -+ { -+ /* These characters are part of the basic character set. ISO C 99 -+ guarantees that their wide character code is identical to their -+ char code. */ -+ mbc->wc = mbc->buf[0] = mbf->buf[0]; -+ mbc->wc_valid = true; -+ mbc->ptr = &mbc->buf[0]; -+ mbc->bytes = 1; -+ mbf->bufcount = 0; -+ return; -+ } -+ -+ /* Use mbrtowc on an increasing number of bytes. Read only as many bytes -+ from mbf->fp as needed. This is needed to give reasonable interactive -+ behaviour when mbf->fp is connected to an interactive tty. */ -+ for (;;) -+ { -+ /* We don't know whether the 'mbrtowc' function updates the state when -+ it returns -2, - this is the ISO C 99 and glibc-2.2 behaviour - or -+ not - amended ANSI C, glibc-2.1 and Solaris 2.7 behaviour. We -+ don't have an autoconf test for this, yet. -+ The new behaviour would allow us to feed the bytes one by one into -+ mbrtowc. But the old behaviour forces us to feed all bytes since -+ the end of the last character into mbrtowc. Since we want to retry -+ with more bytes when mbrtowc returns -2, we must backup the state -+ before calling mbrtowc, because implementations with the new -+ behaviour will clobber it. */ -+ mbstate_t backup_state = mbf->state; -+ -+ bytes = mbrtowc (&mbc->wc, &mbf->buf[0], mbf->bufcount, &mbf->state); -+ -+ if (bytes == (size_t) -1) -+ { -+ /* An invalid multibyte sequence was encountered. */ -+ /* Return a single byte. */ -+ bytes = 1; -+ mbc->wc_valid = false; -+ break; -+ } -+ else if (bytes == (size_t) -2) -+ { -+ /* An incomplete multibyte character. */ -+ mbf->state = backup_state; -+ if (mbf->bufcount == MBCHAR_BUF_SIZE) -+ { -+ /* An overlong incomplete multibyte sequence was encountered. */ -+ /* Return a single byte. */ -+ bytes = 1; -+ mbc->wc_valid = false; -+ break; -+ } -+ else -+ { -+ /* Read one more byte and retry mbrtowc. */ -+ int c = getc (mbf->fp); -+ if (c == EOF) -+ { -+ /* An incomplete multibyte character at the end. */ -+ mbf->eof_seen = true; -+ bytes = mbf->bufcount; -+ mbc->wc_valid = false; -+ break; -+ } -+ mbf->buf[mbf->bufcount] = (unsigned char) c; -+ mbf->bufcount++; -+ } -+ } -+ else -+ { -+ if (bytes == 0) -+ { -+ /* A null wide character was encountered. */ -+ bytes = 1; -+ assert (mbf->buf[0] == '\0'); -+ assert (mbc->wc == 0); -+ } -+ mbc->wc_valid = true; -+ break; -+ } -+ } -+ -+ /* Return the multibyte sequence mbf->buf[0..bytes-1]. */ -+ mbc->ptr = &mbc->buf[0]; -+ memcpy (&mbc->buf[0], &mbf->buf[0], bytes); -+ mbc->bytes = bytes; -+ -+ mbf->bufcount -= bytes; -+ if (mbf->bufcount > 0) -+ { -+ /* It's not worth calling memmove() for so few bytes. */ -+ unsigned int count = mbf->bufcount; -+ char *p = &mbf->buf[0]; -+ -+ do -+ { -+ *p = *(p + bytes); -+ p++; -+ } -+ while (--count > 0); -+ } -+ return; -+ -+eof: -+ /* An mbchar_t with bytes == 0 is used to indicate EOF. */ -+ mbc->ptr = NULL; -+ mbc->bytes = 0; -+ mbc->wc_valid = false; -+ return; -+} -+ -+MBFILE_INLINE void -+mbfile_multi_ungetc (const struct mbchar *mbc, struct mbfile_multi *mbf) -+{ -+ mb_copy (&mbf->pushback, mbc); -+ mbf->have_pushback = true; -+} -+ -+typedef struct mbfile_multi mb_file_t; -+ -+typedef mbchar_t mbf_char_t; -+ -+#define mbf_init(mbf, stream) \ -+ ((mbf).fp = (stream), \ -+ (mbf).eof_seen = false, \ -+ (mbf).have_pushback = false, \ -+ memset (&(mbf).state, '\0', sizeof (mbstate_t)), \ -+ (mbf).bufcount = 0) -+ -+#define mbf_getc(mbc, mbf) mbfile_multi_getc (&(mbc), &(mbf)) -+ -+#define mbf_ungetc(mbc, mbf) mbfile_multi_ungetc (&(mbc), &(mbf)) -+ -+#define mb_iseof(mbc) ((mbc).bytes == 0) -+ -+#ifndef _GL_INLINE_HEADER_BEGIN -+ #error "Please include config.h first." -+#endif -+_GL_INLINE_HEADER_BEGIN -+ -+#endif /* _MBFILE_H */ -- -2.5.5 +2.7.4 diff --git a/coreutils-i18n-fix-unexpand.patch b/coreutils-i18n-fix-unexpand.patch index c7ca839..f0c347c 100644 --- a/coreutils-i18n-fix-unexpand.patch +++ b/coreutils-i18n-fix-unexpand.patch @@ -1,60 +1,28 @@ -From lkundrak@v3.sk Thu Jan 28 20:57:48 2016 -Return-Path: lkundrak@v3.sk -Received: from zimbra.v3.sk (LHLO zimbra.v3.sk) (10.13.37.31) by - zimbra.v3.sk with LMTP; Thu, 28 Jan 2016 20:57:48 +0100 (CET) -Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) - with ESMTP id D4DD260F92 for ; Thu, 28 Jan 2016 20:57:47 - +0100 (CET) -X-Spam-Flag: NO -X-Spam-Score: -2.9 -X-Spam-Level: -X-Spam-Status: No, score=-2.9 tagged_above=-10 required=3 - tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=ham autolearn_force=no -Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk - [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id HB5H5ynfOcyL; Thu, 28 - Jan 2016 20:57:45 +0100 (CET) -Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) - with ESMTP id 3FEF160F90; Thu, 28 Jan 2016 20:57:45 +0100 (CET) -X-Virus-Scanned: amavisd-new at zimbra.v3.sk -Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk - [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id TUF9p5l6r9SN; Thu, 28 - Jan 2016 20:57:44 +0100 (CET) -Received: from odvarok.localdomain (s559633cb.adsl.online.nl - [85.150.51.203]) by zimbra.v3.sk (Postfix) with ESMTPSA id 6763560F8F; Thu, - 28 Jan 2016 20:57:44 +0100 (CET) +From 02424bfcd719bbaa695f4e1c3ef17ad91b0d23c0 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel -To: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= , Ondrej - Oprala -Cc: Lubomir Rintel -Subject: [PATCH] unexpand: fix blank line handling Date: Thu, 28 Jan 2016 20:57:22 +0100 -Message-Id: <1454011042-30492-1-git-send-email-lkundrak@v3.sk> -X-Mailer: git-send-email 2.5.0 -X-Evolution-Source: 1409576065.5421.4@dhcp-24-163.brq.redhat.com -Content-Transfer-Encoding: 8bit -Mime-Version: 1.0 +Subject: [PATCH] unexpand: fix blank line handling + + echo '' |./src/unexpand -a + +Really? +--- + src/unexpand.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) - echo '' |./src/unexpand -a - -Really? ---- - src/unexpand.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/unexpand.c b/src/unexpand.c -index d6ff662..762c56b 100644 ---- a/src/unexpand.c -+++ b/src/unexpand.c -@@ -304,7 +304,7 @@ unexpand (void) - next_tab_column = column; - tab_index -= !!tab_index; - } -- else -+ else if (!mb_iseq (c, '\n')) - { - column += mb_width (c); - if (!column) --- -2.5.0 - +diff --git a/src/unexpand.c b/src/unexpand.c +index 569a7ee..3bbbd66 100644 +--- a/src/unexpand.c ++++ b/src/unexpand.c +@@ -233,7 +233,7 @@ unexpand (void) + next_tab_column = column; + tab_index -= !!tab_index; + } +- else ++ else if (!mb_iseq (c, '\n')) + { + column += mb_width (c); + if (!column) +-- +2.7.4 diff --git a/coreutils-i18n-fix2-expand-unexpand.patch b/coreutils-i18n-fix2-expand-unexpand.patch index 1f02c5e..1a63012 100644 --- a/coreutils-i18n-fix2-expand-unexpand.patch +++ b/coreutils-i18n-fix2-expand-unexpand.patch @@ -1,7 +1,8 @@ -diff -up ./src/expand.c.orig ./src/expand.c ---- ./src/expand.c.orig 2016-06-01 12:42:49.330373488 +0200 -+++ ./src/expand.c 2016-06-07 14:35:16.011142041 +0200 -@@ -173,15 +173,19 @@ expand (void) +diff --git a/src/expand.c b/src/expand.c +index 380e020..310b349 100644 +--- a/src/expand.c ++++ b/src/expand.c +@@ -129,15 +129,19 @@ expand (void) do { @@ -25,10 +26,11 @@ diff -up ./src/expand.c.orig ./src/expand.c if (convert) { -diff -up ./src/unexpand.c.orig ./src/unexpand.c ---- ./src/unexpand.c.orig 2016-06-07 14:26:57.380746446 +0200 -+++ ./src/unexpand.c 2016-06-07 14:34:54.059256698 +0200 -@@ -220,15 +220,19 @@ unexpand (void) +diff --git a/src/unexpand.c b/src/unexpand.c +index 3bbbd66..863a90a 100644 +--- a/src/unexpand.c ++++ b/src/unexpand.c +@@ -164,15 +164,19 @@ unexpand (void) do { @@ -52,9 +54,10 @@ diff -up ./src/unexpand.c.orig ./src/unexpand.c if (convert) { -diff -up ./tests/expand/mb.sh.orig ./tests/expand/mb.sh ---- ./tests/expand/mb.sh.orig 2016-05-11 14:13:53.095289000 +0200 -+++ ./tests/expand/mb.sh 2016-06-07 14:38:48.259033445 +0200 +diff --git a/tests/expand/mb.sh b/tests/expand/mb.sh +index 7971e18..031be7a 100755 +--- a/tests/expand/mb.sh ++++ b/tests/expand/mb.sh @@ -44,6 +44,20 @@ EOF expand < in > out || fail=1 compare exp out > /dev/null 2>&1 || fail=1 @@ -76,9 +79,10 @@ diff -up ./tests/expand/mb.sh.orig ./tests/expand/mb.sh #test characters with display widths != 1 env printf '12345678 e\t|ascii(1) -diff -up ./tests/unexpand/mb.sh.orig ./tests/unexpand/mb.sh ---- ./tests/unexpand/mb.sh.orig 2016-06-07 14:41:44.210106466 +0200 -+++ ./tests/unexpand/mb.sh 2016-06-07 14:52:28.848639772 +0200 +diff --git a/tests/unexpand/mb.sh b/tests/unexpand/mb.sh +index 60d4c1a..8d75652 100755 +--- a/tests/unexpand/mb.sh ++++ b/tests/unexpand/mb.sh @@ -44,6 +44,22 @@ EOF unexpand -a < in > out || fail=1 compare exp out > /dev/null 2>&1 || fail=1 diff --git a/coreutils-i18n-sort-human.patch b/coreutils-i18n-sort-human.patch index 2469189..6752493 100644 --- a/coreutils-i18n-sort-human.patch +++ b/coreutils-i18n-sort-human.patch @@ -14,7 +14,7 @@ diff --git a/src/sort.c b/src/sort.c index 9e07ad8..e47b039 100644 --- a/src/sort.c +++ b/src/sort.c -@@ -2274,12 +2274,10 @@ find_unit_order (char const *number) +@@ -2304,12 +2304,10 @@ find_unit_order (char const *number) < K/k < M < G < T < P < E < Z < Y */ static int diff --git a/coreutils-i18n-un-expand-BOM.patch b/coreutils-i18n-un-expand-BOM.patch index 44769c6..56e7fa5 100644 --- a/coreutils-i18n-un-expand-BOM.patch +++ b/coreutils-i18n-un-expand-BOM.patch @@ -1,19 +1,20 @@ -diff -up ./src/expand-core.c.orig ./src/expand-core.c ---- ./src/expand-core.c.orig 2016-06-28 14:44:18.281619000 +0200 -+++ ./src/expand-core.c 2016-06-30 11:46:50.025109755 +0200 +diff --git a/src/expand-common.c b/src/expand-common.c +index 4657e46..97cbb09 100644 +--- a/src/expand-common.c ++++ b/src/expand-common.c @@ -18,6 +18,7 @@ #include #include +#include - #include "system.h" + #include "die.h" #include "error.h" -@@ -27,6 +28,119 @@ - - #include "expand-core.h" +@@ -85,6 +86,119 @@ add_tab_stop (uintmax_t tabval) + } + } -+extern inline int ++extern int +set_utf_locale (void) +{ + /*try using some predefined locale */ @@ -118,7 +119,7 @@ diff -up ./src/expand-core.c.orig ./src/expand-core.c + return false; +} + -+extern inline void ++extern void +print_bom(void) +{ + putc (0xEF, stdout); @@ -128,42 +129,35 @@ diff -up ./src/expand-core.c.orig ./src/expand-core.c + /* Add the comma or blank separated list of tab stops STOPS to the list of tab stops. */ + extern void +diff --git a/src/expand-common.h b/src/expand-common.h +index 8cb2079..763bfda 100644 +--- a/src/expand-common.h ++++ b/src/expand-common.h +@@ -34,6 +34,18 @@ extern size_t max_column_width; + /* The desired exit status. */ + extern int exit_status; -diff -up ./src/expand-core.h.orig ./src/expand-core.h ---- ./src/expand-core.h.orig 2016-06-28 14:44:18.281619000 +0200 -+++ ./src/expand-core.h 2016-06-30 11:47:18.929437205 +0200 -@@ -15,7 +15,7 @@ - along with this program. If not, see . */ - - #ifndef EXPAND_CORE_H_ --# define EXPAND_CORE_H_ -+#define EXPAND_CORE_H_ - - extern size_t first_free_tab; - -@@ -29,6 +29,18 @@ extern char **file_list; - - extern bool have_read_stdin; - -+inline int ++extern int +set_utf_locale (void); + -+bool ++extern bool +check_utf_locale(void); + -+bool ++extern bool +check_bom(FILE* fp, mb_file_t *mbf); + -+inline void ++extern void +print_bom(void); + - void - parse_tab_stops (char const *stops, void (*add_tab_stop)(uintmax_t)); - -diff -up ./src/expand.c.orig ./src/expand.c ---- ./src/expand.c.orig 2016-06-28 14:44:18.286619000 +0200 -+++ ./src/expand.c 2016-06-30 11:50:15.077312947 +0200 -@@ -149,11 +149,33 @@ expand (void) + /* Add tab stop TABVAL to the end of 'tab_list'. */ + extern void + add_tab_stop (uintmax_t tabval); +diff --git a/src/expand.c b/src/expand.c +index 310b349..4136824 100644 +--- a/src/expand.c ++++ b/src/expand.c +@@ -105,11 +105,33 @@ expand (void) FILE *fp = next_file (NULL); mb_file_t mbf; mbf_char_t c; @@ -199,7 +193,7 @@ diff -up ./src/expand.c.orig ./src/expand.c while (true) { -@@ -178,6 +200,27 @@ expand (void) +@@ -134,6 +156,27 @@ expand (void) if ((mb_iseof (c)) && (fp = next_file (fp))) { mbf_init (mbf, fp); @@ -227,10 +221,11 @@ diff -up ./src/expand.c.orig ./src/expand.c continue; } else -diff -up ./src/unexpand.c.orig ./src/unexpand.c ---- ./src/unexpand.c.orig 2016-06-28 17:39:22.894259000 +0200 -+++ ./src/unexpand.c 2016-07-07 09:48:07.659924755 +0200 -@@ -172,16 +172,36 @@ unexpand (void) +diff --git a/src/unexpand.c b/src/unexpand.c +index 863a90a..5681b58 100644 +--- a/src/unexpand.c ++++ b/src/unexpand.c +@@ -116,16 +116,36 @@ unexpand (void) include characters other than spaces, so the blanks must be stored, not merely counted. */ mbf_char_t *pending_blank; @@ -268,7 +263,7 @@ diff -up ./src/unexpand.c.orig ./src/unexpand.c while (true) { -@@ -225,6 +245,27 @@ unexpand (void) +@@ -169,6 +189,27 @@ unexpand (void) if ((mb_iseof (c)) && (fp = next_file (fp))) { mbf_init (mbf, fp); @@ -296,10 +291,11 @@ diff -up ./src/unexpand.c.orig ./src/unexpand.c continue; } else -diff -up ./tests/expand/mb.sh.orig ./tests/expand/mb.sh ---- ./tests/expand/mb.sh.orig 2016-06-28 14:44:18.287619000 +0200 -+++ ./tests/expand/mb.sh 2016-06-30 11:57:10.038407216 +0200 -@@ -109,4 +109,75 @@ äbcdef\xFF | +diff --git a/tests/expand/mb.sh b/tests/expand/mb.sh +index 031be7a..1621c84 100755 +--- a/tests/expand/mb.sh ++++ b/tests/expand/mb.sh +@@ -109,4 +109,75 @@ env printf '12345678 expand < in > out || fail=1 compare exp out > /dev/null 2>&1 || fail=1 @@ -375,10 +371,11 @@ diff -up ./tests/expand/mb.sh.orig ./tests/expand/mb.sh +compare exp out > /dev/null 2>&1 || fail=1 + exit $fail -diff -up ./tests/unexpand/mb.sh.orig ./tests/unexpand/mb.sh ---- ./tests/unexpand/mb.sh.orig 2016-06-28 17:39:22.895259000 +0200 -+++ ./tests/unexpand/mb.sh 2016-07-07 09:55:00.098281917 +0200 -@@ -111,3 +111,62 @@ äbcdef\xFF\t| +diff --git a/tests/unexpand/mb.sh b/tests/unexpand/mb.sh +index 8d75652..9d4ee3e 100755 +--- a/tests/unexpand/mb.sh ++++ b/tests/unexpand/mb.sh +@@ -111,3 +111,62 @@ env printf '12345678 unexpand -a < in > out || fail=1 compare exp out > /dev/null 2>&1 || fail=1 diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch index bcce9ff..d7cf59c 100644 --- a/coreutils-i18n.patch +++ b/coreutils-i18n.patch @@ -1,6 +1,36 @@ -diff -urNp coreutils-8.24-orig/lib/linebuffer.h coreutils-8.24/lib/linebuffer.h ---- coreutils-8.24-orig/lib/linebuffer.h 2015-06-16 07:00:37.000000000 +0200 -+++ coreutils-8.24/lib/linebuffer.h 2015-07-05 09:04:33.027546943 +0200 +From 29117b2d07af00f4d4b87cf778e4294588ab1a83 Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Thu, 1 Dec 2016 15:10:04 +0100 +Subject: [PATCH] coreutils-i18n.patch + +TODO: merge upstream +--- + lib/linebuffer.h | 8 + + src/fold.c | 308 ++++++++++++++++-- + src/join.c | 359 ++++++++++++++++++--- + src/pr.c | 443 ++++++++++++++++++++++--- + src/sort.c | 764 +++++++++++++++++++++++++++++++++++++++++--- + src/uniq.c | 265 ++++++++++++++- + tests/i18n/sort.sh | 29 ++ + tests/local.mk | 2 + + tests/misc/cut.pl | 7 +- + tests/misc/expand.pl | 42 +++ + tests/misc/fold.pl | 50 ++- + tests/misc/join.pl | 50 +++ + tests/misc/sort-mb-tests.sh | 45 +++ + tests/misc/sort-merge.pl | 42 +++ + tests/misc/sort.pl | 40 ++- + tests/misc/unexpand.pl | 39 +++ + tests/misc/uniq.pl | 55 ++++ + tests/pr/pr-tests.pl | 49 +++ + 18 files changed, 2435 insertions(+), 162 deletions(-) + create mode 100644 tests/i18n/sort.sh + create mode 100644 tests/misc/sort-mb-tests.sh + +diff --git a/lib/linebuffer.h b/lib/linebuffer.h +index 64181af..9b8fe5a 100644 +--- a/lib/linebuffer.h ++++ b/lib/linebuffer.h @@ -21,6 +21,11 @@ # include @@ -23,10 +53,11 @@ diff -urNp coreutils-8.24-orig/lib/linebuffer.h coreutils-8.24/lib/linebuffer.h }; /* Initialize linebuffer LINEBUFFER for use. */ -diff -urNp coreutils-8.24-orig/src/fold.c coreutils-8.24/src/fold.c ---- coreutils-8.24-orig/src/fold.c 2015-06-26 19:05:22.000000000 +0200 -+++ coreutils-8.24/src/fold.c 2015-07-05 09:04:33.029546958 +0200 -@@ -22,11 +22,33 @@ +diff --git a/src/fold.c b/src/fold.c +index 8cd0d6b..d23edd5 100644 +--- a/src/fold.c ++++ b/src/fold.c +@@ -22,12 +22,34 @@ #include #include @@ -41,6 +72,7 @@ diff -urNp coreutils-8.24-orig/src/fold.c coreutils-8.24/src/fold.c +#endif + #include "system.h" + #include "die.h" #include "error.h" #include "fadvise.h" #include "xdectoint.h" @@ -60,7 +92,7 @@ diff -urNp coreutils-8.24-orig/src/fold.c coreutils-8.24/src/fold.c #define TAB_WIDTH 8 /* The official name of this program (e.g., no 'g' prefix). */ -@@ -34,20 +56,41 @@ +@@ -35,20 +57,41 @@ #define AUTHORS proper_name ("David MacKenzie") @@ -106,7 +138,7 @@ diff -urNp coreutils-8.24-orig/src/fold.c coreutils-8.24/src/fold.c {"spaces", no_argument, NULL, 's'}, {"width", required_argument, NULL, 'w'}, {GETOPT_HELP_OPTION_DECL}, -@@ -75,6 +118,7 @@ Wrap input lines in each FILE, writing to standard output.\n\ +@@ -76,6 +119,7 @@ Wrap input lines in each FILE, writing to standard output.\n\ fputs (_("\ -b, --bytes count bytes rather than columns\n\ @@ -114,7 +146,7 @@ diff -urNp coreutils-8.24-orig/src/fold.c coreutils-8.24/src/fold.c -s, --spaces break at spaces\n\ -w, --width=WIDTH use WIDTH columns instead of 80\n\ "), stdout); -@@ -92,7 +136,7 @@ Wrap input lines in each FILE, writing to standard output.\n\ +@@ -93,7 +137,7 @@ Wrap input lines in each FILE, writing to standard output.\n\ static size_t adjust_column (size_t column, char c) { @@ -123,7 +155,7 @@ diff -urNp coreutils-8.24-orig/src/fold.c coreutils-8.24/src/fold.c { if (c == '\b') { -@@ -115,30 +159,14 @@ adjust_column (size_t column, char c) +@@ -116,30 +160,14 @@ adjust_column (size_t column, char c) to stdout, with maximum line length WIDTH. Return true if successful. */ @@ -156,7 +188,7 @@ diff -urNp coreutils-8.24-orig/src/fold.c coreutils-8.24/src/fold.c fadvise (istream, FADVISE_SEQUENTIAL); -@@ -168,6 +196,15 @@ fold_file (char const *filename, size_t width) +@@ -169,6 +197,15 @@ fold_file (char const *filename, size_t width) bool found_blank = false; size_t logical_end = offset_out; @@ -172,7 +204,7 @@ diff -urNp coreutils-8.24-orig/src/fold.c coreutils-8.24/src/fold.c /* Look for the last blank. */ while (logical_end) { -@@ -214,11 +251,221 @@ fold_file (char const *filename, size_t width) +@@ -215,11 +252,221 @@ fold_file (char const *filename, size_t width) line_out[offset_out++] = c; } @@ -395,7 +427,7 @@ diff -urNp coreutils-8.24-orig/src/fold.c coreutils-8.24/src/fold.c if (ferror (istream)) { error (0, saved_errno, "%s", quotef (filename)); -@@ -251,7 +498,8 @@ main (int argc, char **argv) +@@ -252,7 +499,8 @@ main (int argc, char **argv) atexit (close_stdout); @@ -405,7 +437,7 @@ diff -urNp coreutils-8.24-orig/src/fold.c coreutils-8.24/src/fold.c while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1) { -@@ -260,7 +508,15 @@ main (int argc, char **argv) +@@ -261,7 +509,15 @@ main (int argc, char **argv) switch (optc) { case 'b': /* Count bytes rather than columns. */ @@ -422,10 +454,11 @@ diff -urNp coreutils-8.24-orig/src/fold.c coreutils-8.24/src/fold.c break; case 's': /* Break at word boundaries. */ -diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c ---- coreutils-8.24-orig/src/join.c 2015-06-26 19:05:22.000000000 +0200 -+++ coreutils-8.24/src/join.c 2015-07-05 09:04:33.029546958 +0200 -@@ -22,18 +22,32 @@ +diff --git a/src/join.c b/src/join.c +index 98b461c..9990f38 100644 +--- a/src/join.c ++++ b/src/join.c +@@ -22,19 +22,33 @@ #include #include @@ -440,6 +473,7 @@ diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c +#endif + #include "system.h" + #include "die.h" #include "error.h" #include "fadvise.h" #include "hard-locale.h" @@ -459,7 +493,7 @@ diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "join" -@@ -135,10 +149,12 @@ static struct outlist outlist_head; +@@ -136,10 +150,12 @@ static struct outlist outlist_head; /* Last element in 'outlist', where a new element can be added. */ static struct outlist *outlist_end = &outlist_head; @@ -476,7 +510,7 @@ diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c /* If nonzero, check that the input is correctly ordered. */ static enum -@@ -275,13 +291,14 @@ xfields (struct line *line) +@@ -276,13 +292,14 @@ xfields (struct line *line) if (ptr == lim) return; @@ -494,7 +528,7 @@ diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c { /* Skip leading blanks before the first field. */ while (field_sep (*ptr)) -@@ -305,6 +322,147 @@ xfields (struct line *line) +@@ -306,6 +323,147 @@ xfields (struct line *line) extract_field (line, ptr, lim - ptr); } @@ -642,7 +676,7 @@ diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c static void freeline (struct line *line) { -@@ -326,56 +484,133 @@ keycmp (struct line const *line1, struct line const *line2, +@@ -327,56 +485,133 @@ keycmp (struct line const *line1, struct line const *line2, size_t jf_1, size_t jf_2) { /* Start of field to compare in each file. */ @@ -799,7 +833,7 @@ diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c } /* Check that successive input lines PREV and CURRENT from input file -@@ -467,6 +702,11 @@ get_line (FILE *fp, struct line **linep, int which) +@@ -468,6 +703,11 @@ get_line (FILE *fp, struct line **linep, int which) } ++line_no[which - 1]; @@ -811,7 +845,7 @@ diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c xfields (line); if (prevline[which - 1]) -@@ -566,21 +806,28 @@ prfield (size_t n, struct line const *line) +@@ -567,21 +807,28 @@ prfield (size_t n, struct line const *line) /* Output all the fields in line, other than the join field. */ @@ -843,7 +877,7 @@ diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c prfield (i, line); } } -@@ -591,7 +838,6 @@ static void +@@ -592,7 +839,6 @@ static void prjoin (struct line const *line1, struct line const *line2) { const struct outlist *outlist; @@ -851,7 +885,7 @@ diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c size_t field; struct line const *line; -@@ -625,7 +871,7 @@ prjoin (struct line const *line1, struct line const *line2) +@@ -626,7 +872,7 @@ prjoin (struct line const *line1, struct line const *line2) o = o->next; if (o == NULL) break; @@ -860,7 +894,7 @@ diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c } putchar (eolchar); } -@@ -1103,21 +1349,46 @@ main (int argc, char **argv) +@@ -1104,20 +1350,43 @@ main (int argc, char **argv) case 't': { @@ -887,16 +921,14 @@ diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c + newtablen = 1; if (! newtab) - newtab = '\n'; /* '' => process the whole line. */ -+ { + newtab = (char*)"\n"; /* '' => process the whole line. */ -+ } else if (optarg[1]) { - if (STREQ (optarg, "\\0")) - newtab = '\0'; - else -- error (EXIT_FAILURE, 0, _("multi-character tab %s"), -- quote (optarg)); +- die (EXIT_FAILURE, 0, _("multi-character tab %s"), +- quote (optarg)); + if (newtablen == 1 && newtab[1]) + { + if (STREQ (newtab, "\\0")) @@ -906,20 +938,19 @@ diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c + if (tab != NULL && strcmp (tab, newtab)) + { + free (newtab); -+ error (EXIT_FAILURE, 0, _("incompatible tabs")); ++ die (EXIT_FAILURE, 0, _("incompatible tabs")); } - if (0 <= tab && tab != newtab) -- error (EXIT_FAILURE, 0, _("incompatible tabs")); +- die (EXIT_FAILURE, 0, _("incompatible tabs")); tab = newtab; -- } + tablen = newtablen; -+ } + } break; - case 'z': -diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c ---- coreutils-8.24-orig/src/pr.c 2015-06-26 19:05:22.000000000 +0200 -+++ coreutils-8.24/src/pr.c 2015-07-05 09:04:33.030546965 +0200 +diff --git a/src/pr.c b/src/pr.c +index 26f221f..633f50e 100644 +--- a/src/pr.c ++++ b/src/pr.c @@ -311,6 +311,24 @@ #include @@ -943,9 +974,9 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c +#endif + #include "system.h" + #include "die.h" #include "error.h" - #include "fadvise.h" -@@ -323,6 +341,18 @@ +@@ -324,6 +342,18 @@ #include "xstrtol.h" #include "xdectoint.h" @@ -964,7 +995,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "pr" -@@ -415,7 +445,20 @@ struct COLUMN +@@ -416,7 +446,20 @@ struct COLUMN typedef struct COLUMN COLUMN; @@ -986,7 +1017,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c static bool read_line (COLUMN *p); static bool print_page (void); static bool print_stored (COLUMN *p); -@@ -427,6 +470,7 @@ static void add_line_number (COLUMN *p); +@@ -428,6 +471,7 @@ static void add_line_number (COLUMN *p); static void getoptnum (const char *n_str, int min, int *num, const char *errfmt); static void getoptarg (char *arg, char switch_char, char *character, @@ -994,7 +1025,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c int *number); static void print_files (int number_of_files, char **av); static void init_parameters (int number_of_files); -@@ -440,7 +484,6 @@ static void store_char (char c); +@@ -441,7 +485,6 @@ static void store_char (char c); static void pad_down (unsigned int lines); static void read_rest_of_line (COLUMN *p); static void skip_read (COLUMN *p, int column_number); @@ -1002,7 +1033,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c static void cleanup (void); static void print_sep_string (void); static void separator_string (const char *optarg_S); -@@ -452,7 +495,7 @@ static COLUMN *column_vector; +@@ -453,7 +496,7 @@ static COLUMN *column_vector; we store the leftmost columns contiguously in buff. To print a line from buff, get the index of the first character from line_vector[i], and print up to line_vector[i + 1]. */ @@ -1011,7 +1042,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c /* Index of the position in buff where the next character will be stored. */ -@@ -556,7 +599,7 @@ static int chars_per_column; +@@ -557,7 +600,7 @@ static int chars_per_column; static bool untabify_input = false; /* (-e) The input tab character. */ @@ -1020,7 +1051,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c /* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ... where the leftmost column is 1. */ -@@ -566,7 +609,10 @@ static int chars_per_input_tab = 8; +@@ -567,7 +610,10 @@ static int chars_per_input_tab = 8; static bool tabify_output = false; /* (-i) The output tab character. */ @@ -1032,7 +1063,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c /* (-i) The width of the output tab. */ static int chars_per_output_tab = 8; -@@ -636,7 +682,13 @@ static int line_number; +@@ -637,7 +683,13 @@ static int line_number; static bool numbered_lines = false; /* (-n) Character which follows each line number. */ @@ -1047,18 +1078,18 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c /* (-n) line counting starts with 1st line of input file (not with 1st line of 1st page printed). */ -@@ -689,6 +741,7 @@ static bool use_col_separator = false; +@@ -690,6 +742,7 @@ static bool use_col_separator = false; -a|COLUMN|-m is a 'space' and with the -J option a 'tab'. */ - static char *col_sep_string = (char *) ""; + static char const *col_sep_string = ""; static int col_sep_length = 0; +static int col_sep_width = 0; static char *column_separator = (char *) " "; static char *line_separator = (char *) "\t"; -@@ -839,6 +892,13 @@ separator_string (const char *optarg_S) - col_sep_length = (int) strlen (optarg_S); - col_sep_string = xmalloc (col_sep_length + 1); - strcpy (col_sep_string, optarg_S); +@@ -851,6 +904,13 @@ separator_string (const char *optarg_S) + integer_overflow (); + col_sep_length = len; + col_sep_string = optarg_S; + +#if HAVE_MBRTOWC + if (MB_CUR_MAX > 1) @@ -1069,7 +1100,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c } int -@@ -863,6 +923,21 @@ main (int argc, char **argv) +@@ -875,6 +935,21 @@ main (int argc, char **argv) atexit (close_stdout); @@ -1090,8 +1121,8 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c + n_files = 0; file_names = (argc > 1 - ? xmalloc ((argc - 1) * sizeof (char *)) -@@ -939,8 +1014,12 @@ main (int argc, char **argv) + ? xnmalloc (argc - 1, sizeof (char *)) +@@ -951,8 +1026,12 @@ main (int argc, char **argv) break; case 'e': if (optarg) @@ -1106,7 +1137,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c /* Could check tab width > 0. */ untabify_input = true; break; -@@ -953,8 +1032,12 @@ main (int argc, char **argv) +@@ -965,8 +1044,12 @@ main (int argc, char **argv) break; case 'i': if (optarg) @@ -1121,7 +1152,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c /* Could check tab width > 0. */ tabify_output = true; break; -@@ -972,8 +1055,8 @@ main (int argc, char **argv) +@@ -984,8 +1067,8 @@ main (int argc, char **argv) case 'n': numbered_lines = true; if (optarg) @@ -1132,16 +1163,15 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c break; case 'N': skip_count = false; -@@ -997,7 +1080,7 @@ main (int argc, char **argv) - old_s = false; +@@ -1010,6 +1093,7 @@ main (int argc, char **argv) /* Reset an additional input of -s, -S dominates -s */ - col_sep_string = bad_cast (""); -- col_sep_length = 0; -+ col_sep_length = col_sep_width = 0; + col_sep_string = ""; + col_sep_length = 0; ++ col_sep_width = 0; use_col_separator = true; if (optarg) separator_string (optarg); -@@ -1152,10 +1235,45 @@ getoptnum (const char *n_str, int min, int *num, const char *err) +@@ -1166,10 +1250,45 @@ getoptnum (const char *n_str, int min, int *num, const char *err) a number. */ static void @@ -1189,7 +1219,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c if (*arg) { long int tmp_long; -@@ -1177,6 +1295,11 @@ static void +@@ -1191,6 +1310,11 @@ static void init_parameters (int number_of_files) { int chars_used_by_number = 0; @@ -1201,7 +1231,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c lines_per_body = lines_per_page - lines_per_header - lines_per_footer; if (lines_per_body <= 0) -@@ -1214,7 +1337,7 @@ init_parameters (int number_of_files) +@@ -1228,7 +1352,7 @@ init_parameters (int number_of_files) else col_sep_string = column_separator; @@ -1210,7 +1240,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c use_col_separator = true; } /* It's rather pointless to define a TAB separator with column -@@ -1244,11 +1367,11 @@ init_parameters (int number_of_files) +@@ -1258,11 +1382,11 @@ init_parameters (int number_of_files) + TAB_WIDTH (chars_per_input_tab, chars_per_number); */ /* Estimate chars_per_text without any margin and keep it constant. */ @@ -1224,16 +1254,16 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c /* The number is part of the column width unless we are printing files in parallel. */ -@@ -1257,7 +1380,7 @@ init_parameters (int number_of_files) +@@ -1271,7 +1395,7 @@ init_parameters (int number_of_files) } - chars_per_column = (chars_per_line - chars_used_by_number -- - (columns - 1) * col_sep_length) / columns; -+ - (columns - 1) * col_sep_width) / columns; - - if (chars_per_column < 1) - error (EXIT_FAILURE, 0, _("page width too narrow")); -@@ -1275,7 +1398,7 @@ init_parameters (int number_of_files) + int sep_chars, useful_chars; +- if (INT_MULTIPLY_WRAPV (columns - 1, col_sep_length, &sep_chars)) ++ if (INT_MULTIPLY_WRAPV (columns - 1, col_sep_width, &sep_chars)) + sep_chars = INT_MAX; + if (INT_SUBTRACT_WRAPV (chars_per_line - chars_used_by_number, sep_chars, + &useful_chars)) +@@ -1294,7 +1418,7 @@ init_parameters (int number_of_files) We've to use 8 as the lower limit, if we use chars_per_default_tab = 8 to expand a tab which is not an input_tab-char. */ free (clump_buff); @@ -1242,7 +1272,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c } /* Open the necessary files, -@@ -1383,7 +1506,7 @@ init_funcs (void) +@@ -1402,7 +1526,7 @@ init_funcs (void) /* Enlarge p->start_position of first column to use the same form of padding_not_printed with all columns. */ @@ -1251,7 +1281,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c /* This loop takes care of all but the rightmost column. */ -@@ -1417,7 +1540,7 @@ init_funcs (void) +@@ -1436,7 +1560,7 @@ init_funcs (void) } else { @@ -1260,19 +1290,19 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c h_next = h + chars_per_column; } } -@@ -1708,9 +1831,9 @@ static void +@@ -1727,9 +1851,9 @@ static void align_column (COLUMN *p) { padding_not_printed = p->start_position; -- if (padding_not_printed - col_sep_length > 0) -+ if (padding_not_printed - col_sep_width > 0) +- if (col_sep_length < padding_not_printed) ++ if (col_sep_width < padding_not_printed) { - pad_across_to (padding_not_printed - col_sep_length); + pad_across_to (padding_not_printed - col_sep_width); padding_not_printed = ANYWHERE; } -@@ -1981,13 +2104,13 @@ store_char (char c) +@@ -2004,13 +2128,13 @@ store_char (char c) /* May be too generous. */ buff = X2REALLOC (buff, &buff_allocated); } @@ -1288,7 +1318,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c char *s; int num_width; -@@ -2004,22 +2127,24 @@ add_line_number (COLUMN *p) +@@ -2027,22 +2151,24 @@ add_line_number (COLUMN *p) /* Tabification is assumed for multiple columns, also for n-separators, but 'default n-separator = TAB' hasn't been given priority over equal column_width also specified by POSIX. */ @@ -1317,7 +1347,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c output_position = POS_AFTER_TAB (chars_per_output_tab, output_position); } -@@ -2180,7 +2305,7 @@ print_white_space (void) +@@ -2203,7 +2329,7 @@ print_white_space (void) while (goal - h_old > 1 && (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal) { @@ -1326,15 +1356,15 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c h_old = h_new; } while (++h_old <= goal) -@@ -2200,6 +2325,7 @@ print_sep_string (void) +@@ -2223,6 +2349,7 @@ print_sep_string (void) { - char *s; + char const *s = col_sep_string; int l = col_sep_length; + int not_space_flag; - s = col_sep_string; - -@@ -2213,6 +2339,7 @@ print_sep_string (void) + if (separators_not_printed <= 0) + { +@@ -2234,6 +2361,7 @@ print_sep_string (void) { for (; separators_not_printed > 0; --separators_not_printed) { @@ -1342,7 +1372,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c while (l-- > 0) { /* 3 types of sep_strings: spaces only, spaces and chars, -@@ -2226,12 +2353,15 @@ print_sep_string (void) +@@ -2247,12 +2375,15 @@ print_sep_string (void) } else { @@ -1359,7 +1389,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c /* sep_string ends with some spaces */ if (spaces_not_printed > 0) print_white_space (); -@@ -2259,7 +2389,7 @@ print_clump (COLUMN *p, int n, char *clump) +@@ -2280,7 +2411,7 @@ print_clump (COLUMN *p, int n, char *clump) required number of tabs and spaces. */ static void @@ -1368,7 +1398,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c { if (tabify_output) { -@@ -2283,6 +2413,74 @@ print_char (char c) +@@ -2304,6 +2435,74 @@ print_char (char c) putchar (c); } @@ -1443,19 +1473,19 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c /* Skip to page PAGE before printing. PAGE may be larger than total number of pages. */ -@@ -2462,9 +2660,9 @@ read_line (COLUMN *p) +@@ -2483,9 +2682,9 @@ read_line (COLUMN *p) align_empty_cols = false; } -- if (padding_not_printed - col_sep_length > 0) -+ if (padding_not_printed - col_sep_width > 0) +- if (col_sep_length < padding_not_printed) ++ if (col_sep_width < padding_not_printed) { - pad_across_to (padding_not_printed - col_sep_length); + pad_across_to (padding_not_printed - col_sep_width); padding_not_printed = ANYWHERE; } -@@ -2534,7 +2732,7 @@ print_stored (COLUMN *p) +@@ -2555,7 +2754,7 @@ print_stored (COLUMN *p) int i; int line = p->current_line++; @@ -1464,7 +1494,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c /* FIXME UMR: Uninitialized memory read: * This is occurring while in: -@@ -2546,7 +2744,7 @@ print_stored (COLUMN *p) +@@ -2567,7 +2766,7 @@ print_stored (COLUMN *p) xmalloc [xmalloc.c:94] init_store_cols [pr.c:1648] */ @@ -1473,19 +1503,19 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c pad_vertically = true; -@@ -2565,9 +2763,9 @@ print_stored (COLUMN *p) +@@ -2586,9 +2785,9 @@ print_stored (COLUMN *p) } } -- if (padding_not_printed - col_sep_length > 0) -+ if (padding_not_printed - col_sep_width > 0) +- if (col_sep_length < padding_not_printed) ++ if (col_sep_width < padding_not_printed) { - pad_across_to (padding_not_printed - col_sep_length); + pad_across_to (padding_not_printed - col_sep_width); padding_not_printed = ANYWHERE; } -@@ -2580,8 +2778,8 @@ print_stored (COLUMN *p) +@@ -2601,8 +2800,8 @@ print_stored (COLUMN *p) if (spaces_not_printed == 0) { output_position = p->start_position + end_vector[line]; @@ -1496,7 +1526,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c } return true; -@@ -2600,7 +2798,7 @@ print_stored (COLUMN *p) +@@ -2621,7 +2820,7 @@ print_stored (COLUMN *p) number of characters is 1.) */ static int @@ -1505,7 +1535,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c { unsigned char uc = c; char *s = clump_buff; -@@ -2610,10 +2808,10 @@ char_to_clump (char c) +@@ -2631,10 +2830,10 @@ char_to_clump (char c) int chars; int chars_per_c = 8; @@ -1518,7 +1548,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c { width = TAB_WIDTH (chars_per_c, input_position); -@@ -2694,6 +2892,164 @@ char_to_clump (char c) +@@ -2715,6 +2914,164 @@ char_to_clump (char c) return chars; } @@ -1683,9 +1713,10 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c /* We've just printed some files and need to clean up things before looking for more options and printing the next batch of files. -diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c ---- coreutils-8.24-orig/src/sort.c 2015-06-26 19:05:22.000000000 +0200 -+++ coreutils-8.24/src/sort.c 2015-07-05 09:04:33.032546980 +0200 +diff --git a/src/sort.c b/src/sort.c +index 6d2eec5..f189a0d 100644 +--- a/src/sort.c ++++ b/src/sort.c @@ -29,6 +29,14 @@ #include #include @@ -1700,8 +1731,8 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c + #include "system.h" #include "argmatch.h" - #include "error.h" -@@ -163,14 +171,39 @@ static int decimal_point; + #include "die.h" +@@ -165,14 +173,39 @@ static int decimal_point; /* Thousands separator; if -1, then there isn't one. */ static int thousands_sep; @@ -1742,7 +1773,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c /* The kind of blanks for '-b' to skip in various options. */ enum blanktype { bl_start, bl_end, bl_both }; -@@ -344,13 +377,11 @@ static bool reverse; +@@ -346,13 +379,11 @@ static bool reverse; they were read if all keys compare equal. */ static bool stable; @@ -1759,7 +1790,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c /* Flag to remove consecutive duplicate lines from the output. Only the last of a sequence of equal lines will be output. */ -@@ -810,6 +841,46 @@ reap_all (void) +@@ -811,6 +842,46 @@ reap_all (void) reap (-1); } @@ -1806,7 +1837,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c /* Clean up any remaining temporary files. */ static void -@@ -1254,7 +1325,7 @@ zaptemp (char const *name) +@@ -1255,7 +1326,7 @@ zaptemp (char const *name) free (node); } @@ -1815,7 +1846,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c static int struct_month_cmp (void const *m1, void const *m2) -@@ -1269,7 +1340,7 @@ struct_month_cmp (void const *m1, void const *m2) +@@ -1270,7 +1341,7 @@ struct_month_cmp (void const *m1, void const *m2) /* Initialize the character class tables. */ static void @@ -1824,7 +1855,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c { size_t i; -@@ -1281,7 +1352,7 @@ inittables (void) +@@ -1282,7 +1353,7 @@ inittables (void) fold_toupper[i] = toupper (i); } @@ -1833,7 +1864,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c /* If we're not in the "C" locale, read different names for months. */ if (hard_LC_TIME) { -@@ -1363,6 +1434,84 @@ specify_nmerge (int oi, char c, char const *s) +@@ -1364,6 +1435,84 @@ specify_nmerge (int oi, char c, char const *s) xstrtol_fatal (e, oi, c, long_options, s); } @@ -1918,7 +1949,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c /* Specify the amount of main memory to use when sorting. */ static void specify_sort_size (int oi, char c, char const *s) -@@ -1596,7 +1745,7 @@ buffer_linelim (struct buffer const *buf) +@@ -1597,7 +1746,7 @@ buffer_linelim (struct buffer const *buf) by KEY in LINE. */ static char * @@ -1927,7 +1958,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c { char *ptr = line->text, *lim = ptr + line->length - 1; size_t sword = key->sword; -@@ -1605,10 +1754,10 @@ begfield (struct line const *line, struct keyfield const *key) +@@ -1606,10 +1755,10 @@ begfield (struct line const *line, struct keyfield const *key) /* The leading field separator itself is included in a field when -t is absent. */ @@ -1940,7 +1971,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c ++ptr; if (ptr < lim) ++ptr; -@@ -1634,11 +1783,70 @@ begfield (struct line const *line, struct keyfield const *key) +@@ -1635,11 +1784,70 @@ begfield (struct line const *line, struct keyfield const *key) return ptr; } @@ -2012,7 +2043,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c { char *ptr = line->text, *lim = ptr + line->length - 1; size_t eword = key->eword, echar = key->echar; -@@ -1653,10 +1861,10 @@ limfield (struct line const *line, struct keyfield const *key) +@@ -1654,10 +1862,10 @@ limfield (struct line const *line, struct keyfield const *key) 'beginning' is the first character following the delimiting TAB. Otherwise, leave PTR pointing at the first 'blank' character after the preceding field. */ @@ -2025,7 +2056,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c ++ptr; if (ptr < lim && (eword || echar)) ++ptr; -@@ -1702,10 +1910,10 @@ limfield (struct line const *line, struct keyfield const *key) +@@ -1703,10 +1911,10 @@ limfield (struct line const *line, struct keyfield const *key) */ /* Make LIM point to the end of (one byte past) the current field. */ @@ -2038,7 +2069,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c if (newlim) lim = newlim; } -@@ -1736,6 +1944,130 @@ limfield (struct line const *line, struct keyfield const *key) +@@ -1737,6 +1945,130 @@ limfield (struct line const *line, struct keyfield const *key) return ptr; } @@ -2169,7 +2200,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c /* Fill BUF reading from FP, moving buf->left bytes from the end of buf->buf to the beginning first. If EOF is reached and the file wasn't terminated by a newline, supply one. Set up BUF's line -@@ -1822,8 +2154,22 @@ fillbuf (struct buffer *buf, FILE *fp, char const *file) +@@ -1823,8 +2155,22 @@ fillbuf (struct buffer *buf, FILE *fp, char const *file) else { if (key->skipsblanks) @@ -2194,7 +2225,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c line->keybeg = line_start; } } -@@ -1944,7 +2290,7 @@ human_numcompare (char const *a, char const *b) +@@ -1974,7 +2320,7 @@ human_numcompare (char const *a, char const *b) hideously fast. */ static int @@ -2203,7 +2234,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c { while (blanks[to_uchar (*a)]) a++; -@@ -1954,6 +2300,25 @@ numcompare (char const *a, char const *b) +@@ -1984,6 +2330,25 @@ numcompare (char const *a, char const *b) return strnumcmp (a, b, decimal_point, thousands_sep); } @@ -2229,7 +2260,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c /* Work around a problem whereby the long double value returned by glibc's strtold ("NaN", ...) contains uninitialized bits: clear all bytes of A and B before calling strtold. FIXME: remove this function once -@@ -2004,7 +2369,7 @@ general_numcompare (char const *sa, char const *sb) +@@ -2034,7 +2399,7 @@ general_numcompare (char const *sa, char const *sb) Return 0 if the name in S is not recognized. */ static int @@ -2238,7 +2269,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c { size_t lo = 0; size_t hi = MONTHS_PER_YEAR; -@@ -2280,15 +2645,14 @@ debug_key (struct line const *line, struct keyfield const *key) +@@ -2310,15 +2675,14 @@ debug_key (struct line const *line, struct keyfield const *key) char saved = *lim; *lim = '\0'; @@ -2256,16 +2287,16 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c else if (key->general_numeric) ignore_value (strtold (beg, &tighter_lim)); else if (key->numeric || key->human_numeric) -@@ -2432,7 +2796,7 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) - bool maybe_space_aligned = !hard_LC_COLLATE && default_key_compare (key) - && !(key->schar || key->echar); +@@ -2452,7 +2816,7 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) + /* Warn about significant leading blanks. */ + bool implicit_skip = key_numeric (key) || key->month; bool line_offset = key->eword == 0 && key->echar != 0; /* -k1.x,1.y */ -- if (!gkey_only && tab == TAB_DEFAULT && !line_offset -+ if (!gkey_only && !tab_length && !line_offset - && ((!key->skipsblanks && !(implicit_skip || maybe_space_aligned)) +- if (!zero_width && !gkey_only && tab == TAB_DEFAULT && !line_offset ++ if (!zero_width && !gkey_only && !tab_length && !line_offset + && ((!key->skipsblanks && !implicit_skip) || (!key->skipsblanks && key->schar) || (!key->skipeblanks && key->echar))) -@@ -2490,11 +2854,87 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) +@@ -2510,11 +2874,87 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) error (0, 0, _("option '-r' only applies to last-resort comparison")); } @@ -2354,7 +2385,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c { struct keyfield *key = keylist; -@@ -2579,7 +3019,7 @@ keycompare (struct line const *a, struct line const *b) +@@ -2599,7 +3039,7 @@ keycompare (struct line const *a, struct line const *b) else if (key->human_numeric) diff = human_numcompare (ta, tb); else if (key->month) @@ -2363,7 +2394,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c else if (key->random) diff = compare_random (ta, tlena, tb, tlenb); else if (key->version) -@@ -2695,6 +3135,211 @@ keycompare (struct line const *a, struct line const *b) +@@ -2715,6 +3155,211 @@ keycompare (struct line const *a, struct line const *b) return key->reverse ? -diff : diff; } @@ -2575,7 +2606,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c /* Compare two lines A and B, returning negative, zero, or positive depending on whether A compares less than, equal to, or greater than B. */ -@@ -2722,7 +3367,7 @@ compare (struct line const *a, struct line const *b) +@@ -2742,7 +3387,7 @@ compare (struct line const *a, struct line const *b) diff = - NONZERO (blen); else if (blen == 0) diff = 1; @@ -2584,7 +2615,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c { /* Note xmemcoll0 is a performance enhancement as it will not unconditionally write '\0' after the -@@ -4121,6 +4766,7 @@ set_ordering (char const *s, struct keyfield *key, enum blanktype blanktype) +@@ -4139,6 +4784,7 @@ set_ordering (char const *s, struct keyfield *key, enum blanktype blanktype) break; case 'f': key->translate = fold_toupper; @@ -2592,7 +2623,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c break; case 'g': key->general_numeric = true; -@@ -4199,7 +4845,7 @@ main (int argc, char **argv) +@@ -4218,7 +4864,7 @@ main (int argc, char **argv) initialize_exit_failure (SORT_FAILURE); hard_LC_COLLATE = hard_locale (LC_COLLATE); @@ -2601,7 +2632,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c hard_LC_TIME = hard_locale (LC_TIME); #endif -@@ -4220,6 +4866,29 @@ main (int argc, char **argv) +@@ -4239,6 +4885,29 @@ main (int argc, char **argv) thousands_sep = -1; } @@ -2631,7 +2662,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c have_read_stdin = false; inittables (); -@@ -4494,13 +5163,34 @@ main (int argc, char **argv) +@@ -4513,13 +5182,34 @@ main (int argc, char **argv) case 't': { @@ -2641,7 +2672,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c + size_t newtab_length = 1; + strncpy (newtab, optarg, MB_LEN_MAX); + if (! newtab[0]) - error (SORT_FAILURE, 0, _("empty tab")); + die (SORT_FAILURE, 0, _("empty tab")); - if (optarg[1]) +#if HAVE_MBRTOWC + if (MB_CUR_MAX > 1) @@ -2670,22 +2701,21 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c else { /* Provoke with 'sort -txx'. Complain about -@@ -4511,9 +5201,12 @@ main (int argc, char **argv) - quote (optarg)); +@@ -4530,9 +5220,11 @@ main (int argc, char **argv) + quote (optarg)); } } - if (tab != TAB_DEFAULT && tab != newtab) -+ if (tab_length -+ && (tab_length != newtab_length -+ || memcmp (tab, newtab, tab_length) != 0)) - error (SORT_FAILURE, 0, _("incompatible tabs")); ++ if (tab_length && (tab_length != newtab_length ++ || memcmp (tab, newtab, tab_length) != 0)) + die (SORT_FAILURE, 0, _("incompatible tabs")); - tab = newtab; + memcpy (tab, newtab, newtab_length); + tab_length = newtab_length; } break; -@@ -4751,12 +5444,10 @@ main (int argc, char **argv) +@@ -4770,12 +5462,10 @@ main (int argc, char **argv) sort (files, nfiles, outfile, nthreads); } @@ -2697,10 +2727,11 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c -#endif if (have_read_stdin && fclose (stdin) == EOF) - die (_("close failed"), "-"); -diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c ---- coreutils-8.24-orig/src/uniq.c 2015-06-26 19:04:19.000000000 +0200 -+++ coreutils-8.24/src/uniq.c 2015-07-05 09:04:33.032546980 +0200 + sort_die (_("close failed"), "-"); +diff --git a/src/uniq.c b/src/uniq.c +index 87a0c93..9f755d9 100644 +--- a/src/uniq.c ++++ b/src/uniq.c @@ -21,6 +21,17 @@ #include #include @@ -2719,7 +2750,7 @@ diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c #include "system.h" #include "argmatch.h" #include "linebuffer.h" -@@ -31,9 +42,21 @@ +@@ -32,9 +43,21 @@ #include "stdio--.h" #include "xmemcoll.h" #include "xstrtol.h" @@ -2742,7 +2773,7 @@ diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "uniq" -@@ -143,6 +166,10 @@ enum +@@ -144,6 +167,10 @@ enum GROUP_OPTION = CHAR_MAX + 1 }; @@ -2753,7 +2784,7 @@ diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c static struct option const longopts[] = { {"count", no_argument, NULL, 'c'}, -@@ -252,7 +279,7 @@ size_opt (char const *opt, char const *msgid) +@@ -260,7 +287,7 @@ size_opt (char const *opt, char const *msgid) return a pointer to the beginning of the line's field to be compared. */ static char * _GL_ATTRIBUTE_PURE @@ -2762,7 +2793,7 @@ diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c { size_t count; char const *lp = line->buffer; -@@ -272,6 +299,83 @@ find_field (struct linebuffer const *line) +@@ -280,6 +307,83 @@ find_field (struct linebuffer const *line) return line->buffer + i; } @@ -2846,7 +2877,7 @@ diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c /* Return false if two strings OLD and NEW match, true if not. OLD and NEW point not to the beginnings of the lines but rather to the beginnings of the fields to compare. -@@ -280,6 +384,8 @@ find_field (struct linebuffer const *line) +@@ -288,6 +392,8 @@ find_field (struct linebuffer const *line) static bool different (char *old, char *new, size_t oldlen, size_t newlen) { @@ -2855,7 +2886,7 @@ diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c if (check_chars < oldlen) oldlen = check_chars; if (check_chars < newlen) -@@ -287,14 +393,103 @@ different (char *old, char *new, size_t oldlen, size_t newlen) +@@ -295,14 +401,103 @@ different (char *old, char *new, size_t oldlen, size_t newlen) if (ignore_case) { @@ -2964,7 +2995,7 @@ diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c /* Output the line in linebuffer LINE to standard output provided that the switches say it should be output. -@@ -359,19 +554,38 @@ check_file (const char *infile, const char *outfile, char delimiter) +@@ -367,19 +562,38 @@ check_file (const char *infile, const char *outfile, char delimiter) char *prevfield IF_LINT ( = NULL); size_t prevlen IF_LINT ( = 0); bool first_group_printed = false; @@ -3003,7 +3034,7 @@ diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c new_group = (prevline->length == 0 || different (thisfield, prevfield, thislen, prevlen)); -@@ -389,6 +603,10 @@ check_file (const char *infile, const char *outfile, char delimiter) +@@ -397,6 +611,10 @@ check_file (const char *infile, const char *outfile, char delimiter) SWAP_LINES (prevline, thisline); prevfield = thisfield; prevlen = thislen; @@ -3014,7 +3045,7 @@ diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c first_group_printed = true; } } -@@ -401,17 +619,26 @@ check_file (const char *infile, const char *outfile, char delimiter) +@@ -409,17 +627,26 @@ check_file (const char *infile, const char *outfile, char delimiter) size_t prevlen; uintmax_t match_count = 0; bool first_delimiter = true; @@ -3041,7 +3072,7 @@ diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c if (readlinebuffer_delim (thisline, stdin, delimiter) == 0) { if (ferror (stdin)) -@@ -420,6 +647,14 @@ check_file (const char *infile, const char *outfile, char delimiter) +@@ -428,6 +655,14 @@ check_file (const char *infile, const char *outfile, char delimiter) } thisfield = find_field (thisline); thislen = thisline->length - 1 - (thisfield - thisline->buffer); @@ -3056,7 +3087,7 @@ diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c match = !different (thisfield, prevfield, thislen, prevlen); match_count += match; -@@ -452,6 +687,9 @@ check_file (const char *infile, const char *outfile, char delimiter) +@@ -460,6 +695,9 @@ check_file (const char *infile, const char *outfile, char delimiter) SWAP_LINES (prevline, thisline); prevfield = thisfield; prevlen = thislen; @@ -3066,7 +3097,7 @@ diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c if (!match) match_count = 0; } -@@ -498,6 +736,19 @@ main (int argc, char **argv) +@@ -506,6 +744,19 @@ main (int argc, char **argv) atexit (close_stdout); @@ -3086,9 +3117,11 @@ diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c skip_chars = 0; skip_fields = 0; check_chars = SIZE_MAX; -diff -urNp coreutils-8.24-orig/tests/i18n/sort.sh coreutils-8.24/tests/i18n/sort.sh ---- coreutils-8.24-orig/tests/i18n/sort.sh 1970-01-01 01:00:00.000000000 +0100 -+++ coreutils-8.24/tests/i18n/sort.sh 2015-07-05 09:04:33.032546980 +0200 +diff --git a/tests/i18n/sort.sh b/tests/i18n/sort.sh +new file mode 100644 +index 0000000..26c95de +--- /dev/null ++++ b/tests/i18n/sort.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# Verify sort's multi-byte support. @@ -3119,21 +3152,23 @@ diff -urNp coreutils-8.24-orig/tests/i18n/sort.sh coreutils-8.24/tests/i18n/sort + + +Exit $fail -diff -urNp coreutils-8.24-orig/tests/local.mk coreutils-8.24/tests/local.mk ---- coreutils-8.24-orig/tests/local.mk 2015-07-05 09:00:46.526859558 +0200 -+++ coreutils-8.24/tests/local.mk 2015-07-05 09:04:33.033546987 +0200 -@@ -344,6 +344,8 @@ all_tests = \ +diff --git a/tests/local.mk b/tests/local.mk +index 568944e..192f776 100644 +--- a/tests/local.mk ++++ b/tests/local.mk +@@ -350,6 +350,8 @@ all_tests = \ tests/misc/sort-discrim.sh \ tests/misc/sort-files0-from.pl \ tests/misc/sort-float.sh \ + tests/misc/sort-mb-tests.sh \ + tests/i18n/sort.sh \ + tests/misc/sort-h-thousands-sep.sh \ tests/misc/sort-merge.pl \ tests/misc/sort-merge-fdlimit.sh \ - tests/misc/sort-month.sh \ -diff -urNp coreutils-8.24-orig/tests/misc/cut.pl coreutils-8.24/tests/misc/cut.pl ---- coreutils-8.24-orig/tests/misc/cut.pl 2015-06-26 19:04:19.000000000 +0200 -+++ coreutils-8.24/tests/misc/cut.pl 2015-07-05 09:04:33.033546987 +0200 +diff --git a/tests/misc/cut.pl b/tests/misc/cut.pl +index f6f8a56..b426a80 100755 +--- a/tests/misc/cut.pl ++++ b/tests/misc/cut.pl @@ -23,9 +23,11 @@ use strict; # Turn off localization of executable's output. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; @@ -3156,10 +3191,11 @@ diff -urNp coreutils-8.24-orig/tests/misc/cut.pl coreutils-8.24/tests/misc/cut.p push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; } push @Tests, @new; -diff -urNp coreutils-8.24-orig/tests/misc/expand.pl coreutils-8.24/tests/misc/expand.pl ---- coreutils-8.24-orig/tests/misc/expand.pl 2015-06-26 19:04:19.000000000 +0200 -+++ coreutils-8.24/tests/misc/expand.pl 2015-07-05 09:04:33.033546987 +0200 -@@ -23,6 +23,15 @@ use strict; +diff --git a/tests/misc/expand.pl b/tests/misc/expand.pl +index 8a9cad1..9293e39 100755 +--- a/tests/misc/expand.pl ++++ b/tests/misc/expand.pl +@@ -27,6 +27,15 @@ my $prog = 'expand'; # Turn off localization of executable's output. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; @@ -3175,8 +3211,17 @@ diff -urNp coreutils-8.24-orig/tests/misc/expand.pl coreutils-8.24/tests/misc/ex my @Tests = ( ['t1', '--tabs=3', {IN=>"a\tb"}, {OUT=>"a b"}], -@@ -31,6 +40,37 @@ my @Tests = - ['i2', '--tabs=3 -i', {IN=>" \ta\tb"}, {OUT=>" a\tb"}], +@@ -140,6 +149,8 @@ my @Tests = + + + # Test errors ++ # FIXME: The following tests contain ‘quoting’ specific to LC_MESSAGES ++ # So we force LC_MESSAGES=C to make them pass. + ['e1', '--tabs="a"', {IN=>''}, {OUT=>''}, {EXIT=>1}, + {ERR => "$prog: tab size contains invalid character(s): 'a'\n"}], + ['e2', "-t $UINTMAX_OFLOW", {IN=>''}, {OUT=>''}, {EXIT=>1}, +@@ -150,6 +161,37 @@ my @Tests = + {ERR => "$prog: tab sizes must be ascending\n"}], ); +if ($mb_locale ne 'C') @@ -3202,7 +3247,7 @@ diff -urNp coreutils-8.24-orig/tests/misc/expand.pl coreutils-8.24/tests/misc/ex + push @new_t, $sub; + push @$t, $sub; + } -+ push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; ++ push @new, ["$test_name-mb", @new_t, {ENV => "LANG=$mb_locale LC_MESSAGES=C"}]; + } + push @Tests, @new; + } @@ -3213,9 +3258,10 @@ diff -urNp coreutils-8.24-orig/tests/misc/expand.pl coreutils-8.24/tests/misc/ex my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -diff -urNp coreutils-8.24-orig/tests/misc/fold.pl coreutils-8.24/tests/misc/fold.pl ---- coreutils-8.24-orig/tests/misc/fold.pl 2015-06-26 19:04:19.000000000 +0200 -+++ coreutils-8.24/tests/misc/fold.pl 2015-07-05 09:04:33.033546987 +0200 +diff --git a/tests/misc/fold.pl b/tests/misc/fold.pl +index 7b192b4..76f073f 100755 +--- a/tests/misc/fold.pl ++++ b/tests/misc/fold.pl @@ -20,9 +20,18 @@ use strict; (my $program_name = $0) =~ s|.*/||; @@ -3285,9 +3331,10 @@ diff -urNp coreutils-8.24-orig/tests/misc/fold.pl coreutils-8.24/tests/misc/fold -my $prog = 'fold'; my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); exit $fail; -diff -urNp coreutils-8.24-orig/tests/misc/join.pl coreutils-8.24/tests/misc/join.pl ---- coreutils-8.24-orig/tests/misc/join.pl 2015-06-26 19:04:19.000000000 +0200 -+++ coreutils-8.24/tests/misc/join.pl 2015-07-05 09:04:33.033546987 +0200 +diff --git a/tests/misc/join.pl b/tests/misc/join.pl +index 4d399d8..07f2823 100755 +--- a/tests/misc/join.pl ++++ b/tests/misc/join.pl @@ -25,6 +25,15 @@ my $limits = getlimits (); my $prog = 'join'; @@ -3354,9 +3401,11 @@ diff -urNp coreutils-8.24-orig/tests/misc/join.pl coreutils-8.24/tests/misc/join my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -diff -urNp coreutils-8.24-orig/tests/misc/sort-mb-tests.sh coreutils-8.24/tests/misc/sort-mb-tests.sh ---- coreutils-8.24-orig/tests/misc/sort-mb-tests.sh 1970-01-01 01:00:00.000000000 +0100 -+++ coreutils-8.24/tests/misc/sort-mb-tests.sh 2015-07-05 09:04:33.034546995 +0200 +diff --git a/tests/misc/sort-mb-tests.sh b/tests/misc/sort-mb-tests.sh +new file mode 100644 +index 0000000..11836ba +--- /dev/null ++++ b/tests/misc/sort-mb-tests.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# Verify sort's multi-byte support. @@ -3403,9 +3452,10 @@ diff -urNp coreutils-8.24-orig/tests/misc/sort-mb-tests.sh coreutils-8.24/tests/ +compare exp out || { fail=1; cat out; } + +Exit $fail -diff -urNp coreutils-8.24-orig/tests/misc/sort-merge.pl coreutils-8.24/tests/misc/sort-merge.pl ---- coreutils-8.24-orig/tests/misc/sort-merge.pl 2015-06-26 19:04:19.000000000 +0200 -+++ coreutils-8.24/tests/misc/sort-merge.pl 2015-07-05 09:04:33.034546995 +0200 +diff --git a/tests/misc/sort-merge.pl b/tests/misc/sort-merge.pl +index 23f6ed2..402a987 100755 +--- a/tests/misc/sort-merge.pl ++++ b/tests/misc/sort-merge.pl @@ -26,6 +26,15 @@ my $prog = 'sort'; # Turn off localization of executable's output. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; @@ -3462,9 +3512,10 @@ diff -urNp coreutils-8.24-orig/tests/misc/sort-merge.pl coreutils-8.24/tests/mis my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -diff -urNp coreutils-8.24-orig/tests/misc/sort.pl coreutils-8.24/tests/misc/sort.pl ---- coreutils-8.24-orig/tests/misc/sort.pl 2015-06-26 19:04:19.000000000 +0200 -+++ coreutils-8.24/tests/misc/sort.pl 2015-07-05 09:04:33.034546995 +0200 +diff --git a/tests/misc/sort.pl b/tests/misc/sort.pl +index c3e7f8e..6ecd3ff 100755 +--- a/tests/misc/sort.pl ++++ b/tests/misc/sort.pl @@ -24,10 +24,15 @@ my $prog = 'sort'; # Turn off localization of executable's output. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; @@ -3529,9 +3580,10 @@ diff -urNp coreutils-8.24-orig/tests/misc/sort.pl coreutils-8.24/tests/misc/sort my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -diff -urNp coreutils-8.24-orig/tests/misc/unexpand.pl coreutils-8.24/tests/misc/unexpand.pl ---- coreutils-8.24-orig/tests/misc/unexpand.pl 2015-06-26 19:04:19.000000000 +0200 -+++ coreutils-8.24/tests/misc/unexpand.pl 2015-07-05 09:04:33.034546995 +0200 +diff --git a/tests/misc/unexpand.pl b/tests/misc/unexpand.pl +index 6ba6d40..de86723 100755 +--- a/tests/misc/unexpand.pl ++++ b/tests/misc/unexpand.pl @@ -27,6 +27,14 @@ my $limits = getlimits (); my $prog = 'unexpand'; @@ -3547,8 +3599,8 @@ diff -urNp coreutils-8.24-orig/tests/misc/unexpand.pl coreutils-8.24/tests/misc/ my @Tests = ( ['a1', {IN=> ' 'x 1 ."y\n"}, {OUT=> ' 'x 1 ."y\n"}], -@@ -92,6 +100,37 @@ my @Tests = - {EXIT => 1}, {ERR => "$prog: tab stop value is too large\n"}], +@@ -128,6 +136,37 @@ my @Tests = + ['ts2', '-t5,8', {IN=>"x\t \t y\n"}, {OUT=>"x\t\t y\n"}], ); +if ($mb_locale ne 'C') @@ -3585,9 +3637,10 @@ diff -urNp coreutils-8.24-orig/tests/misc/unexpand.pl coreutils-8.24/tests/misc/ my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -diff -urNp coreutils-8.24-orig/tests/misc/uniq.pl coreutils-8.24/tests/misc/uniq.pl ---- coreutils-8.24-orig/tests/misc/uniq.pl 2015-06-26 19:04:19.000000000 +0200 -+++ coreutils-8.24/tests/misc/uniq.pl 2015-07-05 09:04:33.035547002 +0200 +diff --git a/tests/misc/uniq.pl b/tests/misc/uniq.pl +index f028036..8eaf59a 100755 +--- a/tests/misc/uniq.pl ++++ b/tests/misc/uniq.pl @@ -23,9 +23,17 @@ my $limits = getlimits (); my $prog = 'uniq'; my $try = "Try '$prog --help' for more information.\n"; @@ -3660,9 +3713,10 @@ diff -urNp coreutils-8.24-orig/tests/misc/uniq.pl coreutils-8.24/tests/misc/uniq @Tests = add_z_variants \@Tests; @Tests = triple_test \@Tests; -diff -urNp coreutils-8.24-orig/tests/pr/pr-tests.pl coreutils-8.24/tests/pr/pr-tests.pl ---- coreutils-8.24-orig/tests/pr/pr-tests.pl 2015-06-26 19:04:19.000000000 +0200 -+++ coreutils-8.24/tests/pr/pr-tests.pl 2015-07-05 09:04:33.035547002 +0200 +diff --git a/tests/pr/pr-tests.pl b/tests/pr/pr-tests.pl +index ec3980a..136657d 100755 +--- a/tests/pr/pr-tests.pl ++++ b/tests/pr/pr-tests.pl @@ -24,6 +24,15 @@ use strict; my $prog = 'pr'; my $normalize_strerror = "s/': .*/'/"; @@ -3679,9 +3733,9 @@ diff -urNp coreutils-8.24-orig/tests/pr/pr-tests.pl coreutils-8.24/tests/pr/pr-t my @tv = ( # -b option is no longer an official option. But it's still working to -@@ -467,8 +476,48 @@ push @Tests, - {IN=>{3=>"x\ty\tz\n"}}, - {OUT=>join("\t", qw(a b c m n o x y z)) . "\n"} ]; +@@ -474,8 +483,48 @@ push @Tests, + {IN=>{2=>"a\n"}}, + {OUT=>"a\t\t\t\t \t\t\ta\n"} ]; +# Add _POSIX2_VERSION=199209 to the environment of each test +# that uses an old-style option like +1. @@ -3709,7 +3763,7 @@ diff -urNp coreutils-8.24-orig/tests/pr/pr-tests.pl coreutils-8.24/tests/pr/pr-t + push @$t, $sub; + } + #temporarily skip some failing tests -+ next if ($test_name =~ "col-0" or $test_name =~ "col-inval"); ++ next if ($test_name =~ "col-0" or $test_name =~ "col-inval" or $test_name =~ "asan1"); + push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}]; + } + push @Tests, @new; @@ -3728,3 +3782,6 @@ diff -urNp coreutils-8.24-orig/tests/pr/pr-tests.pl coreutils-8.24/tests/pr/pr-t my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; +-- +2.7.4 + diff --git a/coreutils-overflow.patch b/coreutils-overflow.patch index 06059a9..d62b19a 100644 --- a/coreutils-overflow.patch +++ b/coreutils-overflow.patch @@ -1,6 +1,8 @@ ---- coreutils-5.2.1/src/who.c.overflow 2005-05-25 09:59:06.000000000 +0100 -+++ coreutils-5.2.1/src/who.c 2005-05-25 10:00:31.000000000 +0100 -@@ -79,7 +79,7 @@ +diff --git a/src/who.c b/src/who.c +index 55733b4..3ad4774 100644 +--- a/src/who.c ++++ b/src/who.c +@@ -81,7 +81,7 @@ # define UT_TYPE_NEW_TIME(U) false #endif diff --git a/coreutils-selinux.patch b/coreutils-selinux.patch index 9f45177..9f780cc 100644 --- a/coreutils-selinux.patch +++ b/coreutils-selinux.patch @@ -1,15 +1,17 @@ -diff -urNp coreutils-8.21-orig/man/chcon.x coreutils-8.21/man/chcon.x ---- coreutils-8.21-orig/man/chcon.x 2011-08-23 15:44:01.000000000 +0200 -+++ coreutils-8.21/man/chcon.x 2013-02-15 14:31:58.937482694 +0100 +diff --git a/man/chcon.x b/man/chcon.x +index 8c1ff6f..c84fb96 100644 +--- a/man/chcon.x ++++ b/man/chcon.x @@ -1,4 +1,4 @@ [NAME] -chcon \- change file security context +chcon \- change file SELinux security context [DESCRIPTION] .\" Add any additional description here -diff -urNp coreutils-8.21-orig/man/runcon.x coreutils-8.21/man/runcon.x ---- coreutils-8.21-orig/man/runcon.x 2011-08-23 15:44:01.000000000 +0200 -+++ coreutils-8.21/man/runcon.x 2013-02-15 14:31:58.938486496 +0100 +diff --git a/man/runcon.x b/man/runcon.x +index d2df13e..5c5f5d8 100644 +--- a/man/runcon.x ++++ b/man/runcon.x @@ -1,5 +1,5 @@ [NAME] -runcon \- run command with specified security context @@ -17,10 +19,11 @@ diff -urNp coreutils-8.21-orig/man/runcon.x coreutils-8.21/man/runcon.x [DESCRIPTION] Run COMMAND with completely-specified CONTEXT, or with current or transitioned security context modified by one or more of LEVEL, -diff -urNp coreutils-8.21-orig/src/cp.c coreutils-8.21/src/cp.c ---- coreutils-8.21-orig/src/cp.c 2013-02-07 10:37:05.000000000 +0100 -+++ coreutils-8.21/src/cp.c 2013-02-15 14:31:58.945468929 +0100 -@@ -202,6 +202,9 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\ +diff --git a/src/cp.c b/src/cp.c +index 1b528c6..25dbb88 100644 +--- a/src/cp.c ++++ b/src/cp.c +@@ -203,6 +203,9 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\ all\n\ "), stdout); fputs (_("\ @@ -30,16 +33,16 @@ diff -urNp coreutils-8.21-orig/src/cp.c coreutils-8.21/src/cp.c --no-preserve=ATTR_LIST don't preserve the specified attributes\n\ --parents use full source file name under DIRECTORY\n\ "), stdout); -@@ -943,7 +946,7 @@ main (int argc, char **argv) - we'll actually use backup_suffix_string. */ - backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX"); +@@ -929,7 +932,7 @@ main (int argc, char **argv) + selinux_enabled = (0 < is_selinux_enabled ()); + cp_option_init (&x); - while ((c = getopt_long (argc, argv, "abdfHilLnprst:uvxPRS:TZ", + while ((c = getopt_long (argc, argv, "abcdfHilLnprst:uvxPRS:TZ", long_opts, NULL)) != -1) { -@@ -991,6 +994,17 @@ main (int argc, char **argv) +@@ -977,6 +980,17 @@ main (int argc, char **argv) copy_contents = true; break; @@ -57,10 +60,11 @@ diff -urNp coreutils-8.21-orig/src/cp.c coreutils-8.21/src/cp.c case 'd': x.preserve_links = true; x.dereference = DEREF_NEVER; -diff -urNp coreutils-8.21-orig/src/id.c coreutils-8.21/src/id.c ---- coreutils-8.21-orig/src/id.c 2013-01-31 01:46:24.000000000 +0100 -+++ coreutils-8.21/src/id.c 2013-02-15 14:31:58.946469154 +0100 -@@ -113,7 +113,7 @@ int +diff --git a/src/id.c b/src/id.c +index 05d98a5..d6eb002 100644 +--- a/src/id.c ++++ b/src/id.c +@@ -114,7 +114,7 @@ int main (int argc, char **argv) { int optc; @@ -69,28 +73,29 @@ diff -urNp coreutils-8.21-orig/src/id.c coreutils-8.21/src/id.c bool smack_enabled = is_smack_enabled (); bool opt_zero = false; char *pw_name = NULL; -diff -urNp coreutils-8.21-orig/src/install.c coreutils-8.21/src/install.c ---- coreutils-8.21-orig/src/install.c 2013-02-07 10:37:05.000000000 +0100 -+++ coreutils-8.21/src/install.c 2013-02-15 14:31:58.948469440 +0100 -@@ -649,7 +649,7 @@ In the 4th form, create all components of the given DIRECTORY(ies).\n\ +diff --git a/src/install.c b/src/install.c +index d79d597..437889a 100644 +--- a/src/install.c ++++ b/src/install.c +@@ -673,7 +673,7 @@ In the 4th form, create all components of the given DIRECTORY(ies).\n\ -v, --verbose print the name of each directory as it is created\n\ "), stdout); fputs (_("\ - --preserve-context preserve SELinux security context\n\ + -P, --preserve-context preserve SELinux security context (-P deprecated)\n\ -Z set SELinux security context of destination\n\ - file to default type\n\ + file and each created directory to default type\n\ --context[=CTX] like -Z, or if CTX is specified then set the\n\ -@@ -817,7 +817,7 @@ main (int argc, char **argv) - we'll actually use backup_suffix_string. */ - backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX"); +@@ -824,7 +824,7 @@ main (int argc, char **argv) + dir_arg = false; + umask (0); - while ((optc = getopt_long (argc, argv, "bcCsDdg:m:o:pt:TvS:Z", long_options, + while ((optc = getopt_long (argc, argv, "bcCsDdg:m:o:pPt:TvS:Z", long_options, NULL)) != -1) { switch (optc) -@@ -878,6 +878,8 @@ main (int argc, char **argv) +@@ -885,6 +885,8 @@ main (int argc, char **argv) no_target_directory = true; break; @@ -99,7 +104,7 @@ diff -urNp coreutils-8.21-orig/src/install.c coreutils-8.21/src/install.c case PRESERVE_CONTEXT_OPTION: if (! selinux_enabled) { -@@ -885,6 +887,10 @@ main (int argc, char **argv) +@@ -892,6 +894,10 @@ main (int argc, char **argv) "this kernel is not SELinux-enabled")); break; } diff --git a/coreutils-selinuxmanpages.patch b/coreutils-selinuxmanpages.patch index 1540613..c3eb1a8 100644 --- a/coreutils-selinuxmanpages.patch +++ b/coreutils-selinuxmanpages.patch @@ -1,7 +1,8 @@ -diff -urNp coreutils-6.10-orig/doc/coreutils.texi coreutils-6.10/doc/coreutils.texi ---- coreutils-6.10-orig/doc/coreutils.texi 2008-04-07 17:52:11.000000000 +0200 -+++ coreutils-6.10/doc/coreutils.texi 2008-04-07 18:01:43.000000000 +0200 -@@ -8002,6 +8002,11 @@ done +diff --git a/doc/coreutils.texi b/doc/coreutils.texi +index 47e4480..cff2ead 100644 +--- a/doc/coreutils.texi ++++ b/doc/coreutils.texi +@@ -8083,6 +8083,11 @@ done exit $fail @end example diff --git a/coreutils.spec b/coreutils.spec index c5a835a..fd58008 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,12 +1,11 @@ Summary: A set of basic GNU tools commonly used in shell scripts Name: coreutils -Version: 8.25 -Release: 17%{?dist} +Version: 8.26 +Release: 1%{?dist} License: GPLv3+ Group: System Environment/Base Url: http://www.gnu.org/software/coreutils/ Source0: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz -Source2: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig Source50: supported_utils Source105: coreutils-colorls.sh Source106: coreutils-colorls.csh @@ -17,15 +16,6 @@ Source10: coreutils-find-requires.sh %global __find_provides %{_rpmconfigdir}/find-provides %global __find_requires %{SOURCE10} %{_rpmconfigdir}/find-requires -# From upstream -Patch952: coreutils-8.25-intall-Z-selinux.patch -# fix 'sort -h -k' in locales that use blank as thousands separator (#1355780) -Patch953: coreutils-8.25-sort-thousands-sep.patch -# ls: allow interruption when reading slow directories (#1365933) -Patch954: coreutils-8.25-ls-signal.patch -# md5sum,sha*sum: fix --ignore-missing with checksums starting with 00 -Patch955: coreutils-8.25-sum-ignore-missing.patch - # Our patches #general patch to workaround koji build system issues Patch100: coreutils-6.10-configuration.patch @@ -213,12 +203,6 @@ tee DIR_COLORS{,.256color,.lightbgcolor} /dev/null #SELinux %patch950 -p1 -b .selinux %patch951 -p1 -b .selinuxman -%patch952 -p1 - -# upstream patches -%patch953 -p1 -%patch954 -p1 -%patch955 -p1 chmod a+x \ tests/df/direct.sh \ @@ -348,6 +332,9 @@ fi %license COPYING %changelog +* Thu Dec 01 2016 Kamil Dudka - 8.26-1 +- new upstream release 8.26 + * Mon Oct 31 2016 Kamil Dudka - 8.25-17 - md5sum,sha*sum: fix --ignore-missing with checksums starting with 00 diff --git a/sources b/sources index 52af064..becdeb6 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -070e43ba7f618d747414ef56ab248a48 coreutils-8.25.tar.xz -eb5694f81fd88ccf16b68ed80935b10f coreutils-8.25.tar.xz.sig +d5aa2072f662d4118b9f4c63b94601a6 coreutils-8.26.tar.xz diff --git a/supported_utils b/supported_utils index c2aed28..8105ccf 100644 --- a/supported_utils +++ b/supported_utils @@ -1,4 +1,5 @@ %{_bindir}/arch +%{_bindir}/b2sum %{_bindir}/basename %{_bindir}/cat %{_bindir}/chgrp