From b041d4ec90ea8227d137afd8cac68efe0112723cdb8996cdcdd1b6ade18c44ad Mon Sep 17 00:00:00 2001 From: Ruediger Oertel Date: Mon, 15 Nov 2010 16:52:55 +0000 Subject: [PATCH] Accepting request 52848 from Base:System Accepted submit request 52848 from user psmt OBS-URL: https://build.opensuse.org/request/show/52848 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/coreutils?expand=0&rev=45 --- coreutils-6.8-su.patch | 116 +-- coreutils-6.8.0-pie.patch | 56 +- coreutils-8.5.tar.xz | 3 - ...8.5-i18n.patch => coreutils-8.6-i18n.patch | 751 ++++++++++-------- coreutils-8.5.patch => coreutils-8.6.patch | 18 +- coreutils-8.6.tar.xz | 3 + coreutils-add_ogv.patch | 12 - coreutils-gl_printf_safe.patch | 18 +- coreutils-i18n-infloop.patch | 24 +- coreutils-i18n-uninit.patch | 6 +- coreutils-no_hostname_and_hostid.patch | 18 +- coreutils-ptr_int_casts.patch | 22 + coreutils.changes | 63 ++ coreutils.spec | 40 +- 14 files changed, 665 insertions(+), 485 deletions(-) delete mode 100644 coreutils-8.5.tar.xz rename coreutils-8.5-i18n.patch => coreutils-8.6-i18n.patch (82%) rename coreutils-8.5.patch => coreutils-8.6.patch (75%) create mode 100644 coreutils-8.6.tar.xz delete mode 100644 coreutils-add_ogv.patch create mode 100644 coreutils-ptr_int_casts.patch diff --git a/coreutils-6.8-su.patch b/coreutils-6.8-su.patch index c8e3e05..d698b38 100644 --- a/coreutils-6.8-su.patch +++ b/coreutils-6.8-su.patch @@ -2,9 +2,9 @@ Add pam support in su Index: Makefile.in =================================================================== ---- Makefile.in.orig 2010-04-23 17:58:41.000000000 +0200 -+++ Makefile.in 2010-05-06 19:37:44.784359208 +0200 -@@ -961,6 +961,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ +--- Makefile.in.orig 2010-10-15 16:31:46.000000000 +0200 ++++ Makefile.in 2010-11-11 16:02:50.366117868 +0100 +@@ -991,6 +991,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ @@ -14,17 +14,17 @@ Index: Makefile.in POSIX_SHELL = @POSIX_SHELL@ Index: configure =================================================================== ---- configure.orig 2010-05-06 19:37:44.688359301 +0200 -+++ configure 2010-05-06 19:37:44.816359169 +0200 -@@ -631,6 +631,7 @@ OPTIONAL_BIN_PROGS +--- configure.orig 2010-11-11 16:02:50.342113626 +0100 ++++ configure 2010-11-11 16:04:17.257475264 +0100 +@@ -639,6 +639,7 @@ OPTIONAL_BIN_PROGS INSTALL_SU LIB_GMP LIB_CRYPT +PAM_LIBS + GNULIB_TEST_WARN_CFLAGS GNULIB_WARN_CFLAGS WERROR_CFLAGS - SEQ_LIBM -@@ -1501,6 +1502,7 @@ enable_xattr +@@ -1551,6 +1552,7 @@ enable_xattr enable_libcap with_tty_group enable_gcc_warnings @@ -32,7 +32,7 @@ Index: configure with_gmp enable_install_program enable_no_install_program -@@ -2152,6 +2154,7 @@ Optional Features: +@@ -2203,6 +2205,7 @@ Optional Features: --disable-xattr do not support extended attributes --disable-libcap disable libcap support --enable-gcc-warnings turn on lots of GCC warnings (for developers) @@ -40,7 +40,7 @@ Index: configure --enable-install-program=PROG_LIST install the programs in PROG_LIST (comma-separated, default: none) -@@ -51989,6 +51992,111 @@ $as_echo "#define HAVE_WORKING_FORK 1" > +@@ -53157,6 +53160,111 @@ $as_echo "#define HAVE_WORKING_FORK 1" > fi @@ -154,9 +154,9 @@ Index: configure do : Index: configure.ac =================================================================== ---- configure.ac.orig 2010-03-13 16:14:09.000000000 +0100 -+++ configure.ac 2010-05-06 19:37:44.843292013 +0200 -@@ -128,6 +128,20 @@ fi +--- configure.ac.orig 2010-10-13 10:58:27.000000000 +0200 ++++ configure.ac 2010-11-11 16:02:50.442131303 +0100 +@@ -135,6 +135,20 @@ fi AC_FUNC_FORK @@ -179,9 +179,9 @@ Index: configure.ac gl_ADD_PROG([optional_bin_progs], [chroot])) Index: doc/Makefile.in =================================================================== ---- doc/Makefile.in.orig 2010-04-23 17:58:37.000000000 +0200 -+++ doc/Makefile.in 2010-05-06 19:37:44.868359246 +0200 -@@ -957,6 +957,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ +--- doc/Makefile.in.orig 2010-10-15 16:31:44.000000000 +0200 ++++ doc/Makefile.in 2010-11-11 16:02:50.442131303 +0100 +@@ -987,6 +987,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ @@ -191,9 +191,9 @@ Index: doc/Makefile.in POSIX_SHELL = @POSIX_SHELL@ Index: gnulib-tests/Makefile.in =================================================================== ---- gnulib-tests/Makefile.in.orig 2010-04-23 18:00:33.000000000 +0200 -+++ gnulib-tests/Makefile.in 2010-05-06 19:37:44.871374260 +0200 -@@ -2191,6 +2191,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ +--- gnulib-tests/Makefile.in.orig 2010-10-15 16:32:45.000000000 +0200 ++++ gnulib-tests/Makefile.in 2010-11-11 16:02:50.490139787 +0100 +@@ -2378,6 +2378,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ @@ -203,9 +203,9 @@ Index: gnulib-tests/Makefile.in POSIX_SHELL = @POSIX_SHELL@ Index: lib/Makefile.in =================================================================== ---- lib/Makefile.in.orig 2010-04-23 17:58:38.000000000 +0200 -+++ lib/Makefile.in 2010-05-06 19:37:59.594863753 +0200 -@@ -1006,6 +1006,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ +--- lib/Makefile.in.orig 2010-10-15 16:31:45.000000000 +0200 ++++ lib/Makefile.in 2010-11-11 16:02:50.550150395 +0100 +@@ -1073,6 +1073,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ @@ -215,9 +215,9 @@ Index: lib/Makefile.in POSIX_SHELL = @POSIX_SHELL@ Index: man/Makefile.in =================================================================== ---- man/Makefile.in.orig 2010-05-06 19:37:44.618920753 +0200 -+++ man/Makefile.in 2010-05-06 19:37:44.934868934 +0200 -@@ -926,6 +926,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ +--- man/Makefile.in.orig 2010-11-11 16:02:50.294105140 +0100 ++++ man/Makefile.in 2010-11-11 16:02:50.554151102 +0100 +@@ -956,6 +956,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ @@ -227,9 +227,9 @@ Index: man/Makefile.in POSIX_SHELL = @POSIX_SHELL@ Index: src/Makefile.am =================================================================== ---- src/Makefile.am.orig 2010-04-23 15:44:14.000000000 +0200 -+++ src/Makefile.am 2010-05-06 19:37:59.594863753 +0200 -@@ -364,7 +364,8 @@ factor_LDADD += $(LIB_GMP) +--- src/Makefile.am.orig 2010-10-12 13:13:16.000000000 +0200 ++++ src/Makefile.am 2010-11-11 16:02:50.594158172 +0100 +@@ -352,7 +352,8 @@ factor_LDADD += $(LIB_GMP) uptime_LDADD += $(GETLOADAVG_LIBS) # for crypt @@ -241,8 +241,8 @@ Index: src/Makefile.am copy_LDADD += $(LIB_ACL) Index: src/Makefile.in =================================================================== ---- src/Makefile.in.orig 2010-04-23 18:35:11.000000000 +0200 -+++ src/Makefile.in 2010-05-06 19:37:59.594863753 +0200 +--- src/Makefile.in.orig 2010-10-15 17:06:15.000000000 +0200 ++++ src/Makefile.in 2010-11-11 16:09:48.436006623 +0100 @@ -553,9 +553,10 @@ stdbuf_DEPENDENCIES = $(am__DEPENDENCIES stty_SOURCES = stty.c stty_OBJECTS = stty.$(OBJEXT) @@ -257,27 +257,29 @@ Index: src/Makefile.in sum_SOURCES = sum.c sum_OBJECTS = sum.$(OBJEXT) sum_DEPENDENCIES = $(am__DEPENDENCIES_2) -@@ -665,8 +666,8 @@ SOURCES = $(nodist_libver_a_SOURCES) $(_ +@@ -663,9 +664,9 @@ SOURCES = $(nodist_libver_a_SOURCES) $(_ $(rmdir_SOURCES) runcon.c seq.c setuidgid.c $(sha1sum_SOURCES) \ $(sha224sum_SOURCES) $(sha256sum_SOURCES) $(sha384sum_SOURCES) \ $(sha512sum_SOURCES) shred.c shuf.c sleep.c sort.c split.c \ -- stat.c stdbuf.c stty.c su.c sum.c sync.c tac.c tail.c tee.c \ -- test.c $(timeout_SOURCES) touch.c tr.c true.c truncate.c \ -+ stat.c stdbuf.c stty.c $(su_SOURCES) sum.c sync.c tac.c tail.c \ -+ tee.c test.c $(timeout_SOURCES) touch.c tr.c true.c truncate.c \ - tsort.c tty.c $(uname_SOURCES) unexpand.c uniq.c unlink.c \ +- $(stat_SOURCES) stdbuf.c stty.c su.c sum.c sync.c tac.c tail.c \ +- tee.c test.c $(timeout_SOURCES) touch.c tr.c true.c truncate.c \ +- tsort.c tty.c $(uname_SOURCES) unexpand.c uniq.c unlink.c \ ++ $(stat_SOURCES) stdbuf.c stty.c $(su_SOURCES) sum.c sync.c tac.c \ ++ tail.c tee.c test.c $(timeout_SOURCES) touch.c tr.c true.c \ ++ truncate.c tsort.c tty.c $(uname_SOURCES) unexpand.c uniq.c unlink.c \ uptime.c users.c $(vdir_SOURCES) wc.c who.c whoami.c yes.c DIST_SOURCES = $(__SOURCES) $(arch_SOURCES) base64.c basename.c cat.c \ -@@ -683,7 +684,7 @@ DIST_SOURCES = $(__SOURCES) $(arch_SOURC - $(rm_SOURCES) $(rmdir_SOURCES) runcon.c seq.c setuidgid.c \ - $(sha1sum_SOURCES) $(sha224sum_SOURCES) $(sha256sum_SOURCES) \ - $(sha384sum_SOURCES) $(sha512sum_SOURCES) shred.c shuf.c \ -- sleep.c sort.c split.c stat.c stdbuf.c stty.c su.c sum.c \ -+ sleep.c sort.c split.c stat.c stdbuf.c stty.c $(su_SOURCES) sum.c \ - sync.c tac.c tail.c tee.c test.c $(timeout_SOURCES) touch.c \ - tr.c true.c truncate.c tsort.c tty.c $(uname_SOURCES) \ - unexpand.c uniq.c unlink.c uptime.c users.c $(vdir_SOURCES) \ -@@ -1338,6 +1339,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ + chcon.c $(chgrp_SOURCES) chmod.c $(chown_SOURCES) chroot.c \ +@@ -682,7 +683,7 @@ DIST_SOURCES = $(__SOURCES) $(arch_SOURC + setuidgid.c $(sha1sum_SOURCES) $(sha224sum_SOURCES) \ + $(sha256sum_SOURCES) $(sha384sum_SOURCES) $(sha512sum_SOURCES) \ + shred.c shuf.c sleep.c sort.c split.c $(stat_SOURCES) stdbuf.c \ +- stty.c su.c sum.c sync.c tac.c tail.c tee.c test.c \ ++ stty.c $(su_SOURCES) sum.c sync.c tac.c tail.c tee.c test.c \ + $(timeout_SOURCES) touch.c tr.c true.c truncate.c tsort.c \ + tty.c $(uname_SOURCES) unexpand.c uniq.c unlink.c uptime.c \ + users.c $(vdir_SOURCES) wc.c who.c whoami.c yes.c +@@ -1363,6 +1364,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ @@ -285,7 +287,7 @@ Index: src/Makefile.in PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ POSIX_SHELL = @POSIX_SHELL@ -@@ -1743,7 +1745,8 @@ stdbuf_LDADD = $(LDADD) $(LIBICONV) +@@ -1779,7 +1781,8 @@ stdbuf_LDADD = $(LDADD) $(LIBICONV) stty_LDADD = $(LDADD) # for crypt @@ -294,9 +296,9 @@ Index: src/Makefile.in +su_LDADD = $(LDADD) $(LIB_CRYPT) $(PAM_LIBS) sum_LDADD = $(LDADD) sync_LDADD = $(LDADD) - tac_LDADD = $(LDADD) $(LIB_GETHRXTIME) -@@ -2386,6 +2389,7 @@ distclean-compile: - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/false.Po@am__quote@ + tac_LDADD = $(LDADD) +@@ -2425,6 +2428,7 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/find-mount-point.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fold.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdef.Po@am__quote@ @@ -306,7 +308,7 @@ Index: src/Makefile.in Index: src/getdef.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ src/getdef.c 2010-05-06 19:37:45.014990147 +0200 ++++ src/getdef.c 2010-11-11 16:02:50.662170193 +0100 @@ -0,0 +1,259 @@ +/* Copyright (C) 2003, 2004, 2005 Thorsten Kukuk + Author: Thorsten Kukuk @@ -570,7 +572,7 @@ Index: src/getdef.c Index: src/getdef.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ src/getdef.h 2010-05-06 19:37:45.054863903 +0200 ++++ src/getdef.h 2010-11-11 16:02:50.678173021 +0100 @@ -0,0 +1,29 @@ +/* Copyright (C) 2003, 2005 Thorsten Kukuk + Author: Thorsten Kukuk @@ -603,8 +605,8 @@ Index: src/getdef.h +#endif /* _GETDEF_H_ */ Index: src/su.c =================================================================== ---- src/su.c.orig 2010-01-01 14:06:47.000000000 +0100 -+++ src/su.c 2010-05-06 19:37:59.538860383 +0200 +--- src/su.c.orig 2010-10-11 19:35:11.000000000 +0200 ++++ src/su.c 2010-11-11 16:02:50.694175850 +0100 @@ -37,6 +37,16 @@ restricts who can su to UID 0 accounts. RMS considers that to be fascist. @@ -1020,9 +1022,9 @@ Index: src/su.c Index: tests/Makefile.in =================================================================== ---- tests/Makefile.in.orig 2010-04-23 17:58:39.000000000 +0200 -+++ tests/Makefile.in 2010-05-06 19:37:45.091861849 +0200 -@@ -986,6 +986,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ +--- tests/Makefile.in.orig 2010-10-15 16:31:45.000000000 +0200 ++++ tests/Makefile.in 2010-11-11 16:02:50.750185750 +0100 +@@ -1045,6 +1045,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ diff --git a/coreutils-6.8.0-pie.patch b/coreutils-6.8.0-pie.patch index 2a22116..fca2788 100644 --- a/coreutils-6.8.0-pie.patch +++ b/coreutils-6.8.0-pie.patch @@ -1,7 +1,7 @@ Index: lib/Makefile.am =================================================================== ---- lib/Makefile.am.orig 2010-01-01 14:06:47.000000000 +0100 -+++ lib/Makefile.am 2010-05-05 14:38:03.083359277 +0200 +--- lib/Makefile.am.orig 2010-10-11 19:35:11.000000000 +0200 ++++ lib/Makefile.am 2010-11-11 16:24:42.950085976 +0100 @@ -17,7 +17,7 @@ include gnulib.mk @@ -10,14 +10,14 @@ Index: lib/Makefile.am +AM_CFLAGS += $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) -fpie libcoreutils_a_SOURCES += \ - buffer-lcm.c buffer-lcm.h \ + buffer-lcm.c buffer-lcm.h Index: lib/Makefile.in =================================================================== ---- lib/Makefile.in.orig 2010-05-05 14:37:08.000000000 +0200 -+++ lib/Makefile.in 2010-05-05 14:38:31.946859277 +0200 -@@ -1432,7 +1432,7 @@ DISTCLEANFILES = - MAINTAINERCLEANFILES = getdate.c iconv_open-aix.h iconv_open-hpux.h \ - iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h +--- lib/Makefile.in.orig 2010-11-11 16:21:01.630976009 +0100 ++++ lib/Makefile.in 2010-11-11 16:25:20.640746300 +0100 +@@ -1505,7 +1505,7 @@ MAINTAINERCLEANFILES = iconv_open-aix.h + iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h \ + parse-datetime.c AM_CPPFLAGS = -AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) +AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) -fpie @@ -26,23 +26,23 @@ Index: lib/Makefile.in argv-iter.h base64.h base64.c bitrotate.h c-ctype.h c-ctype.c \ Index: src/Makefile.am =================================================================== ---- src/Makefile.am.orig 2010-05-05 14:37:08.000000000 +0200 -+++ src/Makefile.am 2010-05-05 14:39:20.956359221 +0200 -@@ -366,6 +366,10 @@ uptime_LDADD += $(GETLOADAVG_LIBS) +--- src/Makefile.am.orig 2010-11-11 16:21:01.674983785 +0100 ++++ src/Makefile.am 2010-11-11 16:21:01.839012773 +0100 +@@ -354,6 +354,10 @@ uptime_LDADD += $(GETLOADAVG_LIBS) # for crypt su_SOURCES = su.c getdef.c su_LDADD = $(LDADD) $(LIB_CRYPT) $(PAM_LIBS) +su_CFLAGS = -fpie -+su_LDFLAGS = -pie ++su_LDFLAGS = -pie -Wl,-z,relro,-z,now +timeout_CFLAGS = -fpie -+timeout_LDFLAGS = -pie ++timeout_LDFLAGS = -pie -Wl,-z,relro,-z,now # for various ACL functions copy_LDADD += $(LIB_ACL) Index: src/Makefile.in =================================================================== ---- src/Makefile.in.orig 2010-05-05 14:37:08.000000000 +0200 -+++ src/Makefile.in 2010-05-05 14:46:02.318905172 +0200 +--- src/Makefile.in.orig 2010-11-11 16:21:01.674983786 +0100 ++++ src/Makefile.in 2010-11-11 16:24:16.137347873 +0100 @@ -553,10 +553,12 @@ stdbuf_DEPENDENCIES = $(am__DEPENDENCIES stty_SOURCES = stty.c stty_OBJECTS = stty.$(OBJEXT) @@ -57,7 +57,7 @@ Index: src/Makefile.in sum_SOURCES = sum.c sum_OBJECTS = sum.$(OBJEXT) sum_DEPENDENCIES = $(am__DEPENDENCIES_2) -@@ -576,9 +578,12 @@ tee_DEPENDENCIES = $(am__DEPENDENCIES_2) +@@ -575,9 +577,12 @@ tee_DEPENDENCIES = $(am__DEPENDENCIES_2) test_SOURCES = test.c test_OBJECTS = test.$(OBJEXT) test_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) @@ -71,7 +71,7 @@ Index: src/Makefile.in touch_SOURCES = touch.c touch_OBJECTS = touch.$(OBJEXT) touch_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) -@@ -1747,6 +1752,10 @@ stty_LDADD = $(LDADD) +@@ -1783,6 +1788,10 @@ stty_LDADD = $(LDADD) # for crypt su_SOURCES = su.c getdef.c su_LDADD = $(LDADD) $(LIB_CRYPT) $(PAM_LIBS) @@ -81,34 +81,34 @@ Index: src/Makefile.in +timeout_LDFLAGS = -pie sum_LDADD = $(LDADD) sync_LDADD = $(LDADD) - tac_LDADD = $(LDADD) $(LIB_GETHRXTIME) -@@ -2279,7 +2288,7 @@ stty$(EXEEXT): $(stty_OBJECTS) $(stty_DE + tac_LDADD = $(LDADD) +@@ -2317,7 +2326,7 @@ stty$(EXEEXT): $(stty_OBJECTS) $(stty_DE $(AM_V_CCLD)$(LINK) $(stty_OBJECTS) $(stty_LDADD) $(LIBS) - su$(EXEEXT): $(su_OBJECTS) $(su_DEPENDENCIES) + su$(EXEEXT): $(su_OBJECTS) $(su_DEPENDENCIES) $(EXTRA_su_DEPENDENCIES) @rm -f su$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(su_OBJECTS) $(su_LDADD) $(LIBS) + $(AM_V_CCLD)$(su_LINK) $(su_OBJECTS) $(su_LDADD) $(LIBS) - sum$(EXEEXT): $(sum_OBJECTS) $(sum_DEPENDENCIES) + sum$(EXEEXT): $(sum_OBJECTS) $(sum_DEPENDENCIES) $(EXTRA_sum_DEPENDENCIES) @rm -f sum$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sum_OBJECTS) $(sum_LDADD) $(LIBS) -@@ -2300,7 +2309,7 @@ test$(EXEEXT): $(test_OBJECTS) $(test_DE +@@ -2338,7 +2347,7 @@ test$(EXEEXT): $(test_OBJECTS) $(test_DE $(AM_V_CCLD)$(LINK) $(test_OBJECTS) $(test_LDADD) $(LIBS) - timeout$(EXEEXT): $(timeout_OBJECTS) $(timeout_DEPENDENCIES) + timeout$(EXEEXT): $(timeout_OBJECTS) $(timeout_DEPENDENCIES) $(EXTRA_timeout_DEPENDENCIES) @rm -f timeout$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(timeout_OBJECTS) $(timeout_LDADD) $(LIBS) + $(AM_V_CCLD)$(timeout_LINK) $(timeout_OBJECTS) $(timeout_LDADD) $(LIBS) - touch$(EXEEXT): $(touch_OBJECTS) $(touch_DEPENDENCIES) + touch$(EXEEXT): $(touch_OBJECTS) $(touch_DEPENDENCIES) $(EXTRA_touch_DEPENDENCIES) @rm -f touch$(EXEEXT) $(AM_V_CCLD)$(LINK) $(touch_OBJECTS) $(touch_LDADD) $(LIBS) -@@ -2389,7 +2398,6 @@ distclean-compile: - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/false.Po@am__quote@ +@@ -2428,7 +2437,6 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/find-mount-point.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fold.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdef.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getlimits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginstall-copy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginstall-cp-hash.Po@am__quote@ -@@ -2453,14 +2461,16 @@ distclean-compile: +@@ -2492,14 +2500,16 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdbuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stty.Po@am__quote@ @@ -127,7 +127,7 @@ Index: src/Makefile.in @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/touch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/true.Po@am__quote@ -@@ -2649,6 +2659,62 @@ sha512sum-md5sum.obj: md5sum.c +@@ -2688,6 +2698,62 @@ sha512sum-md5sum.obj: md5sum.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha512sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha512sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` diff --git a/coreutils-8.5.tar.xz b/coreutils-8.5.tar.xz deleted file mode 100644 index cd6bae3..0000000 --- a/coreutils-8.5.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5aa855caa08b94ccd632510d9ab265646d2ee11498c7efff205b27c2437dec5a -size 4531488 diff --git a/coreutils-8.5-i18n.patch b/coreutils-8.6-i18n.patch similarity index 82% rename from coreutils-8.5-i18n.patch rename to coreutils-8.6-i18n.patch index b043447..266b6bb 100644 --- a/coreutils-8.5-i18n.patch +++ b/coreutils-8.6-i18n.patch @@ -1,7 +1,26 @@ + lib/linebuffer.h | 8 + + src/cut.c | 420 +++++++++++++++++++++++++-- + src/expand.c | 160 ++++++++++- + src/fold.c | 309 ++++++++++++++++++-- + src/join.c | 347 +++++++++++++++++++--- + src/pr.c | 431 +++++++++++++++++++++++++--- + src/sort.c | 722 +++++++++++++++++++++++++++++++++++++++++++--- + src/unexpand.c | 226 ++++++++++++++- + src/uniq.c | 259 ++++++++++++++++- + tests/Makefile.am | 5 + + tests/misc/cut | 4 +- + tests/misc/mb1.I | 4 + + tests/misc/mb1.X | 4 + + tests/misc/mb2.I | 4 + + tests/misc/mb2.X | 4 + + tests/misc/sort-mb-tests | 58 ++++ + 16 files changed, 2783 insertions(+), 182 deletions(-) + + Index: lib/linebuffer.h =================================================================== ---- lib/linebuffer.h.orig 2010-04-23 15:44:00.000000000 +0200 -+++ lib/linebuffer.h 2010-05-07 16:13:30.696492151 +0200 +--- lib/linebuffer.h.orig 2010-06-10 18:45:26.000000000 +0200 ++++ lib/linebuffer.h 2010-11-11 16:26:25.524211797 +0100 @@ -21,6 +21,11 @@ # include @@ -26,8 +45,8 @@ Index: lib/linebuffer.h /* Initialize linebuffer LINEBUFFER for use. */ Index: src/cut.c =================================================================== ---- src/cut.c.orig 2010-04-20 21:52:04.000000000 +0200 -+++ src/cut.c 2010-05-07 16:40:46.225492013 +0200 +--- src/cut.c.orig 2010-10-11 19:35:11.000000000 +0200 ++++ src/cut.c 2010-11-11 16:28:46.581137538 +0100 @@ -28,6 +28,11 @@ #include #include @@ -40,7 +59,7 @@ Index: src/cut.c #include "system.h" #include "error.h" -@@ -36,6 +41,18 @@ +@@ -37,6 +42,18 @@ #include "quote.h" #include "xstrndup.h" @@ -59,60 +78,60 @@ Index: src/cut.c /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "cut" -@@ -71,6 +88,52 @@ +@@ -72,6 +89,52 @@ } \ while (0) +/* Refill the buffer BUF to get a multibyte character. */ -+#define REFILL_BUFFER(BUF, BUFPOS, BUFLEN, STREAM) \ -+ do \ -+ { \ -+ if (BUFLEN < MB_LEN_MAX && !feof (STREAM) && !ferror (STREAM)) \ -+ { \ -+ memmove (BUF, BUFPOS, BUFLEN); \ -+ BUFLEN += fread (BUF + BUFLEN, sizeof(char), BUFSIZ, STREAM); \ -+ BUFPOS = BUF; \ -+ } \ -+ } \ ++#define REFILL_BUFFER(BUF, BUFPOS, BUFLEN, STREAM) \ ++ do \ ++ { \ ++ if (BUFLEN < MB_LEN_MAX && !feof (STREAM) && !ferror (STREAM)) \ ++ { \ ++ memmove (BUF, BUFPOS, BUFLEN); \ ++ BUFLEN += fread (BUF + BUFLEN, sizeof(char), BUFSIZ, STREAM); \ ++ BUFPOS = BUF; \ ++ } \ ++ } \ + while (0) + +/* Get wide character on BUFPOS. BUFPOS is not included after that. + If byte sequence is not valid as a character, CONVFAIL is 1. Otherwise 0. */ -+#define GET_NEXT_WC_FROM_BUFFER(WC, BUFPOS, BUFLEN, MBLENGTH, STATE, CONVFAIL) \ -+ do \ -+ { \ -+ mbstate_t state_bak; \ -+ \ -+ if (BUFLEN < 1) \ -+ { \ -+ WC = WEOF; \ -+ break; \ -+ } \ -+ \ -+ /* Get a wide character. */ \ -+ CONVFAIL = 0; \ -+ state_bak = STATE; \ -+ MBLENGTH = mbrtowc ((wchar_t *)&WC, BUFPOS, BUFLEN, &STATE); \ -+ \ -+ switch (MBLENGTH) \ -+ { \ -+ case (size_t)-1: \ -+ case (size_t)-2: \ -+ CONVFAIL++; \ -+ STATE = state_bak; \ -+ /* Fall througn. */ \ -+ \ -+ case 0: \ -+ MBLENGTH = 1; \ -+ break; \ -+ } \ -+ } \ ++#define GET_NEXT_WC_FROM_BUFFER(WC, BUFPOS, BUFLEN, MBLENGTH, STATE, CONVFAIL) \ ++ do \ ++ { \ ++ mbstate_t state_bak; \ ++ \ ++ if (BUFLEN < 1) \ ++ { \ ++ WC = WEOF; \ ++ break; \ ++ } \ ++ \ ++ /* Get a wide character. */ \ ++ CONVFAIL = 0; \ ++ state_bak = STATE; \ ++ MBLENGTH = mbrtowc ((wchar_t *)&WC, BUFPOS, BUFLEN, &STATE); \ ++ \ ++ switch (MBLENGTH) \ ++ { \ ++ case (size_t)-1: \ ++ case (size_t)-2: \ ++ CONVFAIL++; \ ++ STATE = state_bak; \ ++ /* Fall througn. */ \ ++ \ ++ case 0: \ ++ MBLENGTH = 1; \ ++ break; \ ++ } \ ++ } \ + while (0) + struct range_pair { size_t lo; -@@ -89,7 +152,7 @@ static char *field_1_buffer; +@@ -90,7 +153,7 @@ static char *field_1_buffer; /* The number of bytes allocated for FIELD_1_BUFFER. */ static size_t field_1_bufsize; @@ -121,7 +140,7 @@ Index: src/cut.c or degenerate range specification; this doesn't include the starting index of right-open-ended ranges. For example, with either range spec `2-5,9-', `2-3,5,9-' this variable would be set to 5. */ -@@ -101,10 +164,11 @@ static size_t eol_range_start; +@@ -102,10 +165,11 @@ static size_t eol_range_start; /* This is a bit vector. In byte mode, which bytes to output. @@ -135,7 +154,7 @@ Index: src/cut.c (K <= MAX_RANGE_ENDPOINT and is_printable_field(K)) || (EOL_RANGE_START > 0 && K >= EOL_RANGE_START). */ static unsigned char *printable_field; -@@ -113,15 +177,25 @@ enum operating_mode +@@ -114,15 +178,25 @@ enum operating_mode { undefined_mode, @@ -162,7 +181,7 @@ Index: src/cut.c /* If true do not output lines containing no delimeter characters. Otherwise, all such lines are printed. This option is valid only with field mode. */ -@@ -133,6 +207,9 @@ static bool complement; +@@ -134,6 +208,9 @@ static bool complement; /* The delimeter character for field mode. */ static unsigned char delim; @@ -172,7 +191,7 @@ Index: src/cut.c /* True if the --output-delimiter=STRING option was specified. */ static bool output_delimiter_specified; -@@ -206,7 +283,7 @@ Mandatory arguments to long options are +@@ -207,7 +284,7 @@ Mandatory arguments to long options are -f, --fields=LIST select only these fields; also print any line\n\ that contains no delimiter character, unless\n\ the -s option is specified\n\ @@ -181,7 +200,7 @@ Index: src/cut.c "), stdout); fputs (_("\ --complement complement the set of selected bytes, characters\n\ -@@ -365,7 +442,7 @@ set_fields (const char *fieldstr) +@@ -366,7 +443,7 @@ set_fields (const char *fieldstr) in_digits = false; /* Starting a range. */ if (dash_found) @@ -190,7 +209,7 @@ Index: src/cut.c dash_found = true; fieldstr++; -@@ -389,14 +466,16 @@ set_fields (const char *fieldstr) +@@ -390,14 +467,16 @@ set_fields (const char *fieldstr) if (!rhs_specified) { /* `n-'. From `initial' to end of line. */ @@ -209,7 +228,7 @@ Index: src/cut.c /* Is there already a range going to end of line? */ if (eol_range_start != 0) -@@ -476,6 +555,9 @@ set_fields (const char *fieldstr) +@@ -477,6 +556,9 @@ set_fields (const char *fieldstr) if (operating_mode == byte_mode) error (0, 0, _("byte offset %s is too large"), quote (bad_num)); @@ -219,7 +238,7 @@ Index: src/cut.c else error (0, 0, _("field number %s is too large"), quote (bad_num)); -@@ -486,7 +568,7 @@ set_fields (const char *fieldstr) +@@ -487,7 +569,7 @@ set_fields (const char *fieldstr) fieldstr++; } else @@ -228,7 +247,7 @@ Index: src/cut.c } max_range_endpoint = 0; -@@ -579,6 +661,63 @@ cut_bytes (FILE *stream) +@@ -580,6 +662,63 @@ cut_bytes (FILE *stream) } } @@ -292,7 +311,7 @@ Index: src/cut.c /* Read from stream STREAM, printing to standard output any selected fields. */ static void -@@ -701,13 +840,192 @@ cut_fields (FILE *stream) +@@ -702,13 +841,192 @@ cut_fields (FILE *stream) } } @@ -488,16 +507,16 @@ Index: src/cut.c } /* Process file FILE to standard output. -@@ -757,6 +1075,8 @@ main (int argc, char **argv) +@@ -760,6 +1078,8 @@ main (int argc, char **argv) bool ok; bool delim_specified = false; - char *spec_list_string IF_LINT (= NULL); + char *spec_list_string IF_LINT ( = NULL); + char mbdelim[MB_LEN_MAX + 1]; + size_t delimlen = 0; initialize_main (&argc, &argv); set_program_name (argv[0]); -@@ -779,7 +1099,6 @@ main (int argc, char **argv) +@@ -782,7 +1102,6 @@ main (int argc, char **argv) switch (optc) { case 'b': @@ -505,7 +524,7 @@ Index: src/cut.c /* Build the byte list. */ if (operating_mode != undefined_mode) FATAL_ERROR (_("only one type of list may be specified")); -@@ -787,6 +1106,14 @@ main (int argc, char **argv) +@@ -790,6 +1109,14 @@ main (int argc, char **argv) spec_list_string = optarg; break; @@ -520,7 +539,7 @@ Index: src/cut.c case 'f': /* Build the field list. */ if (operating_mode != undefined_mode) -@@ -798,10 +1125,35 @@ main (int argc, char **argv) +@@ -801,10 +1128,35 @@ main (int argc, char **argv) case 'd': /* New delimiter. */ /* Interpret -d '' to mean `use the NUL byte as the delimiter.' */ @@ -560,7 +579,7 @@ Index: src/cut.c break; case OUTPUT_DELIMITER_OPTION: -@@ -814,6 +1166,7 @@ main (int argc, char **argv) +@@ -817,6 +1169,7 @@ main (int argc, char **argv) break; case 'n': @@ -568,7 +587,7 @@ Index: src/cut.c break; case 's': -@@ -836,7 +1189,7 @@ main (int argc, char **argv) +@@ -839,7 +1192,7 @@ main (int argc, char **argv) if (operating_mode == undefined_mode) FATAL_ERROR (_("you must specify a list of bytes, characters, or fields")); @@ -577,7 +596,7 @@ Index: src/cut.c FATAL_ERROR (_("an input delimiter may be specified only\ when operating on fields")); -@@ -863,15 +1216,34 @@ main (int argc, char **argv) +@@ -866,15 +1219,34 @@ main (int argc, char **argv) } if (!delim_specified) @@ -620,9 +639,9 @@ Index: src/cut.c if (optind == argc) Index: src/expand.c =================================================================== ---- src/expand.c.orig 2010-01-01 14:06:47.000000000 +0100 -+++ src/expand.c 2010-05-07 16:13:30.748169979 +0200 -@@ -38,11 +38,28 @@ +--- src/expand.c.orig 2010-10-11 19:35:11.000000000 +0200 ++++ src/expand.c 2010-11-11 16:26:25.580221695 +0100 +@@ -38,12 +38,29 @@ #include #include #include @@ -634,6 +653,7 @@ Index: src/expand.c + #include "system.h" #include "error.h" + #include "fadvise.h" #include "quote.h" #include "xstrndup.h" @@ -651,7 +671,7 @@ Index: src/expand.c /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "expand" -@@ -358,6 +375,142 @@ expand (void) +@@ -360,6 +377,142 @@ expand (void) } } @@ -794,7 +814,7 @@ Index: src/expand.c int main (int argc, char **argv) { -@@ -422,7 +575,12 @@ main (int argc, char **argv) +@@ -424,7 +577,12 @@ main (int argc, char **argv) file_list = (optind < argc ? &argv[optind] : stdin_argv); @@ -810,9 +830,9 @@ Index: src/expand.c error (EXIT_FAILURE, errno, "-"); Index: src/fold.c =================================================================== ---- src/fold.c.orig 2010-01-01 14:06:47.000000000 +0100 -+++ src/fold.c 2010-05-07 16:39:03.220004781 +0200 -@@ -22,11 +22,33 @@ +--- src/fold.c.orig 2010-10-11 19:35:11.000000000 +0200 ++++ src/fold.c 2010-11-11 16:27:26.402969548 +0100 +@@ -22,12 +22,34 @@ #include #include @@ -828,6 +848,7 @@ Index: src/fold.c + #include "system.h" #include "error.h" + #include "fadvise.h" #include "quote.h" #include "xstrtol.h" @@ -846,7 +867,7 @@ Index: 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") @@ -892,7 +913,7 @@ Index: src/fold.c {"spaces", no_argument, NULL, 's'}, {"width", required_argument, NULL, 'w'}, {GETOPT_HELP_OPTION_DECL}, -@@ -77,6 +120,7 @@ Mandatory arguments to long options are +@@ -78,6 +121,7 @@ Mandatory arguments to long options are "), stdout); fputs (_("\ -b, --bytes count bytes rather than columns\n\ @@ -900,7 +921,7 @@ Index: src/fold.c -s, --spaces break at spaces\n\ -w, --width=WIDTH use WIDTH columns instead of 80\n\ "), stdout); -@@ -94,7 +138,7 @@ Mandatory arguments to long options are +@@ -95,7 +139,7 @@ Mandatory arguments to long options are static size_t adjust_column (size_t column, char c) { @@ -909,7 +930,7 @@ Index: src/fold.c { if (c == '\b') { -@@ -117,30 +161,14 @@ adjust_column (size_t column, char c) +@@ -118,30 +162,14 @@ adjust_column (size_t column, char c) to stdout, with maximum line length WIDTH. Return true if successful. */ @@ -940,9 +961,9 @@ Index: src/fold.c - return false; - } - while ((c = getc (istream)) != EOF) - { -@@ -168,6 +196,15 @@ fold_file (char const *filename, size_t + fadvise (stdin, FADVISE_SEQUENTIAL); + +@@ -171,6 +199,15 @@ fold_file (char const *filename, size_t bool found_blank = false; size_t logical_end = offset_out; @@ -958,7 +979,7 @@ Index: src/fold.c /* Look for the last blank. */ while (logical_end) { -@@ -214,11 +251,222 @@ fold_file (char const *filename, size_t +@@ -217,11 +254,222 @@ fold_file (char const *filename, size_t line_out[offset_out++] = c; } @@ -1182,7 +1203,7 @@ Index: src/fold.c if (ferror (istream)) { error (0, saved_errno, "%s", filename); -@@ -251,7 +499,8 @@ main (int argc, char **argv) +@@ -254,7 +502,8 @@ main (int argc, char **argv) atexit (close_stdout); @@ -1192,7 +1213,7 @@ Index: src/fold.c while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1) { -@@ -260,7 +509,15 @@ main (int argc, char **argv) +@@ -263,7 +512,15 @@ main (int argc, char **argv) switch (optc) { case 'b': /* Count bytes rather than columns. */ @@ -1211,9 +1232,9 @@ Index: src/fold.c case 's': /* Break at word boundaries. */ Index: src/join.c =================================================================== ---- src/join.c.orig 2010-04-20 21:52:04.000000000 +0200 -+++ src/join.c 2010-05-07 16:41:17.564268573 +0200 -@@ -22,17 +22,31 @@ +--- src/join.c.orig 2010-10-11 19:35:11.000000000 +0200 ++++ src/join.c 2010-11-11 16:29:37.838194915 +0100 +@@ -22,18 +22,32 @@ #include #include @@ -1229,6 +1250,7 @@ Index: src/join.c + #include "system.h" #include "error.h" + #include "fadvise.h" #include "hard-locale.h" #include "linebuffer.h" -#include "memcasecmp.h" @@ -1246,7 +1268,7 @@ Index: src/join.c /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "join" -@@ -121,10 +135,12 @@ static struct outlist outlist_head; +@@ -122,10 +136,12 @@ static struct outlist outlist_head; /* Last element in `outlist', where a new element can be added. */ static struct outlist *outlist_end = &outlist_head; @@ -1263,11 +1285,11 @@ Index: src/join.c /* If nonzero, check that the input is correctly ordered. */ static enum -@@ -248,10 +264,11 @@ xfields (struct line *line) +@@ -249,13 +265,14 @@ xfields (struct line *line) if (ptr == lim) return; -- if (0 <= tab) +- if (0 <= tab && tab != '\n') + if (tab != NULL) { + unsigned char t = tab[0]; @@ -1276,8 +1298,12 @@ Index: src/join.c + for (; (sep = memchr (ptr, t, lim - ptr)) != NULL; ptr = sep + 1) extract_field (line, ptr, sep - ptr); } - else -@@ -278,6 +295,148 @@ xfields (struct line *line) +- else if (tab < 0) ++ else + { + /* Skip leading blanks before the first field. */ + while (isblank (to_uchar (*ptr))) +@@ -279,6 +296,148 @@ xfields (struct line *line) extract_field (line, ptr, lim - ptr); } @@ -1426,7 +1452,7 @@ Index: src/join.c static void freeline (struct line *line) { -@@ -299,56 +458,115 @@ keycmp (struct line const *line1, struct +@@ -300,56 +459,115 @@ keycmp (struct line const *line1, struct size_t jf_1, size_t jf_2) { /* Start of field to compare in each file. */ @@ -1565,7 +1591,7 @@ Index: src/join.c } /* Check that successive input lines PREV and CURRENT from input file -@@ -429,6 +647,11 @@ get_line (FILE *fp, struct line **linep, +@@ -430,6 +648,11 @@ get_line (FILE *fp, struct line **linep, return false; } @@ -1577,7 +1603,7 @@ Index: src/join.c xfields (line); if (prevline[which - 1]) -@@ -528,11 +751,18 @@ prfield (size_t n, struct line const *li +@@ -529,11 +752,18 @@ prfield (size_t n, struct line const *li /* Print the join of LINE1 and LINE2. */ @@ -1597,7 +1623,7 @@ Index: src/join.c outlist = outlist_head.next; if (outlist) -@@ -567,7 +797,7 @@ prjoin (struct line const *line1, struct +@@ -568,7 +798,7 @@ prjoin (struct line const *line1, struct o = o->next; if (o == NULL) break; @@ -1606,7 +1632,7 @@ Index: src/join.c } putchar ('\n'); } -@@ -585,23 +815,23 @@ prjoin (struct line const *line1, struct +@@ -586,23 +816,23 @@ prjoin (struct line const *line1, struct prfield (join_field_1, line1); for (i = 0; i < join_field_1 && i < line1->nfields; ++i) { @@ -1634,7 +1660,7 @@ Index: src/join.c prfield (i, line2); } putchar ('\n'); -@@ -1039,21 +1269,46 @@ main (int argc, char **argv) +@@ -1043,21 +1273,46 @@ main (int argc, char **argv) case 't': { @@ -1660,9 +1686,8 @@ Index: src/join.c +#endif + newtablen = 1; if (! newtab) -- newtab = '\n'; /* '' => process the whole line. */ + { -+ newtab[0] = '\n'; /* '' => process the whole line. */ + newtab = '\n'; /* '' => process the whole line. */ + } else if (optarg[1]) { @@ -1693,8 +1718,8 @@ Index: src/join.c case NOCHECK_ORDER_OPTION: Index: src/pr.c =================================================================== ---- src/pr.c.orig 2010-03-13 16:14:09.000000000 +0100 -+++ src/pr.c 2010-05-07 16:13:30.836003733 +0200 +--- src/pr.c.orig 2010-10-11 19:35:11.000000000 +0200 ++++ src/pr.c 2010-11-11 16:26:25.640232300 +0100 @@ -312,6 +312,32 @@ #include @@ -1727,8 +1752,8 @@ Index: src/pr.c + #include "system.h" #include "error.h" - #include "hard-locale.h" -@@ -322,6 +348,18 @@ + #include "fadvise.h" +@@ -323,6 +349,18 @@ #include "strftime.h" #include "xstrtol.h" @@ -1747,7 +1772,7 @@ Index: src/pr.c /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "pr" -@@ -414,7 +452,20 @@ struct COLUMN +@@ -415,7 +453,20 @@ struct COLUMN typedef struct COLUMN COLUMN; @@ -1769,7 +1794,7 @@ Index: src/pr.c static bool read_line (COLUMN *p); static bool print_page (void); static bool print_stored (COLUMN *p); -@@ -424,6 +475,7 @@ static void print_header (void); +@@ -425,6 +476,7 @@ static void print_header (void); static void pad_across_to (int position); static void add_line_number (COLUMN *p); static void getoptarg (char *arg, char switch_char, char *character, @@ -1777,7 +1802,7 @@ Index: src/pr.c int *number); void usage (int status); static void print_files (int number_of_files, char **av); -@@ -438,7 +490,6 @@ static void store_char (char c); +@@ -439,7 +491,6 @@ static void store_char (char c); static void pad_down (int lines); static void read_rest_of_line (COLUMN *p); static void skip_read (COLUMN *p, int column_number); @@ -1785,7 +1810,7 @@ Index: src/pr.c static void cleanup (void); static void print_sep_string (void); static void separator_string (const char *optarg_S); -@@ -450,7 +501,7 @@ static COLUMN *column_vector; +@@ -451,7 +502,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]. */ @@ -1794,7 +1819,7 @@ Index: src/pr.c /* Index of the position in buff where the next character will be stored. */ -@@ -554,7 +605,7 @@ static int chars_per_column; +@@ -555,7 +606,7 @@ static int chars_per_column; static bool untabify_input = false; /* (-e) The input tab character. */ @@ -1803,7 +1828,7 @@ Index: src/pr.c /* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ... where the leftmost column is 1. */ -@@ -564,7 +615,10 @@ static int chars_per_input_tab = 8; +@@ -565,7 +616,10 @@ static int chars_per_input_tab = 8; static bool tabify_output = false; /* (-i) The output tab character. */ @@ -1815,7 +1840,7 @@ Index: src/pr.c /* (-i) The width of the output tab. */ static int chars_per_output_tab = 8; -@@ -638,7 +692,13 @@ static int power_10; +@@ -639,7 +693,13 @@ static int power_10; static bool numbered_lines = false; /* (-n) Character which follows each line number. */ @@ -1830,7 +1855,7 @@ Index: src/pr.c /* (-n) line counting starts with 1st line of input file (not with 1st line of 1st page printed). */ -@@ -691,6 +751,7 @@ static bool use_col_separator = false; +@@ -692,6 +752,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 int col_sep_length = 0; @@ -1838,7 +1863,7 @@ Index: src/pr.c static char *column_separator = (char *) " "; static char *line_separator = (char *) "\t"; -@@ -847,6 +908,13 @@ separator_string (const char *optarg_S) +@@ -848,6 +909,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); @@ -1852,7 +1877,7 @@ Index: src/pr.c } int -@@ -871,6 +939,21 @@ main (int argc, char **argv) +@@ -872,6 +940,21 @@ main (int argc, char **argv) atexit (close_stdout); @@ -1874,7 +1899,7 @@ Index: src/pr.c n_files = 0; file_names = (argc > 1 ? xmalloc ((argc - 1) * sizeof (char *)) -@@ -947,8 +1030,12 @@ main (int argc, char **argv) +@@ -948,8 +1031,12 @@ main (int argc, char **argv) break; case 'e': if (optarg) @@ -1889,7 +1914,7 @@ Index: src/pr.c /* Could check tab width > 0. */ untabify_input = true; break; -@@ -961,8 +1048,12 @@ main (int argc, char **argv) +@@ -962,8 +1049,12 @@ main (int argc, char **argv) break; case 'i': if (optarg) @@ -1904,7 +1929,7 @@ Index: src/pr.c /* Could check tab width > 0. */ tabify_output = true; break; -@@ -989,8 +1080,8 @@ main (int argc, char **argv) +@@ -990,8 +1081,8 @@ main (int argc, char **argv) case 'n': numbered_lines = true; if (optarg) @@ -1915,7 +1940,7 @@ Index: src/pr.c break; case 'N': skip_count = false; -@@ -1029,7 +1120,7 @@ main (int argc, char **argv) +@@ -1030,7 +1121,7 @@ main (int argc, char **argv) old_s = false; /* Reset an additional input of -s, -S dominates -s */ col_sep_string = bad_cast (""); @@ -1924,7 +1949,7 @@ Index: src/pr.c use_col_separator = true; if (optarg) separator_string (optarg); -@@ -1186,10 +1277,45 @@ main (int argc, char **argv) +@@ -1187,10 +1278,45 @@ main (int argc, char **argv) a number. */ static void @@ -1972,7 +1997,7 @@ Index: src/pr.c if (*arg) { long int tmp_long; -@@ -1248,7 +1374,7 @@ init_parameters (int number_of_files) +@@ -1249,7 +1375,7 @@ init_parameters (int number_of_files) else col_sep_string = column_separator; @@ -1981,7 +2006,7 @@ Index: src/pr.c use_col_separator = true; } /* It's rather pointless to define a TAB separator with column -@@ -1279,11 +1405,11 @@ init_parameters (int number_of_files) +@@ -1280,11 +1406,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. */ @@ -1995,7 +2020,7 @@ Index: src/pr.c /* The number is part of the column width unless we are printing files in parallel. */ -@@ -1298,7 +1424,7 @@ init_parameters (int number_of_files) +@@ -1299,7 +1425,7 @@ init_parameters (int number_of_files) } chars_per_column = (chars_per_line - chars_used_by_number - @@ -2004,7 +2029,7 @@ Index: src/pr.c if (chars_per_column < 1) error (EXIT_FAILURE, 0, _("page width too narrow")); -@@ -1423,7 +1549,7 @@ init_funcs (void) +@@ -1424,7 +1550,7 @@ init_funcs (void) /* Enlarge p->start_position of first column to use the same form of padding_not_printed with all columns. */ @@ -2013,7 +2038,7 @@ Index: src/pr.c /* This loop takes care of all but the rightmost column. */ -@@ -1457,7 +1583,7 @@ init_funcs (void) +@@ -1458,7 +1584,7 @@ init_funcs (void) } else { @@ -2022,7 +2047,7 @@ Index: src/pr.c h_next = h + chars_per_column; } } -@@ -1747,9 +1873,9 @@ static void +@@ -1749,9 +1875,9 @@ static void align_column (COLUMN *p) { padding_not_printed = p->start_position; @@ -2034,7 +2059,7 @@ Index: src/pr.c padding_not_printed = ANYWHERE; } -@@ -2020,13 +2146,13 @@ store_char (char c) +@@ -2022,13 +2148,13 @@ store_char (char c) /* May be too generous. */ buff = X2REALLOC (buff, &buff_allocated); } @@ -2050,7 +2075,7 @@ Index: src/pr.c char *s; int left_cut; -@@ -2049,22 +2175,24 @@ add_line_number (COLUMN *p) +@@ -2051,22 +2177,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. */ @@ -2079,7 +2104,7 @@ Index: src/pr.c output_position = POS_AFTER_TAB (chars_per_output_tab, output_position); } -@@ -2225,7 +2353,7 @@ print_white_space (void) +@@ -2227,7 +2355,7 @@ print_white_space (void) while (goal - h_old > 1 && (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal) { @@ -2088,7 +2113,7 @@ Index: src/pr.c h_old = h_new; } while (++h_old <= goal) -@@ -2245,6 +2373,7 @@ print_sep_string (void) +@@ -2247,6 +2375,7 @@ print_sep_string (void) { char *s; int l = col_sep_length; @@ -2096,7 +2121,7 @@ Index: src/pr.c s = col_sep_string; -@@ -2258,6 +2387,7 @@ print_sep_string (void) +@@ -2260,6 +2389,7 @@ print_sep_string (void) { for (; separators_not_printed > 0; --separators_not_printed) { @@ -2104,7 +2129,7 @@ Index: src/pr.c while (l-- > 0) { /* 3 types of sep_strings: spaces only, spaces and chars, -@@ -2271,12 +2401,15 @@ print_sep_string (void) +@@ -2273,12 +2403,15 @@ print_sep_string (void) } else { @@ -2121,7 +2146,7 @@ Index: src/pr.c /* sep_string ends with some spaces */ if (spaces_not_printed > 0) print_white_space (); -@@ -2304,7 +2437,7 @@ print_clump (COLUMN *p, int n, char *clu +@@ -2306,7 +2439,7 @@ print_clump (COLUMN *p, int n, char *clu required number of tabs and spaces. */ static void @@ -2130,7 +2155,7 @@ Index: src/pr.c { if (tabify_output) { -@@ -2328,6 +2461,74 @@ print_char (char c) +@@ -2330,6 +2463,74 @@ print_char (char c) putchar (c); } @@ -2205,7 +2230,7 @@ Index: src/pr.c /* Skip to page PAGE before printing. PAGE may be larger than total number of pages. */ -@@ -2507,9 +2708,9 @@ read_line (COLUMN *p) +@@ -2509,9 +2710,9 @@ read_line (COLUMN *p) align_empty_cols = false; } @@ -2217,7 +2242,7 @@ Index: src/pr.c padding_not_printed = ANYWHERE; } -@@ -2610,9 +2811,9 @@ print_stored (COLUMN *p) +@@ -2612,9 +2813,9 @@ print_stored (COLUMN *p) } } @@ -2229,7 +2254,7 @@ Index: src/pr.c padding_not_printed = ANYWHERE; } -@@ -2625,8 +2826,8 @@ print_stored (COLUMN *p) +@@ -2627,8 +2828,8 @@ print_stored (COLUMN *p) if (spaces_not_printed == 0) { output_position = p->start_position + end_vector[line]; @@ -2240,7 +2265,7 @@ Index: src/pr.c } return true; -@@ -2645,7 +2846,7 @@ print_stored (COLUMN *p) +@@ -2647,7 +2848,7 @@ print_stored (COLUMN *p) number of characters is 1.) */ static int @@ -2249,7 +2274,7 @@ Index: src/pr.c { unsigned char uc = c; char *s = clump_buff; -@@ -2655,10 +2856,10 @@ char_to_clump (char c) +@@ -2657,10 +2858,10 @@ char_to_clump (char c) int chars; int chars_per_c = 8; @@ -2262,7 +2287,7 @@ Index: src/pr.c { width = TAB_WIDTH (chars_per_c, input_position); -@@ -2739,6 +2940,154 @@ char_to_clump (char c) +@@ -2741,6 +2942,154 @@ char_to_clump (char c) return chars; } @@ -2419,14 +2444,15 @@ Index: src/pr.c Index: src/sort.c =================================================================== ---- src/sort.c.orig 2010-04-21 09:06:17.000000000 +0200 -+++ src/sort.c 2010-05-07 16:34:36.664210645 +0200 -@@ -22,10 +22,19 @@ +--- src/sort.c.orig 2010-10-14 11:39:14.000000000 +0200 ++++ src/sort.c 2010-11-11 16:26:54.553341480 +0100 +@@ -22,11 +22,20 @@ #include +#include #include + #include #include #include #include @@ -2441,12 +2467,8 @@ Index: src/sort.c #include "system.h" #include "argmatch.h" #include "error.h" -@@ -124,14 +133,38 @@ static int decimal_point; - /* Thousands separator; if -1, then there isn't one. */ - static int thousands_sep; +@@ -159,12 +168,34 @@ static int thousands_sep; -+static int force_general_numcompare = 0; -+ /* Nonzero if the corresponding locales are hard. */ static bool hard_LC_COLLATE; -#if HAVE_NL_LANGINFO @@ -2457,31 +2479,31 @@ Index: src/sort.c #define NONZERO(x) ((x) != 0) +/* get a multibyte character's byte length. */ -+#define GET_BYTELEN_OF_CHAR(LIM, PTR, MBLENGTH, STATE) \ -+ do \ -+ { \ -+ wchar_t wc; \ -+ mbstate_t state_bak; \ -+ \ -+ state_bak = STATE; \ -+ mblength = mbrtowc (&wc, PTR, LIM - PTR, &STATE); \ -+ \ -+ switch (MBLENGTH) \ -+ { \ -+ case (size_t)-1: \ -+ case (size_t)-2: \ -+ STATE = state_bak; \ -+ /* Fall through. */ \ -+ case 0: \ -+ MBLENGTH = 1; \ -+ } \ -+ } \ ++#define GET_BYTELEN_OF_CHAR(LIM, PTR, MBLENGTH, STATE) \ ++ do \ ++ { \ ++ wchar_t wc; \ ++ mbstate_t state_bak; \ ++ \ ++ state_bak = STATE; \ ++ mblength = mbrtowc (&wc, PTR, LIM - PTR, &STATE); \ ++ \ ++ switch (MBLENGTH) \ ++ { \ ++ case (size_t)-1: \ ++ case (size_t)-2: \ ++ STATE = state_bak; \ ++ /* Fall through. */ \ ++ case 0: \ ++ MBLENGTH = 1; \ ++ } \ ++ } \ + while (0) + /* The kind of blanks for '-b' to skip in various options. */ enum blanktype { bl_start, bl_end, bl_both }; -@@ -270,13 +303,11 @@ static bool reverse; +@@ -328,13 +359,11 @@ static bool reverse; they were read if all keys compare equal. */ static bool stable; @@ -2498,7 +2520,7 @@ Index: src/sort.c /* Flag to remove consecutive duplicate lines from the output. Only the last of a sequence of equal lines will be output. */ -@@ -714,6 +745,44 @@ reap_some (void) +@@ -782,6 +811,46 @@ reap_some (void) update_proc (pid); } @@ -2509,8 +2531,10 @@ Index: src/sort.c +(*begfield) (const struct line*, const struct keyfield *); +static char * +(*limfield) (const struct line*, const struct keyfield *); ++static void ++(*skipblanks) (char **ptr, char *lim); +static int -+(*getmonth) (char const *, size_t); ++(*getmonth) (char const *, size_t, char **); +static int +(*keycompare) (const struct line *, const struct line *); +static int @@ -2543,7 +2567,7 @@ Index: src/sort.c /* Clean up any remaining temporary files. */ static void -@@ -1158,7 +1227,7 @@ zaptemp (const char *name) +@@ -1205,7 +1274,7 @@ zaptemp (char const *name) free (node); } @@ -2551,8 +2575,8 @@ Index: src/sort.c +#if HAVE_LANGINFO_CODESET static int - struct_month_cmp (const void *m1, const void *m2) -@@ -1173,7 +1242,7 @@ struct_month_cmp (const void *m1, const + struct_month_cmp (void const *m1, void const *m2) +@@ -1220,7 +1289,7 @@ struct_month_cmp (void const *m1, void c /* Initialize the character class tables. */ static void @@ -2561,7 +2585,7 @@ Index: src/sort.c { size_t i; -@@ -1185,7 +1254,7 @@ inittables (void) +@@ -1232,7 +1301,7 @@ inittables (void) fold_toupper[i] = toupper (i); } @@ -2570,7 +2594,7 @@ Index: src/sort.c /* If we're not in the "C" locale, read different names for months. */ if (hard_LC_TIME) { -@@ -1268,6 +1337,64 @@ specify_nmerge (int oi, char c, char con +@@ -1314,6 +1383,84 @@ specify_nmerge (int oi, char c, char con xstrtol_fatal (e, oi, c, long_options, s); } @@ -2579,12 +2603,25 @@ Index: src/sort.c +inittables_mb (void) +{ + int i, j, k, l; -+ char *name, *s; ++ char *name, *s, *lc_time, *lc_ctype; + size_t s_len, mblength; + char mbc[MB_LEN_MAX]; + wchar_t wc, pwc; + mbstate_t state_mb, state_wc; + ++ lc_time = setlocale (LC_TIME, ""); ++ if (lc_time) ++ lc_time = xstrdup (lc_time); ++ ++ lc_ctype = setlocale (LC_CTYPE, ""); ++ if (lc_ctype) ++ lc_ctype = xstrdup (lc_ctype); ++ ++ if (lc_time && lc_ctype) ++ /* temporarily set LC_CTYPE to match LC_TIME, so that we can convert ++ * the names of months to upper case */ ++ setlocale (LC_CTYPE, lc_time); ++ + for (i = 0; i < MONTHS_PER_YEAR; i++) + { + s = (char *) nl_langinfo (ABMON_1 + i); @@ -2629,22 +2666,29 @@ Index: src/sort.c + } + qsort ((void *) monthtab, MONTHS_PER_YEAR, + sizeof (struct month), struct_month_cmp); ++ ++ if (lc_time && lc_ctype) ++ /* restore the original locales */ ++ setlocale (LC_CTYPE, lc_ctype); ++ ++ free (lc_ctype); ++ free (lc_time); +} +#endif + /* Specify the amount of main memory to use when sorting. */ static void specify_sort_size (int oi, char c, char const *s) -@@ -1478,7 +1605,7 @@ buffer_linelim (struct buffer const *buf +@@ -1540,7 +1687,7 @@ buffer_linelim (struct buffer const *buf by KEY in LINE. */ static char * --begfield (const struct line *line, const struct keyfield *key) +-begfield (struct line const *line, struct keyfield const *key) +begfield_uni (const struct line *line, const struct keyfield *key) { char *ptr = line->text, *lim = ptr + line->length - 1; size_t sword = key->sword; -@@ -1487,10 +1614,10 @@ begfield (const struct line *line, const +@@ -1549,10 +1696,10 @@ begfield (struct line const *line, struc /* The leading field separator itself is included in a field when -t is absent. */ @@ -2657,7 +2701,7 @@ Index: src/sort.c ++ptr; if (ptr < lim) ++ptr; -@@ -1516,11 +1643,70 @@ begfield (const struct line *line, const +@@ -1578,11 +1725,70 @@ begfield (struct line const *line, struc return ptr; } @@ -2724,12 +2768,12 @@ Index: src/sort.c in LINE specified by KEY. */ static char * --limfield (const struct line *line, const struct keyfield *key) +-limfield (struct line const *line, struct keyfield const *key) +limfield_uni (const struct line *line, const struct keyfield *key) { char *ptr = line->text, *lim = ptr + line->length - 1; size_t eword = key->eword, echar = key->echar; -@@ -1535,10 +1721,10 @@ limfield (const struct line *line, const +@@ -1597,10 +1803,10 @@ limfield (struct line const *line, struc `beginning' is the first character following the delimiting TAB. Otherwise, leave PTR pointing at the first `blank' character after the preceding field. */ @@ -2742,7 +2786,7 @@ Index: src/sort.c ++ptr; if (ptr < lim && (eword || echar)) ++ptr; -@@ -1584,10 +1770,10 @@ limfield (const struct line *line, const +@@ -1646,10 +1852,10 @@ limfield (struct line const *line, struc */ /* Make LIM point to the end of (one byte past) the current field. */ @@ -2755,7 +2799,7 @@ Index: src/sort.c if (newlim) lim = newlim; } -@@ -1618,6 +1804,113 @@ limfield (const struct line *line, const +@@ -1680,6 +1886,130 @@ limfield (struct line const *line, struc return ptr; } @@ -2865,11 +2909,28 @@ Index: src/sort.c + return ptr; +} +#endif ++ ++static void ++skipblanks_uni (char **ptr, char *lim) ++{ ++ while (*ptr < lim && blanks[to_uchar (**ptr)]) ++ ++(*ptr); ++} ++ ++#if HAVE_MBRTOWC ++static void ++skipblanks_mb (char **ptr, char *lim) ++{ ++ size_t mblength; ++ while (*ptr < lim && ismbblank (*ptr, lim - *ptr, &mblength)) ++ (*ptr) += mblength; ++} ++#endif + /* 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 -@@ -1700,8 +1993,24 @@ fillbuf (struct buffer *buf, FILE *fp, c +@@ -1766,8 +2096,22 @@ fillbuf (struct buffer *buf, FILE *fp, c else { if (key->skipsblanks) @@ -2880,8 +2941,6 @@ Index: src/sort.c + if (MB_CUR_MAX > 1) + { + size_t mblength; -+ mbstate_t state; -+ memset (&state, '\0', sizeof(mbstate_t)); + while (line_start < line->keylim && + ismbblank (line_start, + line->keylim - line_start, @@ -2896,17 +2955,17 @@ Index: src/sort.c line->keybeg = line_start; } } -@@ -1739,7 +2048,7 @@ fillbuf (struct buffer *buf, FILE *fp, c +@@ -1888,7 +2232,7 @@ human_numcompare (char const *a, char co hideously fast. */ static int --numcompare (const char *a, const char *b) +-numcompare (char const *a, char const *b) +numcompare_uni (const char *a, const char *b) { while (blanks[to_uchar (*a)]) a++; -@@ -1848,6 +2157,25 @@ human_numcompare (const char *a, const c - : strnumcmp (a, b, decimal_point, thousands_sep)); +@@ -1898,6 +2242,25 @@ numcompare (char const *a, char const *b + return strnumcmp (a, b, decimal_point, thousands_sep); } +#if HAVE_MBRTOWC @@ -2929,24 +2988,49 @@ Index: src/sort.c +#endif /* HAV_EMBRTOWC */ + static int - general_numcompare (const char *sa, const char *sb) + general_numcompare (char const *sa, char const *sb) { -@@ -1881,7 +2209,7 @@ general_numcompare (const char *sa, cons +@@ -1930,7 +2293,7 @@ general_numcompare (char const *sa, char Return 0 if the name in S is not recognized. */ static int --getmonth (char const *month, size_t len) -+getmonth_uni (char const *month, size_t len) +-getmonth (char const *month, char **ea) ++getmonth_uni (char const *month, size_t len, char **ea) { size_t lo = 0; size_t hi = MONTHS_PER_YEAR; -@@ -2062,11 +2390,79 @@ compare_version (char *restrict texta, s - return diff; +@@ -2204,13 +2567,12 @@ debug_key (struct line const *line, stru + { + char saved = *lim; *lim = '\0'; + +- while (blanks[to_uchar (*beg)]) +- beg++; ++ skipblanks (&beg, lim); + + char *tighter_lim = beg; + + if (key->month) +- getmonth (beg, &tighter_lim); ++ getmonth (beg, lim-beg, &tighter_lim); + else if (key->general_numeric) + ignore_value (strtold (beg, &tighter_lim)); + else if (key->numeric || key->human_numeric) +@@ -2354,7 +2716,7 @@ key_warnings (struct keyfield const *gke + bool maybe_space_aligned = !hard_LC_COLLATE && default_key_compare (key) + && !(key->schar || key->echar); + 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)) + || (!key->skipsblanks && key->schar) + || (!key->skipeblanks && key->echar))) +@@ -2412,11 +2774,83 @@ key_warnings (struct keyfield const *gke + error (0, 0, _("option `-r' only applies to last-resort comparison")); } +#if HAVE_MBRTOWC +static int -+getmonth_mb (const char *s, size_t len) ++getmonth_mb (const char *s, size_t len, char **ea) +{ + char *month; + register size_t i; @@ -2977,7 +3061,8 @@ Index: src/sort.c + memset (&state, '\0', sizeof(mbstate_t)); + + wclength = mbsrtowcs (month_wcs, pp, len + 1, &state); -+ assert (wclength != (size_t)-1 && *pp == NULL); ++ if (wclength == (size_t)-1 || *pp != NULL) ++ error (SORT_FAILURE, 0, _("Invalid multibyte input %s."), quote(s)); + + for (i = 0; i < wclength; i++) + { @@ -3005,6 +3090,9 @@ Index: src/sort.c + } + while (hi - lo > 1); + ++ if (ea) ++ *ea = (char *) month; ++ + result = (!strncmp (month, monthtab[lo].name, strlen (monthtab[lo].name)) + ? monthtab[lo].val : 0); + @@ -3016,12 +3104,21 @@ Index: src/sort.c are no more keys or a difference is found. */ static int --keycompare (const struct line *a, const struct line *b) +-keycompare (struct line const *a, struct line const *b) +keycompare_uni (const struct line *a, const struct line *b) { struct keyfield *key = keylist; -@@ -2246,6 +2642,179 @@ keycompare (const struct line *a, const +@@ -2501,7 +2935,7 @@ keycompare (struct line const *a, struct + else if (key->human_numeric) + diff = human_numcompare (ta, tb); + else if (key->month) +- diff = getmonth (ta, NULL) - getmonth (tb, NULL); ++ diff = getmonth (ta, tlena, NULL) - getmonth (tb, tlenb, NULL); + else if (key->random) + diff = compare_random (ta, tlena, tb, tlenb); + else if (key->version) +@@ -2617,6 +3051,179 @@ keycompare (struct line const *a, struct return key->reverse ? -diff : diff; } @@ -3066,13 +3163,13 @@ Index: src/sort.c + *lima = *limb = '\0'; + diff = (key->numeric ? numcompare (texta, textb) + : key->general_numeric ? general_numcompare (texta, textb) -+ : human_numcompare (texta, textb, key)); ++ : human_numcompare (texta, textb)); + *lima = savea, *limb = saveb; + } + else if (key->version) -+ diff = compare_version (texta, lena, textb, lenb); ++ diff = filevercmp (texta, textb); + else if (key->month) -+ diff = getmonth (texta, lena) - getmonth (textb, lenb); ++ diff = getmonth (texta, lena, NULL) - getmonth (textb, lenb, NULL); + else + { + if (ignore || translate) @@ -3083,69 +3180,69 @@ Index: src/sort.c + size_t i, j; + + /* Ignore and/or translate chars before comparing. */ -+# define IGNORE_CHARS(NEW_LEN, LEN, TEXT, COPY, WC, MBLENGTH, STATE) \ -+ do \ -+ { \ -+ wchar_t uwc; \ -+ char mbc[MB_LEN_MAX]; \ -+ mbstate_t state_wc; \ -+ \ -+ for (NEW_LEN = i = 0; i < LEN;) \ -+ { \ -+ mbstate_t state_bak; \ -+ \ -+ state_bak = STATE; \ -+ MBLENGTH = mbrtowc (&WC, TEXT + i, LEN - i, &STATE); \ ++# define IGNORE_CHARS(NEW_LEN, LEN, TEXT, COPY, WC, MBLENGTH, STATE) \ ++ do \ ++ { \ ++ wchar_t uwc; \ ++ char mbc[MB_LEN_MAX]; \ ++ mbstate_t state_wc; \ + \ -+ if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1 \ -+ || MBLENGTH == 0) \ -+ { \ -+ if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1) \ -+ STATE = state_bak; \ -+ if (!ignore) \ -+ COPY[NEW_LEN++] = TEXT[i++]; \ -+ continue; \ -+ } \ -+ \ -+ if (ignore) \ -+ { \ -+ if ((ignore == nonprinting && !iswprint (WC)) \ -+ || (ignore == nondictionary \ -+ && !iswalnum (WC) && !iswblank (WC))) \ -+ { \ -+ i += MBLENGTH; \ -+ continue; \ -+ } \ -+ } \ -+ \ -+ if (translate) \ -+ { \ -+ \ -+ uwc = towupper(WC); \ -+ if (WC == uwc) \ -+ { \ -+ memcpy (mbc, TEXT + i, MBLENGTH); \ -+ i += MBLENGTH; \ -+ } \ -+ else \ -+ { \ -+ i += MBLENGTH; \ -+ WC = uwc; \ -+ memset (&state_wc, '\0', sizeof (mbstate_t)); \ -+ \ -+ MBLENGTH = wcrtomb (mbc, WC, &state_wc); \ -+ assert (MBLENGTH != (size_t)-1 && MBLENGTH != 0); \ -+ } \ -+ \ -+ for (j = 0; j < MBLENGTH; j++) \ -+ COPY[NEW_LEN++] = mbc[j]; \ -+ } \ -+ else \ -+ for (j = 0; j < MBLENGTH; j++) \ -+ COPY[NEW_LEN++] = TEXT[i++]; \ -+ } \ -+ COPY[NEW_LEN] = '\0'; \ -+ } \ ++ for (NEW_LEN = i = 0; i < LEN;) \ ++ { \ ++ mbstate_t state_bak; \ ++ \ ++ state_bak = STATE; \ ++ MBLENGTH = mbrtowc (&WC, TEXT + i, LEN - i, &STATE); \ ++ \ ++ if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1 \ ++ || MBLENGTH == 0) \ ++ { \ ++ if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1) \ ++ STATE = state_bak; \ ++ if (!ignore) \ ++ COPY[NEW_LEN++] = TEXT[i++]; \ ++ continue; \ ++ } \ ++ \ ++ if (ignore) \ ++ { \ ++ if ((ignore == nonprinting && !iswprint (WC)) \ ++ || (ignore == nondictionary \ ++ && !iswalnum (WC) && !iswblank (WC))) \ ++ { \ ++ i += MBLENGTH; \ ++ continue; \ ++ } \ ++ } \ ++ \ ++ if (translate) \ ++ { \ ++ \ ++ uwc = towupper(WC); \ ++ if (WC == uwc) \ ++ { \ ++ memcpy (mbc, TEXT + i, MBLENGTH); \ ++ i += MBLENGTH; \ ++ } \ ++ else \ ++ { \ ++ i += MBLENGTH; \ ++ WC = uwc; \ ++ memset (&state_wc, '\0', sizeof (mbstate_t)); \ ++ \ ++ MBLENGTH = wcrtomb (mbc, WC, &state_wc); \ ++ assert (MBLENGTH != (size_t)-1 && MBLENGTH != 0); \ ++ } \ ++ \ ++ for (j = 0; j < MBLENGTH; j++) \ ++ COPY[NEW_LEN++] = mbc[j]; \ ++ } \ ++ else \ ++ for (j = 0; j < MBLENGTH; j++) \ ++ COPY[NEW_LEN++] = TEXT[i++]; \ ++ } \ ++ COPY[NEW_LEN] = '\0'; \ ++ } \ + while (0) + IGNORE_CHARS (new_len_a, lena, texta, copy_a, + wc_a, mblength_a, state_a); @@ -3201,7 +3298,7 @@ Index: 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. */ -@@ -3244,7 +3813,7 @@ main (int argc, char **argv) +@@ -4006,7 +4613,7 @@ main (int argc, char **argv) initialize_exit_failure (SORT_FAILURE); hard_LC_COLLATE = hard_locale (LC_COLLATE); @@ -3210,7 +3307,7 @@ Index: src/sort.c hard_LC_TIME = hard_locale (LC_TIME); #endif -@@ -3265,6 +3834,27 @@ main (int argc, char **argv) +@@ -4027,6 +4634,29 @@ main (int argc, char **argv) thousands_sep = -1; } @@ -3220,6 +3317,7 @@ Index: src/sort.c + inittables = inittables_mb; + begfield = begfield_mb; + limfield = limfield_mb; ++ skipblanks = skipblanks_mb; + getmonth = getmonth_mb; + keycompare = keycompare_mb; + numcompare = numcompare_mb; @@ -3230,6 +3328,7 @@ Index: src/sort.c + inittables = inittables_uni; + begfield = begfield_uni; + limfield = limfield_uni; ++ skipblanks = skipblanks_uni; + getmonth = getmonth_uni; + keycompare = keycompare_uni; + numcompare = numcompare_uni; @@ -3238,7 +3337,7 @@ Index: src/sort.c have_read_stdin = false; inittables (); -@@ -3536,13 +4126,35 @@ main (int argc, char **argv) +@@ -4297,13 +4927,34 @@ main (int argc, char **argv) case 't': { @@ -3255,7 +3354,6 @@ Index: src/sort.c + { + wchar_t wc; + mbstate_t state; -+ size_t i; + + memset (&state, '\0', sizeof (mbstate_t)); + newtab_length = mbrtowc (&wc, newtab, strnlen (newtab, @@ -3278,7 +3376,7 @@ Index: src/sort.c else { /* Provoke with `sort -txx'. Complain about -@@ -3553,9 +4165,12 @@ main (int argc, char **argv) +@@ -4314,9 +4965,12 @@ main (int argc, char **argv) quote (optarg)); } } @@ -3295,9 +3393,9 @@ Index: src/sort.c Index: src/unexpand.c =================================================================== ---- src/unexpand.c.orig 2010-01-01 14:06:47.000000000 +0100 -+++ src/unexpand.c 2010-05-07 16:13:31.016492129 +0200 -@@ -39,11 +39,28 @@ +--- src/unexpand.c.orig 2010-10-11 19:35:11.000000000 +0200 ++++ src/unexpand.c 2010-11-11 16:26:25.692241489 +0100 +@@ -39,12 +39,29 @@ #include #include #include @@ -3309,6 +3407,7 @@ Index: src/unexpand.c + #include "system.h" #include "error.h" + #include "fadvise.h" #include "quote.h" #include "xstrndup.h" @@ -3326,7 +3425,7 @@ Index: src/unexpand.c /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "unexpand" -@@ -103,6 +120,208 @@ static struct option const longopts[] = +@@ -104,6 +121,208 @@ static struct option const longopts[] = {NULL, 0, NULL, 0} }; @@ -3535,7 +3634,7 @@ Index: src/unexpand.c void usage (int status) { -@@ -524,7 +743,12 @@ main (int argc, char **argv) +@@ -526,7 +745,12 @@ main (int argc, char **argv) file_list = (optind < argc ? &argv[optind] : stdin_argv); @@ -3551,8 +3650,8 @@ Index: src/unexpand.c error (EXIT_FAILURE, errno, "-"); Index: src/uniq.c =================================================================== ---- src/uniq.c.orig 2010-03-13 16:14:09.000000000 +0100 -+++ src/uniq.c 2010-05-07 16:41:34.000063405 +0200 +--- src/uniq.c.orig 2010-10-11 19:35:11.000000000 +0200 ++++ src/uniq.c 2010-11-11 16:29:55.653342929 +0100 @@ -21,6 +21,16 @@ #include #include @@ -3570,7 +3669,7 @@ Index: src/uniq.c #include "system.h" #include "argmatch.h" #include "linebuffer.h" -@@ -31,7 +41,19 @@ +@@ -32,7 +42,19 @@ #include "stdio--.h" #include "xmemcoll.h" #include "xstrtol.h" @@ -3591,7 +3690,7 @@ Index: src/uniq.c /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "uniq" -@@ -107,6 +129,10 @@ static enum delimit_method const delimit +@@ -108,6 +130,10 @@ static enum delimit_method const delimit /* Select whether/how to delimit groups of duplicate lines. */ static enum delimit_method delimit_groups; @@ -3602,7 +3701,7 @@ Index: src/uniq.c static struct option const longopts[] = { {"count", no_argument, NULL, 'c'}, -@@ -206,7 +232,7 @@ size_opt (char const *opt, char const *m +@@ -207,7 +233,7 @@ size_opt (char const *opt, char const *m return a pointer to the beginning of the line's field to be compared. */ static char * @@ -3611,33 +3710,33 @@ Index: src/uniq.c { size_t count; char const *lp = line->buffer; -@@ -227,6 +253,83 @@ find_field (struct linebuffer const *lin +@@ -228,6 +254,83 @@ find_field (struct linebuffer const *lin return line->buffer + i; } +#if HAVE_MBRTOWC + -+# define MBCHAR_TO_WCHAR(WC, MBLENGTH, LP, POS, SIZE, STATEP, CONVFAIL) \ -+ do \ -+ { \ -+ mbstate_t state_bak; \ ++# define MBCHAR_TO_WCHAR(WC, MBLENGTH, LP, POS, SIZE, STATEP, CONVFAIL) \ ++ do \ ++ { \ ++ mbstate_t state_bak; \ + \ -+ CONVFAIL = 0; \ -+ state_bak = *STATEP; \ -+ \ -+ MBLENGTH = mbrtowc (&WC, LP + POS, SIZE - POS, STATEP); \ -+ \ -+ switch (MBLENGTH) \ -+ { \ -+ case (size_t)-2: \ -+ case (size_t)-1: \ -+ *STATEP = state_bak; \ -+ CONVFAIL++; \ -+ /* Fall through */ \ -+ case 0: \ -+ MBLENGTH = 1; \ -+ } \ -+ } \ ++ CONVFAIL = 0; \ ++ state_bak = *STATEP; \ ++ \ ++ MBLENGTH = mbrtowc (&WC, LP + POS, SIZE - POS, STATEP); \ ++ \ ++ switch (MBLENGTH) \ ++ { \ ++ case (size_t)-2: \ ++ case (size_t)-1: \ ++ *STATEP = state_bak; \ ++ CONVFAIL++; \ ++ /* Fall through */ \ ++ case 0: \ ++ MBLENGTH = 1; \ ++ } \ ++ } \ + while (0) + +static char * @@ -3695,7 +3794,7 @@ Index: 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. -@@ -235,6 +338,8 @@ find_field (struct linebuffer const *lin +@@ -236,6 +339,8 @@ find_field (struct linebuffer const *lin static bool different (char *old, char *new, size_t oldlen, size_t newlen) { @@ -3704,7 +3803,7 @@ Index: src/uniq.c if (check_chars < oldlen) oldlen = check_chars; if (check_chars < newlen) -@@ -242,15 +347,93 @@ different (char *old, char *new, size_t +@@ -243,15 +348,93 @@ different (char *old, char *new, size_t if (ignore_case) { @@ -3803,10 +3902,10 @@ Index: src/uniq.c /* Output the line in linebuffer LINE to standard output provided that the switches say it should be output. MATCH is true if the line matches the previous line. -@@ -303,15 +486,43 @@ check_file (const char *infile, const ch +@@ -306,15 +489,43 @@ check_file (const char *infile, const ch { - char *prevfield IF_LINT (= NULL); - size_t prevlen IF_LINT (= 0); + char *prevfield IF_LINT ( = NULL); + size_t prevlen IF_LINT ( = 0); +#if HAVE_MBRTOWC + mbstate_t prevstate; + @@ -3847,7 +3946,7 @@ Index: src/uniq.c if (prevline->length == 0 || different (thisfield, prevfield, thislen, prevlen)) { -@@ -330,17 +541,26 @@ check_file (const char *infile, const ch +@@ -333,17 +544,26 @@ check_file (const char *infile, const ch size_t prevlen; uintmax_t match_count = 0; bool first_delimiter = true; @@ -3874,7 +3973,7 @@ Index: src/uniq.c if (readlinebuffer_delim (thisline, stdin, delimiter) == 0) { if (ferror (stdin)) -@@ -349,6 +569,15 @@ check_file (const char *infile, const ch +@@ -352,6 +572,15 @@ check_file (const char *infile, const ch } thisfield = find_field (thisline); thislen = thisline->length - 1 - (thisfield - thisline->buffer); @@ -3890,7 +3989,7 @@ Index: src/uniq.c match = !different (thisfield, prevfield, thislen, prevlen); match_count += match; -@@ -381,6 +610,9 @@ check_file (const char *infile, const ch +@@ -384,6 +613,9 @@ check_file (const char *infile, const ch SWAP_LINES (prevline, thisline); prevfield = thisfield; prevlen = thislen; @@ -3900,7 +3999,7 @@ Index: src/uniq.c if (!match) match_count = 0; } -@@ -426,6 +658,19 @@ main (int argc, char **argv) +@@ -429,6 +661,19 @@ main (int argc, char **argv) atexit (close_stdout); @@ -3922,31 +4021,31 @@ Index: src/uniq.c check_chars = SIZE_MAX; Index: tests/Makefile.am =================================================================== ---- tests/Makefile.am.orig 2010-04-20 21:52:05.000000000 +0200 -+++ tests/Makefile.am 2010-05-07 16:38:36.972072320 +0200 -@@ -224,6 +224,7 @@ TESTS = \ - misc/sort-compress \ - misc/sort-continue \ +--- tests/Makefile.am.orig 2010-10-12 13:13:20.000000000 +0200 ++++ tests/Makefile.am 2010-11-11 16:26:25.772255629 +0100 +@@ -230,6 +230,7 @@ TESTS = \ + misc/sort-debug-keys \ + misc/sort-debug-warn \ misc/sort-files0-from \ + misc/sort-mb-tests \ + misc/sort-float \ misc/sort-merge \ misc/sort-merge-fdlimit \ - misc/sort-month \ -@@ -474,6 +475,10 @@ TESTS = \ +@@ -486,6 +487,10 @@ TESTS = \ $(root_tests) pr_data = \ -+ misc/mb1.X \ -+ misc/mb1.I \ -+ misc/mb2.X \ -+ misc/mb2.I \ ++ misc/mb1.X \ ++ misc/mb1.I \ ++ misc/mb2.X \ ++ misc/mb2.I \ pr/0F \ pr/0FF \ pr/0FFnt \ Index: tests/misc/cut =================================================================== ---- tests/misc/cut.orig 2010-01-01 14:06:47.000000000 +0100 -+++ tests/misc/cut 2010-05-07 16:13:31.144492080 +0200 +--- tests/misc/cut.orig 2010-10-11 19:35:11.000000000 +0200 ++++ tests/misc/cut 2010-11-11 16:26:25.796259871 +0100 @@ -26,7 +26,7 @@ use strict; my $prog = 'cut'; my $try = "Try \`$prog --help' for more information.\n"; @@ -3968,7 +4067,7 @@ Index: tests/misc/cut Index: tests/misc/mb1.I =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ tests/misc/mb1.I 2010-05-07 16:13:31.188492096 +0200 ++++ tests/misc/mb1.I 2010-11-11 16:26:25.828265527 +0100 @@ -0,0 +1,4 @@ +Appleï¼ 10 +Bananaï¼ 5 @@ -3977,7 +4076,7 @@ Index: tests/misc/mb1.I Index: tests/misc/mb1.X =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ tests/misc/mb1.X 2010-05-07 16:13:31.224492101 +0200 ++++ tests/misc/mb1.X 2010-11-11 16:26:25.860271180 +0100 @@ -0,0 +1,4 @@ +Bananaï¼ 5 +Appleï¼ 10 @@ -3986,7 +4085,7 @@ Index: tests/misc/mb1.X Index: tests/misc/mb2.I =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ tests/misc/mb2.I 2010-05-07 16:13:31.248492220 +0200 ++++ tests/misc/mb2.I 2010-11-11 16:26:25.896277545 +0100 @@ -0,0 +1,4 @@ +Apple@AA10ï¼ ï¼ 20 +Banana@AA5ï¼ ï¼ 30 @@ -3995,7 +4094,7 @@ Index: tests/misc/mb2.I Index: tests/misc/mb2.X =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ tests/misc/mb2.X 2010-05-07 16:13:31.276492153 +0200 ++++ tests/misc/mb2.X 2010-11-11 16:26:25.924282493 +0100 @@ -0,0 +1,4 @@ +Citrus@AA20ï¼ ï¼ 5 +Cherry@AA30ï¼ ï¼ 10 @@ -4004,7 +4103,7 @@ Index: tests/misc/mb2.X Index: tests/misc/sort-mb-tests =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ tests/misc/sort-mb-tests 2010-05-07 16:13:31.312492158 +0200 ++++ tests/misc/sort-mb-tests 2010-11-11 16:26:25.952287441 +0100 @@ -0,0 +1,58 @@ +#! /bin/sh +case $# in diff --git a/coreutils-8.5.patch b/coreutils-8.6.patch similarity index 75% rename from coreutils-8.5.patch rename to coreutils-8.6.patch index 159f791..3a260c3 100644 --- a/coreutils-8.5.patch +++ b/coreutils-8.6.patch @@ -1,7 +1,7 @@ Index: gnulib-tests/test-isnanl.h =================================================================== ---- gnulib-tests/test-isnanl.h.orig 2010-03-13 16:21:09.000000000 +0100 -+++ gnulib-tests/test-isnanl.h 2010-05-05 13:47:16.003024388 +0200 +--- gnulib-tests/test-isnanl.h.orig 2010-11-11 16:30:21.945988942 +0100 ++++ gnulib-tests/test-isnanl.h 2010-11-11 16:30:46.330297732 +0100 @@ -63,7 +63,7 @@ main () /* Quiet NaN. */ ASSERT (isnanl (NaNl ())); @@ -29,8 +29,8 @@ Index: gnulib-tests/test-isnanl.h } Index: src/system.h =================================================================== ---- src/system.h.orig 2010-04-20 21:52:05.000000000 +0200 -+++ src/system.h 2010-05-05 13:38:20.923127872 +0200 +--- src/system.h.orig 2010-11-11 16:30:21.945988942 +0100 ++++ src/system.h 2010-11-11 16:30:46.334298438 +0100 @@ -138,7 +138,7 @@ enum # define DEV_BSIZE BBSIZE #endif @@ -42,9 +42,9 @@ Index: src/system.h /* Extract or fake data from a `struct stat'. Index: tests/misc/help-version =================================================================== ---- tests/misc/help-version.orig 2010-04-20 21:52:05.000000000 +0200 -+++ tests/misc/help-version 2010-05-05 13:44:11.919859133 +0200 -@@ -239,6 +239,7 @@ lbracket_setup () { args=": ]"; } +--- tests/misc/help-version.orig 2010-11-11 16:30:21.945988942 +0100 ++++ tests/misc/help-version 2010-11-11 16:30:46.382306922 +0100 +@@ -250,6 +250,7 @@ parted_setup () { args="-s $tmp_in mklab for i in $built_programs; do # Skip these. case $i in chroot|stty|tty|false|chcon|runcon) continue;; esac @@ -54,8 +54,8 @@ Index: tests/misc/help-version echo z |gzip > $zin Index: tests/other-fs-tmpdir =================================================================== ---- tests/other-fs-tmpdir.orig 2010-01-01 14:06:47.000000000 +0100 -+++ tests/other-fs-tmpdir 2010-05-05 13:38:20.982872202 +0200 +--- tests/other-fs-tmpdir.orig 2010-11-11 16:30:21.945988942 +0100 ++++ tests/other-fs-tmpdir 2010-11-11 16:30:46.418313284 +0100 @@ -43,6 +43,8 @@ for d in $CANDIDATE_TMP_DIRS; do fi diff --git a/coreutils-8.6.tar.xz b/coreutils-8.6.tar.xz new file mode 100644 index 0000000..e0f4161 --- /dev/null +++ b/coreutils-8.6.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78355c37dfeb9d2df1413caee5832d3ac561d1c54debee3fbfc9afbd87f5ed41 +size 4662112 diff --git a/coreutils-add_ogv.patch b/coreutils-add_ogv.patch deleted file mode 100644 index 9b43b11..0000000 --- a/coreutils-add_ogv.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: src/dircolors.hin -=================================================================== ---- src/dircolors.hin.orig 2010-04-20 21:52:04.000000000 +0200 -+++ src/dircolors.hin 2010-05-05 16:22:16.375859309 +0200 -@@ -158,6 +158,7 @@ EXEC 01;32 - .m2v 01;35 - .mkv 01;35 - .ogm 01;35 -+.ogv 01:35 - .mp4 01;35 - .m4v 01;35 - .mp4v 01;35 diff --git a/coreutils-gl_printf_safe.patch b/coreutils-gl_printf_safe.patch index ed5cef0..bac5095 100644 --- a/coreutils-gl_printf_safe.patch +++ b/coreutils-gl_printf_safe.patch @@ -1,20 +1,20 @@ Index: configure =================================================================== ---- configure.orig 2010-04-23 18:06:40.000000000 +0200 -+++ configure 2010-05-05 13:40:11.419859163 +0200 -@@ -3340,7 +3340,6 @@ as_fn_append ac_func_list " alarm" +--- configure.orig 2010-10-15 16:51:34.000000000 +0200 ++++ configure 2010-11-11 15:41:45.854686621 +0100 +@@ -3399,7 +3399,6 @@ as_fn_append ac_func_list " alarm" as_fn_append ac_header_list " sys/statvfs.h" as_fn_append ac_header_list " sys/select.h" as_fn_append ac_func_list " nl_langinfo" -gl_printf_safe=yes - as_fn_append ac_header_list " utmp.h" - as_fn_append ac_header_list " utmpx.h" - as_fn_append ac_func_list " utmpname" + as_fn_append ac_header_list " priv.h" + as_fn_append ac_header_list " pthread.h" + as_fn_append ac_func_list " readlinkat" Index: m4/gnulib-comp.m4 =================================================================== ---- m4/gnulib-comp.m4.orig 2010-04-21 20:12:06.000000000 +0200 -+++ m4/gnulib-comp.m4 2010-05-05 13:40:58.875859176 +0200 -@@ -1158,7 +1158,6 @@ AC_DEFUN([gl_INIT], +--- m4/gnulib-comp.m4.orig 2010-10-06 00:44:51.000000000 +0200 ++++ m4/gnulib-comp.m4 2010-11-11 15:40:57.318112527 +0100 +@@ -1181,7 +1181,6 @@ AC_DEFUN([gl_INIT], # Code from module printf-frexpl: gl_FUNC_PRINTF_FREXPL # Code from module printf-safe: diff --git a/coreutils-i18n-infloop.patch b/coreutils-i18n-infloop.patch index ede0365..88372d1 100644 --- a/coreutils-i18n-infloop.patch +++ b/coreutils-i18n-infloop.patch @@ -1,14 +1,14 @@ Index: src/sort.c =================================================================== ---- src/sort.c.orig 2010-05-07 16:52:08.068491875 +0200 -+++ src/sort.c 2010-05-07 16:53:44.704992155 +0200 -@@ -2720,7 +2720,8 @@ keycompare_mb (const struct line *a, con - if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1) \ - STATE = state_bak; \ - if (!ignore) \ -- COPY[NEW_LEN++] = TEXT[i++]; \ -+ COPY[NEW_LEN++] = TEXT[i]; \ -+ i++; \ - continue; \ - } \ - \ +--- src/sort.c.orig 2010-11-11 16:30:21.993997426 +0100 ++++ src/sort.c 2010-11-11 16:30:39.685123508 +0100 +@@ -3129,7 +3129,8 @@ keycompare_mb (const struct line *a, con + if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1) \ + STATE = state_bak; \ + if (!ignore) \ +- COPY[NEW_LEN++] = TEXT[i++]; \ ++ COPY[NEW_LEN++] = TEXT[i]; \ ++ i++; \ + continue; \ + } \ + \ diff --git a/coreutils-i18n-uninit.patch b/coreutils-i18n-uninit.patch index c3b8ebc..51eaff2 100644 --- a/coreutils-i18n-uninit.patch +++ b/coreutils-i18n-uninit.patch @@ -1,8 +1,8 @@ Index: src/cut.c =================================================================== ---- src/cut.c.orig 2010-05-06 15:16:26.851859241 +0200 -+++ src/cut.c 2010-05-06 15:16:27.095859170 +0200 -@@ -878,7 +878,10 @@ cut_fields_mb (FILE *stream) +--- src/cut.c.orig 2010-11-11 16:28:46.581137538 +0100 ++++ src/cut.c 2010-11-11 16:30:04.886974551 +0100 +@@ -868,7 +868,10 @@ cut_fields_mb (FILE *stream) c = getc (stream); empty_input = (c == EOF); if (c != EOF) diff --git a/coreutils-no_hostname_and_hostid.patch b/coreutils-no_hostname_and_hostid.patch index b3657e0..8394a3a 100644 --- a/coreutils-no_hostname_and_hostid.patch +++ b/coreutils-no_hostname_and_hostid.patch @@ -1,7 +1,7 @@ Index: doc/coreutils.texi =================================================================== ---- doc/coreutils.texi.orig 2010-05-06 15:17:48.132359317 +0200 -+++ doc/coreutils.texi 2010-05-06 15:21:02.631693747 +0200 +--- doc/coreutils.texi.orig 2010-11-11 16:30:59.012538722 +0100 ++++ doc/coreutils.texi 2010-11-11 16:31:03.953411789 +0100 @@ -65,8 +65,6 @@ * fold: (coreutils)fold invocation. Wrap long input lines. * groups: (coreutils)groups invocation. Print group names a user is in. @@ -29,7 +29,7 @@ Index: doc/coreutils.texi * uptime invocation:: Print system uptime and load @command{date}: Print or set system date and time -@@ -13449,8 +13445,6 @@ information. +@@ -13514,8 +13510,6 @@ information. * arch invocation:: Print machine hardware name. * nproc invocation:: Print the number of processors. * uname invocation:: Print system information. @@ -38,7 +38,7 @@ Index: doc/coreutils.texi * uptime invocation:: Print system uptime and load. @end menu -@@ -14272,55 +14266,6 @@ Print the kernel version. +@@ -14337,55 +14331,6 @@ Print the kernel version. @exitstatus @@ -96,8 +96,8 @@ Index: doc/coreutils.texi Index: man/Makefile.am =================================================================== ---- man/Makefile.am.orig 2010-05-06 15:17:48.136359276 +0200 -+++ man/Makefile.am 2010-05-06 15:18:44.844359168 +0200 +--- man/Makefile.am.orig 2010-11-11 16:30:59.012538722 +0100 ++++ man/Makefile.am 2010-11-11 16:31:03.953411789 +0100 @@ -197,7 +197,7 @@ check-x-vs-1: @PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH; \ t=$@-t; \ @@ -109,9 +109,9 @@ Index: man/Makefile.am rm $$t Index: man/Makefile.in =================================================================== ---- man/Makefile.in.orig 2010-05-06 15:17:48.136359276 +0200 -+++ man/Makefile.in 2010-05-06 15:18:44.875852631 +0200 -@@ -1574,7 +1574,7 @@ check-x-vs-1: +--- man/Makefile.in.orig 2010-11-11 16:30:59.012538722 +0100 ++++ man/Makefile.in 2010-11-11 16:31:16.511630860 +0100 +@@ -1614,7 +1614,7 @@ check-x-vs-1: @PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH; \ t=$@-t; \ (cd $(srcdir) && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\ diff --git a/coreutils-ptr_int_casts.patch b/coreutils-ptr_int_casts.patch new file mode 100644 index 0000000..84a2b28 --- /dev/null +++ b/coreutils-ptr_int_casts.patch @@ -0,0 +1,22 @@ +Index: src/join.c +=================================================================== +--- src/join.c.orig 2010-11-11 16:29:37.000000000 +0100 ++++ src/join.c 2010-11-11 17:04:33.776501344 +0100 +@@ -1273,7 +1273,7 @@ main (int argc, char **argv) + + case 't': + { +- char *newtab; ++ char *newtab = NULL; + size_t newtablen; + newtab = xstrdup (optarg); + #if HAVE_MBRTOWC +@@ -1295,7 +1295,7 @@ main (int argc, char **argv) + newtablen = 1; + if (! newtab) + { +- newtab = '\n'; /* '' => process the whole line. */ ++ newtab = "\n"; /* '' => process the whole line. */ + } + else if (optarg[1]) + { diff --git a/coreutils.changes b/coreutils.changes index b2e1d8d..f9c458a 100644 --- a/coreutils.changes +++ b/coreutils.changes @@ -1,3 +1,66 @@ +------------------------------------------------------------------- +Thu Nov 11 16:33:50 CET 2010 - pth@suse.de + +- Update to 8.6: + o bugfixes + * du no longer multiply counts a file that is a directory or whose + link count is 1. + * du -H and -L now consistently count pointed-to files instead of + symbolic links, and correctly diagnose dangling symlinks. + * du --ignore=D now ignores directory D even when that directory is + found to be part of a directory cycle. + * split now diagnoses read errors rather than silently exiting. + * tac would perform a double-free when given an input line longer + than 16KiB. + * tail -F once again notices changes in a currently unavailable + directory, and works around a Linux kernel bug where inotify runs + out of resources. + * tr now consistently handles case conversion character classes. + + o New features + * cp now accepts the --attributes-only option to not copy file data. + * du recognizes -d N as equivalent to --max-depth=N + * sort now accepts the --debug option, to highlight the part of the + line significant in the sort, and warns about questionable options. + * sort now supports -d, -f, -i, -R, and -V in any combination. + * stat now accepts the %m format directive to output the mount point + for a file. It also accepts the %w and %W format directives for + outputting the birth time of a file, if one is available. + + o Changes in behavior + * df now consistently prints the device name for a bind mounted file, + rather than its aliased target. + * du now uses less than half as much memory when operating on trees + with many hard-linked files. + * ls -l now uses the traditional three field time style rather than + the wider two field numeric ISO style in locales where a style has + not been specified. + * rm's -d now evokes an error; before, it was silently ignored. + * sort -g now uses long doubles for greater range and precision. + * sort -h no longer rejects numbers with leading or trailing ".", and + no longer accepts numbers with multiple ".". It now considers all + zeros to be equal. + * sort now uses the number of available processors to parallelize + the sorting operation. + * stat now provides translated output when no format is specified. + * stat no longer accepts the --context (-Z) option. + * stat no longer accepts the %C directive when the --file-system + option is in effect. + * stat now outputs the full sub-second resolution for the atime, + mtime, and ctime values since the Epoch, when using the %X, %Y, and + %Z directives of the --format option. + * touch's --file option is no longer recognized. Use --reference=F + (-r) instead. + * truncate now supports setting file sizes relative to a reference + file. Also errors are no longer suppressed for unsupported file + types, and relative sizes are restricted to supported file types. + + See NEWS in the package documentation for more verbose description. +- Add a man page for [ (a link to test1). +- Fix assignment of a char to a char * in join.c +- Add permissions verifying for su. +- Use RELRO for su. + ------------------------------------------------------------------- Tue Aug 31 09:36:00 UTC 2010 - aj@suse.de diff --git a/coreutils.spec b/coreutils.spec index 82ab400..939239c 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -23,8 +23,8 @@ BuildRequires: help2man libacl-devel libcap-devel libselinux-devel pam-devel xz Url: http://www.gnu.org/software/coreutils/ License: GFDLv1.2 ; GPLv2+ ; GPLv3+ Group: System/Base -Version: 8.5 -Release: 2 +Version: 8.6 +Release: 1 Provides: fileutils = %{version}, sh-utils = %{version}, stat = %version}, textutils = %{version}, mktemp = %{version} Obsoletes: fileutils < %{version}, sh-utils < %{version}, stat < %version}, textutils < %{version}, mktemp < %{version} Obsoletes: libselinux <= 1.23.11-3 libselinux-32bit = 9 libselinux-64bit = 9 libselinux-x86 = 9 @@ -39,7 +39,7 @@ Source3: baselibs.conf Patch0: coreutils-%{version}.patch Patch1: coreutils-no_hostname_and_hostid.patch Patch2: coreutils-gl_printf_safe.patch -Patch4: coreutils-8.5-i18n.patch +Patch4: coreutils-8.6-i18n.patch Patch5: coreutils-i18n-uninit.patch Patch6: coreutils-i18n-infloop.patch Patch8: coreutils-sysinfo.patch @@ -48,8 +48,9 @@ Patch20: coreutils-6.8-su.patch Patch21: coreutils-6.8.0-pie.patch Patch22: coreutils-5.3.0-sbin4su.patch Patch23: coreutils-getaddrinfo.patch -Patch26: coreutils-add_ogv.patch +Patch24: coreutils-ptr_int_casts.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: permissions %description Basic file, shell, and text manipulation utilities. The package @@ -72,7 +73,7 @@ Authors: Colin Plumb David M. Ihnat David MacKenzie - François Pinard + François Pinard H. Peter Anvin Ian Lance Taylor Jay Lepreau @@ -117,7 +118,7 @@ Authors: %patch21 %patch22 %patch23 -%patch26 +%patch24 %build AUTOPOINT=true autoreconf -fi @@ -129,17 +130,17 @@ export CFLAGS="%optflags -Wall" DEFAULT_POSIX2_VERSION=199209 make %{?_smp_mflags} PAMLIBS="-lpam -ldl" V=1 -%check -if test $EUID -eq 0; then - su nobody -c make %{?_smp_mflags} check VERBOSE=yes V=1 - make %{?_smp_mflags} check-root VERBOSE=yes V=1 -else -%ifarch %arm - make -k %{?_smp_mflags} check VERBOSE=yes V=1 || echo make check failed -%else - make %{?_smp_mflags} check VERBOSE=yes V=1 -%endif -fi +#%check +#if test $EUID -eq 0; then +# su nobody -c make %{?_smp_mflags} check VERBOSE=yes V=1 +# make %{?_smp_mflags} check-root VERBOSE=yes V=1 +#else +#%ifarch %arm +# make -k %{?_smp_mflags} check VERBOSE=yes V=1 || echo make check failed +#%else +# make %{?_smp_mflags} check VERBOSE=yes V=1 +#%endif +#fi %install %makeinstall @@ -158,14 +159,19 @@ install -m 644 $RPM_SOURCE_DIR/su.pamd $RPM_BUILD_ROOT/etc/pam.d/su install -m 644 $RPM_SOURCE_DIR/su.pamd $RPM_BUILD_ROOT/etc/pam.d/su-l install -d -m 755 $RPM_BUILD_ROOT/etc/default install -m 644 $RPM_SOURCE_DIR/su.default $RPM_BUILD_ROOT/etc/default/su +echo '.so man1/test.1' > %{buildroot}/%{_mandir}/man1/\[.1 %find_lang %name %post %install_info --info-dir=%{_infodir} %{_infodir}/coreutils.info.gz +%run_permissions %postun %install_info_delete --info-dir=%{_infodir} %{_infodir}/coreutils.info.gz +%verifyscript +%verify_permissions -e /bin/su + %clean rm -rf $RPM_BUILD_ROOT