From 0ea2ae63571c7e912cba176b81ec250438388b14 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?=
Date: Mon, 20 Apr 2015 15:21:51 +0100
Subject: [PATCH 001/256] sync/adjust LS_COLORS
* coreutils-DIR_COLORS: sync with upstream
(remove old Xiph formats, add m4a audio format).
* coreutils-DIR_COLORS.256color: Likewise.
Also sync with 8 color mode above, by removing
the specific MULTIHARDLINK coloring, and
giving MISSING symlink targets a red background.
Also lighten the DIR and EXEC color a little
(as discussed in bug 1196642)
* coreutils-DIR_COLORS.lightbgcolor: Sync terminal
types with other 2 databases above.
---
coreutils-DIR_COLORS | 9 +++--
coreutils-DIR_COLORS.256color | 13 ++++---
coreutils-DIR_COLORS.lightbgcolor | 57 ++++++++++++++++++++++---------
coreutils.spec | 5 ++-
4 files changed, 55 insertions(+), 29 deletions(-)
diff --git a/coreutils-DIR_COLORS b/coreutils-DIR_COLORS
index 6abc937..10ebf7a 100644
--- a/coreutils-DIR_COLORS
+++ b/coreutils-DIR_COLORS
@@ -84,11 +84,11 @@ EIGHTBIT 1
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
#NORMAL 00 # no color code at all
#FILE 00 # normal file, use no color at all
-RESET 0 # reset to "normal" color
+RESET 0 # reset to "normal" color
DIR 01;34 # directory
LINK 01;36 # symbolic link (If you set this to 'target' instead of a
# numerical value, the color is as for the file pointed to.)
-MULTIHARDLINK 00 # regular file with more than one link
+MULTIHARDLINK 00 # regular file with more than one link
FIFO 40;33 # pipe
SOCK 01;35 # socket
DOOR 01;35 # door
@@ -209,8 +209,6 @@ EXEC 01;32
.emf 01;35
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
-.axv 01;35
-.anx 01;35
.ogv 01;35
.ogx 01;35
@@ -218,6 +216,7 @@ EXEC 01;32
.aac 01;36
.au 01;36
.flac 01;36
+.m4a 01;36
.mid 01;36
.midi 01;36
.mka 01;36
@@ -228,8 +227,8 @@ EXEC 01;32
.wav 01;36
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
-.axa 01;36
.oga 01;36
+.opus 01;36
.spx 01;36
.xspf 01;36
diff --git a/coreutils-DIR_COLORS.256color b/coreutils-DIR_COLORS.256color
index 4efaca1..5290aea 100644
--- a/coreutils-DIR_COLORS.256color
+++ b/coreutils-DIR_COLORS.256color
@@ -55,17 +55,17 @@ EIGHTBIT 1
#NORMAL 00 # global default, no color code at all
#FILE 00 # normal file, use no color at all
RESET 0 # reset to "normal" color
-DIR 38;5;27 # directory
+DIR 38;5;33 # directory
LINK 38;5;51 # symbolic link (If you set this to 'target' instead of a
# numerical value, the color is as for the file pointed to.)
-MULTIHARDLINK 44;38;5;15 # regular file with more than one link
+MULTIHARDLINK 00 # regular file with more than one link
FIFO 40;38;5;11 # pipe
SOCK 38;5;13 # socket
DOOR 38;5;5 # door
BLK 48;5;232;38;5;11 # block device driver
CHR 48;5;232;38;5;3 # character device driver
ORPHAN 48;5;232;38;5;9 # symlink to nonexistent file, or non-stat'able file
-MISSING 05;48;5;232;38;5;15 # ... and the files they point to
+MISSING 01;05;37;41 # ... and the files they point to
SETUID 48;5;196;38;5;15 # file that is setuid (u+s)
SETGID 48;5;11;38;5;16 # file that is setgid (g+s)
CAPABILITY 48;5;196;38;5;226 # file with capability
@@ -74,7 +74,7 @@ OTHER_WRITABLE 48;5;10;38;5;21 # dir that is other-writable (o+w) and not sticky
STICKY 48;5;21;38;5;15 # dir with the sticky bit set (+t) and not other-writable
# This is for files with execute permission:
-EXEC 38;5;34
+EXEC 38;5;40
# 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.
@@ -179,8 +179,6 @@ EXEC 38;5;34
.emf 38;5;13
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
-.axv 38;5;13
-.anx 38;5;13
.ogv 38;5;13
.ogx 38;5;13
@@ -188,6 +186,7 @@ EXEC 38;5;34
.aac 38;5;45
.au 38;5;45
.flac 38;5;45
+.m4a 38;5;45
.mid 38;5;45
.midi 38;5;45
.mka 38;5;45
@@ -198,8 +197,8 @@ EXEC 38;5;34
.wav 38;5;45
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
-.axa 38;5;45
.oga 38;5;45
+.opus 38;5;45
.spx 38;5;45
.xspf 38;5;45
diff --git a/coreutils-DIR_COLORS.lightbgcolor b/coreutils-DIR_COLORS.lightbgcolor
index 43820b2..bf3e5b3 100644
--- a/coreutils-DIR_COLORS.lightbgcolor
+++ b/coreutils-DIR_COLORS.lightbgcolor
@@ -1,4 +1,4 @@
-# Configuration file for the color ls utility - modified for gray backgrounds
+# Configuration file for the color ls utility - modified for lighter backgrounds
# Synchronized with coreutils 8.5 dircolors
# This file goes in the /etc directory, and must be world readable.
# You can copy this file to .dir_colors in your $HOME directory to override
@@ -16,8 +16,9 @@ COLOR tty
OPTIONS -F -T 0
# Below, there should be one TERM entry for each termtype that is colorizable
-TERM linux
-TERM console
+TERM Eterm
+TERM ansi
+TERM color-xterm
TERM con132x25
TERM con132x30
TERM con132x43
@@ -29,20 +30,46 @@ TERM con80x43
TERM con80x50
TERM con80x60
TERM cons25
-TERM xterm
-TERM xterm-16color
-TERM xterm-88color
-TERM xterm-256color
+TERM console
+TERM cygwin
+TERM dtterm
+TERM eterm-color
+TERM gnome
+TERM gnome-256color
+TERM jfbterm
+TERM konsole
+TERM kterm
+TERM linux
+TERM linux-c
+TERM mach-color
+TERM mlterm
+TERM putty
+TERM putty-256color
TERM rxvt
TERM rxvt-256color
+TERM rxvt-cygwin
+TERM rxvt-cygwin-native
TERM rxvt-unicode
TERM rxvt-unicode-256color
TERM rxvt-unicode256
-TERM xterm-color
-TERM color-xterm
+TERM screen
+TERM screen-256color
+TERM screen-256color-bce
+TERM screen-bce
+TERM screen-w
+TERM screen.Eterm
+TERM screen.rxvt
+TERM screen.linux
+TERM st
+TERM st-256color
+TERM terminator
TERM vt100
-TERM dtterm
-TERM color_xterm
+TERM xterm
+TERM xterm-16color
+TERM xterm-256color
+TERM xterm-88color
+TERM xterm-color
+TERM xterm-debian
# EIGHTBIT, followed by '1' for on, '0' for off. (8-bit output)
EIGHTBIT 1
@@ -57,7 +84,7 @@ EIGHTBIT 1
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
#NORMAL 00 # no color code at all
#FILE 00 # normal file, use no color at all
-RESET 0
+RESET 0 # reset to "normal" color
DIR 00;34 # directory
LINK 00;36 # symbolic link (If you set this to 'target' instead of a
# numerical value, the color is as for the file pointed to.)
@@ -76,7 +103,6 @@ STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
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:
EXEC 00;32
@@ -182,8 +208,6 @@ EXEC 00;32
.emf 00;35
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
-.axv 00;35
-.anx 00;35
.ogv 00;35
.ogx 00;35
@@ -191,6 +215,7 @@ EXEC 00;32
.aac 00;36
.au 00;36
.flac 00;36
+.m4a 00;36
.mid 00;36
.midi 00;36
.mka 00;36
@@ -201,8 +226,8 @@ EXEC 00;32
.wav 00;36
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
-.axa 00;36
.oga 00;36
+.opus 00;36
.spx 00;36
.xspf 00;36
diff --git a/coreutils.spec b/coreutils.spec
index 71c57ff..b482fa2 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.23
-Release: 8%{?dist}
+Release: 9%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -373,6 +373,9 @@ fi
%{_sbindir}/chroot
%changelog
+* Mon Apr 20 2015 Pádraig Brady - 8.23-9
+- Adjust LS_COLORS in 256 color mode; brighten some, remove hardlink colors (#1196642)
+
* Sun Mar 22 2015 Peter Robinson 8.23-8
- Drop large ancient docs
From 7adccbb0266c6642a5171a0df26f16ba378426c8 Mon Sep 17 00:00:00 2001
From: Ondrej Oprala
Date: Wed, 13 May 2015 10:53:55 +0200
Subject: [PATCH 002/256] sort - fix buffer overflow in some case conversions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- patch by Pádraig Brady
---
coreutils-i18n.patch | 40 +++++++++++++++++++++++++++++++++++++---
coreutils.spec | 6 +++++-
2 files changed, 42 insertions(+), 4 deletions(-)
diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch
index e7005cf..948b555 100644
--- a/coreutils-i18n.patch
+++ b/coreutils-i18n.patch
@@ -3245,8 +3245,8 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
+
+ if (ignore || translate)
+ {
-+ char *copy_a = (char *) xmalloc (lena + 1 + lenb + 1);
-+ char *copy_b = copy_a + lena + 1;
++ char *copy_a = (char *) xmalloc ((lena + lenb) * MB_CUR_MAX + 2);
++ char *copy_b = copy_a + lena * MB_CUR_MAX + 1;
+ size_t new_len_a, new_len_b;
+ size_t i, j;
+
@@ -3452,6 +3452,39 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
}
break;
+diff -urNp coreutils-8.23-orig/tests/i18n/sort.sh coreutils-8.23/tests/i18n/sort.sh
+--- coreutils-8.23-orig/tests/i18n/sort.sh 1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.23/tests/i18n/sort.sh 2014-07-22 13:45:52.733652016 +0200
+@@ -0,0 +1,29 @@
++#!/bin/sh
++# Verify sort's multi-byte support.
++
++. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
++print_ver_ sort
++
++export LC_ALL=en_US.UTF-8
++locale -k LC_CTYPE | grep -q "charmap.*UTF-8" \
++ || skip_ "No UTF-8 locale available"
++
++# Enable heap consistency checkng on older systems
++export MALLOC_CHECK_=2
++
++
++# check buffer overflow issue due to
++# expanding multi-byte representation due to case conversion
++# https://bugzilla.suse.com/show_bug.cgi?id=928749
++cat < exp
++.
++ɑ
++EOF
++cat < out || fail=1
++.
++ɑ
++EOF
++compare exp out || { fail=1; cat out; }
++
++
++Exit $fail
diff -urNp coreutils-8.23-orig/src/unexpand.c coreutils-8.23/src/unexpand.c
--- coreutils-8.23-orig/src/unexpand.c 2014-07-11 13:00:07.000000000 +0200
+++ coreutils-8.23/src/unexpand.c 2014-07-22 13:45:52.721651968 +0200
@@ -4099,11 +4132,12 @@ diff -urNp coreutils-8.23-orig/src/uniq.c coreutils-8.23/src/uniq.c
diff -urNp coreutils-8.23-orig/tests/local.mk coreutils-8.23/tests/local.mk
--- coreutils-8.23-orig/tests/local.mk 2014-07-22 13:45:10.494422571 +0200
+++ coreutils-8.23/tests/local.mk 2014-07-22 13:45:52.726651988 +0200
-@@ -331,6 +331,7 @@ all_tests = \
+@@ -331,6 +331,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-merge.pl \
tests/misc/sort-merge-fdlimit.sh \
tests/misc/sort-month.sh \
diff --git a/coreutils.spec b/coreutils.spec
index b482fa2..94cd5e3 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.23
-Release: 9%{?dist}
+Release: 10%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -373,6 +373,10 @@ fi
%{_sbindir}/chroot
%changelog
+* Wed May 13 2015 Ondrej Oprala - 8.23-9
- Adjust LS_COLORS in 256 color mode; brighten some, remove hardlink colors (#1196642)
From e2395bc17f364d881937f839d416ce6f56d6a0ae Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 14 May 2015 14:04:44 +0200
Subject: [PATCH 003/256] run 'make check' in parallel to speed up the build
---
coreutils.spec | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/coreutils.spec b/coreutils.spec
index 94cd5e3..f80345c 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.23
-Release: 10%{?dist}
+Release: 11%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -179,7 +179,7 @@ make all %{?_smp_mflags}
sed -i -e 's,/etc/utmp,/var/run/utmp,g;s,/etc/wtmp,/var/run/wtmp,g' doc/coreutils.texi
%check
-make check
+make check %{?_smp_mflags}
%install
make DESTDIR=$RPM_BUILD_ROOT install
@@ -373,7 +373,10 @@ fi
%{_sbindir}/chroot
%changelog
-* Wed May 13 2015 Ondrej Oprala - 8.23-11
+- run 'make check' in parallel to speed up the build
+
+* Wed May 13 2015 Ondrej Oprala - 8.23-10
- sort - fix buffer overflow in some case conversions
- patch by Pádraig Brady
From 58ee24949fc65914c86d7e3b17253481a9c7a998 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?=
Date: Thu, 4 Jun 2015 10:47:11 +0200
Subject: [PATCH 004/256] call utilities in colorls.* scripts with full path
(#1222140)
---
coreutils-colorls.csh | 18 +++++++++---------
coreutils-colorls.sh | 16 ++++++++--------
coreutils.spec | 5 ++++-
3 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/coreutils-colorls.csh b/coreutils-colorls.csh
index a146dd1..f631762 100755
--- a/coreutils-colorls.csh
+++ b/coreutils-colorls.csh
@@ -16,7 +16,7 @@ set COLORS=/etc/DIR_COLORS
if ($?TERM) then
if ( -e "/etc/DIR_COLORS.256color" ) then
- if ( "`tput colors`" == "256" ) then
+ if ( "`/usr/bin/tput colors`" == "256" ) then
set COLORS=/etc/DIR_COLORS.256color
endif
endif
@@ -30,29 +30,29 @@ if ($?TERM) then
if ( -f ~/.dircolors."$TERM" ) set COLORS=~/.dircolors."$TERM"
if ( -f ~/.dir_colors."$TERM" ) set COLORS=~/.dir_colors."$TERM"
endif
-set INCLUDE="`cat "$COLORS" | grep '^INCLUDE' | cut -d ' ' -f2-`"
+set INCLUDE="`/usr/bin/cat "$COLORS" | /usr/bin/grep '^INCLUDE' | /usr/bin/cut -d ' ' -f2-`"
if ( ! -e "$COLORS" ) exit
-set _tmp="`mktemp .colorlsXXX -q --tmpdir=/tmp`"
+set _tmp="`/usr/bin/mktemp .colorlsXXX -q --tmpdir=/tmp`"
#if mktemp fails, exit when include was active, otherwise use $COLORS file
if ( "$_tmp" == '' ) then
if ( "$INCLUDE" == '' ) then
- eval "`dircolors -c $COLORS`"
+ eval "`/usr/bin/dircolors -c $COLORS`"
endif
goto cleanup
endif
-if ( "$INCLUDE" != '' ) cat "$INCLUDE" >> $_tmp
-grep -v '^INCLUDE' "$COLORS" >> $_tmp
+if ( "$INCLUDE" != '' ) /usr/bin/cat "$INCLUDE" >> $_tmp
+/usr/bin/grep -v '^INCLUDE' "$COLORS" >> $_tmp
-eval "`dircolors -c $_tmp`"
+eval "`/usr/bin/dircolors -c $_tmp`"
-rm -f $_tmp
+/usr/bin/rm -f $_tmp
if ( "$LS_COLORS" == '' ) exit
cleanup:
-set color_none=`sed -n '/^COLOR.*none/Ip' < $COLORS`
+set color_none=`/usr/bin/sed -n '/^COLOR.*none/Ip' < $COLORS`
if ( "$color_none" != '' ) then
unset color_none
exit
diff --git a/coreutils-colorls.sh b/coreutils-colorls.sh
index f9484b3..c3f6a43 100755
--- a/coreutils-colorls.sh
+++ b/coreutils-colorls.sh
@@ -15,7 +15,7 @@ if [ -z "$USER_LS_COLORS" ]; then
for colors in "$HOME/.dir_colors.$TERM" "$HOME/.dircolors.$TERM" \
"$HOME/.dir_colors" "$HOME/.dircolors"; do
[ -e "$colors" ] && COLORS="$colors" && \
- INCLUDE="`cat "$COLORS" | grep '^INCLUDE' | cut -d ' ' -f2-`" && \
+ INCLUDE="`/usr/bin/cat "$COLORS" | /usr/bin/grep '^INCLUDE' | /usr/bin/cut -d ' ' -f2-`" && \
break
done
@@ -23,7 +23,7 @@ if [ -z "$USER_LS_COLORS" ]; then
COLORS="/etc/DIR_COLORS.$TERM"
[ -z "$COLORS" ] && [ -e "/etc/DIR_COLORS.256color" ] && \
- [ "x`tty -s && tput colors 2>/dev/null`" = "x256" ] && \
+ [ "x`/usr/bin/tty -s && /usr/bin/tput colors 2>/dev/null`" = "x256" ] && \
COLORS="/etc/DIR_COLORS.256color"
[ -z "$COLORS" ] && [ -e "/etc/DIR_COLORS" ] && \
@@ -34,16 +34,16 @@ if [ -z "$USER_LS_COLORS" ]; then
if [ -e "$INCLUDE" ];
then
- TMP="`mktemp .colorlsXXX -q --tmpdir=/tmp`"
+ TMP="`/usr/bin/mktemp .colorlsXXX -q --tmpdir=/tmp`"
[ -z "$TMP" ] && return
- cat "$INCLUDE" >> $TMP
- grep -v '^INCLUDE' "$COLORS" >> $TMP
+ /usr/bin/cat "$INCLUDE" >> $TMP
+ /usr/bin/grep -v '^INCLUDE' "$COLORS" >> $TMP
- eval "`dircolors --sh $TMP 2>/dev/null`"
- rm -f $TMP
+ eval "`/usr/bin/dircolors --sh $TMP 2>/dev/null`"
+ /usr/bin/rm -f $TMP
else
- eval "`dircolors --sh $COLORS 2>/dev/null`"
+ eval "`/usr/bin/dircolors --sh $COLORS 2>/dev/null`"
fi
[ -z "$LS_COLORS" ] && return
diff --git a/coreutils.spec b/coreutils.spec
index b11431a..524a952 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.23
-Release: 6%{?dist}
+Release: 7%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -373,6 +373,9 @@ fi
%{_sbindir}/chroot
%changelog
+* Thu Jun 04 2015 Ondrej Vasik - 8.23-7
+- call utilities in colorls.* scripts with full path (#1222140)
+
* Mon Dec 01 2014 Ondrej Vasik - 8.23-6
- have the LC_TIME subdirs with lang macro (#1169027)
From 1b318dd8057a523438ccbb6a29ff86426271e945 Mon Sep 17 00:00:00 2001
From: Jaromir Capik
Date: Thu, 11 Jun 2015 15:15:44 +0200
Subject: [PATCH 005/256] Adding STAGE1 bootstrap recipe
---
STAGE1-coreutils | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100644 STAGE1-coreutils
diff --git a/STAGE1-coreutils b/STAGE1-coreutils
new file mode 100644
index 0000000..bfe73b5
--- /dev/null
+++ b/STAGE1-coreutils
@@ -0,0 +1,7 @@
+srpm coreutils
+mcd $BUILDDIR/$1
+(cd $SRC/${1}-*/ ; autoreconf -vif)
+$SRC/${1}-*/configure $TCONFIGARGS --disable-pam
+notparallel
+make $J man1_MANS= V=1
+make $J man1_MANS= install DESTDIR=${ROOTFS}
From 42e4196fc06ab72807851e1ece9786c75dfbdcae Mon Sep 17 00:00:00 2001
From: Dennis Gilmore
Date: Wed, 17 Jun 2015 03:15:59 +0000
Subject: [PATCH 006/256] - Rebuilt for
https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
---
coreutils.spec | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/coreutils.spec b/coreutils.spec
index b3d573d..587648e 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.23
-Release: 12%{?dist}
+Release: 13%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -373,6 +373,9 @@ fi
%{_sbindir}/chroot
%changelog
+* Wed Jun 17 2015 Fedora Release Engineering - 8.23-13
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
+
* Thu Jun 04 2015 Ondrej Vasik - 8.23-12
- call utilities in colorls.* scripts with full path (#1222140)
From 1f9b908a99efdad7f2ef1933603cad5708174ebf Mon Sep 17 00:00:00 2001
From: Peter Robinson
Date: Sat, 4 Jul 2015 11:25:51 +0100
Subject: [PATCH 007/256] Disable failing test-update-copyright to fix FTBFS
---
coreutils-remove-test-update-copyright.patch | 50 ++++++++++++++++++++
coreutils.spec | 8 +++-
2 files changed, 57 insertions(+), 1 deletion(-)
create mode 100644 coreutils-remove-test-update-copyright.patch
diff --git a/coreutils-remove-test-update-copyright.patch b/coreutils-remove-test-update-copyright.patch
new file mode 100644
index 0000000..23ce342
--- /dev/null
+++ b/coreutils-remove-test-update-copyright.patch
@@ -0,0 +1,50 @@
+--- coreutils-8.23/gnulib-tests/gnulib.mk.orig 2015-07-04 11:11:09.438579284 +0100
++++ coreutils-8.23/gnulib-tests/gnulib.mk 2015-07-04 11:12:12.113643496 +0100
+@@ -2312,14 +2312,6 @@
+
+ ## end gnulib module unsetenv-tests
+
+-## begin gnulib module update-copyright-tests
+-
+-TESTS += test-update-copyright.sh
+-TESTS_ENVIRONMENT += abs_aux_dir='$(abs_aux_dir)'
+-EXTRA_DIST += test-update-copyright.sh
+-
+-## end gnulib module update-copyright-tests
+-
+ ## begin gnulib module userspec-tests
+
+ TESTS += test-userspec
+--- coreutils-8.23/gnulib-tests/Makefile.in.orig 2015-07-04 11:10:54.353323089 +0100
++++ coreutils-8.23/gnulib-tests/Makefile.in 2015-07-04 11:12:45.542210970 +0100
+@@ -220,7 +220,6 @@
+ test-u8-mbtoucr$(EXEEXT) test-u8-uctomb$(EXEEXT) \
+ test-uc_width$(EXEEXT) uniwidth/test-uc_width2.sh \
+ test-unlink$(EXEEXT) test-unlinkat$(EXEEXT) \
+- test-unsetenv$(EXEEXT) test-update-copyright.sh \
+ test-userspec$(EXEEXT) test-utimens$(EXEEXT) \
+ test-utimensat$(EXEEXT) test-vasnprintf$(EXEEXT) \
+ test-vasprintf-posix$(EXEEXT) test-vasprintf$(EXEEXT) \
+@@ -3766,7 +3765,7 @@
+ uniwidth/test-uc_width2.sh macros.h test-unlink.h \
+ test-unlink.c signature.h macros.h test-unlinkat.c \
+ test-rmdir.h test-unlink.h signature.h macros.h unlinkdir.h \
+- test-unsetenv.c signature.h macros.h test-update-copyright.sh \
++ test-unsetenv.c signature.h macros.h \
+ test-userspec.c nap.h test-futimens.h test-lutimens.h \
+ test-utimens.h test-utimens-common.h test-utimens.c macros.h \
+ nap.h test-lutimens.h test-utimens.h test-utimens-common.h \
+@@ -7787,13 +7786,6 @@
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+- "$$tst" $(AM_TESTS_FD_REDIRECT)
+-test-update-copyright.sh.log: test-update-copyright.sh
+- @p='test-update-copyright.sh'; \
+- b='test-update-copyright.sh'; \
+- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+- --log-file $$b.log --trs-file $$b.trs \
+- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+ test-userspec.log: test-userspec$(EXEEXT)
+ @p='test-userspec$(EXEEXT)'; \
diff --git a/coreutils.spec b/coreutils.spec
index 587648e..b6b6450 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.23
-Release: 13%{?dist}
+Release: 14%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -29,6 +29,8 @@ Patch103: coreutils-8.2-uname-processortype.patch
Patch104: coreutils-df-direct.patch
#add note about mkdir --mode behaviour into info documentation(#610559)
Patch107: coreutils-8.4-mkdir-modenote.patch
+# Don't run the currently failing test-update-copyright.sh test
+Patch108: coreutils-remove-test-update-copyright.patch
# sh-utils
#add info about TZ envvar to date manpage
@@ -132,6 +134,7 @@ the old GNU fileutils, sh-utils, and textutils packages.
%patch103 -p1 -b .sysinfo
%patch104 -p1 -b .dfdirect
%patch107 -p1 -b .mkdirmode
+%patch108 -p1 -b .crtest
# sh-utils
%patch703 -p1 -b .dateman
@@ -373,6 +376,9 @@ fi
%{_sbindir}/chroot
%changelog
+* Sat Jul 4 2015 Peter Robinson 8.23-14
+- Disable failing test-update-copyright to fix FTBFS
+
* Wed Jun 17 2015 Fedora Release Engineering - 8.23-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
From 3775f446fe0e41a1998e3b0931d4a8d53a15a602 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?=
Date: Sun, 5 Jul 2015 09:17:02 +0200
Subject: [PATCH 008/256] new upstream release 8.24
---
.gitignore | 2 +
coreutils-6.10-configuration.patch | 6 +-
coreutils-8.23-chroot-chdir.patch | 411 ---------------------------
coreutils-DIR_COLORS | 2 +
coreutils-DIR_COLORS.lightbgcolor | 2 +
coreutils-df-direct.patch | 8 +-
coreutils-i18n.patch | 441 ++++++++++++++---------------
coreutils.spec | 10 +-
sources | 4 +-
9 files changed, 235 insertions(+), 651 deletions(-)
delete mode 100644 coreutils-8.23-chroot-chdir.patch
diff --git a/.gitignore b/.gitignore
index cbcc306..8f473b3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,5 @@
/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
diff --git a/coreutils-6.10-configuration.patch b/coreutils-6.10-configuration.patch
index 4403811..4c68077 100644
--- a/coreutils-6.10-configuration.patch
+++ b/coreutils-6.10-configuration.patch
@@ -172,15 +172,15 @@ diff -urNp coreutils-8.23-orig/tests/df/skip-duplicates.sh coreutils-8.23/tests/
+++ 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"
+ 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)
- test -z "$CU_NONROOT_FS" && unique_entries=1 || unique_entries=2
-
+ 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
diff --git a/coreutils-8.23-chroot-chdir.patch b/coreutils-8.23-chroot-chdir.patch
deleted file mode 100644
index ce977bd..0000000
--- a/coreutils-8.23-chroot-chdir.patch
+++ /dev/null
@@ -1,411 +0,0 @@
-From 0cf7b1d928acaaddd4eaa28c6a22f7bd6457b379 Mon Sep 17 00:00:00 2001
-From: Bernhard Voelker
-Date: Fri, 01 Aug 2014 00:07:33 +0000
-Subject: chroot: perform chdir("/") again unless new --skip-chdir is specified
-
-Since commit v8.22-94-g99960ee, chroot(1) skips the chroot(2) syscall
-for "/" arguments (and synonyms). The problem is that it also skips
-the following chdir("/") call in that case. The latter breaks existing
-scripts which expect "/" to be the working directory inside the chroot.
-While the first part of the change - i.e., skipping chroot("/") - is
-okay for consistency with systems where it might succeed for a non-root
-user, the second part might be malicious, e.g.
-
- cd /home/user && chroot '/' bin/foo
-
-In the "best" case, chroot(1) could not execute 'bin/foo' with ENOENT,
-but in the worst case, chroot(1) would execute '/home/user/bin/foo' in
-the case that exists - instead of '/bin/foo'.
-
-Revert that second part of the patch, i.e., perform the chdir("/)
-in the common case again - unless the new --skip-chdir option is
-specified. Restrict this new option to the case of "/" arguments.
-
-* src/chroot.c (SKIP_CHDIR): Add enum.
-(long_opts): Add entry for the new --skip-chdir option.
-(usage): Add --skip-chdir option, and while at it, move the other
-to options into alphabetical order.
-(main): Accept the above new option, allowing it only in the case
-when NEWROOT is the old "/".
-Move down the chdir() call after the if-clause to ensure it is
-run in any case - unless --skip-chdir is specified.
-Add a 'newroot' variable for the new root directory as it is used
-in a couple of places now.
-* tests/misc/chroot-fail.sh: Invert the last tests which check the
-working directory of the execvp()ed program when a "/"-like
-argument was passed: now expect it to be "/" - unless --skip-chdir
-is given.
-* doc/coreutils.texi (chroot invocation): Document the new option.
-Document that chroot(1) usually calls chdir("/") unless the new
---skip-chdir option is specified. Sort options.
-* init.cfg (nonroot_has_perm_): Add chroot's new --skip-chdir option.
-* tests/cp/preserve-gid.sh (t1): Likewise.
-* tests/cp/special-bits.sh: Likewise.
-* tests/id/setgid.sh: Likewise.
-* tests/misc/truncate-owned-by-other.sh: Likewise.
-* tests/mv/sticky-to-xpart.sh: Likewise.
-* tests/rm/fail-2eperm.sh: Likewise.
-* tests/rm/no-give-up.sh: Likewise.
-* tests/touch/now-owned-by-other.sh: Likewise.
-
-Reported by Andreas Schwab in http://bugs.gnu.org/18062
----
-diff --git a/doc/coreutils.texi b/doc/coreutils.texi
-index 96f0781..7c86719 100644
---- a/doc/coreutils.texi
-+++ b/doc/coreutils.texi
-@@ -16113,7 +16113,10 @@ On many systems, only the super-user can do this.@footnote{However,
- some systems (e.g., FreeBSD) can be configured to allow certain regular
- users to use the @code{chroot} system call, and hence to run this program.
- Also, on Cygwin, anyone can run the @command{chroot} command, because the
--underlying function is non-privileged due to lack of support in MS-Windows.}
-+underlying function is non-privileged due to lack of support in MS-Windows.
-+Furthermore, the @command{chroot} command avoids the @code{chroot} system call
-+when @var{newroot} is identical to the old @file{/} directory for consistency
-+with systems where this is allowed for non-privileged users.}.
- Synopses:
-
- @example
-@@ -16123,10 +16126,11 @@ chroot @var{option}
-
- Ordinarily, file names are looked up starting at the root of the
- directory structure, i.e., @file{/}. @command{chroot} changes the root to
--the directory @var{newroot} (which must exist) and then runs
--@var{command} with optional @var{args}. If @var{command} is not
--specified, the default is the value of the @env{SHELL} environment
--variable or @command{/bin/sh} if not set, invoked with the @option{-i} option.
-+the directory @var{newroot} (which must exist), then changes the working
-+directory to @file{/}, and finally runs @var{command} with optional @var{args}.
-+If @var{command} is not specified, the default is the value of the @env{SHELL}
-+environment variable or @command{/bin/sh} if not set, invoked with the
-+@option{-i} option.
- @var{command} must not be a special built-in utility
- (@pxref{Special built-in utilities}).
-
-@@ -16135,6 +16139,14 @@ Options must precede operands.
-
- @table @samp
-
-+@item --groups=@var{groups}
-+@opindex --groups
-+Use this option to override the supplementary @var{groups} to be
-+used by the new process.
-+The items in the list (names or numeric IDs) must be separated by commas.
-+Use @samp{--groups=''} to disable the supplementary group look-up
-+implicit in the @option{--userspec} option.
-+
- @item --userspec=@var{user}[:@var{group}]
- @opindex --userspec
- By default, @var{command} is run with the same credentials
-@@ -16145,13 +16157,13 @@ If a @var{user} is specified then the supplementary groups
- are set according to the system defined list for that user,
- unless overridden with the @option{--groups} option.
-
--@item --groups=@var{groups}
--@opindex --groups
--Use this option to override the supplementary @var{groups} to be
--used by the new process.
--The items in the list (names or numeric IDs) must be separated by commas.
--Use @samp{--groups=''} to disable the supplementary group look-up
--implicit in the @option{--userspec} option.
-+@item --skip-chdir
-+@opindex --skip-chdir
-+Use this option to not change the working directory to @file{/} after changing
-+the root directory to @var{newroot}, i.e., inside the chroot.
-+This option is only permitted when @var{newroot} is the old @file{/} directory,
-+and therefore is mostly useful together with the @option{--groups} and
-+@option{--userspec} options to retain the previous working directory.
-
- @end table
-
-diff --git a/init.cfg b/init.cfg
-index 725ee12..032646b 100644
---- a/init.cfg
-+++ b/init.cfg
-@@ -400,7 +400,8 @@ nonroot_has_perm_()
- require_built_ chroot
-
- local rm_version=$(
-- chroot --user=$NON_ROOT_USERNAME / env PATH="$PATH" rm --version |
-+ chroot --skip-chdir --user=$NON_ROOT_USERNAME / env PATH="$PATH" \
-+ rm --version |
- sed -n '1s/.* //p'
- )
- case ":$rm_version:" in
-diff --git a/src/chroot.c b/src/chroot.c
-index 6c2d63f..418ea67 100644
---- a/src/chroot.c
-+++ b/src/chroot.c
-@@ -49,13 +49,15 @@ static inline bool gid_unset (gid_t gid) { return gid == (gid_t) -1; }
- enum
- {
- GROUPS = UCHAR_MAX + 1,
-- USERSPEC
-+ USERSPEC,
-+ SKIP_CHDIR
- };
-
- static struct option const long_opts[] =
- {
- {"groups", required_argument, NULL, GROUPS},
- {"userspec", required_argument, NULL, USERSPEC},
-+ {"skip-chdir", no_argument, NULL, SKIP_CHDIR},
- {GETOPT_HELP_OPTION_DECL},
- {GETOPT_VERSION_OPTION_DECL},
- {NULL, 0, NULL, 0}
-@@ -194,9 +196,14 @@ Run COMMAND with root directory set to NEWROOT.\n\
- "), stdout);
-
- fputs (_("\
-- --userspec=USER:GROUP specify user and group (ID or name) to use\n\
- --groups=G_LIST specify supplementary groups as g1,g2,..,gN\n\
- "), stdout);
-+ fputs (_("\
-+ --userspec=USER:GROUP specify user and group (ID or name) to use\n\
-+"), stdout);
-+ printf (_("\
-+ --skip-chdir do not change working directory to %s\n\
-+"), quote ("/"));
-
- fputs (HELP_OPTION_DESCRIPTION, stdout);
- fputs (VERSION_OPTION_DESCRIPTION, stdout);
-@@ -218,6 +225,7 @@ main (int argc, char **argv)
- char *userspec = NULL;
- char const *username = NULL;
- char const *groups = NULL;
-+ bool skip_chdir = false;
-
- /* Parsed user and group IDs. */
- uid_t uid = -1;
-@@ -254,6 +262,10 @@ main (int argc, char **argv)
- groups = optarg;
- break;
-
-+ case SKIP_CHDIR:
-+ skip_chdir = true;
-+ break;
-+
- case_GETOPT_HELP_CHAR;
-
- case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
-@@ -269,9 +281,19 @@ main (int argc, char **argv)
- usage (EXIT_CANCELED);
- }
-
-+ char const *newroot = argv[optind];
-+ bool is_oldroot = is_root (newroot);
-+
-+ if (! is_oldroot && skip_chdir)
-+ {
-+ error (0, 0, _("option --skip-chdir only permitted if NEWROOT is old %s"),
-+ quote ("/"));
-+ usage (EXIT_CANCELED);
-+ }
-+
- /* Only do chroot specific actions if actually changing root.
- The main difference here is that we don't change working dir. */
-- if (! is_root (argv[optind]))
-+ if (! is_oldroot)
- {
- /* We have to look up users and groups twice.
- - First, outside the chroot to load potentially necessary passwd/group
-@@ -307,14 +329,14 @@ main (int argc, char **argv)
- }
- #endif
-
-- if (chroot (argv[optind]) != 0)
-+ if (chroot (newroot) != 0)
- error (EXIT_CANCELED, errno, _("cannot change root directory to %s"),
-- argv[optind]);
--
-- if (chdir ("/"))
-- error (EXIT_CANCELED, errno, _("cannot chdir to root directory"));
-+ newroot);
- }
-
-+ if (! skip_chdir && chdir ("/"))
-+ error (EXIT_CANCELED, errno, _("cannot chdir to root directory"));
-+
- if (argc == optind + 1)
- {
- /* No command. Run an interactive shell. */
-diff --git a/tests/cp/preserve-gid.sh b/tests/cp/preserve-gid.sh
-index f141ac1..5499c2e 100755
---- a/tests/cp/preserve-gid.sh
-+++ b/tests/cp/preserve-gid.sh
-@@ -117,7 +117,8 @@ t1() {
- u=$1; shift
- g=$1; shift
- t0 "$f" "$u" "$g" \
-- chroot --user=+$nameless_uid:+$nameless_gid1 \
-+ chroot --skip-chdir \
-+ --user=+$nameless_uid:+$nameless_gid1 \
- --groups="+$nameless_gid1,+$nameless_gid2" \
- / env PATH="$tmp_path" "$@"
- }
-diff --git a/tests/cp/special-bits.sh b/tests/cp/special-bits.sh
-index a55eea2..1402819 100755
---- a/tests/cp/special-bits.sh
-+++ b/tests/cp/special-bits.sh
-@@ -42,7 +42,8 @@ set _ $(ls -l b); shift; p1=$1
- set _ $(ls -l b2); shift; p2=$1
- test $p1 = $p2 || fail=1
-
--chroot --user=$NON_ROOT_USERNAME / env PATH="$PATH" cp -p c c2 || fail=1
-+chroot --skip-chdir --user=$NON_ROOT_USERNAME / env PATH="$PATH" cp -p c c2 \
-+ || fail=1
- set _ $(ls -l c); shift; p1=$1
- set _ $(ls -l c2); shift; p2=$1
- test $p1 = $p2 && fail=1
-diff --git a/tests/id/setgid.sh b/tests/id/setgid.sh
-index 6d9d74f..019418a 100755
---- a/tests/id/setgid.sh
-+++ b/tests/id/setgid.sh
-@@ -27,14 +27,14 @@ echo $gp1 > exp || framework_failure_
-
- # With coreutils-8.16 and earlier, id -G would print both:
- # $gp1 $NON_ROOT_GID
--chroot --user=$NON_ROOT_USERNAME:+$gp1 --groups='' / env PATH="$PATH" \
-- id -G > out || fail=1
-+chroot --skip-chdir --user=$NON_ROOT_USERNAME:+$gp1 --groups='' / \
-+ env PATH="$PATH" id -G > out || fail=1
- compare exp out || fail=1
-
- # With coreutils-8.22 and earlier, id would erroneously print
- # groups=$NON_ROOT_GID
--chroot --user=$NON_ROOT_USERNAME:+$gp1 --groups='' / env PATH="$PATH" \
-- id > out || fail=1
-+chroot --skip-chdir --user=$NON_ROOT_USERNAME:+$gp1 --groups='' / \
-+ env PATH="$PATH" id > out || fail=1
- grep -F "groups=$gp1" out || { cat out; fail=1; }
-
- Exit $fail
-diff --git a/tests/misc/chroot-fail.sh b/tests/misc/chroot-fail.sh
-index a84826f..82ae23c 100755
---- a/tests/misc/chroot-fail.sh
-+++ b/tests/misc/chroot-fail.sh
-@@ -30,7 +30,7 @@ chroot --- / true # unknown option
- test $? = 125 || fail=1
-
- # Note chroot("/") succeeds for non-root users on some systems, but not all,
--# however we avoid the chroot() with "/" to have common behvavior.
-+# however we avoid the chroot() with "/" to have common behavior.
- chroot / sh -c 'exit 2' # exit status propagation
- test $? = 2 || fail=1
- chroot / . # invalid command
-@@ -38,10 +38,25 @@ test $? = 126 || fail=1
- chroot / no_such # no such command
- test $? = 127 || fail=1
-
--# Ensure we don't chdir("/") when not changing root
--# to allow only changing user ids for a command.
--for dir in '/' '/.' '/../'; do
-+# Ensure that --skip-chdir fails with a non-"/" argument.
-+cat <<\EOF > exp || framework_failure_
-+chroot: option --skip-chdir only permitted if NEWROOT is old '/'
-+Try 'chroot --help' for more information.
-+EOF
-+chroot --skip-chdir . env pwd >out 2>err && fail=1
-+compare /dev/null out || fail=1
-+compare exp err || fail=1
-+
-+# Ensure we don't chroot("/") when NEWROOT is old "/".
-+ln -s / isroot || framework_failure_
-+for dir in '/' '/.' '/../' isroot; do
-+ # Verify that chroot(1) succeeds and performs chdir("/")
-+ # (chroot(1) of coreutils-8.23 failed to run the latter).
- curdir=$(chroot "$dir" env pwd) || fail=1
-+ test "$curdir" = '/' || fail=1
-+
-+ # Test the "--skip-chdir" option.
-+ curdir=$(chroot --skip-chdir "$dir" env pwd) || fail=1
- test "$curdir" = '/' && fail=1
- done
-
-diff --git a/tests/misc/truncate-owned-by-other.sh b/tests/misc/truncate-owned-by-other.sh
-index e70badb..f65439e 100755
---- a/tests/misc/truncate-owned-by-other.sh
-+++ b/tests/misc/truncate-owned-by-other.sh
-@@ -29,7 +29,7 @@ chmod g+w root-owned
- # Ensure that the current directory is searchable by $NON_ROOT_USERNAME.
- chmod g+x .
-
--chroot --user=$NON_ROOT_USERNAME / env PATH="$PATH" \
-+chroot --skip-chdir --user=$NON_ROOT_USERNAME / env PATH="$PATH" \
- truncate -s0 root-owned || fail=1
-
- Exit $fail
-diff --git a/tests/mv/sticky-to-xpart.sh b/tests/mv/sticky-to-xpart.sh
-index e0c99e9..6c1f6e8 100755
---- a/tests/mv/sticky-to-xpart.sh
-+++ b/tests/mv/sticky-to-xpart.sh
-@@ -42,7 +42,8 @@ chmod go+x . || framework_failure_
-
- # Ensure that $NON_ROOT_USERNAME can access the required version of mv.
- version=$(
-- chroot --user=$NON_ROOT_USERNAME / env PATH="$PATH" mv --version |
-+ chroot --skip-chdir --user=$NON_ROOT_USERNAME / env PATH="$PATH" \
-+ mv --version |
- sed -n '1s/.* //p'
- )
- case $version in
-@@ -50,7 +51,7 @@ case $version in
- *) skip_ "cannot access just-built mv as user $NON_ROOT_USERNAME";;
- esac
-
--chroot --user=$NON_ROOT_USERNAME / env PATH="$PATH" \
-+chroot --skip-chdir --user=$NON_ROOT_USERNAME / env PATH="$PATH" \
- mv t/root-owned "$other_partition_tmpdir" 2> out-t && fail=1
-
- # On some systems, we get 'Not owner'. Convert it.
-diff --git a/tests/rm/fail-2eperm.sh b/tests/rm/fail-2eperm.sh
-index 6e8ce9b..c324037 100755
---- a/tests/rm/fail-2eperm.sh
-+++ b/tests/rm/fail-2eperm.sh
-@@ -32,14 +32,16 @@ touch a/b || framework_failure_
- # Try to ensure that $NON_ROOT_USERNAME can access
- # the required version of rm.
- rm_version=$(
-- chroot --user=$NON_ROOT_USERNAME / env PATH="$PATH" rm --version |
-+ chroot --skip-chdir --user=$NON_ROOT_USERNAME / env PATH="$PATH" \
-+ rm --version |
- sed -n '1s/.* //p'
- )
- case $rm_version in
- $PACKAGE_VERSION) ;;
- *) skip_ "cannot access just-built rm as user $NON_ROOT_USERNAME";;
- esac
--chroot --user=$NON_ROOT_USERNAME / env PATH="$PATH" rm -rf a 2> out-t && fail=1
-+chroot --skip-chdir --user=$NON_ROOT_USERNAME / \
-+ env PATH="$PATH" rm -rf a 2> out-t && fail=1
-
- # On some systems, we get 'Not owner'. Convert it.
- # On other systems (HPUX), we get 'Permission denied'. Convert it, too.
-diff --git a/tests/rm/no-give-up.sh b/tests/rm/no-give-up.sh
-index 41070c9..958f9e8 100755
---- a/tests/rm/no-give-up.sh
-+++ b/tests/rm/no-give-up.sh
-@@ -30,7 +30,7 @@ chmod go=x . || framework_failure_
-
-
- # This must fail, since '.' is not writable by $NON_ROOT_USERNAME.
--chroot --user=$NON_ROOT_USERNAME / env PATH="$PATH" \
-+chroot --skip-chdir --user=$NON_ROOT_USERNAME / env PATH="$PATH" \
- rm -rf d 2>/dev/null && fail=1
-
- # d must remain.
-diff --git a/tests/touch/now-owned-by-other.sh b/tests/touch/now-owned-by-other.sh
-index d01097e..018ef11 100755
---- a/tests/touch/now-owned-by-other.sh
-+++ b/tests/touch/now-owned-by-other.sh
-@@ -28,7 +28,7 @@ chmod g+w root-owned
- # Ensure that the current directory is searchable by $NON_ROOT_USERNAME.
- chmod g+x .
-
--chroot --user=$NON_ROOT_USERNAME / env PATH="$PATH" \
-+chroot --skip-chdir --user=$NON_ROOT_USERNAME / env PATH="$PATH" \
- touch -d now root-owned || fail=1
-
- Exit $fail
---
-cgit v0.9.0.2
diff --git a/coreutils-DIR_COLORS b/coreutils-DIR_COLORS
index 10ebf7a..ecffc65 100644
--- a/coreutils-DIR_COLORS
+++ b/coreutils-DIR_COLORS
@@ -36,12 +36,14 @@ 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
diff --git a/coreutils-DIR_COLORS.lightbgcolor b/coreutils-DIR_COLORS.lightbgcolor
index bf3e5b3..450deb0 100644
--- a/coreutils-DIR_COLORS.lightbgcolor
+++ b/coreutils-DIR_COLORS.lightbgcolor
@@ -36,12 +36,14 @@ 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
diff --git a/coreutils-df-direct.patch b/coreutils-df-direct.patch
index a3df5e9..361b813 100644
--- a/coreutils-df-direct.patch
+++ b/coreutils-df-direct.patch
@@ -1,9 +1,9 @@
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
-@@ -10961,6 +10961,13 @@ pseudo-file-systems, such as automounter
- Scale sizes by @var{size} before printing them (@pxref{Block size}).
- For example, @option{-BG} prints sizes in units of 1,073,741,824 bytes.
+@@ -10961,6 +10961,13 @@
+ but in general this option makes @command{df} much slower, especially when
+ there are many or very busy file systems.
+@item --direct
+@opindex --direct
@@ -82,9 +82,9 @@ diff -urNp coreutils-8.21-orig/src/df.c coreutils-8.21/src/df.c
'-BM' prints sizes in units of 1,048,576 bytes;\n\
see SIZE format below\n\
+ --direct show statistics for a file instead of mount point\n\
- --total produce a grand total\n\
-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);
@@ -1305,6 +1325,9 @@ main (int argc, char **argv)
xstrtol_fatal (e, oi, c, long_options, optarg);
}
diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch
index 948b555..d1d18a8 100644
--- a/coreutils-i18n.patch
+++ b/coreutils-i18n.patch
@@ -1,6 +1,6 @@
-diff -urNp coreutils-8.23-orig/lib/linebuffer.h coreutils-8.23/lib/linebuffer.h
---- coreutils-8.23-orig/lib/linebuffer.h 2014-05-29 14:05:50.000000000 +0200
-+++ coreutils-8.23/lib/linebuffer.h 2014-07-22 13:45:52.700651881 +0200
+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
@@ -21,6 +21,11 @@
# include
@@ -23,9 +23,9 @@ diff -urNp coreutils-8.23-orig/lib/linebuffer.h coreutils-8.23/lib/linebuffer.h
};
/* Initialize linebuffer LINEBUFFER for use. */
-diff -urNp coreutils-8.23-orig/src/cut.c coreutils-8.23/src/cut.c
---- coreutils-8.23-orig/src/cut.c 2014-07-11 13:00:07.000000000 +0200
-+++ coreutils-8.23/src/cut.c 2014-07-22 13:48:06.225671732 +0200
+diff -urNp coreutils-8.24-orig/src/cut.c coreutils-8.24/src/cut.c
+--- coreutils-8.24-orig/src/cut.c 2015-06-26 19:05:22.000000000 +0200
++++ coreutils-8.24/src/cut.c 2015-07-05 09:04:33.028546950 +0200
@@ -28,6 +28,11 @@
#include
#include
@@ -156,7 +156,7 @@ diff -urNp coreutils-8.23-orig/src/cut.c coreutils-8.23/src/cut.c
/* True if the --output-delimiter=STRING option was specified. */
static bool output_delimiter_specified;
-@@ -188,7 +266,7 @@ Print selected parts of lines from each
+@@ -189,7 +267,7 @@ Print selected parts of lines from each
-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\
@@ -165,7 +165,7 @@ diff -urNp coreutils-8.23-orig/src/cut.c coreutils-8.23/src/cut.c
"), stdout);
fputs (_("\
--complement complement the set of selected bytes, characters\n\
-@@ -381,6 +459,9 @@ set_fields (const char *fieldstr)
+@@ -380,6 +458,9 @@ set_fields (const char *fieldstr)
if (operating_mode == byte_mode)
error (0, 0,
_("byte offset %s is too large"), quote (bad_num));
@@ -175,7 +175,7 @@ diff -urNp coreutils-8.23-orig/src/cut.c coreutils-8.23/src/cut.c
else
error (0, 0,
_("field number %s is too large"), quote (bad_num));
-@@ -505,6 +586,82 @@ cut_bytes (FILE *stream)
+@@ -504,6 +585,82 @@ cut_bytes (FILE *stream)
}
}
@@ -258,7 +258,7 @@ diff -urNp coreutils-8.23-orig/src/cut.c coreutils-8.23/src/cut.c
/* Read from stream STREAM, printing to standard output any selected fields. */
static void
-@@ -649,13 +806,211 @@ cut_fields (FILE *stream)
+@@ -648,13 +805,211 @@ cut_fields (FILE *stream)
}
}
@@ -473,7 +473,7 @@ diff -urNp coreutils-8.23-orig/src/cut.c coreutils-8.23/src/cut.c
}
/* Process file FILE to standard output.
-@@ -707,6 +1062,7 @@ main (int argc, char **argv)
+@@ -706,6 +1061,7 @@ main (int argc, char **argv)
bool ok;
bool delim_specified = false;
char *spec_list_string IF_LINT ( = NULL);
@@ -481,7 +481,7 @@ diff -urNp coreutils-8.23-orig/src/cut.c coreutils-8.23/src/cut.c
initialize_main (&argc, &argv);
set_program_name (argv[0]);
-@@ -729,7 +1085,6 @@ main (int argc, char **argv)
+@@ -728,7 +1084,6 @@ main (int argc, char **argv)
switch (optc)
{
case 'b':
@@ -489,7 +489,7 @@ diff -urNp coreutils-8.23-orig/src/cut.c coreutils-8.23/src/cut.c
/* Build the byte list. */
if (operating_mode != undefined_mode)
FATAL_ERROR (_("only one type of list may be specified"));
-@@ -737,6 +1092,14 @@ main (int argc, char **argv)
+@@ -736,6 +1091,14 @@ main (int argc, char **argv)
spec_list_string = optarg;
break;
@@ -504,7 +504,7 @@ diff -urNp coreutils-8.23-orig/src/cut.c coreutils-8.23/src/cut.c
case 'f':
/* Build the field list. */
if (operating_mode != undefined_mode)
-@@ -748,10 +1111,38 @@ main (int argc, char **argv)
+@@ -747,10 +1110,38 @@ main (int argc, char **argv)
case 'd':
/* New delimiter. */
/* Interpret -d '' to mean 'use the NUL byte as the delimiter.' */
@@ -547,7 +547,7 @@ diff -urNp coreutils-8.23-orig/src/cut.c coreutils-8.23/src/cut.c
break;
case OUTPUT_DELIMITER_OPTION:
-@@ -764,6 +1155,7 @@ main (int argc, char **argv)
+@@ -763,6 +1154,7 @@ main (int argc, char **argv)
break;
case 'n':
@@ -555,7 +555,7 @@ diff -urNp coreutils-8.23-orig/src/cut.c coreutils-8.23/src/cut.c
break;
case 's':
-@@ -803,15 +1195,34 @@ main (int argc, char **argv)
+@@ -802,15 +1194,34 @@ main (int argc, char **argv)
}
if (!delim_specified)
@@ -596,9 +596,9 @@ diff -urNp coreutils-8.23-orig/src/cut.c coreutils-8.23/src/cut.c
}
if (optind == argc)
-diff -urNp coreutils-8.23-orig/src/expand.c coreutils-8.23/src/expand.c
---- coreutils-8.23-orig/src/expand.c 2014-07-11 13:00:07.000000000 +0200
-+++ coreutils-8.23/src/expand.c 2014-07-22 13:45:52.704651900 +0200
+diff -urNp coreutils-8.24-orig/src/expand.c coreutils-8.24/src/expand.c
+--- coreutils-8.24-orig/src/expand.c 2015-06-26 19:05:22.000000000 +0200
++++ coreutils-8.24/src/expand.c 2015-07-05 09:04:33.028546950 +0200
@@ -37,12 +37,34 @@
#include
#include
@@ -791,10 +791,10 @@ diff -urNp coreutils-8.23-orig/src/expand.c coreutils-8.23/src/expand.c
if (have_read_stdin && fclose (stdin) != 0)
error (EXIT_FAILURE, errno, "-");
-diff -urNp coreutils-8.23-orig/src/fold.c coreutils-8.23/src/fold.c
---- coreutils-8.23-orig/src/fold.c 2014-07-11 13:00:07.000000000 +0200
-+++ coreutils-8.23/src/fold.c 2014-07-22 13:45:52.705651904 +0200
-@@ -22,12 +22,34 @@
+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 @@
#include
#include
@@ -811,8 +811,7 @@ diff -urNp coreutils-8.23-orig/src/fold.c coreutils-8.23/src/fold.c
#include "system.h"
#include "error.h"
#include "fadvise.h"
- #include "quote.h"
- #include "xstrtol.h"
+ #include "xdectoint.h"
+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
+ installation; work around this configuration error. */
@@ -829,7 +828,7 @@ diff -urNp coreutils-8.23-orig/src/fold.c coreutils-8.23/src/fold.c
#define TAB_WIDTH 8
/* The official name of this program (e.g., no 'g' prefix). */
-@@ -35,20 +57,41 @@
+@@ -34,20 +56,41 @@
#define AUTHORS proper_name ("David MacKenzie")
@@ -875,7 +874,7 @@ diff -urNp coreutils-8.23-orig/src/fold.c coreutils-8.23/src/fold.c
{"spaces", no_argument, NULL, 's'},
{"width", required_argument, NULL, 'w'},
{GETOPT_HELP_OPTION_DECL},
-@@ -76,6 +119,7 @@ standard output.\n\
+@@ -75,6 +118,7 @@ Wrap input lines in each FILE, writing t
fputs (_("\
-b, --bytes count bytes rather than columns\n\
@@ -883,7 +882,7 @@ diff -urNp coreutils-8.23-orig/src/fold.c coreutils-8.23/src/fold.c
-s, --spaces break at spaces\n\
-w, --width=WIDTH use WIDTH columns instead of 80\n\
"), stdout);
-@@ -93,7 +137,7 @@ standard output.\n\
+@@ -92,7 +136,7 @@ Wrap input lines in each FILE, writing t
static size_t
adjust_column (size_t column, char c)
{
@@ -892,7 +891,7 @@ diff -urNp coreutils-8.23-orig/src/fold.c coreutils-8.23/src/fold.c
{
if (c == '\b')
{
-@@ -116,30 +160,14 @@ adjust_column (size_t column, char c)
+@@ -115,30 +159,14 @@ adjust_column (size_t column, char c)
to stdout, with maximum line length WIDTH.
Return true if successful. */
@@ -925,7 +924,7 @@ diff -urNp coreutils-8.23-orig/src/fold.c coreutils-8.23/src/fold.c
fadvise (istream, FADVISE_SEQUENTIAL);
-@@ -169,6 +197,15 @@ fold_file (char const *filename, size_t
+@@ -168,6 +196,15 @@ fold_file (char const *filename, size_t
bool found_blank = false;
size_t logical_end = offset_out;
@@ -941,16 +940,16 @@ diff -urNp coreutils-8.23-orig/src/fold.c coreutils-8.23/src/fold.c
/* Look for the last blank. */
while (logical_end)
{
-@@ -215,11 +252,221 @@ fold_file (char const *filename, size_t
+@@ -214,11 +251,221 @@ fold_file (char const *filename, size_t
line_out[offset_out++] = c;
}
- saved_errno = errno;
+ *saved_errno = errno;
-
- if (offset_out)
- fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
-
++
++ if (offset_out)
++ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
++
+}
+
+#if HAVE_MBRTOWC
@@ -1122,10 +1121,10 @@ diff -urNp coreutils-8.23-orig/src/fold.c coreutils-8.23/src/fold.c
+ }
+
+ *saved_errno = errno;
-+
-+ if (offset_out)
-+ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
-+
+
+ if (offset_out)
+ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
+
+}
+#endif
+
@@ -1164,7 +1163,7 @@ diff -urNp coreutils-8.23-orig/src/fold.c coreutils-8.23/src/fold.c
if (ferror (istream))
{
error (0, saved_errno, "%s", filename);
-@@ -252,7 +499,8 @@ main (int argc, char **argv)
+@@ -251,7 +498,8 @@ main (int argc, char **argv)
atexit (close_stdout);
@@ -1174,7 +1173,7 @@ diff -urNp coreutils-8.23-orig/src/fold.c coreutils-8.23/src/fold.c
while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
{
-@@ -261,7 +509,15 @@ main (int argc, char **argv)
+@@ -260,7 +508,15 @@ main (int argc, char **argv)
switch (optc)
{
case 'b': /* Count bytes rather than columns. */
@@ -1191,9 +1190,9 @@ diff -urNp coreutils-8.23-orig/src/fold.c coreutils-8.23/src/fold.c
break;
case 's': /* Break at word boundaries. */
-diff -urNp coreutils-8.23-orig/src/join.c coreutils-8.23/src/join.c
---- coreutils-8.23-orig/src/join.c 2014-07-11 13:00:07.000000000 +0200
-+++ coreutils-8.23/src/join.c 2014-07-22 13:45:52.707651912 +0200
+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 @@
#include
#include
@@ -1245,7 +1244,7 @@ diff -urNp coreutils-8.23-orig/src/join.c coreutils-8.23/src/join.c
/* If nonzero, check that the input is correctly ordered. */
static enum
-@@ -269,13 +285,14 @@ xfields (struct line *line)
+@@ -275,13 +291,14 @@ xfields (struct line *line)
if (ptr == lim)
return;
@@ -1263,7 +1262,7 @@ diff -urNp coreutils-8.23-orig/src/join.c coreutils-8.23/src/join.c
{
/* Skip leading blanks before the first field. */
while (isblank (to_uchar (*ptr)))
-@@ -299,6 +316,147 @@ xfields (struct line *line)
+@@ -305,6 +322,147 @@ xfields (struct line *line)
extract_field (line, ptr, lim - ptr);
}
@@ -1411,7 +1410,7 @@ diff -urNp coreutils-8.23-orig/src/join.c coreutils-8.23/src/join.c
static void
freeline (struct line *line)
{
-@@ -320,56 +478,133 @@ keycmp (struct line const *line1, struct
+@@ -326,56 +484,133 @@ keycmp (struct line const *line1, struct
size_t jf_1, size_t jf_2)
{
/* Start of field to compare in each file. */
@@ -1542,8 +1541,8 @@ diff -urNp coreutils-8.23-orig/src/join.c coreutils-8.23/src/join.c
- diff = memcmp (beg1, beg2, MIN (len1, len2));
+ copy[0] = beg[0];
+ copy[1] = beg[1];
- }
-
++ }
++
+ if (hard_LC_COLLATE)
+ {
+ diff = xmemcoll ((char *) copy[0], len[0], (char *) copy[1], len[1]);
@@ -1553,14 +1552,14 @@ diff -urNp coreutils-8.23-orig/src/join.c coreutils-8.23/src/join.c
+ free (copy[i]);
+
+ return diff;
-+ }
+ }
+ diff = memcmp (copy[0], copy[1], MIN (len[0], len[1]));
+
+ if (mallocd)
+ for (i = 0; i < 2; i++)
+ free (copy[i]);
+
-+
+
if (diff)
return diff;
- return len1 < len2 ? -1 : len1 != len2;
@@ -1568,7 +1567,7 @@ diff -urNp coreutils-8.23-orig/src/join.c coreutils-8.23/src/join.c
}
/* Check that successive input lines PREV and CURRENT from input file
-@@ -461,6 +696,11 @@ get_line (FILE *fp, struct line **linep,
+@@ -467,6 +702,11 @@ get_line (FILE *fp, struct line **linep,
}
++line_no[which - 1];
@@ -1580,7 +1579,7 @@ diff -urNp coreutils-8.23-orig/src/join.c coreutils-8.23/src/join.c
xfields (line);
if (prevline[which - 1])
-@@ -560,21 +800,28 @@ prfield (size_t n, struct line const *li
+@@ -566,21 +806,28 @@ prfield (size_t n, struct line const *li
/* Output all the fields in line, other than the join field. */
@@ -1612,7 +1611,7 @@ diff -urNp coreutils-8.23-orig/src/join.c coreutils-8.23/src/join.c
prfield (i, line);
}
}
-@@ -585,7 +832,6 @@ static void
+@@ -591,7 +838,6 @@ static void
prjoin (struct line const *line1, struct line const *line2)
{
const struct outlist *outlist;
@@ -1620,7 +1619,7 @@ diff -urNp coreutils-8.23-orig/src/join.c coreutils-8.23/src/join.c
size_t field;
struct line const *line;
-@@ -619,7 +865,7 @@ prjoin (struct line const *line1, struct
+@@ -625,7 +871,7 @@ prjoin (struct line const *line1, struct
o = o->next;
if (o == NULL)
break;
@@ -1629,7 +1628,7 @@ diff -urNp coreutils-8.23-orig/src/join.c coreutils-8.23/src/join.c
}
putchar (eolchar);
}
-@@ -1097,21 +1343,46 @@ main (int argc, char **argv)
+@@ -1103,21 +1349,46 @@ main (int argc, char **argv)
case 't':
{
@@ -1686,9 +1685,9 @@ diff -urNp coreutils-8.23-orig/src/join.c coreutils-8.23/src/join.c
break;
case 'z':
-diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
---- coreutils-8.23-orig/src/pr.c 2014-07-11 13:00:07.000000000 +0200
-+++ coreutils-8.23/src/pr.c 2014-07-22 13:45:52.713651936 +0200
+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
@@ -312,6 +312,24 @@
#include
@@ -1714,9 +1713,9 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
#include "system.h"
#include "error.h"
#include "fadvise.h"
-@@ -323,6 +341,18 @@
- #include "strftime.h"
+@@ -324,6 +342,18 @@
#include "xstrtol.h"
+ #include "xdectoint.h"
+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
+#if HAVE_MBRTOWC && defined mbstate_t
@@ -1733,7 +1732,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/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;
@@ -1755,23 +1754,23 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
static bool read_line (COLUMN *p);
static bool print_page (void);
static bool print_stored (COLUMN *p);
-@@ -425,6 +468,7 @@ static void print_header (void);
- static void pad_across_to (int position);
- 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,
+ int *character_length, int *character_width,
int *number);
static void print_files (int number_of_files, char **av);
static void init_parameters (int number_of_files);
-@@ -438,7 +482,6 @@ static void store_char (char c);
- static void pad_down (int lines);
+@@ -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);
-static void print_char (char c);
static void cleanup (void);
static void print_sep_string (void);
static void separator_string (const char *optarg_S);
-@@ -450,7 +493,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]. */
@@ -1780,7 +1779,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
/* Index of the position in buff where the next character
will be stored. */
-@@ -554,7 +597,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. */
@@ -1789,7 +1788,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/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 +607,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. */
@@ -1801,7 +1800,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
/* (-i) The width of the output tab. */
static int chars_per_output_tab = 8;
-@@ -634,7 +680,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. */
@@ -1816,7 +1815,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
/* (-n) line counting starts with 1st line of input file (not with 1st
line of 1st page printed). */
-@@ -687,6 +739,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 int col_sep_length = 0;
@@ -1824,7 +1823,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
static char *column_separator = (char *) " ";
static char *line_separator = (char *) "\t";
-@@ -843,6 +896,13 @@ separator_string (const char *optarg_S)
+@@ -840,6 +893,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);
@@ -1838,7 +1837,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
}
int
-@@ -867,6 +927,21 @@ main (int argc, char **argv)
+@@ -864,6 +924,21 @@ main (int argc, char **argv)
atexit (close_stdout);
@@ -1860,7 +1859,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
n_files = 0;
file_names = (argc > 1
? xmalloc ((argc - 1) * sizeof (char *))
-@@ -943,8 +1018,12 @@ main (int argc, char **argv)
+@@ -940,8 +1015,12 @@ main (int argc, char **argv)
break;
case 'e':
if (optarg)
@@ -1875,7 +1874,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
/* Could check tab width > 0. */
untabify_input = true;
break;
-@@ -957,8 +1036,12 @@ main (int argc, char **argv)
+@@ -954,8 +1033,12 @@ main (int argc, char **argv)
break;
case 'i':
if (optarg)
@@ -1890,7 +1889,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
/* Could check tab width > 0. */
tabify_output = true;
break;
-@@ -985,8 +1068,8 @@ main (int argc, char **argv)
+@@ -973,8 +1056,8 @@ main (int argc, char **argv)
case 'n':
numbered_lines = true;
if (optarg)
@@ -1901,7 +1900,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
break;
case 'N':
skip_count = false;
-@@ -1025,7 +1108,7 @@ main (int argc, char **argv)
+@@ -998,7 +1081,7 @@ main (int argc, char **argv)
old_s = false;
/* Reset an additional input of -s, -S dominates -s */
col_sep_string = bad_cast ("");
@@ -1910,7 +1909,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
use_col_separator = true;
if (optarg)
separator_string (optarg);
-@@ -1182,10 +1265,45 @@ main (int argc, char **argv)
+@@ -1152,10 +1235,45 @@ getoptnum (const char *n_str, int min, i
a number. */
static void
@@ -1958,7 +1957,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
if (*arg)
{
long int tmp_long;
-@@ -1207,6 +1325,11 @@ static void
+@@ -1177,6 +1295,11 @@ static void
init_parameters (int number_of_files)
{
int chars_used_by_number = 0;
@@ -1970,7 +1969,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
lines_per_body = lines_per_page - lines_per_header - lines_per_footer;
if (lines_per_body <= 0)
-@@ -1244,7 +1367,7 @@ init_parameters (int number_of_files)
+@@ -1214,7 +1337,7 @@ init_parameters (int number_of_files)
else
col_sep_string = column_separator;
@@ -1979,7 +1978,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
use_col_separator = true;
}
/* It's rather pointless to define a TAB separator with column
-@@ -1274,11 +1397,11 @@ init_parameters (int number_of_files)
+@@ -1244,11 +1367,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. */
@@ -1993,7 +1992,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
/* The number is part of the column width unless we are
printing files in parallel. */
-@@ -1287,7 +1410,7 @@ init_parameters (int number_of_files)
+@@ -1257,7 +1380,7 @@ init_parameters (int number_of_files)
}
chars_per_column = (chars_per_line - chars_used_by_number
@@ -2002,7 +2001,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
if (chars_per_column < 1)
error (EXIT_FAILURE, 0, _("page width too narrow"));
-@@ -1305,7 +1428,7 @@ init_parameters (int number_of_files)
+@@ -1275,7 +1398,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);
@@ -2011,7 +2010,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
}
/* Open the necessary files,
-@@ -1413,7 +1536,7 @@ init_funcs (void)
+@@ -1383,7 +1506,7 @@ init_funcs (void)
/* Enlarge p->start_position of first column to use the same form of
padding_not_printed with all columns. */
@@ -2020,7 +2019,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
/* This loop takes care of all but the rightmost column. */
-@@ -1447,7 +1570,7 @@ init_funcs (void)
+@@ -1417,7 +1540,7 @@ init_funcs (void)
}
else
{
@@ -2029,7 +2028,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
h_next = h + chars_per_column;
}
}
-@@ -1738,9 +1861,9 @@ static void
+@@ -1708,9 +1831,9 @@ static void
align_column (COLUMN *p)
{
padding_not_printed = p->start_position;
@@ -2041,7 +2040,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
padding_not_printed = ANYWHERE;
}
-@@ -2011,13 +2134,13 @@ store_char (char c)
+@@ -1981,13 +2104,13 @@ store_char (char c)
/* May be too generous. */
buff = X2REALLOC (buff, &buff_allocated);
}
@@ -2057,7 +2056,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
char *s;
int num_width;
-@@ -2034,22 +2157,24 @@ add_line_number (COLUMN *p)
+@@ -2004,22 +2127,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. */
@@ -2086,7 +2085,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
output_position = POS_AFTER_TAB (chars_per_output_tab,
output_position);
}
-@@ -2210,7 +2335,7 @@ print_white_space (void)
+@@ -2180,7 +2305,7 @@ print_white_space (void)
while (goal - h_old > 1
&& (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal)
{
@@ -2095,7 +2094,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
h_old = h_new;
}
while (++h_old <= goal)
-@@ -2230,6 +2355,7 @@ print_sep_string (void)
+@@ -2200,6 +2325,7 @@ print_sep_string (void)
{
char *s;
int l = col_sep_length;
@@ -2103,7 +2102,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
s = col_sep_string;
-@@ -2243,6 +2369,7 @@ print_sep_string (void)
+@@ -2213,6 +2339,7 @@ print_sep_string (void)
{
for (; separators_not_printed > 0; --separators_not_printed)
{
@@ -2111,7 +2110,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
while (l-- > 0)
{
/* 3 types of sep_strings: spaces only, spaces and chars,
-@@ -2256,12 +2383,15 @@ print_sep_string (void)
+@@ -2226,12 +2353,15 @@ print_sep_string (void)
}
else
{
@@ -2128,7 +2127,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
/* sep_string ends with some spaces */
if (spaces_not_printed > 0)
print_white_space ();
-@@ -2289,7 +2419,7 @@ print_clump (COLUMN *p, int n, char *clu
+@@ -2259,7 +2389,7 @@ print_clump (COLUMN *p, int n, char *clu
required number of tabs and spaces. */
static void
@@ -2137,7 +2136,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
{
if (tabify_output)
{
-@@ -2313,6 +2443,74 @@ print_char (char c)
+@@ -2283,6 +2413,74 @@ print_char (char c)
putchar (c);
}
@@ -2212,7 +2211,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
/* Skip to page PAGE before printing.
PAGE may be larger than total number of pages. */
-@@ -2492,9 +2690,9 @@ read_line (COLUMN *p)
+@@ -2462,9 +2660,9 @@ read_line (COLUMN *p)
align_empty_cols = false;
}
@@ -2224,7 +2223,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
padding_not_printed = ANYWHERE;
}
-@@ -2564,7 +2762,7 @@ print_stored (COLUMN *p)
+@@ -2534,7 +2732,7 @@ print_stored (COLUMN *p)
int i;
int line = p->current_line++;
@@ -2233,7 +2232,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
/* FIXME
UMR: Uninitialized memory read:
* This is occurring while in:
-@@ -2576,7 +2774,7 @@ print_stored (COLUMN *p)
+@@ -2546,7 +2744,7 @@ print_stored (COLUMN *p)
xmalloc [xmalloc.c:94]
init_store_cols [pr.c:1648]
*/
@@ -2242,7 +2241,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
pad_vertically = true;
-@@ -2595,9 +2793,9 @@ print_stored (COLUMN *p)
+@@ -2565,9 +2763,9 @@ print_stored (COLUMN *p)
}
}
@@ -2254,7 +2253,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
padding_not_printed = ANYWHERE;
}
-@@ -2610,8 +2808,8 @@ print_stored (COLUMN *p)
+@@ -2580,8 +2778,8 @@ print_stored (COLUMN *p)
if (spaces_not_printed == 0)
{
output_position = p->start_position + end_vector[line];
@@ -2265,7 +2264,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
}
return true;
-@@ -2630,7 +2828,7 @@ print_stored (COLUMN *p)
+@@ -2600,7 +2798,7 @@ print_stored (COLUMN *p)
number of characters is 1.) */
static int
@@ -2274,7 +2273,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
{
unsigned char uc = c;
char *s = clump_buff;
-@@ -2640,10 +2838,10 @@ char_to_clump (char c)
+@@ -2610,10 +2808,10 @@ char_to_clump (char c)
int chars;
int chars_per_c = 8;
@@ -2287,7 +2286,7 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/src/pr.c
{
width = TAB_WIDTH (chars_per_c, input_position);
-@@ -2724,6 +2922,164 @@ char_to_clump (char c)
+@@ -2694,6 +2892,164 @@ char_to_clump (char c)
return chars;
}
@@ -2452,9 +2451,9 @@ diff -urNp coreutils-8.23-orig/src/pr.c coreutils-8.23/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.23-orig/src/sort.c coreutils-8.23/src/sort.c
---- coreutils-8.23-orig/src/sort.c 2014-07-14 00:09:52.000000000 +0200
-+++ coreutils-8.23/src/sort.c 2014-07-22 13:45:52.719651960 +0200
+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
@@ -29,6 +29,14 @@
#include
#include
@@ -2528,7 +2527,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
/* Flag to remove consecutive duplicate lines from the output.
Only the last of a sequence of equal lines will be output. */
-@@ -811,6 +842,46 @@ reap_all (void)
+@@ -810,6 +841,46 @@ reap_all (void)
reap (-1);
}
@@ -2575,7 +2574,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
/* Clean up any remaining temporary files. */
static void
-@@ -1255,7 +1326,7 @@ zaptemp (char const *name)
+@@ -1254,7 +1325,7 @@ zaptemp (char const *name)
free (node);
}
@@ -2584,7 +2583,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
static int
struct_month_cmp (void const *m1, void const *m2)
-@@ -1270,7 +1341,7 @@ struct_month_cmp (void const *m1, void c
+@@ -1269,7 +1340,7 @@ struct_month_cmp (void const *m1, void c
/* Initialize the character class tables. */
static void
@@ -2593,7 +2592,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
{
size_t i;
-@@ -1282,7 +1353,7 @@ inittables (void)
+@@ -1281,7 +1352,7 @@ inittables (void)
fold_toupper[i] = toupper (i);
}
@@ -2602,7 +2601,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
/* If we're not in the "C" locale, read different names for months. */
if (hard_LC_TIME)
{
-@@ -1364,6 +1435,84 @@ specify_nmerge (int oi, char c, char con
+@@ -1363,6 +1434,84 @@ specify_nmerge (int oi, char c, char con
xstrtol_fatal (e, oi, c, long_options, s);
}
@@ -2687,7 +2686,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/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)
-@@ -1597,7 +1746,7 @@ buffer_linelim (struct buffer const *buf
+@@ -1596,7 +1745,7 @@ buffer_linelim (struct buffer const *buf
by KEY in LINE. */
static char *
@@ -2696,7 +2695,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
{
char *ptr = line->text, *lim = ptr + line->length - 1;
size_t sword = key->sword;
-@@ -1606,10 +1755,10 @@ begfield (struct line const *line, struc
+@@ -1605,10 +1754,10 @@ begfield (struct line const *line, struc
/* The leading field separator itself is included in a field when -t
is absent. */
@@ -2709,7 +2708,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
++ptr;
if (ptr < lim)
++ptr;
-@@ -1635,11 +1784,70 @@ begfield (struct line const *line, struc
+@@ -1634,11 +1783,70 @@ begfield (struct line const *line, struc
return ptr;
}
@@ -2781,7 +2780,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
{
char *ptr = line->text, *lim = ptr + line->length - 1;
size_t eword = key->eword, echar = key->echar;
-@@ -1654,10 +1862,10 @@ limfield (struct line const *line, struc
+@@ -1653,10 +1861,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. */
@@ -2794,7 +2793,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
++ptr;
if (ptr < lim && (eword || echar))
++ptr;
-@@ -1703,10 +1911,10 @@ limfield (struct line const *line, struc
+@@ -1702,10 +1910,10 @@ limfield (struct line const *line, struc
*/
/* Make LIM point to the end of (one byte past) the current field. */
@@ -2807,7 +2806,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
if (newlim)
lim = newlim;
}
-@@ -1737,6 +1945,130 @@ limfield (struct line const *line, struc
+@@ -1736,6 +1944,130 @@ limfield (struct line const *line, struc
return ptr;
}
@@ -2938,7 +2937,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/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
-@@ -1823,8 +2155,22 @@ fillbuf (struct buffer *buf, FILE *fp, c
+@@ -1822,8 +2154,22 @@ fillbuf (struct buffer *buf, FILE *fp, c
else
{
if (key->skipsblanks)
@@ -2963,7 +2962,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
line->keybeg = line_start;
}
}
-@@ -1945,7 +2291,7 @@ human_numcompare (char const *a, char co
+@@ -1944,7 +2290,7 @@ human_numcompare (char const *a, char co
hideously fast. */
static int
@@ -2972,7 +2971,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
{
while (blanks[to_uchar (*a)])
a++;
-@@ -1955,6 +2301,25 @@ numcompare (char const *a, char const *b
+@@ -1954,6 +2300,25 @@ numcompare (char const *a, char const *b
return strnumcmp (a, b, decimal_point, thousands_sep);
}
@@ -2998,7 +2997,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/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
-@@ -2005,7 +2370,7 @@ general_numcompare (char const *sa, char
+@@ -2004,7 +2369,7 @@ general_numcompare (char const *sa, char
Return 0 if the name in S is not recognized. */
static int
@@ -3007,7 +3006,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
{
size_t lo = 0;
size_t hi = MONTHS_PER_YEAR;
-@@ -2280,15 +2645,14 @@ debug_key (struct line const *line, stru
+@@ -2279,15 +2644,14 @@ debug_key (struct line const *line, stru
char saved = *lim;
*lim = '\0';
@@ -3025,7 +3024,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/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 *gke
+@@ -2431,7 +2795,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 */
@@ -3034,7 +3033,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
&& ((!key->skipsblanks && !(implicit_skip || maybe_space_aligned))
|| (!key->skipsblanks && key->schar)
|| (!key->skipeblanks && key->echar)))
-@@ -2490,11 +2854,87 @@ key_warnings (struct keyfield const *gke
+@@ -2489,11 +2853,87 @@ key_warnings (struct keyfield const *gke
error (0, 0, _("option '-r' only applies to last-resort comparison"));
}
@@ -3123,7 +3122,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
{
struct keyfield *key = keylist;
-@@ -2579,7 +3019,7 @@ keycompare (struct line const *a, struct
+@@ -2578,7 +3018,7 @@ keycompare (struct line const *a, struct
else if (key->human_numeric)
diff = human_numcompare (ta, tb);
else if (key->month)
@@ -3132,7 +3131,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
else if (key->random)
diff = compare_random (ta, tlena, tb, tlenb);
else if (key->version)
-@@ -2695,6 +3135,209 @@ keycompare (struct line const *a, struct
+@@ -2694,6 +3134,209 @@ keycompare (struct line const *a, struct
return key->reverse ? -diff : diff;
}
@@ -3342,7 +3341,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/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 +3347,7 @@ compare (struct line const *a, struct li
+@@ -2721,7 +3364,7 @@ compare (struct line const *a, struct li
diff = - NONZERO (blen);
else if (blen == 0)
diff = 1;
@@ -3351,7 +3350,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
{
/* Note xmemcoll0 is a performance enhancement as
it will not unconditionally write '\0' after the
-@@ -4121,6 +4746,7 @@ set_ordering (char const *s, struct keyf
+@@ -4120,6 +4763,7 @@ set_ordering (char const *s, struct keyf
break;
case 'f':
key->translate = fold_toupper;
@@ -3359,7 +3358,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
break;
case 'g':
key->general_numeric = true;
-@@ -4198,7 +4824,7 @@ main (int argc, char **argv)
+@@ -4197,7 +4841,7 @@ main (int argc, char **argv)
initialize_exit_failure (SORT_FAILURE);
hard_LC_COLLATE = hard_locale (LC_COLLATE);
@@ -3368,7 +3367,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
hard_LC_TIME = hard_locale (LC_TIME);
#endif
-@@ -4219,6 +4845,29 @@ main (int argc, char **argv)
+@@ -4218,6 +4862,29 @@ main (int argc, char **argv)
thousands_sep = -1;
}
@@ -3398,7 +3397,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
have_read_stdin = false;
inittables ();
-@@ -4493,13 +5142,34 @@ main (int argc, char **argv)
+@@ -4492,13 +5159,34 @@ main (int argc, char **argv)
case 't':
{
@@ -3437,7 +3436,7 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
else
{
/* Provoke with 'sort -txx'. Complain about
-@@ -4510,9 +5180,12 @@ main (int argc, char **argv)
+@@ -4509,9 +5197,12 @@ main (int argc, char **argv)
quote (optarg));
}
}
@@ -3452,42 +3451,9 @@ diff -urNp coreutils-8.23-orig/src/sort.c coreutils-8.23/src/sort.c
}
break;
-diff -urNp coreutils-8.23-orig/tests/i18n/sort.sh coreutils-8.23/tests/i18n/sort.sh
---- coreutils-8.23-orig/tests/i18n/sort.sh 1970-01-01 01:00:00.000000000 +0100
-+++ coreutils-8.23/tests/i18n/sort.sh 2014-07-22 13:45:52.733652016 +0200
-@@ -0,0 +1,29 @@
-+#!/bin/sh
-+# Verify sort's multi-byte support.
-+
-+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
-+print_ver_ sort
-+
-+export LC_ALL=en_US.UTF-8
-+locale -k LC_CTYPE | grep -q "charmap.*UTF-8" \
-+ || skip_ "No UTF-8 locale available"
-+
-+# Enable heap consistency checkng on older systems
-+export MALLOC_CHECK_=2
-+
-+
-+# check buffer overflow issue due to
-+# expanding multi-byte representation due to case conversion
-+# https://bugzilla.suse.com/show_bug.cgi?id=928749
-+cat < exp
-+.
-+ɑ
-+EOF
-+cat < out || fail=1
-+.
-+ɑ
-+EOF
-+compare exp out || { fail=1; cat out; }
-+
-+
-+Exit $fail
-diff -urNp coreutils-8.23-orig/src/unexpand.c coreutils-8.23/src/unexpand.c
---- coreutils-8.23-orig/src/unexpand.c 2014-07-11 13:00:07.000000000 +0200
-+++ coreutils-8.23/src/unexpand.c 2014-07-22 13:45:52.721651968 +0200
+diff -urNp coreutils-8.24-orig/src/unexpand.c coreutils-8.24/src/unexpand.c
+--- coreutils-8.24-orig/src/unexpand.c 2015-06-26 19:05:22.000000000 +0200
++++ coreutils-8.24/src/unexpand.c 2015-07-05 09:04:33.032546980 +0200
@@ -38,12 +38,29 @@
#include
#include
@@ -3743,9 +3709,9 @@ diff -urNp coreutils-8.23-orig/src/unexpand.c coreutils-8.23/src/unexpand.c
if (have_read_stdin && fclose (stdin) != 0)
error (EXIT_FAILURE, errno, "-");
-diff -urNp coreutils-8.23-orig/src/uniq.c coreutils-8.23/src/uniq.c
---- coreutils-8.23-orig/src/uniq.c 2014-07-11 13:00:07.000000000 +0200
-+++ coreutils-8.23/src/uniq.c 2014-07-22 13:45:52.724651980 +0200
+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
@@ -21,6 +21,17 @@
#include
#include
@@ -3898,7 +3864,7 @@ diff -urNp coreutils-8.23-orig/src/uniq.c coreutils-8.23/src/uniq.c
if (check_chars < oldlen)
oldlen = check_chars;
if (check_chars < newlen)
-@@ -286,14 +392,103 @@ different (char *old, char *new, size_t
+@@ -286,15 +392,104 @@ different (char *old, char *new, size_t
if (ignore_case)
{
@@ -3930,8 +3896,8 @@ diff -urNp coreutils-8.23-orig/src/uniq.c coreutils-8.23/src/uniq.c
+
+ return xmemcoll (copy_old, oldlen, copy_new, newlen);
+
-+}
-+
+ }
+
+#if HAVE_MBRTOWC
+static int
+different_multi (const char *old, const char *new, size_t oldlen, size_t newlen, mbstate_t oldstate, mbstate_t newstate)
@@ -4002,11 +3968,12 @@ diff -urNp coreutils-8.23-orig/src/uniq.c coreutils-8.23/src/uniq.c
+ free (copy[1]);
+ return rc;
+
- }
++}
+#endif
-
++
/* 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.
@@ -358,19 +553,38 @@ check_file (const char *infile, const ch
char *prevfield IF_LINT ( = NULL);
size_t prevlen IF_LINT ( = 0);
@@ -4129,10 +4096,43 @@ diff -urNp coreutils-8.23-orig/src/uniq.c coreutils-8.23/src/uniq.c
skip_chars = 0;
skip_fields = 0;
check_chars = SIZE_MAX;
-diff -urNp coreutils-8.23-orig/tests/local.mk coreutils-8.23/tests/local.mk
---- coreutils-8.23-orig/tests/local.mk 2014-07-22 13:45:10.494422571 +0200
-+++ coreutils-8.23/tests/local.mk 2014-07-22 13:45:52.726651988 +0200
-@@ -331,6 +331,8 @@ all_tests = \
+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
+@@ -0,0 +1,29 @@
++#!/bin/sh
++# Verify sort's multi-byte support.
++
++. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
++print_ver_ sort
++
++export LC_ALL=en_US.UTF-8
++locale -k LC_CTYPE | grep -q "charmap.*UTF-8" \
++ || skip_ "No UTF-8 locale available"
++
++# Enable heap consistency checkng on older systems
++export MALLOC_CHECK_=2
++
++
++# check buffer overflow issue due to
++# expanding multi-byte representation due to case conversion
++# https://bugzilla.suse.com/show_bug.cgi?id=928749
++cat < exp
++.
++ɑ
++EOF
++cat < out || fail=1
++.
++ɑ
++EOF
++compare exp out || { fail=1; cat out; }
++
++
++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
+@@ -341,6 +341,8 @@ all_tests = \
tests/misc/sort-discrim.sh \
tests/misc/sort-files0-from.pl \
tests/misc/sort-float.sh \
@@ -4141,9 +4141,9 @@ diff -urNp coreutils-8.23-orig/tests/local.mk coreutils-8.23/tests/local.mk
tests/misc/sort-merge.pl \
tests/misc/sort-merge-fdlimit.sh \
tests/misc/sort-month.sh \
-diff -urNp coreutils-8.23-orig/tests/misc/cut.pl coreutils-8.23/tests/misc/cut.pl
---- coreutils-8.23-orig/tests/misc/cut.pl 2014-07-11 13:00:07.000000000 +0200
-+++ coreutils-8.23/tests/misc/cut.pl 2014-07-22 13:45:52.728651996 +0200
+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
@@ -23,9 +23,11 @@ use strict;
# Turn off localization of executable's output.
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
@@ -4166,9 +4166,9 @@ diff -urNp coreutils-8.23-orig/tests/misc/cut.pl coreutils-8.23/tests/misc/cut.p
push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}];
}
push @Tests, @new;
-diff -urNp coreutils-8.23-orig/tests/misc/expand.pl coreutils-8.23/tests/misc/expand.pl
---- coreutils-8.23-orig/tests/misc/expand.pl 2014-07-11 13:00:07.000000000 +0200
-+++ coreutils-8.23/tests/misc/expand.pl 2014-07-22 13:45:52.729652000 +0200
+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;
# Turn off localization of executable's output.
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
@@ -4223,9 +4223,9 @@ diff -urNp coreutils-8.23-orig/tests/misc/expand.pl coreutils-8.23/tests/misc/ex
my $save_temps = $ENV{DEBUG};
my $verbose = $ENV{VERBOSE};
-diff -urNp coreutils-8.23-orig/tests/misc/fold.pl coreutils-8.23/tests/misc/fold.pl
---- coreutils-8.23-orig/tests/misc/fold.pl 2014-07-11 13:00:07.000000000 +0200
-+++ coreutils-8.23/tests/misc/fold.pl 2014-07-22 13:45:52.730652004 +0200
+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
@@ -20,9 +20,18 @@ use strict;
(my $program_name = $0) =~ s|.*/||;
@@ -4295,9 +4295,9 @@ diff -urNp coreutils-8.23-orig/tests/misc/fold.pl coreutils-8.23/tests/misc/fold
-my $prog = 'fold';
my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
exit $fail;
-diff -urNp coreutils-8.23-orig/tests/misc/join.pl coreutils-8.23/tests/misc/join.pl
---- coreutils-8.23-orig/tests/misc/join.pl 2014-07-11 13:00:07.000000000 +0200
-+++ coreutils-8.23/tests/misc/join.pl 2014-07-22 13:45:52.731652008 +0200
+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
@@ -25,6 +25,15 @@ my $limits = getlimits ();
my $prog = 'join';
@@ -4364,9 +4364,9 @@ diff -urNp coreutils-8.23-orig/tests/misc/join.pl coreutils-8.23/tests/misc/join
my $save_temps = $ENV{DEBUG};
my $verbose = $ENV{VERBOSE};
-diff -urNp coreutils-8.23-orig/tests/misc/sort-mb-tests.sh coreutils-8.23/tests/misc/sort-mb-tests.sh
---- coreutils-8.23-orig/tests/misc/sort-mb-tests.sh 1970-01-01 01:00:00.000000000 +0100
-+++ coreutils-8.23/tests/misc/sort-mb-tests.sh 2014-07-22 13:45:52.733652016 +0200
+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
@@ -0,0 +1,45 @@
+#!/bin/sh
+# Verify sort's multi-byte support.
@@ -4413,9 +4413,9 @@ diff -urNp coreutils-8.23-orig/tests/misc/sort-mb-tests.sh coreutils-8.23/tests/
+compare exp out || { fail=1; cat out; }
+
+Exit $fail
-diff -urNp coreutils-8.23-orig/tests/misc/sort-merge.pl coreutils-8.23/tests/misc/sort-merge.pl
---- coreutils-8.23-orig/tests/misc/sort-merge.pl 2014-07-11 13:00:07.000000000 +0200
-+++ coreutils-8.23/tests/misc/sort-merge.pl 2014-07-22 13:45:52.733652016 +0200
+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
@@ -26,6 +26,15 @@ my $prog = 'sort';
# Turn off localization of executable's output.
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
@@ -4472,9 +4472,9 @@ diff -urNp coreutils-8.23-orig/tests/misc/sort-merge.pl coreutils-8.23/tests/mis
my $save_temps = $ENV{DEBUG};
my $verbose = $ENV{VERBOSE};
-diff -urNp coreutils-8.23-orig/tests/misc/sort.pl coreutils-8.23/tests/misc/sort.pl
---- coreutils-8.23-orig/tests/misc/sort.pl 2014-07-11 13:00:07.000000000 +0200
-+++ coreutils-8.23/tests/misc/sort.pl 2014-07-22 13:45:52.734652020 +0200
+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
@@ -24,10 +24,15 @@ my $prog = 'sort';
# Turn off localization of executable's output.
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
@@ -4492,18 +4492,7 @@ diff -urNp coreutils-8.23-orig/tests/misc/sort.pl coreutils-8.23/tests/misc/sort
# Since each test is run with a file name and with redirected stdin,
# the name in the diagnostic is either the file name or "-".
# Normalize each diagnostic to use '-'.
-@@ -317,6 +322,10 @@ my @Tests =
- ["22a", '-k 2,2fd -k 1,1r', {IN=>"3 b\n4 B\n"}, {OUT=>"4 B\n3 b\n"}],
- ["22b", '-k 2,2d -k 1,1r', {IN=>"3 b\n4 b\n"}, {OUT=>"4 b\n3 b\n"}],
-
-+# This fails in Fedora 20, per Göran Uddeborg in: http://bugs.gnu.org/18540
-+["23", '-s -k1,1 -t/', {IN=>"a b/x\na-b-c/x\n"}, {OUT=>"a b/x\na-b-c/x\n"},
-+ {ENV => "LC_ALL=$mb_locale"}],
-+
- ["no-file1", 'no-file', {EXIT=>2}, {ERR=>$no_file}],
- # This test failed until 1.22f. Sort didn't give an error.
- # From Will Edgington.
-@@ -415,6 +420,38 @@ foreach my $t (@Tests)
+@@ -419,6 +428,38 @@ foreach my $t (@Tests)
}
}
@@ -4542,7 +4531,7 @@ diff -urNp coreutils-8.23-orig/tests/misc/sort.pl coreutils-8.23/tests/misc/sort
@Tests = triple_test \@Tests;
# Remember that triple_test creates from each test with exactly one "IN"
-@@ -424,6 +460,7 @@ foreach my $t (@Tests)
+@@ -428,6 +469,7 @@ foreach my $t (@Tests)
# Remove the IN_PIPE version of the "output-is-input" test above.
# The others aren't susceptible because they have three inputs each.
@Tests = grep {$_->[0] ne 'output-is-input.p'} @Tests;
@@ -4550,9 +4539,9 @@ diff -urNp coreutils-8.23-orig/tests/misc/sort.pl coreutils-8.23/tests/misc/sort
my $save_temps = $ENV{DEBUG};
my $verbose = $ENV{VERBOSE};
-diff -urNp coreutils-8.23-orig/tests/misc/unexpand.pl coreutils-8.23/tests/misc/unexpand.pl
---- coreutils-8.23-orig/tests/misc/unexpand.pl 2014-07-11 13:00:07.000000000 +0200
-+++ coreutils-8.23/tests/misc/unexpand.pl 2014-07-22 13:45:52.735652024 +0200
+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
@@ -27,6 +27,14 @@ my $limits = getlimits ();
my $prog = 'unexpand';
@@ -4606,9 +4595,9 @@ diff -urNp coreutils-8.23-orig/tests/misc/unexpand.pl coreutils-8.23/tests/misc/
my $save_temps = $ENV{DEBUG};
my $verbose = $ENV{VERBOSE};
-diff -urNp coreutils-8.23-orig/tests/misc/uniq.pl coreutils-8.23/tests/misc/uniq.pl
---- coreutils-8.23-orig/tests/misc/uniq.pl 2014-07-11 13:00:07.000000000 +0200
-+++ coreutils-8.23/tests/misc/uniq.pl 2014-07-22 13:45:52.736652028 +0200
+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
@@ -23,9 +23,17 @@ my $limits = getlimits ();
my $prog = 'uniq';
my $try = "Try '$prog --help' for more information.\n";
@@ -4681,12 +4670,12 @@ diff -urNp coreutils-8.23-orig/tests/misc/uniq.pl coreutils-8.23/tests/misc/uniq
@Tests = add_z_variants \@Tests;
@Tests = triple_test \@Tests;
-diff -urNp coreutils-8.23-orig/tests/pr/pr-tests.pl coreutils-8.23/tests/pr/pr-tests.pl
---- coreutils-8.23-orig/tests/pr/pr-tests.pl 2014-07-11 13:00:07.000000000 +0200
-+++ coreutils-8.23/tests/pr/pr-tests.pl 2014-07-22 13:45:52.737652032 +0200
-@@ -23,6 +23,15 @@ use strict;
-
+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
+@@ -24,6 +24,15 @@ use strict;
my $prog = 'pr';
+ my $normalize_strerror = "s/': .*/'/";
+my $mb_locale;
+#Uncomment the following line to enable multibyte tests
@@ -4700,7 +4689,7 @@ diff -urNp coreutils-8.23-orig/tests/pr/pr-tests.pl coreutils-8.23/tests/pr/pr-t
my @tv = (
# -b option is no longer an official option. But it's still working to
-@@ -466,8 +475,48 @@ push @Tests,
+@@ -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"} ];
diff --git a/coreutils.spec b/coreutils.spec
index b6b6450..754ef3d 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
-Version: 8.23
-Release: 14%{?dist}
+Version: 8.24
+Release: 1%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -14,7 +14,6 @@ Source105: coreutils-colorls.sh
Source106: coreutils-colorls.csh
# From upstream
-Patch1: coreutils-8.23-chroot-chdir.patch
# Our patches
#general patch to workaround koji build system issues
@@ -125,8 +124,6 @@ the old GNU fileutils, sh-utils, and textutils packages.
%prep
%setup -q
-%patch1 -p1 -b .chdir
-
# Our patches
%patch100 -p1 -b .configure
%patch101 -p1 -b .manpages
@@ -376,6 +373,9 @@ fi
%{_sbindir}/chroot
%changelog
+* Sun Jul 05 2015 Ondrej Vasik 8.24-1
+- new upstream release 8.24
+
* Sat Jul 4 2015 Peter Robinson 8.23-14
- Disable failing test-update-copyright to fix FTBFS
diff --git a/sources b/sources
index b5d101f..c53a0ef 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-abed135279f87ad6762ce57ff6d89c41 coreutils-8.23.tar.xz
-f93deb9f48c2bc7236743a10bf1c2409 coreutils-8.23.tar.xz.sig
+40efdbce865d2458d8da0a9dcee7c16c coreutils-8.24.tar.xz
+01b4406a1de25aa4af49b9c4b0057c19 coreutils-8.24.tar.xz.sig
From 7b7a0554fba4e0f40682c1116e6acea336d27558 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?=
Date: Thu, 16 Jul 2015 10:35:36 +0200
Subject: [PATCH 009/256] use newer version of sort/I18N fix for CVE-2015-4041
and CVE-2015-4042
---
coreutils-i18n.patch | 6 ++++--
coreutils.spec | 6 +++++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch
index d1d18a8..8589d74 100644
--- a/coreutils-i18n.patch
+++ b/coreutils-i18n.patch
@@ -3131,7 +3131,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)
-@@ -2694,6 +3134,209 @@ keycompare (struct line const *a, struct
+@@ -2694,6 +3134,211 @@ keycompare (struct line const *a, struct
return key->reverse ? -diff : diff;
}
@@ -3244,7 +3244,9 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c
+
+ if (ignore || translate)
+ {
-+ char *copy_a = (char *) xmalloc ((lena + lenb) * MB_CUR_MAX + 2);
++ if (SIZE_MAX - lenb - 2 < lena)
++ xalloc_die ();
++ char *copy_a = (char *) xnmalloc (lena + lenb + 2, MB_CUR_MAX);
+ char *copy_b = copy_a + lena * MB_CUR_MAX + 1;
+ size_t new_len_a, new_len_b;
+ size_t i, j;
diff --git a/coreutils.spec b/coreutils.spec
index 754ef3d..c4e1341 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.24
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -373,6 +373,10 @@ fi
%{_sbindir}/chroot
%changelog
+* Thu Jul 16 2015 Ondrej Vasik 8.24-2
+- use newer version of sort/I18N fix for CVE-2015-4041
+ and CVE-2015-4042
+
* Sun Jul 05 2015 Ondrej Vasik 8.24-1
- new upstream release 8.24
From cfbfd8c4908e28c178eabff5c896e332f8789b4c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?=
Date: Tue, 1 Sep 2015 17:32:54 +0100
Subject: [PATCH 010/256] avoid check failure on glibc 2.22
glibc 2.22 introduces two extra stat() calls per opendir(),
which induces a false failure in a test counting stat() calls.
---
coreutils.spec | 3 ++
glibc-2.22-test-fix.patch | 83 +++++++++++++++++++++++++++++++++++++++
2 files changed, 86 insertions(+)
create mode 100644 glibc-2.22-test-fix.patch
diff --git a/coreutils.spec b/coreutils.spec
index c4e1341..deac632 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -30,6 +30,8 @@ Patch104: coreutils-df-direct.patch
Patch107: coreutils-8.4-mkdir-modenote.patch
# Don't run the currently failing test-update-copyright.sh test
Patch108: coreutils-remove-test-update-copyright.patch
+#avoid false failure due to extra stat() calls done by opendir() in glibc 2.22
+Patch109: glibc-2.22-test-fix.patch
# sh-utils
#add info about TZ envvar to date manpage
@@ -132,6 +134,7 @@ the old GNU fileutils, sh-utils, and textutils packages.
%patch104 -p1 -b .dfdirect
%patch107 -p1 -b .mkdirmode
%patch108 -p1 -b .crtest
+%patch109 -p1 -b .opendir_stat
# sh-utils
%patch703 -p1 -b .dateman
diff --git a/glibc-2.22-test-fix.patch b/glibc-2.22-test-fix.patch
new file mode 100644
index 0000000..efbe850
--- /dev/null
+++ b/glibc-2.22-test-fix.patch
@@ -0,0 +1,83 @@
+From fd5f2b1569e2e0b31be755e14e236a7a02478fc0 Mon Sep 17 00:00:00 2001
+From: Bernhard Voelker
+Date: Sun, 30 Aug 2015 22:49:35 +0200
+Subject: [PATCH] tests: avoid FP of ls/stat-free-color.sh with newer glibc
+
+Since glibc-2.22, specifically commit [0], the opendir() implementation
+implicitly makes an additional stat call thus leading to a FP.
+Seen on openSUSE:Tumbleweed since snapshot 20150821.
+
+[0]
+https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=46f894d8c60a
+
+* tests/ls/stat-free-color.sh: Change the test to verify that ls(1)
+needs the same number of stat-like calls for a single, empty directory
+argument as for one with a few directory entries (sub-directory,
+regular file, symlink, etc.).
+---
+ tests/ls/stat-free-color.sh | 39 ++++++++++++++++++++++++---------------
+ 1 file changed, 24 insertions(+), 15 deletions(-)
+
+diff --git a/tests/ls/stat-free-color.sh b/tests/ls/stat-free-color.sh
+index fb2ee8b..35816a3 100755
+--- a/tests/ls/stat-free-color.sh
++++ b/tests/ls/stat-free-color.sh
+@@ -27,8 +27,6 @@ stats='stat,lstat,stat64,lstat64,newfstatat'
+ require_strace_ $stats
+ require_dirent_d_type_
+
+-ln -s nowhere dangle || framework_failure_
+-
+ # Disable enough features via LS_COLORS so that ls --color
+ # can do its job without calling stat (other than the obligatory
+ # one-call-per-command-line argument).
+@@ -54,22 +52,33 @@ EOF
+ eval $(dircolors -b color-without-stat)
+
+ # The system may perform additional stat-like calls before main.
+-# To avoid counting those, first get a baseline count by running
+-# ls with only the --help option. Then, compare that with the
++# Furthermore, underlying library functions may also implicitly
++# add an extra stat call, e.g. opendir since glibc-2.21-360-g46f894d.
++# To avoid counting those, first get a baseline count for running
++# ls with one empty directory argument. Then, compare that with the
+ # invocation under test.
+-strace -o log-help -e $stats ls --help >/dev/null || fail=1
+-n_lines_help=$(wc -l < log-help)
++mkdir d || framework_failure_
++
++strace -o log1 -e $stats ls --color=always d || fail=1
++n_stat1=$(wc -l < log1) || framework_failure_
++
++test $n_stat1 = 0 \
++ && skip_ 'No stat calls recognized on this platform'
+
+-strace -o log -e $stats ls --color=always . || fail=1
+-n_lines=$(wc -l < log)
++# Populate the test directory.
++mkdir d/subdir \
++ && touch d/regf \
++ && ln d/regf d/hlink \
++ && ln -s regf d/slink \
++ && ln -s nowhere d/dangle \
++ || framework_failure_
+
+-n_stat=$(expr $n_lines - $n_lines_help)
++# Invocation under test.
++strace -o log2 -e $stats ls --color=always d || fail=1
++n_stat2=$(wc -l < log2) || framework_failure_
+
+-# Expect one stat call.
+-case $n_stat in
+- 0) skip_ 'No stat calls recognized on this platform' ;;
+- 1) ;; # Corresponding to stat(".")
+- *) fail=1; head -n30 log* ;;
+-esac
++# Expect the same number of stat calls.
++test $n_stat1 = $n_stat2 \
++ || { fail=1; head -n30 log*; }
+
+ Exit $fail
+--
+2.4.1
+
From 2ad92d25c004ced89a89955a0568d07b0169656d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?=
Date: Sat, 12 Sep 2015 08:00:58 +0200
Subject: [PATCH 011/256] fix one still existing occurance of non-full path in
colorls.sh
---
coreutils-colorls.sh | 2 +-
coreutils.spec | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/coreutils-colorls.sh b/coreutils-colorls.sh
index c3f6a43..cfd2288 100755
--- a/coreutils-colorls.sh
+++ b/coreutils-colorls.sh
@@ -47,7 +47,7 @@ if [ -z "$USER_LS_COLORS" ]; then
fi
[ -z "$LS_COLORS" ] && return
- grep -qi "^COLOR.*none" $COLORS >/dev/null 2>/dev/null && return
+ /usr/bin/grep -qi "^COLOR.*none" $COLORS >/dev/null 2>/dev/null && return
fi
unset TMP COLORS INCLUDE
diff --git a/coreutils.spec b/coreutils.spec
index deac632..5db34fe 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.24
-Release: 2%{?dist}
+Release: 3%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -376,6 +376,9 @@ fi
%{_sbindir}/chroot
%changelog
+* Sat Sep 12 2015 Ondrej Vasik 8.24-3
+- fix one still existing occurance of non-full path in colorls.sh
+
* Thu Jul 16 2015 Ondrej Vasik 8.24-2
- use newer version of sort/I18N fix for CVE-2015-4041
and CVE-2015-4042
From c7c3ee3fabb7b48c6545383e4b2da07e661d0007 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 16 Sep 2015 19:58:21 +0200
Subject: [PATCH 012/256] Resolves: #1259942 - fix memory leak in sort/I18N
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Patches written by Pádraig.
Note that the corresponding i18n/sort-month test was not included
because it breaks unless sort is compiled -Dlint and we do not want
to decrease performance of the resulting RPMs (and valgrind is not
installed in production buildroots anyway).
---
coreutils-i18n.patch | 65 +++++++++++++++++++++++++++++++-------------
coreutils.spec | 5 +++-
2 files changed, 50 insertions(+), 20 deletions(-)
diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch
index 8589d74..f823a40 100644
--- a/coreutils-i18n.patch
+++ b/coreutils-i18n.patch
@@ -3046,8 +3046,8 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c
+ register int lo = 0, hi = MONTHS_PER_YEAR, result;
+ char *tmp;
+ size_t wclength, mblength;
-+ const char **pp;
-+ const wchar_t **wpp;
++ const char *pp;
++ const wchar_t *wpp;
+ wchar_t *month_wcs;
+ mbstate_t state;
+
@@ -3060,17 +3060,19 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c
+ if (len == 0)
+ return 0;
+
-+ month = (char *) xmalloc (len + 1);
++ if (SIZE_MAX - len < 1)
++ xalloc_die ();
+
-+ tmp = (char *) xmalloc (len + 1);
++ month = (char *) xnmalloc (len + 1, MB_CUR_MAX);
++
++ pp = tmp = (char *) xnmalloc (len + 1, MB_CUR_MAX);
+ memcpy (tmp, s, len);
+ tmp[len] = '\0';
-+ pp = (const char **)&tmp;
-+ month_wcs = (wchar_t *) xmalloc ((len + 1) * sizeof (wchar_t));
-+ memset (&state, '\0', sizeof(mbstate_t));
++ wpp = month_wcs = (wchar_t *) xnmalloc (len + 1, sizeof (wchar_t));
++ memset (&state, '\0', sizeof (mbstate_t));
+
-+ wclength = mbsrtowcs (month_wcs, pp, len + 1, &state);
-+ if (wclength == (size_t)-1 || *pp != NULL)
++ wclength = mbsrtowcs (month_wcs, &pp, len + 1, &state);
++ if (wclength == (size_t)-1 || pp != NULL)
+ error (SORT_FAILURE, 0, _("Invalid multibyte input %s."), quote(s));
+
+ for (i = 0; i < wclength; i++)
@@ -3083,10 +3085,8 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c
+ }
+ }
+
-+ wpp = (const wchar_t **)&month_wcs;
-+
-+ mblength = wcsrtombs (month, wpp, len + 1, &state);
-+ assert (mblength != (-1) && *wpp == NULL);
++ mblength = wcsrtombs (month, &wpp, (len + 1) * MB_CUR_MAX, &state);
++ assert (mblength != (-1) && wpp == NULL);
+
+ do
+ {
@@ -3343,7 +3343,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. */
-@@ -2721,7 +3364,7 @@ compare (struct line const *a, struct li
+@@ -2721,7 +3366,7 @@ compare (struct line const *a, struct line const *b)
diff = - NONZERO (blen);
else if (blen == 0)
diff = 1;
@@ -3352,7 +3352,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
-@@ -4120,6 +4763,7 @@ set_ordering (char const *s, struct keyf
+@@ -4120,6 +4765,7 @@ set_ordering (char const *s, struct keyfield *key, enum blanktype blanktype)
break;
case 'f':
key->translate = fold_toupper;
@@ -3360,7 +3360,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c
break;
case 'g':
key->general_numeric = true;
-@@ -4197,7 +4841,7 @@ main (int argc, char **argv)
+@@ -4197,7 +4843,7 @@ main (int argc, char **argv)
initialize_exit_failure (SORT_FAILURE);
hard_LC_COLLATE = hard_locale (LC_COLLATE);
@@ -3369,7 +3369,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c
hard_LC_TIME = hard_locale (LC_TIME);
#endif
-@@ -4218,6 +4862,29 @@ main (int argc, char **argv)
+@@ -4218,6 +4864,29 @@ main (int argc, char **argv)
thousands_sep = -1;
}
@@ -3399,7 +3399,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c
have_read_stdin = false;
inittables ();
-@@ -4492,13 +5159,34 @@ main (int argc, char **argv)
+@@ -4492,13 +5161,34 @@ main (int argc, char **argv)
case 't':
{
@@ -3438,7 +3438,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c
else
{
/* Provoke with 'sort -txx'. Complain about
-@@ -4509,9 +5197,12 @@ main (int argc, char **argv)
+@@ -4509,9 +5199,12 @@ main (int argc, char **argv)
quote (optarg));
}
}
@@ -3453,6 +3453,33 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c
}
break;
+@@ -4681,10 +5374,10 @@ main (int argc, char **argv)
+
+ if (nfiles == 0)
+ {
+- static char *minus = (char *) "-";
+ nfiles = 1;
+ free (files);
+- files = −
++ files = xmalloc (sizeof *files);
++ *files = (char *) "-";
+ }
+
+ /* Need to re-check that we meet the minimum requirement for memory
+@@ -4742,6 +5435,13 @@ main (int argc, char **argv)
+ sort (files, nfiles, outfile, nthreads);
+ }
+
++#ifdef lint
++ if (files_from)
++ readtokens0_free (&tok);
++ else
++ free (files);
++#endif
++
+ if (have_read_stdin && fclose (stdin) == EOF)
+ die (_("close failed"), "-");
+
diff -urNp coreutils-8.24-orig/src/unexpand.c coreutils-8.24/src/unexpand.c
--- coreutils-8.24-orig/src/unexpand.c 2015-06-26 19:05:22.000000000 +0200
+++ coreutils-8.24/src/unexpand.c 2015-07-05 09:04:33.032546980 +0200
diff --git a/coreutils.spec b/coreutils.spec
index 5db34fe..20cdfe6 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.24
-Release: 3%{?dist}
+Release: 4%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -376,6 +376,9 @@ fi
%{_sbindir}/chroot
%changelog
+* Wed Sep 16 2015 Kamil Dudka - 8.24-4
+- fix memory leak in sort/I18N (patches written by Pádraig, #1259942)
+
* Sat Sep 12 2015 Ondrej Vasik 8.24-3
- fix one still existing occurance of non-full path in colorls.sh
From f0951fecacb45c1c922337164533bba10a1c0477 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?=
Date: Tue, 17 Nov 2015 23:58:22 +0000
Subject: [PATCH 013/256] clean stale parts of the spec file
---
coreutils.spec | 126 +++++-------------------------------------------
supported_utils | 102 +++++++++++++++++++++++++++++++++++++++
2 files changed, 113 insertions(+), 115 deletions(-)
create mode 100644 supported_utils
diff --git a/coreutils.spec b/coreutils.spec
index 20cdfe6..b82655e 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -7,6 +7,7 @@ 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
Source101: coreutils-DIR_COLORS
Source102: coreutils-DIR_COLORS.lightbgcolor
Source103: coreutils-DIR_COLORS.256color
@@ -152,7 +153,7 @@ the old GNU fileutils, sh-utils, and textutils packages.
%patch950 -p1 -b .selinux
%patch951 -p1 -b .selinuxman
-chmod a+x tests/misc/sort-mb-tests.sh tests/df/direct.sh tests/cp/no-ctx.sh || :
+chmod a+x tests/misc/sort-mb-tests.sh tests/df/direct.sh || :
#fix typos/mistakes in localized documentation(#439410, #440056)
find ./po/ -name "*.p*" | xargs \
@@ -167,19 +168,16 @@ touch aclocal.m4 configure config.hin Makefile.in */Makefile.in
aclocal -I m4
autoconf --force
automake --copy --add-missing
-%configure --enable-largefile \
+%configure --enable-install-program=arch \
+ --enable-no-install-program=uptime \
--with-openssl \
- --enable-install-program=hostname,arch \
--with-tty-group \
DEFAULT_POSIX2_VERSION=200112 alternative=199209 || :
-# Regenerate manpages
-touch man/*.x
-
make all %{?_smp_mflags}
-# XXX docs should say /var/run/[uw]tmp not /etc/[uw]tmp
-sed -i -e 's,/etc/utmp,/var/run/utmp,g;s,/etc/wtmp,/var/run/wtmp,g' doc/coreutils.texi
+# Get the list of supported utilities
+cp %SOURCE50 .
%check
make check %{?_smp_mflags}
@@ -187,9 +185,6 @@ make check %{?_smp_mflags}
%install
make DESTDIR=$RPM_BUILD_ROOT install
-# man pages are not installed with make install
-make mandir=$RPM_BUILD_ROOT%{_mandir} install-man
-
# fix japanese catalog file
if [ -d $RPM_BUILD_ROOT%{_datadir}/locale/ja_JP.EUC/LC_MESSAGES ]; then
mkdir -p $RPM_BUILD_ROOT%{_datadir}/locale/ja/LC_MESSAGES
@@ -214,7 +209,10 @@ install -p -c -m644 %SOURCE105 $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/colorls.s
install -p -c -m644 %SOURCE106 $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/colorls.csh
# These come from util-linux and/or procps.
-for i in hostname uptime kill ; do
+# With coreutils > 8.24 one can just add to --enable-no-install-program
+# rather than manually removing here, since tests depending on
+# built utilities are correctly skipped if not present.
+for i in kill ; do
rm $RPM_BUILD_ROOT{%{_bindir}/$i,%{_mandir}/man1/$i.1}
done
@@ -262,118 +260,16 @@ if [ -f %{_infodir}/%{name}.info.gz ]; then
/sbin/install-info %{_infodir}/%{name}.info.gz %{_infodir}/dir || :
fi
-%files -f %{name}.lang
+%files -f %{name}.lang -f supported_utils
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/DIR_COLORS*
%config(noreplace) %{_sysconfdir}/profile.d/*
%doc ABOUT-NLS NEWS README THANKS TODO
%{!?_licensedir:%global license %%doc}
%license COPYING
-%{_bindir}/arch
-%{_bindir}/basename
-%{_bindir}/cat
-%{_bindir}/chgrp
-%{_bindir}/chmod
-%{_bindir}/chown
-%{_bindir}/cp
-%{_bindir}/cut
-%{_bindir}/date
-%{_bindir}/dd
-%{_bindir}/df
-%{_bindir}/echo
-%{_bindir}/env
-%{_bindir}/false
-%{_bindir}/link
-%{_bindir}/ln
-%{_bindir}/ls
-%{_bindir}/mkdir
-%{_bindir}/mknod
-%{_bindir}/mv
-%{_bindir}/nice
-%{_bindir}/pwd
-%{_bindir}/readlink
-%{_bindir}/rm
-%{_bindir}/rmdir
-%{_bindir}/sleep
-%{_bindir}/sort
-%{_bindir}/stty
-%{_bindir}/sync
-%{_bindir}/mktemp
-%{_bindir}/touch
-%{_bindir}/true
-%{_bindir}/uname
-%{_bindir}/unlink
-%{_bindir}/[
-%{_bindir}/base64
-%{_bindir}/chcon
-%{_bindir}/cksum
-%{_bindir}/comm
-%{_bindir}/csplit
-%{_bindir}/dir
-%{_bindir}/dircolors
-%{_bindir}/dirname
-%{_bindir}/du
-%{_bindir}/expand
-%{_bindir}/expr
-%{_bindir}/factor
-%{_bindir}/fmt
-%{_bindir}/fold
-%{_bindir}/groups
-%{_bindir}/head
-%{_bindir}/hostid
-%{_bindir}/id
-%{_bindir}/install
-%{_bindir}/join
-%{_bindir}/logname
-%{_bindir}/md5sum
-%{_bindir}/mkfifo
-%{_bindir}/nl
-%{_bindir}/nohup
-%{_bindir}/nproc
-%{_bindir}/numfmt
-%{_bindir}/od
-%{_bindir}/paste
-%{_bindir}/pathchk
-%{_bindir}/pinky
-%{_bindir}/pr
-%{_bindir}/printenv
-%{_bindir}/printf
-%{_bindir}/ptx
-%{_bindir}/realpath
-%{_bindir}/runcon
-%{_bindir}/seq
-%{_bindir}/sha1sum
-%{_bindir}/sha224sum
-%{_bindir}/sha256sum
-%{_bindir}/sha384sum
-%{_bindir}/sha512sum
-%{_bindir}/shred
-%{_bindir}/shuf
-%{_bindir}/split
-%{_bindir}/stat
-%{_bindir}/stdbuf
-%{_bindir}/sum
-%{_bindir}/tac
-%{_bindir}/tail
-%{_bindir}/tee
-%{_bindir}/test
-%{_bindir}/timeout
-%{_bindir}/tr
-%{_bindir}/truncate
-%{_bindir}/tsort
-%{_bindir}/tty
-%{_bindir}/unexpand
-%{_bindir}/uniq
-%{_bindir}/users
-%{_bindir}/vdir
-%{_bindir}/wc
-%{_bindir}/who
-%{_bindir}/whoami
-%{_bindir}/yes
%{_infodir}/coreutils*
%{_libexecdir}/coreutils*
%{_mandir}/man*/*
-%{_sbindir}/chroot
%changelog
* Wed Sep 16 2015 Kamil Dudka - 8.24-4
diff --git a/supported_utils b/supported_utils
new file mode 100644
index 0000000..124e14c
--- /dev/null
+++ b/supported_utils
@@ -0,0 +1,102 @@
+%{_bindir}/arch
+%{_bindir}/basename
+%{_bindir}/cat
+%{_bindir}/chgrp
+%{_bindir}/chmod
+%{_bindir}/chown
+%{_bindir}/cp
+%{_bindir}/cut
+%{_bindir}/date
+%{_bindir}/dd
+%{_bindir}/df
+%{_bindir}/echo
+%{_bindir}/env
+%{_bindir}/false
+%{_bindir}/link
+%{_bindir}/ln
+%{_bindir}/ls
+%{_bindir}/mkdir
+%{_bindir}/mknod
+%{_bindir}/mv
+%{_bindir}/nice
+%{_bindir}/pwd
+%{_bindir}/readlink
+%{_bindir}/rm
+%{_bindir}/rmdir
+%{_bindir}/sleep
+%{_bindir}/sort
+%{_bindir}/stty
+%{_bindir}/sync
+%{_bindir}/mktemp
+%{_bindir}/touch
+%{_bindir}/true
+%{_bindir}/uname
+%{_bindir}/unlink
+%{_bindir}/[
+%{_bindir}/base64
+%{_bindir}/chcon
+%{_bindir}/cksum
+%{_bindir}/comm
+%{_bindir}/csplit
+%{_bindir}/dir
+%{_bindir}/dircolors
+%{_bindir}/dirname
+%{_bindir}/du
+%{_bindir}/expand
+%{_bindir}/expr
+%{_bindir}/factor
+%{_bindir}/fmt
+%{_bindir}/fold
+%{_bindir}/groups
+%{_bindir}/head
+%{_bindir}/hostid
+%{_bindir}/id
+%{_bindir}/install
+%{_bindir}/join
+%{_bindir}/logname
+%{_bindir}/md5sum
+%{_bindir}/mkfifo
+%{_bindir}/nl
+%{_bindir}/nohup
+%{_bindir}/nproc
+%{_bindir}/numfmt
+%{_bindir}/od
+%{_bindir}/paste
+%{_bindir}/pathchk
+%{_bindir}/pinky
+%{_bindir}/pr
+%{_bindir}/printenv
+%{_bindir}/printf
+%{_bindir}/ptx
+%{_bindir}/realpath
+%{_bindir}/runcon
+%{_bindir}/seq
+%{_bindir}/sha1sum
+%{_bindir}/sha224sum
+%{_bindir}/sha256sum
+%{_bindir}/sha384sum
+%{_bindir}/sha512sum
+%{_bindir}/shred
+%{_bindir}/shuf
+%{_bindir}/split
+%{_bindir}/stat
+%{_bindir}/stdbuf
+%{_bindir}/sum
+%{_bindir}/tac
+%{_bindir}/tail
+%{_bindir}/tee
+%{_bindir}/test
+%{_bindir}/timeout
+%{_bindir}/tr
+%{_bindir}/truncate
+%{_bindir}/tsort
+%{_bindir}/tty
+%{_bindir}/unexpand
+%{_bindir}/uniq
+%{_bindir}/users
+%{_bindir}/vdir
+%{_bindir}/wc
+%{_bindir}/who
+%{_bindir}/whoami
+%{_bindir}/yes
+%{_sbindir}/chroot
From 5fb9bc4700bb2ae5e109805e3a0af8796c12904e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?=
Date: Thu, 19 Nov 2015 15:28:04 +0000
Subject: [PATCH 014/256] split package and provide coreutils-single
Notes about coreutils:
- Drops from 14.2MB to 5.5MB.
- Still requires coreutils-common, though being separated
allows for easier removal if required.
- Explicitly conflicts with coreutils-single to avoid errant installs
Notes about coreutils-single:
- Contains a single multicall binary which is 1.2MB
- Have to force install over any existing coreutils package
so best used for initial install without existing coreutils package
- Doesn't require (but suggests) coreutils-common
so install that manually for docs, translations, and colors etc.
Notes about coreutils-common:
- 8.7MB
- Having this split out gives an easy way to remove all
docs and translations.
Note RemovePathPostfixes: introduced with rpm 4.13
is used to facilitate producing the two sets of conflicting binaries
from the same build, while maintaining appropriate --fileprovide
in each generated rpm.
---
coreutils.spec | 108 ++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 89 insertions(+), 19 deletions(-)
diff --git a/coreutils.spec b/coreutils.spec
index b82655e..736b002 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.24
-Release: 4%{?dist}
+Release: 100%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -55,6 +55,8 @@ Patch950: coreutils-selinux.patch
Patch951: coreutils-selinuxmanpages.patch
Conflicts: filesystem < 3
+# To avoid clobbering installs during %post
+Conflicts: coreutils-single
Provides: /bin/basename
Provides: /bin/cat
Provides: /bin/chgrp
@@ -100,6 +102,7 @@ BuildRequires: gmp-devel
BuildRequires: attr
BuildRequires: strace
+Requires: %{name}-common = %{version}-%{release}
Requires(pre): /sbin/install-info
Requires(preun): /sbin/install-info
Requires(post): /sbin/install-info
@@ -119,11 +122,36 @@ Obsoletes: fileutils <= 4.1.9
Obsoletes: sh-utils <= 2.0.12
Obsoletes: stat <= 3.3
Obsoletes: textutils <= 2.0.21
+Obsoletes: %{name} < 8.24-100
%description
These are the GNU core utilities. This package is the combination of
the old GNU fileutils, sh-utils, and textutils packages.
+%package single
+Summary: coreutils multicall binary
+Suggests: coreutils-common
+Provides: coreutils
+# To avoid clobbering installs during %post
+Conflicts: coreutils < 8.24-100
+# Note RPM doesn't support separate buildroots for %files
+# http://rpm.org/ticket/874 so use RemovePathPostfixes
+# (new in rpm 4.13) to support separate file sets.
+RemovePathPostfixes: .single
+%description single
+These are the GNU core utilities,
+packaged as a single multicall binary.
+
+
+%package common
+# yum obsoleting rules explained at:
+# https://bugzilla.redhat.com/show_bug.cgi?id=1107973#c7
+Obsoletes: %{name} < 8.24-100
+Summary: coreutils common optional components
+%description common
+Optional though recommended components,
+including documentation and translations.
+
%prep
%setup -q
@@ -168,22 +196,53 @@ touch aclocal.m4 configure config.hin Makefile.in */Makefile.in
aclocal -I m4
autoconf --force
automake --copy --add-missing
-%configure --enable-install-program=arch \
- --enable-no-install-program=uptime \
- --with-openssl \
- --with-tty-group \
- DEFAULT_POSIX2_VERSION=200112 alternative=199209 || :
-
-make all %{?_smp_mflags}
+for type in separate single; do
+ mkdir $type && \
+ (cd $type && ln -s ../configure && \
+ test $type = 'single' && configure_single='--enable-single-binary'
+ %configure $configure_single \
+ --cache-file=../config.cache \
+ --enable-install-program=arch \
+ --enable-no-install-program=uptime \
+ --with-openssl \
+ --with-tty-group \
+ DEFAULT_POSIX2_VERSION=200112 alternative=199209 || :
+ mkdir src # not needed with coreutils > 8.24
+ make all %{?_smp_mflags})
+done
# Get the list of supported utilities
cp %SOURCE50 .
%check
-make check %{?_smp_mflags}
+for type in separate single; do
+ test $type = 'single' && subdirs='SUBDIRS=.' # Only check gnulib once
+ (cd $type && make check %{?_smp_mflags} $subdirs)
+done
%install
-make DESTDIR=$RPM_BUILD_ROOT install
+for type in separate single; do
+ install=install
+ if test $type = 'single'; then
+ subdir=%{_libexecdir}/%{name}; install=install-exec
+ fi
+ (cd $type && make DESTDIR=$RPM_BUILD_ROOT/$subdir $install)
+
+ # chroot was in /usr/sbin :
+ mkdir -p $RPM_BUILD_ROOT/$subdir/{%{_bindir},%{_sbindir}}
+ mv $RPM_BUILD_ROOT/$subdir/{%_bindir,%_sbindir}/chroot
+
+ # Move multicall variants to *.single.
+ # RemovePathPostfixes will strip that later.
+ if test $type = 'single'; then
+ for dir in %{_bindir} %{_sbindir} %{_libexecdir}/%{name}; do
+ for bin in $RPM_BUILD_ROOT/%{_libexecdir}/%{name}/$dir/*; do
+ basebin=$(basename $bin)
+ mv $bin $RPM_BUILD_ROOT/$dir/$basebin.single
+ done
+ done
+ fi
+done
# fix japanese catalog file
if [ -d $RPM_BUILD_ROOT%{_datadir}/locale/ja_JP.EUC/LC_MESSAGES ]; then
@@ -195,12 +254,6 @@ fi
bzip2 -9f ChangeLog
-# let be compatible with old fileutils, sh-utils and textutils packages :
-mkdir -p $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}
-
-# chroot was in /usr/sbin :
-mv $RPM_BUILD_ROOT{%_bindir,%_sbindir}/chroot
-
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
install -p -c -m644 %SOURCE101 $RPM_BUILD_ROOT%{_sysconfdir}/DIR_COLORS
install -p -c -m644 %SOURCE102 $RPM_BUILD_ROOT%{_sysconfdir}/DIR_COLORS.lightbgcolor
@@ -213,7 +266,8 @@ install -p -c -m644 %SOURCE106 $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/colorls.c
# rather than manually removing here, since tests depending on
# built utilities are correctly skipped if not present.
for i in kill ; do
- rm $RPM_BUILD_ROOT{%{_bindir}/$i,%{_mandir}/man1/$i.1}
+ rm -f $RPM_BUILD_ROOT{%{_bindir}/$i,%{_mandir}/man1/$i.1}
+ rm -f $RPM_BUILD_ROOT/%{_libexecdir}/%{name}/{%{_bindir}/$i,%{_mandir}/man1/$i.1}
done
# Compress ChangeLogs from before the fileutils/textutils/etc merge
@@ -260,18 +314,34 @@ if [ -f %{_infodir}/%{name}.info.gz ]; then
/sbin/install-info %{_infodir}/%{name}.info.gz %{_infodir}/dir || :
fi
-%files -f %{name}.lang -f supported_utils
+%files -f supported_utils
+%defattr(-,root,root,-)
+%exclude %{_bindir}/*.single
+%{_libexecdir}/coreutils/*.so
+
+%files single
+%defattr(-,root,root,-)
+%{_bindir}/*.single
+%{_sbindir}/chroot.single
+%{_libexecdir}/coreutils/*.so.single
+
+%files common -f %{name}.lang
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/DIR_COLORS*
%config(noreplace) %{_sysconfdir}/profile.d/*
+%{_infodir}/coreutils*
+%{_mandir}/man*/*
+# The following go to /usr/share/doc/coreutils-common
%doc ABOUT-NLS NEWS README THANKS TODO
%{!?_licensedir:%global license %%doc}
%license COPYING
%{_infodir}/coreutils*
-%{_libexecdir}/coreutils*
%{_mandir}/man*/*
%changelog
+* Wed Nov 18 2015 Pádraig Brady - 8.24-100
+- Split package to more easily support smaller installs
+
* Wed Sep 16 2015 Kamil Dudka - 8.24-4
- fix memory leak in sort/I18N (patches written by Pádraig, #1259942)
From 5dc61e9dc17d78652156dbcd688994518a1fd505 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?=
Date: Tue, 24 Nov 2015 01:43:34 +0000
Subject: [PATCH 015/256] maint: update stale comments
The comments re %post processing were for a non commited change
that created symlinks during %post that clobbered any existing binaries.
Now all files are directly managed by rpm.
---
coreutils.spec | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/coreutils.spec b/coreutils.spec
index 736b002..4cf459c 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -55,7 +55,7 @@ Patch950: coreutils-selinux.patch
Patch951: coreutils-selinuxmanpages.patch
Conflicts: filesystem < 3
-# To avoid clobbering installs during %post
+# To avoid clobbering installs
Conflicts: coreutils-single
Provides: /bin/basename
Provides: /bin/cat
@@ -132,7 +132,7 @@ the old GNU fileutils, sh-utils, and textutils packages.
Summary: coreutils multicall binary
Suggests: coreutils-common
Provides: coreutils
-# To avoid clobbering installs during %post
+# To avoid clobbering installs
Conflicts: coreutils < 8.24-100
# Note RPM doesn't support separate buildroots for %files
# http://rpm.org/ticket/874 so use RemovePathPostfixes
From 49c29b40693909ed9a7b158d7863c9a4d0070be5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?=
Date: Mon, 30 Nov 2015 14:32:27 +0100
Subject: [PATCH 016/256] Resolves:#1286338 - coreutils-single should provide
versioned coreutils
---
coreutils.spec | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/coreutils.spec b/coreutils.spec
index 736b002..75ed0d7 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.24
-Release: 100%{?dist}
+Release: 101%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -131,7 +131,7 @@ the old GNU fileutils, sh-utils, and textutils packages.
%package single
Summary: coreutils multicall binary
Suggests: coreutils-common
-Provides: coreutils
+Provides: coreutils = %{version}-%{release}
# To avoid clobbering installs during %post
Conflicts: coreutils < 8.24-100
# Note RPM doesn't support separate buildroots for %files
@@ -339,6 +339,9 @@ fi
%{_mandir}/man*/*
%changelog
+* Mon Nov 30 2015 Ondrej Vasik - 8.24-101
+- coreutils-single should provide versioned coreutils (#1286338)
+
* Wed Nov 18 2015 Pádraig Brady - 8.24-100
- Split package to more easily support smaller installs
From 32b1e5a1542885941508ab440e3cabe0cdb36a1d Mon Sep 17 00:00:00 2001
From: Ondrej Oprala
Date: Tue, 1 Dec 2015 09:40:25 +0100
Subject: [PATCH 017/256] Use the new i18n implementation for expand/unexpand
---
coreutils-i18n-expand-unexpand.patch | 1452 ++++++++++++++++++++++++++
coreutils-i18n.patch | 453 --------
coreutils.spec | 8 +-
3 files changed, 1459 insertions(+), 454 deletions(-)
create mode 100644 coreutils-i18n-expand-unexpand.patch
diff --git a/coreutils-i18n-expand-unexpand.patch b/coreutils-i18n-expand-unexpand.patch
new file mode 100644
index 0000000..63813f9
--- /dev/null
+++ b/coreutils-i18n-expand-unexpand.patch
@@ -0,0 +1,1452 @@
+From 332e9adf944e4ea232a855b1bf75ea4ddfd7e794 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
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+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.
+* tests/{expand,unexpand}/mb.sh: New tests.
+
+Co-authored-by: Pádraig Brady
+---
+ NEWS | 3 +
+ bootstrap.conf | 1 +
+ configure.ac | 2 +
+ po/POTFILES.in | 1 +
+ src/expand-core.c | 150 +++++++++++++++++++++++++++++++++++++++
+ src/expand-core.h | 44 ++++++++++++
+ src/expand.c | 183 ++++++++++-------------------------------------
+ src/local.mk | 2 +
+ src/unexpand.c | 197 ++++++++++++---------------------------------------
+ tests/expand/mb.sh | 98 +++++++++++++++++++++++++
+ tests/local.mk | 2 +
+ tests/unexpand/mb.sh | 97 +++++++++++++++++++++++++
+ 12 files changed, 482 insertions(+), 298 deletions(-)
+ 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
+--- a/bootstrap.conf
++++ b/bootstrap.conf
+@@ -152,6 +152,7 @@ gnulib_modules="
+ maintainer-makefile
+ malloc-gnu
+ manywarnings
++ mbfile
+ mbrlen
+ mbrtowc
+ mbsalign
+diff --git a/configure.ac b/configure.ac
+index 8dc2192..b8b5114 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -422,6 +422,8 @@ gl_WINSIZE_IN_PTEM
+ # I'm leaving it here for now. This whole thing needs to be modernized...
+ gl_WINSIZE_IN_PTEM
+
++gl_MBFILE
++
+ 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
+new file mode 100644
+index 0000000..c8445db
+--- /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.
++
++ 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 . */
++
++#include
++
++#include
++#include
++
++#include "system.h"
++#include "error.h"
++#include "fadvise.h"
++#include "quote.h"
++#include "xstrndup.h"
++
++#include "expand-core.h"
++
++/* Add the comma or blank separated list of tab stops STOPS
++ to the list of tab stops. */
++
++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;
++
++ 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. */
++
++extern 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. */
++
++extern FILE *
++next_file (FILE *fp)
++{
++ static char *prev_file;
++ char *file;
++
++ if (fp)
++ {
++ 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)
++ {
++ error (0, errno, "%s", 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", 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.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see . */
++
++#ifndef EXPAND_CORE_H_
++# define EXPAND_CORE_H_
++
++extern size_t first_free_tab;
++
++extern size_t n_tabs_allocated;
++
++extern uintmax_t *tab_list;
++
++extern int exit_status;
++
++extern char **file_list;
++
++extern bool have_read_stdin;
++
++void
++parse_tab_stops (char const *stops, void (*add_tab_stop)(uintmax_t));
++
++void
++validate_tab_stops (uintmax_t const *tabs, size_t entries);
++
++FILE *
++next_file (FILE *fp);
++
++#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
++
++#include
++
+ #include "system.h"
+ #include "error.h"
+ #include "fadvise.h"
+-#include "quote.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::";
+
+@@ -125,128 +129,6 @@
+ if (first_free_tab == n_tabs_allocated)
+ tab_list = X2NREALLOC (tab_list, &n_tabs_allocated);
+ 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", prev_file);
+- exit_status = EXIT_FAILURE;
+- }
+- if (STREQ (prev_file, "-"))
+- clearerr (fp); /* Also clear EOF. */
+- else if (fclose (fp) != 0)
+- {
+- error (0, errno, "%s", 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", file);
+- exit_status = EXIT_FAILURE;
+- }
+- return NULL;
+ }
+
+ /* Change tabs to spaces, writing to stdout.
+@@ -265,19 +146,19 @@ expand (void)
+ {
+ /* Input stream. */
+ FILE *fp = next_file (NULL);
++ mb_file_t mbf;
++ mbf_char_t c;
+
+ if (!fp)
+ return;
+
++ mbf_init (mbf, fp);
++
+ while (true)
+ {
+- /* Input character, or EOF. */
+- int c;
+-
+ /* If true, perform translations. */
+ bool convert = true;
+
+-
+ /* The following variables have valid values only when CONVERT
+ is true: */
+
+@@ -287,17 +168,23 @@ expand (void)
+ /* Index in TAB_LIST of next tab stop to examine. */
+ size_t tab_index = 0;
+
+-
+ /* Convert a line of text. */
+
+ do
+ {
+- while ((c = getc (fp)) < 0 && (fp = next_file (fp)))
+- continue;
++ do {
++ mbf_getc (c, mbf);
++ if (mb_iseof (c))
++ {
++ mbf_init (mbf, fp = next_file (fp));
++ continue;
++ }
++ }
++ while (false);
+
+ if (convert)
+ {
+- if (c == '\t')
++ if (mb_iseq (c, '\t'))
+ {
+ /* Column the next input tab stop is on. */
+ uintmax_t next_tab_column;
+@@ -328,32 +215,34 @@ expand (void)
+ if (putchar (' ') < 0)
+ error (EXIT_FAILURE, errno, _("write error"));
+
+- c = ' ';
++ mb_setascii (&c, ' ');
+ }
+- else if (c == '\b')
++ else if (mb_iseq (c, '\b'))
+ {
+ /* Go back one column, and force recalculation of the
+ next tab stop. */
+ column -= !!column;
+ tab_index -= !!tab_index;
+ }
+- else
++ /* A leading control character could make us trip over. */
++ else if (!mb_iscntrl (c))
+ {
+- column++;
++ column += mb_width (c);
+ if (!column)
+ error (EXIT_FAILURE, 0, _("input line is too long"));
+ }
+
+- convert &= convert_entire_line || !! isblank (c);
++ convert &= convert_entire_line || mb_isblank (c);
+ }
+
+- if (c < 0)
++ if (mb_iseof (c))
+ return;
+
+- if (putchar (c) < 0)
++ mb_putc (c, stdout);
++ if (ferror (stdout))
+ error (EXIT_FAILURE, errno, _("write error"));
+ }
+- while (c != '\n');
++ while (!mb_iseq (c, '\n'));
+ }
+ }
+
+@@ -385,19 +274,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
+@@ -362,6 +362,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
+--- a/src/unexpand.c
++++ b/src/unexpand.c
+@@ -38,12 +38,16 @@
+ #include
+ #include
+ #include
++
++#include
++
+ #include "system.h"
+ #include "error.h"
+ #include "fadvise.h"
+-#include "quote.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 +156,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", prev_file);
+- exit_status = EXIT_FAILURE;
+- }
+- if (STREQ (prev_file, "-"))
+- clearerr (fp); /* Also clear EOF. */
+- else if (fclose (fp) != 0)
+- {
+- error (0, errno, "%s", 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", file);
+- exit_status = EXIT_FAILURE;
+- }
+- return NULL;
+-}
+-
+ /* Change blanks to tabs, writing to stdout.
+ Read each file in 'file_list', in order. */
+
+@@ -284,11 +164,12 @@ unexpand (void)
+ {
+ /* Input stream. */
+ FILE *fp = next_file (NULL);
++ mb_file_t mbf;
+
+ /* The array of pending blanks. In non-POSIX locales, blanks can
+ include characters other than spaces, so the blanks must be
+ stored, not merely counted. */
+- char *pending_blank;
++ mbf_char_t *pending_blank;
+
+ if (!fp)
+ return;
+@@ -296,12 +177,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. */
+- pending_blank = xmalloc (max_column_width);
++ pending_blank = xmalloc (max_column_width * sizeof (mbf_char_t));
++
++ mbf_init (mbf, fp);
+
+ while (true)
+ {
+ /* Input character, or EOF. */
+- int c;
++ mbf_char_t c;
+
+ /* If true, perform translations. */
+ bool convert = true;
+@@ -335,12 +218,19 @@ unexpand (void)
+
+ do
+ {
+- while ((c = getc (fp)) < 0 && (fp = next_file (fp)))
+- continue;
++ do {
++ mbf_getc (c, mbf);
++ if (mb_iseof (c))
++ {
++ mbf_init (mbf, fp = next_file (fp));
++ continue;
++ }
++ }
++ while (false);
+
+ if (convert)
+ {
+- bool blank = !! isblank (c);
++ bool blank = mb_isblank (c);
+
+ if (blank)
+ {
+@@ -372,16 +262,16 @@ unexpand (void)
+ if (next_tab_column < column)
+ error (EXIT_FAILURE, 0, _("input line is too long"));
+
+- if (c == '\t')
++ if (mb_iseq (c, '\t'))
+ {
+ column = next_tab_column;
+
+ if (pending)
+- pending_blank[0] = '\t';
++ mb_setascii (&pending_blank[0], '\t');
+ }
+ else
+ {
+- column++;
++ column += mb_width (c);
+
+ if (! (prev_blank && column == next_tab_column))
+ {
+@@ -389,13 +279,14 @@ unexpand (void)
+ will be replaced by tabs. */
+ if (column == next_tab_column)
+ one_blank_before_tab_stop = true;
+- pending_blank[pending++] = c;
++ mb_copy (&pending_blank[pending++], &c);
+ prev_blank = true;
+ continue;
+ }
+
+ /* Replace the pending blanks by a tab or two. */
+- pending_blank[0] = c = '\t';
++ mb_setascii (&c, '\t');
++ mb_setascii (&pending_blank[0], '\t');
+ }
+
+ /* Discard pending blanks, unless it was a single
+@@ -403,7 +294,7 @@ unexpand (void)
+ pending = one_blank_before_tab_stop;
+ }
+ }
+- else if (c == '\b')
++ else if (mb_iseq (c, '\b'))
+ {
+ /* Go back one column, and force recalculation of the
+ next tab stop. */
+@@ -413,7 +304,7 @@ unexpand (void)
+ }
+ else
+ {
+- column++;
++ column += mb_width (c);
+ if (!column)
+ error (EXIT_FAILURE, 0, _("input line is too long"));
+ }
+@@ -421,9 +312,13 @@ unexpand (void)
+ if (pending)
+ {
+ if (pending > 1 && one_blank_before_tab_stop)
+- pending_blank[0] = '\t';
+- if (fwrite (pending_blank, 1, pending, stdout) != pending)
++ mb_setascii (&pending_blank[0], '\t');
++
++ for (int n = 0; n < pending; ++n)
++ mb_putc (pending_blank[n], stdout);
++ if (ferror (stdout))
+ error (EXIT_FAILURE, errno, _("write error"));
++
+ pending = 0;
+ one_blank_before_tab_stop = false;
+ }
+@@ -432,16 +327,16 @@ unexpand (void)
+ convert &= convert_entire_line || blank;
+ }
+
+- if (c < 0)
++ if (mb_iseof (c))
+ {
+ free (pending_blank);
+ return;
+ }
+-
+- if (putchar (c) < 0)
++ mb_putc (c, stdout);
++ if (ferror (stdout))
+ error (EXIT_FAILURE, errno, _("write error"));
+ }
+- while (c != '\n');
++ while (!mb_iseq (c, '\n'));
+ }
+ }
+
+@@ -482,7 +377,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
+--- /dev/null
++++ b/tests/expand/mb.sh
+@@ -0,0 +1,98 @@
++#!/bin/sh
++
++# Copyright (C) 2012-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 .
++
++. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
++print_ver_ expand
++
++export LC_ALL=en_US.UTF-8
++
++#input containing multibyte characters
++cat <<\EOF > in || framework_failure_
++1234567812345678123456781
++. . . .
++a b c d
++. . . .
++ä ö ü ß
++. . . .
++EOF
++env printf ' äöü\t. öüä. \tä xx\n' >> in || framework_failure_
++
++cat <<\EOF > exp || framework_failure_
++1234567812345678123456781
++. . . .
++a b c d
++. . . .
++ä ö ü ß
++. . . .
++ äöü . öüä. ä xx
++EOF
++
++expand < in > out || fail=1
++compare exp out > /dev/null 2>&1 || fail=1
++
++#test characters with display widths != 1
++env printf '12345678
++e\t|ascii(1)
++\u00E9\t|composed(1)
++e\u0301\t|decomposed(1)
++\u3000\t|ideo-space(2)
++\uFF0D\t|full-hypen(2)
++' > in || framework_failure_
++
++env printf '12345678
++e |ascii(1)
++\u00E9 |composed(1)
++e\u0301 |decomposed(1)
++\u3000 |ideo-space(2)
++\uFF0D |full-hypen(2)
++' > exp || framework_failure_
++
++expand < in > out || fail=1
++compare exp out > /dev/null 2>&1 || fail=1
++
++#shouldn't fail with "input line too long"
++#when a line starts with a control character
++env printf '\n' > in || framework_failure_
++
++expand < in > out || fail=1
++compare in out > /dev/null 2>&1 || fail=1
++
++#non-Unicode characters interspersed between Unicode ones
++env printf '12345678
++\t\xFF|
++\xFF\t|
++\t\xFFä|
++ä\xFF\t|
++\tä\xFF|
++\xFF\tä|
++äbcdef\xFF\t|
++' > in || framework_failure_
++
++env printf '12345678
++ \xFF|
++\xFF |
++ \xFFä|
++ä\xFF |
++ ä\xFF|
++\xFF ä|
++äbcdef\xFF |
++' > exp || framework_failure_
++
++expand < in > out || fail=1
++compare exp out > /dev/null 2>&1 || fail=1
++
++exit $fail
+diff --git a/tests/local.mk b/tests/local.mk
+index 7df04da..d3462be 100644
+--- a/tests/local.mk
++++ b/tests/local.mk
+@@ -532,6 +532,7 @@ all_tests = \
+ tests/du/threshold.sh \
+ tests/du/trailing-slash.sh \
+ tests/du/two-args.sh \
++ tests/expand/mb.sh \
+ tests/id/gnu-zero-uids.sh \
+ tests/id/no-context.sh \
+ tests/id/context.sh \
+@@ -671,6 +672,7 @@ all_tests = \
+ tests/touch/read-only.sh \
+ tests/touch/relative.sh \
+ tests/touch/trailing-slash.sh \
++ tests/unexpand/mb.sh \
+ $(all_root_tests)
+
+ # See tests/factor/create-test.sh.
+diff --git a/tests/unexpand/mb.sh b/tests/unexpand/mb.sh
+new file mode 100755
+index 0000000..60d4c1a
+--- /dev/null
++++ b/tests/unexpand/mb.sh
+@@ -0,0 +1,97 @@
++#!/bin/sh
++
++# Copyright (C) 2012-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 .
++
++. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
++print_ver_ unexpand
++
++export LC_ALL=en_US.UTF-8
++
++#input containing multibyte characters
++cat > in <<\EOF
++1234567812345678123456781
++. . . .
++a b c d
++. . . .
++ä ö ü ß
++. . . .
++ äöü . öüä. ä xx
++EOF
++
++cat > exp <<\EOF
++1234567812345678123456781
++. . . .
++a b c d
++. . . .
++ä ö ü ß
++. . . .
++ äöü . öüä. ä xx
++EOF
++
++unexpand -a < in > out || fail=1
++compare exp out > /dev/null 2>&1 || fail=1
++
++#test characters with a display width larger than 1
++
++env printf '12345678
++e |ascii(1)
++\u00E9 |composed(1)
++e\u0301 |decomposed(1)
++\u3000 |ideo-space(2)
++\uFF0D |full-hypen(2)
++' > in || framework_failure_
++
++env printf '12345678
++e\t|ascii(1)
++\u00E9\t|composed(1)
++e\u0301\t|decomposed(1)
++\u3000\t|ideo-space(2)
++\uFF0D\t|full-hypen(2)
++' > exp || framework_failure_
++
++unexpand -a < in > out || fail=1
++compare exp out > /dev/null 2>&1 || fail=1
++
++#test input where a blank of width > 1 is not being substituted
++in="$(LC_ALL=en_US.UTF-8 printf ' \u3000 ö ü ß')"
++exp=' ö ü ß'
++
++unexpand -a < in > out || fail=1
++compare exp out > /dev/null 2>&1 || fail=1
++
++#non-Unicode characters interspersed between Unicode ones
++env printf '12345678
++ \xFF|
++\xFF |
++ \xFFä|
++ä\xFF |
++ ä\xFF|
++\xFF ä|
++äbcdef\xFF |
++' > in || framework_failure_
++
++env printf '12345678
++\t\xFF|
++\xFF\t|
++\t\xFFä|
++ä\xFF\t|
++\tä\xFF|
++\xFF\tä|
++äbcdef\xFF\t|
++' > exp || framework_failure_
++
++unexpand -a < in > out || fail=1
++compare exp out > /dev/null 2>&1 || fail=1
+--
+2.4.3
+
+--- /dev/null 2015-11-30 08:40:17.566742513 +0100
++++ coreutils-8.24/m4/mbfile.m4 2015-12-01 09:30:55.951149907 +0100
+@@ -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])
++ :
++])
+--- /dev/null 2015-11-30 08:40:17.566742513 +0100
++++ coreutils-8.24/lib/mbfile.c 2015-12-01 09:28:22.254928468 +0100
+@@ -0,0 +1,3 @@
++#include
++#define MBFILE_INLINE _GL_EXTERN_INLINE
++#include "mbfile.h"
+--- /dev/null 2015-11-30 08:40:17.566742513 +0100
++++ coreutils-8.24/lib/mbfile.h 2015-12-01 09:28:30.829885570 +0100
+@@ -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 */
diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch
index f823a40..5d3a591 100644
--- a/coreutils-i18n.patch
+++ b/coreutils-i18n.patch
@@ -596,201 +596,6 @@ diff -urNp coreutils-8.24-orig/src/cut.c coreutils-8.24/src/cut.c
}
if (optind == argc)
-diff -urNp coreutils-8.24-orig/src/expand.c coreutils-8.24/src/expand.c
---- coreutils-8.24-orig/src/expand.c 2015-06-26 19:05:22.000000000 +0200
-+++ coreutils-8.24/src/expand.c 2015-07-05 09:04:33.028546950 +0200
-@@ -37,12 +37,34 @@
- #include
- #include
- #include
-+
-+/* Get mbstate_t, mbrtowc(), wcwidth(). */
-+#if HAVE_WCHAR_H
-+# include
-+#endif
-+
-+/* Get iswblank(). */
-+#if HAVE_WCTYPE_H
-+# include
-+#endif
-+
- #include "system.h"
- #include "error.h"
- #include "fadvise.h"
- #include "quote.h"
- #include "xstrndup.h"
-
-+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
-+ installation; work around this configuration error. */
-+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
-+# define MB_LEN_MAX 16
-+#endif
-+
-+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
-+#if HAVE_MBRTOWC && defined mbstate_t
-+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
-+#endif
-+
- /* The official name of this program (e.g., no 'g' prefix). */
- #define PROGRAM_NAME "expand"
-
-@@ -357,6 +379,142 @@ expand (void)
- }
- }
-
-+#if HAVE_MBRTOWC
-+static void
-+expand_multibyte (void)
-+{
-+ FILE *fp; /* Input strem. */
-+ mbstate_t i_state; /* Current shift state of the input stream. */
-+ mbstate_t i_state_bak; /* Back up the I_STATE. */
-+ mbstate_t o_state; /* Current shift state of the output stream. */
-+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
-+ char *bufpos = buf; /* Next read position of BUF. */
-+ size_t buflen = 0; /* The length of the byte sequence in buf. */
-+ wchar_t wc; /* A gotten wide character. */
-+ size_t mblength; /* The byte size of a multibyte character
-+ which shows as same character as WC. */
-+ int tab_index = 0; /* Index in `tab_list' of next tabstop. */
-+ int column = 0; /* Column on screen of the next char. */
-+ int next_tab_column; /* Column the next tab stop is on. */
-+ int convert = 1; /* If nonzero, perform translations. */
-+
-+ fp = next_file ((FILE *) NULL);
-+ if (fp == NULL)
-+ return;
-+
-+ memset (&o_state, '\0', sizeof(mbstate_t));
-+ memset (&i_state, '\0', sizeof(mbstate_t));
-+
-+ for (;;)
-+ {
-+ /* Refill the buffer BUF. */
-+ if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp))
-+ {
-+ memmove (buf, bufpos, buflen);
-+ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp);
-+ bufpos = buf;
-+ }
-+
-+ /* No character is left in BUF. */
-+ if (buflen < 1)
-+ {
-+ fp = next_file (fp);
-+
-+ if (fp == NULL)
-+ break; /* No more files. */
-+ else
-+ {
-+ memset (&i_state, '\0', sizeof(mbstate_t));
-+ continue;
-+ }
-+ }
-+
-+ /* Get a wide character. */
-+ i_state_bak = i_state;
-+ mblength = mbrtowc (&wc, bufpos, buflen, &i_state);
-+
-+ switch (mblength)
-+ {
-+ case (size_t)-1: /* illegal byte sequence. */
-+ case (size_t)-2:
-+ mblength = 1;
-+ i_state = i_state_bak;
-+ if (convert)
-+ {
-+ ++column;
-+ if (convert_entire_line == 0 && !isblank(*bufpos))
-+ convert = 0;
-+ }
-+ putchar (*bufpos);
-+ break;
-+
-+ case 0: /* null. */
-+ mblength = 1;
-+ if (convert && convert_entire_line == 0)
-+ convert = 0;
-+ putchar ('\0');
-+ break;
-+
-+ default:
-+ if (wc == L'\n') /* LF. */
-+ {
-+ tab_index = 0;
-+ column = 0;
-+ convert = 1;
-+ putchar ('\n');
-+ }
-+ else if (wc == L'\t' && convert) /* Tab. */
-+ {
-+ if (tab_size == 0)
-+ {
-+ /* Do not let tab_index == first_free_tab;
-+ stop when it is 1 less. */
-+ while (tab_index < first_free_tab - 1
-+ && column >= tab_list[tab_index])
-+ tab_index++;
-+ next_tab_column = tab_list[tab_index];
-+ if (tab_index < first_free_tab - 1)
-+ tab_index++;
-+ if (column >= next_tab_column)
-+ next_tab_column = column + 1;
-+ }
-+ else
-+ next_tab_column = column + tab_size - column % tab_size;
-+
-+ while (column < next_tab_column)
-+ {
-+ putchar (' ');
-+ ++column;
-+ }
-+ }
-+ else /* Others. */
-+ {
-+ if (convert)
-+ {
-+ if (wc == L'\b')
-+ {
-+ if (column > 0)
-+ --column;
-+ }
-+ else
-+ {
-+ int width; /* The width of WC. */
-+
-+ width = wcwidth (wc);
-+ column += (width > 0) ? width : 0;
-+ if (convert_entire_line == 0 && !iswblank(wc))
-+ convert = 0;
-+ }
-+ }
-+ fwrite (bufpos, sizeof(char), mblength, stdout);
-+ }
-+ }
-+ buflen -= mblength;
-+ bufpos += mblength;
-+ }
-+}
-+#endif
-+
- int
- main (int argc, char **argv)
- {
-@@ -421,7 +579,12 @@ main (int argc, char **argv)
-
- file_list = (optind < argc ? &argv[optind] : stdin_argv);
-
-- expand ();
-+#if HAVE_MBRTOWC
-+ if (MB_CUR_MAX > 1)
-+ expand_multibyte ();
-+ else
-+#endif
-+ expand ();
-
- if (have_read_stdin && fclose (stdin) != 0)
- error (EXIT_FAILURE, errno, "-");
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
@@ -3480,264 +3285,6 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c
if (have_read_stdin && fclose (stdin) == EOF)
die (_("close failed"), "-");
-diff -urNp coreutils-8.24-orig/src/unexpand.c coreutils-8.24/src/unexpand.c
---- coreutils-8.24-orig/src/unexpand.c 2015-06-26 19:05:22.000000000 +0200
-+++ coreutils-8.24/src/unexpand.c 2015-07-05 09:04:33.032546980 +0200
-@@ -38,12 +38,29 @@
- #include
- #include
- #include
-+
-+/* Get mbstate_t, mbrtowc(), wcwidth(). */
-+#if HAVE_WCHAR_H
-+# include
-+#endif
-+
- #include "system.h"
- #include "error.h"
- #include "fadvise.h"
- #include "quote.h"
- #include "xstrndup.h"
-
-+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
-+ installation; work around this configuration error. */
-+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
-+# define MB_LEN_MAX 16
-+#endif
-+
-+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
-+#if HAVE_MBRTOWC && defined mbstate_t
-+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
-+#endif
-+
- /* The official name of this program (e.g., no 'g' prefix). */
- #define PROGRAM_NAME "unexpand"
-
-@@ -103,6 +120,210 @@ static struct option const longopts[] =
- {NULL, 0, NULL, 0}
- };
-
-+static FILE *next_file (FILE *fp);
-+
-+#if HAVE_MBRTOWC
-+static void
-+unexpand_multibyte (void)
-+{
-+ FILE *fp; /* Input stream. */
-+ mbstate_t i_state; /* Current shift state of the input stream. */
-+ mbstate_t i_state_bak; /* Back up the I_STATE. */
-+ mbstate_t o_state; /* Current shift state of the output stream. */
-+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
-+ char *bufpos = buf; /* Next read position of BUF. */
-+ size_t buflen = 0; /* The length of the byte sequence in buf. */
-+ wint_t wc; /* A gotten wide character. */
-+ size_t mblength; /* The byte size of a multibyte character
-+ which shows as same character as WC. */
-+ bool prev_tab = false;
-+
-+ /* Index in `tab_list' of next tabstop: */
-+ int tab_index = 0; /* For calculating width of pending tabs. */
-+ int print_tab_index = 0; /* For printing as many tabs as possible. */
-+ unsigned int column = 0; /* Column on screen of next char. */
-+ int next_tab_column; /* Column the next tab stop is on. */
-+ int convert = 1; /* If nonzero, perform translations. */
-+ unsigned int pending = 0; /* Pending columns of blanks. */
-+
-+ fp = next_file ((FILE *) NULL);
-+ if (fp == NULL)
-+ return;
-+
-+ memset (&o_state, '\0', sizeof(mbstate_t));
-+ memset (&i_state, '\0', sizeof(mbstate_t));
-+
-+ for (;;)
-+ {
-+ if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp))
-+ {
-+ memmove (buf, bufpos, buflen);
-+ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp);
-+ bufpos = buf;
-+ }
-+
-+ /* Get a wide character. */
-+ if (buflen < 1)
-+ {
-+ mblength = 1;
-+ wc = WEOF;
-+ }
-+ else
-+ {
-+ i_state_bak = i_state;
-+ mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &i_state);
-+ }
-+
-+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
-+ {
-+ i_state = i_state_bak;
-+ wc = L'\0';
-+ }
-+
-+ if (wc == L' ' && convert && column < INT_MAX)
-+ {
-+ ++pending;
-+ ++column;
-+ }
-+ else if (wc == L'\t' && convert)
-+ {
-+ if (tab_size == 0)
-+ {
-+ /* Do not let tab_index == first_free_tab;
-+ stop when it is 1 less. */
-+ while (tab_index < first_free_tab - 1
-+ && column >= tab_list[tab_index])
-+ tab_index++;
-+ next_tab_column = tab_list[tab_index];
-+ if (tab_index < first_free_tab - 1)
-+ tab_index++;
-+ if (column >= next_tab_column)
-+ {
-+ convert = 0; /* Ran out of tab stops. */
-+ goto flush_pend_mb;
-+ }
-+ }
-+ else
-+ {
-+ next_tab_column = column + tab_size - column % tab_size;
-+ }
-+ pending += next_tab_column - column;
-+ column = next_tab_column;
-+ }
-+ else
-+ {
-+flush_pend_mb:
-+ /* Flush pending spaces. Print as many tabs as possible,
-+ then print the rest as spaces. */
-+ if (pending == 1 && column != 1 && !prev_tab)
-+ {
-+ putchar (' ');
-+ pending = 0;
-+ }
-+ column -= pending;
-+ while (pending > 0)
-+ {
-+ if (tab_size == 0)
-+ {
-+ /* Do not let print_tab_index == first_free_tab;
-+ stop when it is 1 less. */
-+ while (print_tab_index < first_free_tab - 1
-+ && column >= tab_list[print_tab_index])
-+ print_tab_index++;
-+ next_tab_column = tab_list[print_tab_index];
-+ if (print_tab_index < first_free_tab - 1)
-+ print_tab_index++;
-+ }
-+ else
-+ {
-+ next_tab_column =
-+ column + tab_size - column % tab_size;
-+ }
-+ if (next_tab_column - column <= pending)
-+ {
-+ putchar ('\t');
-+ pending -= next_tab_column - column;
-+ column = next_tab_column;
-+ }
-+ else
-+ {
-+ --print_tab_index;
-+ column += pending;
-+ while (pending != 0)
-+ {
-+ putchar (' ');
-+ pending--;
-+ }
-+ }
-+ }
-+
-+ if (wc == WEOF)
-+ {
-+ fp = next_file (fp);
-+ if (fp == NULL)
-+ break; /* No more files. */
-+ else
-+ {
-+ memset (&i_state, '\0', sizeof(mbstate_t));
-+ continue;
-+ }
-+ }
-+
-+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
-+ {
-+ if (convert)
-+ {
-+ ++column;
-+ if (convert_entire_line == 0)
-+ convert = 0;
-+ }
-+ mblength = 1;
-+ putchar (buf[0]);
-+ }
-+ else if (mblength == 0)
-+ {
-+ if (convert && convert_entire_line == 0)
-+ convert = 0;
-+ mblength = 1;
-+ putchar ('\0');
-+ }
-+ else
-+ {
-+ if (convert)
-+ {
-+ if (wc == L'\b')
-+ {
-+ if (column > 0)
-+ --column;
-+ }
-+ else
-+ {
-+ int width; /* The width of WC. */
-+
-+ width = wcwidth (wc);
-+ column += (width > 0) ? width : 0;
-+ if (convert_entire_line == 0)
-+ convert = 0;
-+ }
-+ }
-+
-+ if (wc == L'\n')
-+ {
-+ tab_index = print_tab_index = 0;
-+ column = pending = 0;
-+ convert = 1;
-+ }
-+ fwrite (bufpos, sizeof(char), mblength, stdout);
-+ }
-+ }
-+ prev_tab = wc == L'\t';
-+ buflen -= mblength;
-+ bufpos += mblength;
-+ }
-+}
-+#endif
-+
-+
- void
- usage (int status)
- {
-@@ -523,7 +744,12 @@ main (int argc, char **argv)
-
- file_list = (optind < argc ? &argv[optind] : stdin_argv);
-
-- unexpand ();
-+#if HAVE_MBRTOWC
-+ if (MB_CUR_MAX > 1)
-+ unexpand_multibyte ();
-+ else
-+#endif
-+ unexpand ();
-
- if (have_read_stdin && fclose (stdin) != 0)
- error (EXIT_FAILURE, errno, "-");
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
diff --git a/coreutils.spec b/coreutils.spec
index b0c13dc..d2d7c1c 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.24
-Release: 101%{?dist}
+Release: 102%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -41,6 +41,8 @@ Patch713: coreutils-4.5.3-langinfo.patch
# (sb) lin18nux/lsb compliance - multibyte functionality patch
Patch800: coreutils-i18n.patch
+# (sb) lin18nux/lsb compliance - expand/unexpand
+Patch801: coreutils-i18n-expand-unexpand.patch
#getgrouplist() patch from Ulrich Drepper.
Patch908: coreutils-getgrouplist.patch
@@ -171,6 +173,7 @@ including documentation and translations.
# li18nux/lsb
%patch800 -p1 -b .i18n
+%patch801 -p1 -b .i18n-expand
# Coreutils
%patch908 -p1 -b .getgrouplist
@@ -339,6 +342,9 @@ fi
%{_mandir}/man*/*
%changelog
+* Tue Dec 01 2015 Ondrej Oprala - 8.24-102
+- Use the new i18n implementation for expand/unexpand
+
* Mon Nov 30 2015 Ondrej Vasik - 8.24-101
- coreutils-single should provide versioned coreutils (#1286338)
From 1f6f388ba38890604388bd8c1b3eed3db159f0ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?=
Date: Thu, 3 Dec 2015 19:38:07 +0000
Subject: [PATCH 018/256] avoid warning about twice specified %files
---
coreutils.spec | 2 --
1 file changed, 2 deletions(-)
diff --git a/coreutils.spec b/coreutils.spec
index d2d7c1c..c852c0e 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -338,8 +338,6 @@ fi
%doc ABOUT-NLS NEWS README THANKS TODO
%{!?_licensedir:%global license %%doc}
%license COPYING
-%{_infodir}/coreutils*
-%{_mandir}/man*/*
%changelog
* Tue Dec 01 2015 Ondrej Oprala - 8.24-102
From 7f1720d9a27d5bffd9d74cb6dcffdcefd3a01cee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?=
Date: Thu, 3 Dec 2015 17:06:53 +0000
Subject: [PATCH 019/256] fix inclusion of /usr/bin/kill in coreutils-single
we need to remove /usr/bin/kill.single
---
coreutils.spec | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/coreutils.spec b/coreutils.spec
index c852c0e..626f42a 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.24
-Release: 102%{?dist}
+Release: 103%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -270,7 +270,7 @@ install -p -c -m644 %SOURCE106 $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/colorls.c
# built utilities are correctly skipped if not present.
for i in kill ; do
rm -f $RPM_BUILD_ROOT{%{_bindir}/$i,%{_mandir}/man1/$i.1}
- rm -f $RPM_BUILD_ROOT/%{_libexecdir}/%{name}/{%{_bindir}/$i,%{_mandir}/man1/$i.1}
+ rm -f $RPM_BUILD_ROOT%{_bindir}/$i.single
done
# Compress ChangeLogs from before the fileutils/textutils/etc merge
@@ -340,6 +340,9 @@ fi
%license COPYING
%changelog
+* Thu Dec 03 2015 Pádraig Brady - 8.24-103
+- Remove erroneous /usr/bin/kill from coreutils-single
+
* Tue Dec 01 2015 Ondrej Oprala - 8.24-102
- Use the new i18n implementation for expand/unexpand
From 63c57dca196ca34c10b9039f15085543f0dd1f7f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?=
Date: Thu, 3 Dec 2015 13:53:49 +0000
Subject: [PATCH 020/256] reduce dependencies for coreutils-single
Don't depend on libcrypto from the multicall binary in
the coreutils-single package, because that trades space for speed.
Don't depend on libgmp from the multicall binary in
the coreutils-single package, because that only benefits
factor and expr. The large size of gmp is not seen as
an appropriate tradeoff for this functionality.
Note also there is reduced startup overhead for all tools
with these removed due to not linking with the shared libs.
---
coreutils-find-requires.sh | 25 +++++++++++++++++++++++++
coreutils.spec | 25 +++++++++++++++++++------
2 files changed, 44 insertions(+), 6 deletions(-)
create mode 100755 coreutils-find-requires.sh
diff --git a/coreutils-find-requires.sh b/coreutils-find-requires.sh
new file mode 100755
index 0000000..27d1368
--- /dev/null
+++ b/coreutils-find-requires.sh
@@ -0,0 +1,25 @@
+#!/bin/sh -
+# Reduce requires for coreutils-single
+# Needed since it has overlapping "binaries" with the main package
+# Ideally we could do the following in the spec only for the single subpackage
+# %define __requires_exclude_from ^(%{_bindir}|%{_sbindir})/([^c]|c[^o]|co[^r]|cor[^e])
+
+original_find_requires="$1"
+shift
+
+# Get the list of files.
+files=`sed "s/['\"]/\\\&/g"`
+
+single_bin='/usr/bin/coreutils'
+
+single=`echo $files | grep "$single_bin"`
+
+echo $files | tr [:blank:] '\n' |
+if [ "$single" ]; then
+ # Only allow the coreutils multicall binary
+ # Also adjust for .single renaming
+ sed -n 's|\(.*'"$single_bin"'\)\(.single\)\?$|\1.single|p'
+else
+ cat
+fi |
+$original_find_requires
diff --git a/coreutils.spec b/coreutils.spec
index 626f42a..1cea379 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.24
-Release: 103%{?dist}
+Release: 104%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -14,6 +14,12 @@ Source103: coreutils-DIR_COLORS.256color
Source105: coreutils-colorls.sh
Source106: coreutils-colorls.csh
+# Provide our own custom requires for coreutils-single package
+Source10: coreutils-find-requires.sh
+%global _use_internal_dependency_generator 0
+%global __find_provides %{_rpmconfigdir}/find-provides
+%global __find_requires %{SOURCE10} %{_rpmconfigdir}/find-requires
+
# From upstream
# Our patches
@@ -110,7 +116,6 @@ Requires(preun): /sbin/install-info
Requires(post): /sbin/install-info
Requires(post): grep
Requires: ncurses
-Requires: gmp
Provides: fileutils = %{version}-%{release}
Provides: sh-utils = %{version}-%{release}
@@ -201,13 +206,18 @@ autoconf --force
automake --copy --add-missing
for type in separate single; do
mkdir $type && \
- (cd $type && ln -s ../configure && \
- test $type = 'single' && configure_single='--enable-single-binary'
- %configure $configure_single \
+ (cd $type && ln -s ../configure || exit 1
+ if test $type = 'single'; then
+ config_single='--enable-single-binary'
+ config_single="$config_single --without-openssl" # smaller/slower sha*sum
+ config_single="$config_single --without-gmp" # expr/factor machine ints
+ else
+ config_single='--with-openssl' # faster sha*sum
+ fi
+ %configure $config_single \
--cache-file=../config.cache \
--enable-install-program=arch \
--enable-no-install-program=uptime \
- --with-openssl \
--with-tty-group \
DEFAULT_POSIX2_VERSION=200112 alternative=199209 || :
mkdir src # not needed with coreutils > 8.24
@@ -340,6 +350,9 @@ fi
%license COPYING
%changelog
+* Thu Dec 03 2015 Pádraig Brady - 8.24-104
+- Avoid libgmp and libcrypto dependencies from coreutils-single
+
* Thu Dec 03 2015 Pádraig Brady - 8.24-103
- Remove erroneous /usr/bin/kill from coreutils-single
From c553cab787c2499ffaa36748a2de7c0e08fe31d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?=
Date: Mon, 14 Dec 2015 14:14:33 +0000
Subject: [PATCH 021/256] give explicit priority to coreutils over
coreutils-single
Make the main coreutils package Obsoletes: coreutils-single
so that it has priority in depsolving.
---
coreutils.spec | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/coreutils.spec b/coreutils.spec
index 1cea379..3d28fb6 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.24
-Release: 104%{?dist}
+Release: 105%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -65,6 +65,8 @@ Patch951: coreutils-selinuxmanpages.patch
Conflicts: filesystem < 3
# To avoid clobbering installs
Conflicts: coreutils-single
+# To give priority to this package
+Obsoletes: coreutils-single
Provides: /bin/basename
Provides: /bin/cat
Provides: /bin/chgrp
@@ -350,6 +352,9 @@ fi
%license COPYING
%changelog
+* Mon Dec 14 2015 Pádraig Brady - 8.24-105
+- Give explicit priority to coreutils over coreutils-single
+
* Thu Dec 03 2015 Pádraig Brady - 8.24-104
- Avoid libgmp and libcrypto dependencies from coreutils-single
From 452aa4a7e3909a3d96291afca08337d7a95d422b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?=
Date: Wed, 13 Jan 2016 12:30:46 +0100
Subject: [PATCH 022/256] mv: prevent dataloss when source dir is specified
multiple times (#1297464, by P.Brady)
---
coreutils-8.24-mv-duplicate-sources.patch | 119 ++++++++++++++++++++++
coreutils.spec | 14 ++-
2 files changed, 130 insertions(+), 3 deletions(-)
create mode 100644 coreutils-8.24-mv-duplicate-sources.patch
diff --git a/coreutils-8.24-mv-duplicate-sources.patch b/coreutils-8.24-mv-duplicate-sources.patch
new file mode 100644
index 0000000..f518cc6
--- /dev/null
+++ b/coreutils-8.24-mv-duplicate-sources.patch
@@ -0,0 +1,119 @@
+@@ -, +, @@
+ destination
+ mv dir dir dir
+---
+ src/copy.c | 12 +++++++----
+ tests/local.mk | 1 -
+ tests/mv/dup-source.sh | 46 +++++++++++++++++++++++++++++++++----------
+ 3 files changed, 44 insertions(+), 15 deletions(-)
+--- a/src/copy.c
++++ a/src/copy.c
+@@ -2278,10 +2278,14 @@ copy_internal (char const *src_name, char const *dst_name,
+ error (0, 0, _("warning: source directory %s "
+ "specified more than once"),
+ quote (top_level_src_name));
+- /* We only do backups in move mode and for non dirs,
+- and in move mode this won't be the issue as the source will
+- be missing for subsequent attempts.
+- There we just warn and return here. */
++ /* In move mode, if a previous rename succeeded, then
++ we won't be in this path as the source is missing. If the
++ rename previously failed, then that has been handled.
++ Pretend this instance succeeded so the source isn't removed. */
++ if (x->move_mode && rename_succeeded)
++ *rename_succeeded = true;
++ /* We only do backups in move mode, and for non directories.
++ So just ignore this repeated entry. */
+ return true;
+ }
+ else if (x->dereference == DEREF_ALWAYS
+--- a/tests/local.mk
++++ a/tests/local.mk
+@@ -443,7 +443,6 @@ all_tests = \
+ tests/cp/dir-rm-dest.sh \
+ tests/cp/dir-slash.sh \
+ tests/cp/dir-vs-file.sh \
+- tests/cp/duplicate-sources.sh \
+ tests/cp/existing-perm-dir.sh \
+ tests/cp/existing-perm-race.sh \
+ tests/cp/fail-perm.sh \
+--- a/tests/mv/dup-source.sh
++++ a/tests/mv/dup-source.sh
+@@ -24,25 +24,37 @@ print_ver_ cp mv
+
+ skip_if_root_
+
++reset_files() { rm -fr a b d; touch a; mkdir b d; }
++
+ for i in cp; do
+
+ # cp may not fail in this case.
+-
+- rm -fr a d; touch a; mkdir d
++ reset_files
+ $i a a d/ 2> out || fail=1
+- rm -fr a d; touch a; mkdir d
++ reset_files
+ $i ./a a d/ 2>> out || fail=1
+
++ # Similarly for directories, but handle
++ # source == dest appropriately.
++ reset_files
++ $i -a ./b b d/ 2>> out || fail=1
++ reset_files
++ returns_ 1 $i -a ./b b b/ 2>> out || fail=1
++
+ # cp succeeds with --backup=numbered.
+- rm -fr a d; touch a; mkdir d
++ reset_files
+ $i --backup=numbered a a d/ 2>> out || fail=1
+
+ # But not with plain '--backup'
+- rm -fr a d; touch a; mkdir d
+- $i --backup a a d/ 2>> out && fail=1
++ reset_files
++ returns_ 1 $i --backup a a d/ 2>> out || fail=1
++
+ cat < exp
+ $i: warning: source file 'a' specified more than once
+ $i: warning: source file 'a' specified more than once
++$i: warning: source directory 'b' specified more than once
++$i: cannot copy a directory, './b', into itself, 'b/b'
++$i: warning: source directory 'b' specified more than once
+ $i: will not overwrite just-created 'd/a' with 'a'
+ EOF
+ compare exp out || fail=1
+@@ -50,14 +62,28 @@ done
+
+ for i in mv; do
+ # But mv *does* fail in this case (it has to).
++ reset_files
++ returns_ 1 $i a a d/ 2> out || fail=1
++ returns_ 1 test -e a || fail=1
++ reset_files
++ returns_ 1 $i ./a a d/ 2>> out || fail=1
++ returns_ 1 test -e a || fail=1
++
++ # Similarly for directories, also handling
++ # source == dest appropriately.
++ reset_files
++ returns_ 1 $i ./b b d/ 2>> out || fail=1
++ returns_ 1 test -e b || fail=1
++ reset_files
++ returns_ 1 $i --verbose ./b b b/ 2>> out || fail=1
++ test -d b || fail=1
+
+- rm -fr a d; touch a; mkdir d
+- $i a a d/ 2> out && fail=1
+- rm -fr a d; touch a; mkdir d
+- $i ./a a d/ 2>> out && fail=1
+ cat < exp
+ $i: cannot stat 'a': No such file or directory
+ $i: cannot stat 'a': No such file or directory
++$i: cannot stat 'b': No such file or directory
++$i: cannot move './b' to a subdirectory of itself, 'b/b'
++$i: warning: source directory 'b' specified more than once
+ EOF
+ compare exp out || fail=1
+ done
+--
diff --git a/coreutils.spec b/coreutils.spec
index 3d28fb6..31cba83 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.24
-Release: 105%{?dist}
+Release: 106%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -20,7 +20,10 @@ Source10: coreutils-find-requires.sh
%global __find_provides %{_rpmconfigdir}/find-provides
%global __find_requires %{SOURCE10} %{_rpmconfigdir}/find-requires
-# From upstream
+# From upstream
+#mv: prevent dataloss when source directory is specified multiple t imes
+Patch1: coreutils-8.24-mv-duplicate-sources.patch
+
# Our patches
#general patch to workaround koji build system issues
@@ -186,12 +189,13 @@ including documentation and translations.
%patch908 -p1 -b .getgrouplist
%patch912 -p1 -b .overflow
%patch913 -p1 -b .testoff
+%patch1 -p1 -b .dupl
#SELinux
%patch950 -p1 -b .selinux
%patch951 -p1 -b .selinuxman
-chmod a+x tests/misc/sort-mb-tests.sh tests/df/direct.sh || :
+chmod a+x tests/misc/sort-mb-tests.sh tests/df/direct.sh tests/mv-dup-source.sh || :
#fix typos/mistakes in localized documentation(#439410, #440056)
find ./po/ -name "*.p*" | xargs \
@@ -352,6 +356,10 @@ fi
%license COPYING
%changelog
+* Wed Jan 13 2016 Ondrej Vasik - 8.24-106
+- mv: prevent dataloss when source dir is specified multiple
+ times (#1297464, by P.Brady)
+
* Mon Dec 14 2015 Pádraig Brady - 8.24-105
- Give explicit priority to coreutils over coreutils-single
From 01067b2813033d1ad183289a76007e8859659cda Mon Sep 17 00:00:00 2001
From: Ondrej Oprala
Date: Mon, 7 Dec 2015 09:59:13 +0100
Subject: [PATCH 023/256] Use the new i18n implementation for the cut utility
---
coreutils-i18n-cut.patch | 583 +++++++++++++++++++++++++++++++++++++++
coreutils-i18n.patch | 573 --------------------------------------
coreutils.spec | 8 +-
3 files changed, 590 insertions(+), 574 deletions(-)
create mode 100644 coreutils-i18n-cut.patch
diff --git a/coreutils-i18n-cut.patch b/coreutils-i18n-cut.patch
new file mode 100644
index 0000000..b300eac
--- /dev/null
+++ b/coreutils-i18n-cut.patch
@@ -0,0 +1,583 @@
+--- coreutils-8.24/src/cut.c 2015-06-26 19:05:22.000000000 +0200
++++ cut.c 2016-01-15 10:15:04.863804121 +0100
+@@ -28,6 +28,11 @@
+ #include
+ #include
+ #include
++
++#include
++#include
++#include
++
+ #include "system.h"
+
+ #include "error.h"
+@@ -90,25 +95,16 @@ add_range_pair (size_t lo, size_t hi)
+ ++n_rp;
+ }
+
+-/* This buffer is used to support the semantics of the -s option
+- (or lack of same) when the specified field list includes (does
+- not include) the first field. In both of those cases, the entire
+- first field must be read into this buffer to determine whether it
+- is followed by a delimiter or a newline before any of it may be
+- output. Otherwise, cut_fields can do the job without using this
+- buffer. */
+-static char *field_1_buffer;
+-
+-/* The number of bytes allocated for FIELD_1_BUFFER. */
+-static size_t field_1_bufsize;
+-
+ enum operating_mode
+ {
+ undefined_mode,
+
+- /* Output characters that are in the given bytes. */
++ /* Output the given bytes. */
+ byte_mode,
+
++ /* Output characters that are in the given positions . */
++ char_mode,
++
+ /* Output the given delimiter-separated fields. */
+ field_mode
+ };
+@@ -120,12 +116,16 @@ static enum operating_mode operating_mod
+ with field mode. */
+ static bool suppress_non_delimited;
+
++/* Unless true, we do not recognize multibyte characters in byte-splitting
++ mode. */
++static bool no_break_mb_chars;
++
+ /* If true, print all bytes, characters, or fields _except_
+ those that were specified. */
+ static bool complement;
+
+ /* The delimiter character for field mode. */
+-static unsigned char delim;
++static mbf_char_t delim;
+
+ /* True if the --output-delimiter=STRING option was specified. */
+ static bool output_delimiter_specified;
+@@ -135,7 +135,7 @@ static size_t output_delimiter_length;
+
+ /* The output field separator string. Defaults to the 1-character
+ string consisting of the input delimiter. */
+-static char *output_delimiter_string;
++static char const *output_delimiter_string;
+
+ /* True if we have ever read standard input. */
+ static bool have_read_stdin;
+@@ -189,7 +189,7 @@ Print selected parts of lines from each
+ -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\
+- -n (ignored)\n\
++ -n with -b, don't split multibyte characters\n\
+ "), stdout);
+ fputs (_("\
+ --complement complement the set of selected bytes, characters\n\
+@@ -435,6 +435,12 @@ next_item (size_t *item_idx)
+ current_rp++;
+ }
+
++static inline void
++next_item_n (size_t *item_idx, size_t n)
++{
++ while (n-- > 0)
++ next_item (item_idx);
++}
+ /* Return nonzero if the K'th field or byte is printable. */
+
+ static inline bool
+@@ -443,6 +449,15 @@ print_kth (size_t k)
+ return current_rp->lo <= k;
+ }
+
++/* The lo and hi params should be used for the current characters byte position
++ * and byte size, respectively. */
++static inline bool
++rp_intersect (size_t lo, size_t hi)
++{
++ return ((current_rp->lo <= lo && current_rp->hi >= lo)
++ || (current_rp->lo <= hi && current_rp->hi >= hi));
++}
++
+ /* Return nonzero if K'th byte is the beginning of a range. */
+
+ static inline bool
+@@ -505,23 +520,216 @@ cut_bytes (FILE *stream)
+ }
+
+ /* Read from stream STREAM, printing to standard output any selected fields. */
++extern ssize_t
++mb_getndelim2 (mbf_char_t **lineptr, size_t *linesize, size_t nmax,
++ mbf_char_t delim1, mbf_char_t delim2, mb_file_t *stream)
++{
++/* The maximum value that getndelim2 can return without suffering from
++ overflow problems, either internally (because of pointer
++ subtraction overflow) or due to the API (because of ssize_t). */
++#define GETNDELIM2_MAXIMUM (PTRDIFF_MAX < SSIZE_MAX ? PTRDIFF_MAX : SSIZE_MAX)
++
++/* Try to add at least this many bytes when extending the buffer.
++ MIN_CHUNK must be no greater than GETNDELIM2_MAXIMUM. */
++#define MIN_CHUNK 64
++ size_t nchars_avail; /* Allocated but unused chars in *LINEPTR. */
++ mbf_char_t *read_pos; /* Where we're reading into *LINEPTR. */
++ ssize_t chars_stored = -1;
++ mbf_char_t *ptr = *lineptr;
++ size_t size = *linesize;
++ bool found_delimiter;
++
++ if (!ptr)
++ {
++ size = nmax < MIN_CHUNK ? nmax : MIN_CHUNK;
++ ptr = malloc (size * sizeof (mbf_char_t));
++ if (!ptr)
++ return -1;
++ }
++
++ if (size < 0)
++ goto done;
++
++ nchars_avail = size;
++ read_pos = ptr;
++
++ if (nchars_avail == 0 && nmax <= size)
++ goto done;
++
++ /* Normalize delimiters, since memchr2 doesn't handle EOF. */
++ if (mb_iseof (delim1))
++ mb_copy (&delim1, &delim2);
++ else if (mb_iseof (delim2))
++ mb_copy (&delim2, &delim1);
++
++ flockfile (stream);
++
++ found_delimiter = false;
++ do
++ {
++ /* Here always ptr + size == read_pos + nchars_avail.
++ Also nchars_avail > 0 || size < nmax. */
++
++ mbf_char_t c IF_LINT (= 0);
++ {
++ mbf_getc (c, *stream);
++ if (mb_iseof (c))
++ {
++ /* Return partial line, if any. */
++ if (read_pos == ptr)
++ goto unlock_done;
++ else
++ break;
++ }
++ if (mb_equal (c, delim1) || mb_equal (c, delim2))
++ found_delimiter = true;
++ }
++
++ /* We always want at least one byte left in the buffer, since we
++ always (unless we get an error while reading the first byte)
++ NUL-terminate the line buffer. */
++
++ if (!nchars_avail)
++ {
++ /* Grow size proportionally, not linearly, to avoid O(n^2)
++ running time. */
++ size_t newsize = size < MIN_CHUNK ? size + MIN_CHUNK : 2 * size;
++ mbf_char_t *newptr;
++
++ /* Respect nmax. This handles possible integer overflow. */
++ if (! (size < newsize && newsize <= nmax))
++ newsize = nmax;
++
++ if (GETNDELIM2_MAXIMUM < newsize)
++ {
++ size_t newsizemax = GETNDELIM2_MAXIMUM + 1;
++ if (size == newsizemax)
++ goto unlock_done;
++ newsize = newsizemax;
++ }
++ nchars_avail = newsize - (read_pos - ptr);
++ newptr = realloc (ptr, newsize * sizeof (mbf_char_t));
++ if (!newptr)
++ goto unlock_done;
++ ptr = newptr;
++ size = newsize;
++ read_pos = size - nchars_avail + ptr;
++ }
++
++ /* Here, if size < nmax, nchars_avail >= buffer_len + 1.
++ If size == nmax, nchars_avail > 0. */
++
++ if (1 < nchars_avail)
++ {
++ mb_copy(read_pos++, &c);
++ --nchars_avail;
++ }
++
++ }
++ while (!found_delimiter);
++
++ chars_stored = (read_pos - ptr);
++
++ unlock_done:
++ funlockfile (stream);
++
++ done:
++ *lineptr = ptr;
++ *linesize = size;
++ return chars_stored;
++}
++
++static void
++cut_chars (FILE *stream)
++{
++ size_t char_idx; /* Number of chars in the line so far. */
++ bool print_delimiter;
++ mbf_char_t c;
++ mb_file_t mbf;
++
++ print_delimiter = false;
++ char_idx = 0;
++ current_rp = rp;
++
++ mbf_init (mbf, stream);
++ while (true)
++ {
++ mbf_getc (c, mbf);
++
++ if (mb_iseq (c, '\n'))
++ {
++ putc ('\n', stdout);
++ char_idx = 0;
++ print_delimiter = false;
++ current_rp = rp;
++ }
++ else if (mb_iseof (c))
++ {
++ if (char_idx > 0)
++ putc ('\n', stdout);
++ break;
++ }
++ else
++ {
++ /* Forward by one byte. */
++ next_item (&char_idx);
++
++ /* Check if the current characters byte range is within
++ * the argument list. */
++ if (rp_intersect (char_idx, char_idx + mb_len (c) - 1))
++ {
++ if (output_delimiter_specified)
++ {
++ if (print_delimiter && is_range_start_index (char_idx))
++ {
++ fwrite (output_delimiter_string, sizeof (char),
++ output_delimiter_length, stdout);
++ }
++ print_delimiter = true;
++ }
++ mb_putc (c, stdout);
++ }
++
++ /* Byte mode with multibyte characters uncut (-b -n). */
++ if (no_break_mb_chars)
++ /* Forward by an additional byte_length (c) - 1. */
++ next_item_n (&char_idx, mb_len (c) - 1);
++ }
++ }
++}
+
+ static void
+ cut_fields (FILE *stream)
+ {
+- int c;
++
++ /* This buffer is used to support the semantics of the -s option
++ (or lack of same) when the specified field list includes (does
++ not include) the first field. In both of those cases, the entire
++ first field must be read into this buffer to determine whether it
++ is followed by a delimiter or a newline before any of it may be
++ output. Otherwise, cut_fields can do the job without using this
++ buffer. */
++ mbf_char_t *field_1_buffer = 0;
++ /* The number of bytes allocated for FIELD_1_BUFFER. */
++ size_t field_1_bufsize;
++
++
++ mbf_char_t c, d;
++ mb_file_t mbf;
+ size_t field_idx = 1;
+ bool found_any_selected_field = false;
+ bool buffer_first_field;
+
+ current_rp = rp;
+
+- c = getc (stream);
+- if (c == EOF)
++ mbf_init (mbf, stream);
++ mbf_getc (c, mbf);
++ if (mb_iseof (c))
+ return;
+
+- ungetc (c, stream);
+- c = 0;
++ mbf_ungetc (c, mbf);
++ mb_setascii (&c, 0);
++ mb_copy (&d, &delim);
+
+ /* To support the semantics of the -s flag, we may have to buffer
+ all of the first field to determine whether it is 'delimited.'
+@@ -536,10 +744,14 @@ cut_fields (FILE *stream)
+ if (field_idx == 1 && buffer_first_field)
+ {
+ ssize_t len;
+- size_t n_bytes;
++ size_t n_chars;
++ mbf_char_t nl;
++ mb_setascii (&nl, '\n');
++
++ len = mb_getndelim2 (&field_1_buffer, &field_1_bufsize,
++ GETNLINE_NO_LIMIT, d, nl, &mbf);
++
+
+- len = getndelim2 (&field_1_buffer, &field_1_bufsize, 0,
+- GETNLINE_NO_LIMIT, delim, '\n', stream);
+ if (len < 0)
+ {
+ free (field_1_buffer);
+@@ -549,15 +761,15 @@ cut_fields (FILE *stream)
+ xalloc_die ();
+ }
+
+- n_bytes = len;
+- assert (n_bytes != 0);
++ n_chars = len;
++ //assert (n_chars != 0);
+
+- c = 0;
++ mb_setascii (&c, 0);
+
+ /* If the first field extends to the end of line (it is not
+ delimited) and we are printing all non-delimited lines,
+ print this one. */
+- if (to_uchar (field_1_buffer[n_bytes - 1]) != delim)
++ if (!mb_equal (field_1_buffer[n_chars - 1], d))
+ {
+ if (suppress_non_delimited)
+ {
+@@ -565,26 +777,30 @@ cut_fields (FILE *stream)
+ }
+ else
+ {
+- fwrite (field_1_buffer, sizeof (char), n_bytes, stdout);
++ for (int i = 0; i < n_chars; ++i)
++ mb_putc (field_1_buffer[i], stdout);
++
+ /* Make sure the output line is newline terminated. */
+- if (field_1_buffer[n_bytes - 1] != '\n')
++ if (!mb_iseq (field_1_buffer[n_chars - 1], '\n'))
+ putchar ('\n');
+- c = '\n';
++ mb_setascii (&c,'\n');
+ }
+ continue;
+ }
+ if (print_kth (1))
+ {
+ /* Print the field, but not the trailing delimiter. */
+- fwrite (field_1_buffer, sizeof (char), n_bytes - 1, stdout);
++ for (int i = 0; i < n_chars - 1; ++i)
++ mb_putc (field_1_buffer[i], stdout);
+
+ /* With -d$'\n' don't treat the last '\n' as a delimiter. */
+- if (delim == '\n')
++ if (mb_iseq (d, '\n'))
+ {
+- int last_c = getc (stream);
+- if (last_c != EOF)
++ mbf_char_t last_c;
++ mbf_getc (last_c, mbf);
++ if (!mb_iseof (last_c))
+ {
+- ungetc (last_c, stream);
++ mbf_ungetc (last_c, mbf);
+ found_any_selected_field = true;
+ }
+ }
+@@ -594,7 +810,8 @@ cut_fields (FILE *stream)
+ next_item (&field_idx);
+ }
+
+- int prev_c = c;
++ mbf_char_t prev_c;
++ mb_copy (&prev_c, &c);
+
+ if (print_kth (field_idx))
+ {
+@@ -605,41 +822,46 @@ cut_fields (FILE *stream)
+ }
+ found_any_selected_field = true;
+
+- while ((c = getc (stream)) != delim && c != '\n' && c != EOF)
++ mbf_getc (c, mbf);
++ while (!mb_equal (c, d) && !mb_iseq (c, '\n') && !mb_iseof (c))
+ {
+- putchar (c);
+- prev_c = c;
++ mb_putc (c, stdout);
++ mb_copy (&prev_c, &c);
++ mbf_getc (c, mbf);
+ }
+ }
+ else
+ {
+- while ((c = getc (stream)) != delim && c != '\n' && c != EOF)
++ mbf_getc (c, mbf);
++ while (!mb_equal (c, d) && !mb_iseq (c, '\n') && !mb_iseof (c))
+ {
+- prev_c = c;
++ mb_copy (&prev_c, &c);
++ mbf_getc (c, mbf);
+ }
+ }
+
+ /* With -d$'\n' don't treat the last '\n' as a delimiter. */
+- if (delim == '\n' && c == delim)
++ if (mb_iseq (d, '\n') && mb_equal (c, d))
+ {
+- int last_c = getc (stream);
+- if (last_c != EOF)
+- ungetc (last_c, stream);
++ mbf_char_t last_c;
++ mbf_getc (last_c, mbf);
++ if (!mb_iseof (last_c))
++ mbf_ungetc (last_c, mbf);
+ else
+- c = last_c;
++ mb_copy (&c, &last_c);
+ }
+
+- if (c == delim)
++ if (mb_equal (c, d))
+ next_item (&field_idx);
+- else if (c == '\n' || c == EOF)
++ else if (mb_iseq (c, '\n') || mb_iseof (c))
+ {
+ if (found_any_selected_field
+ || !(suppress_non_delimited && field_idx == 1))
+ {
+- if (c == '\n' || prev_c != '\n' || delim == '\n')
++ if (mb_iseq (c, '\n') || !mb_iseq (prev_c, '\n') || mb_iseq (d, '\n'))
+ putchar ('\n');
+ }
+- if (c == EOF)
++ if (mb_iseof (c))
+ break;
+ field_idx = 1;
+ current_rp = rp;
+@@ -652,7 +874,14 @@ static void
+ cut_stream (FILE *stream)
+ {
+ if (operating_mode == byte_mode)
+- cut_bytes (stream);
++ {
++ if (no_break_mb_chars)
++ cut_chars (stream);
++ else
++ cut_bytes (stream);
++ }
++ else if (operating_mode == char_mode)
++ cut_chars (stream);
+ else
+ cut_fields (stream);
+ }
+@@ -706,6 +935,7 @@ main (int argc, char **argv)
+ bool ok;
+ bool delim_specified = false;
+ char *spec_list_string IF_LINT ( = NULL);
++ mbi_iterator_t iter;
+
+ initialize_main (&argc, &argv);
+ set_program_name (argv[0]);
+@@ -719,8 +949,10 @@ main (int argc, char **argv)
+
+ /* By default, all non-delimited lines are printed. */
+ suppress_non_delimited = false;
++ /* Default behaviour for -b, unless -n is also specified. */
++ no_break_mb_chars = false;
+
+- delim = '\0';
++ mb_setascii (&delim, '\0');
+ have_read_stdin = false;
+
+ while ((optc = getopt_long (argc, argv, "b:c:d:f:ns", longopts, NULL)) != -1)
+@@ -728,7 +960,6 @@ main (int argc, char **argv)
+ switch (optc)
+ {
+ case 'b':
+- case 'c':
+ /* Build the byte list. */
+ if (operating_mode != undefined_mode)
+ FATAL_ERROR (_("only one type of list may be specified"));
+@@ -736,6 +967,14 @@ main (int argc, char **argv)
+ spec_list_string = optarg;
+ break;
+
++ case 'c':
++ /* Build the char list. */
++ if (operating_mode != undefined_mode)
++ FATAL_ERROR (_("only one type of list may be specified"));
++ operating_mode = char_mode;
++ spec_list_string = optarg;
++ break;
++
+ case 'f':
+ /* Build the field list. */
+ if (operating_mode != undefined_mode)
+@@ -747,9 +986,15 @@ main (int argc, char **argv)
+ case 'd':
+ /* New delimiter. */
+ /* Interpret -d '' to mean 'use the NUL byte as the delimiter.' */
+- if (optarg[0] != '\0' && optarg[1] != '\0')
++ mbi_init (iter, optarg, strlen (optarg));
++ if (!mbi_avail (iter))
++ mb_setascii (&delim, '\0');
++ else
++ mb_copy (&delim, &mbi_cur (iter));
++
++ mbi_advance (iter);
++ if (mbi_avail (iter))
+ FATAL_ERROR (_("the delimiter must be a single character"));
+- delim = optarg[0];
+ delim_specified = true;
+ break;
+
+@@ -763,6 +1008,7 @@ main (int argc, char **argv)
+ break;
+
+ case 'n':
++ no_break_mb_chars = true;
+ break;
+
+ case 's':
+@@ -802,15 +1048,12 @@ main (int argc, char **argv)
+ }
+
+ if (!delim_specified)
+- delim = '\t';
++ mb_setascii (&delim, '\t');
+
+ if (output_delimiter_string == NULL)
+ {
+- static char dummy[2];
+- dummy[0] = delim;
+- dummy[1] = '\0';
+- output_delimiter_string = dummy;
+- output_delimiter_length = 1;
++ output_delimiter_string = mb_ptr (delim);
++ output_delimiter_length = mb_len (delim);
+ }
+
+ if (optind == argc)
diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch
index 5d3a591..e876fe3 100644
--- a/coreutils-i18n.patch
+++ b/coreutils-i18n.patch
@@ -23,579 +23,6 @@ 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/cut.c coreutils-8.24/src/cut.c
---- coreutils-8.24-orig/src/cut.c 2015-06-26 19:05:22.000000000 +0200
-+++ coreutils-8.24/src/cut.c 2015-07-05 09:04:33.028546950 +0200
-@@ -28,6 +28,11 @@
- #include
- #include
- #include
-+
-+/* Get mbstate_t, mbrtowc(). */
-+#if HAVE_WCHAR_H
-+# include
-+#endif
- #include "system.h"
-
- #include "error.h"
-@@ -37,6 +42,18 @@
- #include "quote.h"
- #include "xstrndup.h"
-
-+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
-+ installation; work around this configuration error. */
-+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
-+# undef MB_LEN_MAX
-+# define MB_LEN_MAX 16
-+#endif
-+
-+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
-+#if HAVE_MBRTOWC && defined mbstate_t
-+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
-+#endif
-+
- /* The official name of this program (e.g., no 'g' prefix). */
- #define PROGRAM_NAME "cut"
-
-@@ -53,6 +70,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; \
-+ } \
-+ } \
-+ while (0)
-+
-+/* Get wide character on BUFPOS. BUFPOS is not included after that.
-+ If byte sequence is not valid as a character, CONVFAIL is true. Otherwise false. */
-+#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 = false; \
-+ state_bak = STATE; \
-+ MBLENGTH = mbrtowc ((wchar_t *)&WC, BUFPOS, BUFLEN, &STATE); \
-+ \
-+ switch (MBLENGTH) \
-+ { \
-+ case (size_t)-1: \
-+ case (size_t)-2: \
-+ CONVFAIL = true; \
-+ STATE = state_bak; \
-+ /* Fall througn. */ \
-+ \
-+ case 0: \
-+ MBLENGTH = 1; \
-+ break; \
-+ } \
-+ } \
-+ while (0)
-+
-
- struct range_pair
- {
-@@ -75,6 +138,8 @@ static size_t n_rp;
- /* Number of `struct range_pair's allocated. */
- static size_t n_rp_allocated;
-
-+/* Length of the delimiter given as argument to -d. */
-+size_t delimlen;
-
- /* Append LOW, HIGH to the list RP of range pairs, allocating additional
- space if necessary. Update global variable N_RP. When allocating,
-@@ -106,15 +171,25 @@ enum operating_mode
- {
- undefined_mode,
-
-- /* Output characters that are in the given bytes. */
-+ /* Output bytes that are at the given positions. */
- byte_mode,
-
-+ /* Output characters that are at the given positions. */
-+ character_mode,
-+
- /* Output the given delimiter-separated fields. */
- field_mode
- };
-
- static enum operating_mode operating_mode;
-
-+/* If nonzero, when in byte mode, don't split multibyte characters. */
-+static int byte_mode_character_aware;
-+
-+/* If nonzero, the function for single byte locale is work
-+ if this program runs on multibyte locale. */
-+static int force_singlebyte_mode;
-+
- /* If true do not output lines containing no delimiter characters.
- Otherwise, all such lines are printed. This option is valid only
- with field mode. */
-@@ -126,6 +201,9 @@ static bool complement;
-
- /* The delimiter character for field mode. */
- static unsigned char delim;
-+#if HAVE_WCHAR_H
-+static wchar_t wcdelim;
-+#endif
-
- /* True if the --output-delimiter=STRING option was specified. */
- static bool output_delimiter_specified;
-@@ -189,7 +267,7 @@ Print selected parts of lines from each
- -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\
-- -n (ignored)\n\
-+ -n with -b: don't split multibyte characters\n\
- "), stdout);
- fputs (_("\
- --complement complement the set of selected bytes, characters\n\
-@@ -380,6 +458,9 @@ set_fields (const char *fieldstr)
- if (operating_mode == byte_mode)
- error (0, 0,
- _("byte offset %s is too large"), quote (bad_num));
-+ else if (operating_mode == character_mode)
-+ error (0, 0,
-+ _("character offset %s is too large"), quote (bad_num));
- else
- error (0, 0,
- _("field number %s is too large"), quote (bad_num));
-@@ -504,6 +585,82 @@ cut_bytes (FILE *stream)
- }
- }
-
-+#if HAVE_MBRTOWC
-+/* This function is in use for the following case.
-+
-+ 1. Read from the stream STREAM, printing to standard output any selected
-+ characters.
-+
-+ 2. Read from stream STREAM, printing to standard output any selected bytes,
-+ without splitting multibyte characters. */
-+
-+static void
-+cut_characters_or_cut_bytes_no_split (FILE *stream)
-+{
-+ size_t idx; /* number of bytes or characters in the line so far. */
-+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
-+ char *bufpos; /* Next read position of BUF. */
-+ size_t buflen; /* The length of the byte sequence in buf. */
-+ wint_t wc; /* A gotten wide character. */
-+ size_t mblength; /* The byte size of a multibyte character which shows
-+ as same character as WC. */
-+ mbstate_t state; /* State of the stream. */
-+ bool convfail = false; /* true, when conversion failed. Otherwise false. */
-+ /* Whether to begin printing delimiters between ranges for the current line.
-+ Set after we've begun printing data corresponding to the first range. */
-+ bool print_delimiter = false;
-+
-+ idx = 0;
-+ buflen = 0;
-+ bufpos = buf;
-+ memset (&state, '\0', sizeof(mbstate_t));
-+
-+ current_rp = rp;
-+
-+ while (1)
-+ {
-+ REFILL_BUFFER (buf, bufpos, buflen, stream);
-+
-+ GET_NEXT_WC_FROM_BUFFER (wc, bufpos, buflen, mblength, state, convfail);
-+ (void) convfail; /* ignore unused */
-+
-+ if (wc == WEOF)
-+ {
-+ if (idx > 0)
-+ putchar ('\n');
-+ break;
-+ }
-+ else if (wc == L'\n')
-+ {
-+ putchar ('\n');
-+ idx = 0;
-+ print_delimiter = false;
-+ current_rp = rp;
-+ }
-+ else
-+ {
-+ next_item (&idx);
-+ if (print_kth (idx))
-+ {
-+ if (output_delimiter_specified)
-+ {
-+ if (print_delimiter && is_range_start_index (idx))
-+ {
-+ fwrite (output_delimiter_string, sizeof (char),
-+ output_delimiter_length, stdout);
-+ }
-+ print_delimiter = true;
-+ }
-+ fwrite (bufpos, mblength, sizeof(char), stdout);
-+ }
-+ }
-+
-+ buflen -= mblength;
-+ bufpos += mblength;
-+ }
-+}
-+#endif
-+
- /* Read from stream STREAM, printing to standard output any selected fields. */
-
- static void
-@@ -648,13 +805,211 @@ cut_fields (FILE *stream)
- }
- }
-
-+#if HAVE_MBRTOWC
-+static void
-+cut_fields_mb (FILE *stream)
-+{
-+ int c;
-+ size_t field_idx;
-+ int found_any_selected_field;
-+ int buffer_first_field;
-+ int empty_input;
-+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
-+ char *bufpos; /* Next read position of BUF. */
-+ size_t buflen; /* The length of the byte sequence in buf. */
-+ wint_t wc = 0; /* A gotten wide character. */
-+ size_t mblength; /* The byte size of a multibyte character which shows
-+ as same character as WC. */
-+ mbstate_t state; /* State of the stream. */
-+ bool convfail = false; /* true, when conversion failed. Otherwise false. */
-+
-+ current_rp = rp;
-+
-+ found_any_selected_field = 0;
-+ field_idx = 1;
-+ bufpos = buf;
-+ buflen = 0;
-+ memset (&state, '\0', sizeof(mbstate_t));
-+
-+ c = getc (stream);
-+ empty_input = (c == EOF);
-+ if (c != EOF)
-+ {
-+ ungetc (c, stream);
-+ wc = 0;
-+ }
-+ else
-+ wc = WEOF;
-+
-+ /* To support the semantics of the -s flag, we may have to buffer
-+ all of the first field to determine whether it is `delimited.'
-+ But that is unnecessary if all non-delimited lines must be printed
-+ and the first field has been selected, or if non-delimited lines
-+ must be suppressed and the first field has *not* been selected.
-+ That is because a non-delimited line has exactly one field. */
-+ buffer_first_field = (suppress_non_delimited ^ !print_kth (1));
-+
-+ while (1)
-+ {
-+ if (field_idx == 1 && buffer_first_field)
-+ {
-+ int len = 0;
-+
-+ while (1)
-+ {
-+ REFILL_BUFFER (buf, bufpos, buflen, stream);
-+
-+ GET_NEXT_WC_FROM_BUFFER
-+ (wc, bufpos, buflen, mblength, state, convfail);
-+
-+ if (wc == WEOF)
-+ break;
-+
-+ field_1_buffer = xrealloc (field_1_buffer, len + mblength);
-+ memcpy (field_1_buffer + len, bufpos, mblength);
-+ len += mblength;
-+ buflen -= mblength;
-+ bufpos += mblength;
-+
-+ if (!convfail && (wc == L'\n' || wc == wcdelim))
-+ break;
-+ }
-+
-+ if (len <= 0 && wc == WEOF)
-+ break;
-+
-+ /* If the first field extends to the end of line (it is not
-+ delimited) and we are printing all non-delimited lines,
-+ print this one. */
-+ if (convfail || (!convfail && wc != wcdelim))
-+ {
-+ if (suppress_non_delimited)
-+ {
-+ /* Empty. */
-+ }
-+ else
-+ {
-+ fwrite (field_1_buffer, sizeof (char), len, stdout);
-+ /* Make sure the output line is newline terminated. */
-+ if (convfail || (!convfail && wc != L'\n'))
-+ putchar ('\n');
-+ }
-+ continue;
-+ }
-+
-+ if (print_kth (1))
-+ {
-+ /* Print the field, but not the trailing delimiter. */
-+ fwrite (field_1_buffer, sizeof (char), len - 1, stdout);
-+ found_any_selected_field = 1;
-+ }
-+ next_item (&field_idx);
-+ }
-+
-+ if (wc != WEOF)
-+ {
-+ if (print_kth (field_idx))
-+ {
-+ if (found_any_selected_field)
-+ {
-+ fwrite (output_delimiter_string, sizeof (char),
-+ output_delimiter_length, stdout);
-+ }
-+ found_any_selected_field = 1;
-+ }
-+
-+ while (1)
-+ {
-+ REFILL_BUFFER (buf, bufpos, buflen, stream);
-+
-+ GET_NEXT_WC_FROM_BUFFER
-+ (wc, bufpos, buflen, mblength, state, convfail);
-+
-+ if (wc == WEOF)
-+ break;
-+ else if (!convfail && (wc == wcdelim || wc == L'\n'))
-+ {
-+ buflen -= mblength;
-+ bufpos += mblength;
-+ break;
-+ }
-+
-+ if (print_kth (field_idx))
-+ fwrite (bufpos, mblength, sizeof(char), stdout);
-+
-+ buflen -= mblength;
-+ bufpos += mblength;
-+ }
-+ }
-+
-+ if ((!convfail || wc == L'\n') && buflen < 1)
-+ wc = WEOF;
-+
-+ if (!convfail && wc == wcdelim)
-+ next_item (&field_idx);
-+ else if (wc == WEOF || (!convfail && wc == L'\n'))
-+ {
-+ if (found_any_selected_field
-+ || (!empty_input && !(suppress_non_delimited && field_idx == 1)))
-+ putchar ('\n');
-+ if (wc == WEOF)
-+ break;
-+ field_idx = 1;
-+ current_rp = rp;
-+ found_any_selected_field = 0;
-+ }
-+ }
-+}
-+#endif
-+
- static void
- cut_stream (FILE *stream)
- {
-- if (operating_mode == byte_mode)
-- cut_bytes (stream);
-+#if HAVE_MBRTOWC
-+ if (MB_CUR_MAX > 1 && !force_singlebyte_mode)
-+ {
-+ switch (operating_mode)
-+ {
-+ case byte_mode:
-+ if (byte_mode_character_aware)
-+ cut_characters_or_cut_bytes_no_split (stream);
-+ else
-+ cut_bytes (stream);
-+ break;
-+
-+ case character_mode:
-+ cut_characters_or_cut_bytes_no_split (stream);
-+ break;
-+
-+ case field_mode:
-+ if (delimlen == 1)
-+ {
-+ /* Check if we have utf8 multibyte locale, so we can use this
-+ optimization because of uniqueness of characters, which is
-+ not true for e.g. SJIS */
-+ char * loc = setlocale(LC_CTYPE, NULL);
-+ if (loc && (strstr (loc, "UTF-8") || strstr (loc, "utf-8") ||
-+ strstr (loc, "UTF8") || strstr (loc, "utf8")))
-+ {
-+ cut_fields (stream);
-+ break;
-+ }
-+ }
-+ cut_fields_mb (stream);
-+ break;
-+
-+ default:
-+ abort ();
-+ }
-+ }
- else
-- cut_fields (stream);
-+#endif
-+ {
-+ if (operating_mode == field_mode)
-+ cut_fields (stream);
-+ else
-+ cut_bytes (stream);
-+ }
- }
-
- /* Process file FILE to standard output.
-@@ -706,6 +1061,7 @@ main (int argc, char **argv)
- bool ok;
- bool delim_specified = false;
- char *spec_list_string IF_LINT ( = NULL);
-+ char mbdelim[MB_LEN_MAX + 1];
-
- initialize_main (&argc, &argv);
- set_program_name (argv[0]);
-@@ -728,7 +1084,6 @@ main (int argc, char **argv)
- switch (optc)
- {
- case 'b':
-- case 'c':
- /* Build the byte list. */
- if (operating_mode != undefined_mode)
- FATAL_ERROR (_("only one type of list may be specified"));
-@@ -736,6 +1091,14 @@ main (int argc, char **argv)
- spec_list_string = optarg;
- break;
-
-+ case 'c':
-+ /* Build the character list. */
-+ if (operating_mode != undefined_mode)
-+ FATAL_ERROR (_("only one type of list may be specified"));
-+ operating_mode = character_mode;
-+ spec_list_string = optarg;
-+ break;
-+
- case 'f':
- /* Build the field list. */
- if (operating_mode != undefined_mode)
-@@ -747,10 +1110,38 @@ main (int argc, char **argv)
- case 'd':
- /* New delimiter. */
- /* Interpret -d '' to mean 'use the NUL byte as the delimiter.' */
-- if (optarg[0] != '\0' && optarg[1] != '\0')
-- FATAL_ERROR (_("the delimiter must be a single character"));
-- delim = optarg[0];
-- delim_specified = true;
-+ {
-+#if HAVE_MBRTOWC
-+ if(MB_CUR_MAX > 1)
-+ {
-+ mbstate_t state;
-+
-+ memset (&state, '\0', sizeof(mbstate_t));
-+ delimlen = mbrtowc (&wcdelim, optarg, strnlen(optarg, MB_LEN_MAX), &state);
-+
-+ if (delimlen == (size_t)-1 || delimlen == (size_t)-2)
-+ ++force_singlebyte_mode;
-+ else
-+ {
-+ delimlen = (delimlen < 1) ? 1 : delimlen;
-+ if (wcdelim != L'\0' && *(optarg + delimlen) != '\0')
-+ FATAL_ERROR (_("the delimiter must be a single character"));
-+ memcpy (mbdelim, optarg, delimlen);
-+ mbdelim[delimlen] = '\0';
-+ if (delimlen == 1)
-+ delim = *optarg;
-+ }
-+ }
-+
-+ if (MB_CUR_MAX <= 1 || force_singlebyte_mode)
-+#endif
-+ {
-+ if (optarg[0] != '\0' && optarg[1] != '\0')
-+ FATAL_ERROR (_("the delimiter must be a single character"));
-+ delim = (unsigned char) optarg[0];
-+ }
-+ delim_specified = true;
-+ }
- break;
-
- case OUTPUT_DELIMITER_OPTION:
-@@ -763,6 +1154,7 @@ main (int argc, char **argv)
- break;
-
- case 'n':
-+ byte_mode_character_aware = 1;
- break;
-
- case 's':
-@@ -802,15 +1194,34 @@ main (int argc, char **argv)
- }
-
- if (!delim_specified)
-- delim = '\t';
-+ {
-+ delim = '\t';
-+#ifdef HAVE_MBRTOWC
-+ wcdelim = L'\t';
-+ mbdelim[0] = '\t';
-+ mbdelim[1] = '\0';
-+ delimlen = 1;
-+#endif
-+ }
-
- if (output_delimiter_string == NULL)
- {
-- static char dummy[2];
-- dummy[0] = delim;
-- dummy[1] = '\0';
-- output_delimiter_string = dummy;
-- output_delimiter_length = 1;
-+#ifdef HAVE_MBRTOWC
-+ if (MB_CUR_MAX > 1 && !force_singlebyte_mode)
-+ {
-+ output_delimiter_string = xstrdup(mbdelim);
-+ output_delimiter_length = delimlen;
-+ }
-+
-+ if (MB_CUR_MAX <= 1 || force_singlebyte_mode)
-+#endif
-+ {
-+ static char dummy[2];
-+ dummy[0] = delim;
-+ dummy[1] = '\0';
-+ output_delimiter_string = dummy;
-+ output_delimiter_length = 1;
-+ }
- }
-
- if (optind == argc)
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
diff --git a/coreutils.spec b/coreutils.spec
index 31cba83..a4c3ed1 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.24
-Release: 106%{?dist}
+Release: 107%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -52,6 +52,8 @@ Patch713: coreutils-4.5.3-langinfo.patch
Patch800: coreutils-i18n.patch
# (sb) lin18nux/lsb compliance - expand/unexpand
Patch801: coreutils-i18n-expand-unexpand.patch
+# (sb) lin18nux/lsb compliance - cut
+Patch802: coreutils-i18n-cut.patch
#getgrouplist() patch from Ulrich Drepper.
Patch908: coreutils-getgrouplist.patch
@@ -184,6 +186,7 @@ including documentation and translations.
# li18nux/lsb
%patch800 -p1 -b .i18n
%patch801 -p1 -b .i18n-expand
+%patch802 -p1 -b .i18n-cut
# Coreutils
%patch908 -p1 -b .getgrouplist
@@ -356,6 +359,9 @@ fi
%license COPYING
%changelog
+* Fri Jan 15 2016 Ondrej Oprala - 8.24-107
+- Use the new i18n implementation for the cut utility
+
* Wed Jan 13 2016 Ondrej Vasik - 8.24-106
- mv: prevent dataloss when source dir is specified multiple
times (#1297464, by P.Brady)
From 11e5aa1d55d932ecf9680e860a968b5652d25dbb Mon Sep 17 00:00:00 2001
From: Ondrej Oprala
Date: Fri, 15 Jan 2016 11:02:13 +0100
Subject: [PATCH 024/256] cut: be MB for ALL archs
---
coreutils-i18n-cut.patch | 10 ++++++----
coreutils.spec | 5 ++++-
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/coreutils-i18n-cut.patch b/coreutils-i18n-cut.patch
index b300eac..0c694ed 100644
--- a/coreutils-i18n-cut.patch
+++ b/coreutils-i18n-cut.patch
@@ -536,7 +536,7 @@
case 'f':
/* Build the field list. */
if (operating_mode != undefined_mode)
-@@ -747,9 +986,15 @@ main (int argc, char **argv)
+@@ -747,9 +986,17 @@ main (int argc, char **argv)
case 'd':
/* New delimiter. */
/* Interpret -d '' to mean 'use the NUL byte as the delimiter.' */
@@ -545,11 +545,13 @@
+ if (!mbi_avail (iter))
+ mb_setascii (&delim, '\0');
+ else
-+ mb_copy (&delim, &mbi_cur (iter));
++ {
++ mb_copy (&delim, &mbi_cur (iter));
+
-+ mbi_advance (iter);
-+ if (mbi_avail (iter))
++ mbi_advance (iter);
++ if (mbi_avail (iter))
FATAL_ERROR (_("the delimiter must be a single character"));
++ }
- delim = optarg[0];
delim_specified = true;
break;
diff --git a/coreutils.spec b/coreutils.spec
index a4c3ed1..c122e22 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.24
-Release: 107%{?dist}
+Release: 108%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -359,6 +359,9 @@ fi
%license COPYING
%changelog
+* Fri Jan 15 2016 Ondrej Oprala - 8.24-108
+- cut: be MB for ALL archs
+
* Fri Jan 15 2016 Ondrej Oprala - 8.24-107
- Use the new i18n implementation for the cut utility
From 7d9c9afa38925b51a69b0eb68a43d6d181a1f2e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?=
Date: Wed, 20 Jan 2016 16:43:39 +0100
Subject: [PATCH 025/256] Initial commit for coreutils 8.25 ... still need to
fix two failing tests before build (likely i18n stuff)
---
.gitignore | 1 +
coreutils-6.10-manpages.patch | 2 +-
coreutils-7.4-sttytcsadrain.patch | 12 --
coreutils-8.24-mv-duplicate-sources.patch | 119 -------------------
coreutils-i18n-cut.patch | 69 +++++------
coreutils-i18n-expand-unexpand.patch | 12 +-
coreutils-i18n.patch | 38 +-----
coreutils-remove-test-update-copyright.patch | 50 --------
coreutils.spec | 22 +---
glibc-2.22-test-fix.patch | 83 -------------
sources | 3 +-
11 files changed, 56 insertions(+), 355 deletions(-)
delete mode 100644 coreutils-7.4-sttytcsadrain.patch
delete mode 100644 coreutils-8.24-mv-duplicate-sources.patch
delete mode 100644 coreutils-remove-test-update-copyright.patch
delete mode 100644 glibc-2.22-test-fix.patch
diff --git a/.gitignore b/.gitignore
index 8f473b3..9b1b40a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,4 @@
/coreutils-8.23.tar.xz.sig
/coreutils-8.24.tar.xz
/coreutils-8.24.tar.xz.sig
+/coreutils-8.25.tar.xz
diff --git a/coreutils-6.10-manpages.patch b/coreutils-6.10-manpages.patch
index 3f5d37b..8d5bc94 100644
--- a/coreutils-6.10-manpages.patch
+++ b/coreutils-6.10-manpages.patch
@@ -10,4 +10,4 @@ diff -urNp coreutils-6.12-orig/src/md5sum.c coreutils-6.12/src/md5sum.c
+"), stdout);
fputs (_("\
\n\
- The following four options are useful only when verifying checksums:\n\
+ The following five options are useful only when verifying checksums:\n\
diff --git a/coreutils-7.4-sttytcsadrain.patch b/coreutils-7.4-sttytcsadrain.patch
deleted file mode 100644
index bc3f47b..0000000
--- a/coreutils-7.4-sttytcsadrain.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urNp coreutils-8.13-orig/src/stty.c coreutils-8.13/src/stty.c
---- coreutils-8.13-orig/src/stty.c 2011-07-28 12:38:27.000000000 +0200
-+++ coreutils-8.13/src/stty.c 2011-09-09 10:18:57.526687209 +0200
-@@ -1005,7 +1005,7 @@ main (int argc, char **argv)
- spurious difference in an uninitialized portion of the structure. */
- static struct termios new_mode;
-
-- if (tcsetattr (STDIN_FILENO, TCSADRAIN, &mode))
-+ if (tcsetattr (STDIN_FILENO, TCSANOW, &mode))
- error (EXIT_FAILURE, errno, "%s", device_name);
-
- /* POSIX (according to Zlotnick's book) tcsetattr returns zero if
diff --git a/coreutils-8.24-mv-duplicate-sources.patch b/coreutils-8.24-mv-duplicate-sources.patch
deleted file mode 100644
index f518cc6..0000000
--- a/coreutils-8.24-mv-duplicate-sources.patch
+++ /dev/null
@@ -1,119 +0,0 @@
-@@ -, +, @@
- destination
- mv dir dir dir
----
- src/copy.c | 12 +++++++----
- tests/local.mk | 1 -
- tests/mv/dup-source.sh | 46 +++++++++++++++++++++++++++++++++----------
- 3 files changed, 44 insertions(+), 15 deletions(-)
---- a/src/copy.c
-+++ a/src/copy.c
-@@ -2278,10 +2278,14 @@ copy_internal (char const *src_name, char const *dst_name,
- error (0, 0, _("warning: source directory %s "
- "specified more than once"),
- quote (top_level_src_name));
-- /* We only do backups in move mode and for non dirs,
-- and in move mode this won't be the issue as the source will
-- be missing for subsequent attempts.
-- There we just warn and return here. */
-+ /* In move mode, if a previous rename succeeded, then
-+ we won't be in this path as the source is missing. If the
-+ rename previously failed, then that has been handled.
-+ Pretend this instance succeeded so the source isn't removed. */
-+ if (x->move_mode && rename_succeeded)
-+ *rename_succeeded = true;
-+ /* We only do backups in move mode, and for non directories.
-+ So just ignore this repeated entry. */
- return true;
- }
- else if (x->dereference == DEREF_ALWAYS
---- a/tests/local.mk
-+++ a/tests/local.mk
-@@ -443,7 +443,6 @@ all_tests = \
- tests/cp/dir-rm-dest.sh \
- tests/cp/dir-slash.sh \
- tests/cp/dir-vs-file.sh \
-- tests/cp/duplicate-sources.sh \
- tests/cp/existing-perm-dir.sh \
- tests/cp/existing-perm-race.sh \
- tests/cp/fail-perm.sh \
---- a/tests/mv/dup-source.sh
-+++ a/tests/mv/dup-source.sh
-@@ -24,25 +24,37 @@ print_ver_ cp mv
-
- skip_if_root_
-
-+reset_files() { rm -fr a b d; touch a; mkdir b d; }
-+
- for i in cp; do
-
- # cp may not fail in this case.
--
-- rm -fr a d; touch a; mkdir d
-+ reset_files
- $i a a d/ 2> out || fail=1
-- rm -fr a d; touch a; mkdir d
-+ reset_files
- $i ./a a d/ 2>> out || fail=1
-
-+ # Similarly for directories, but handle
-+ # source == dest appropriately.
-+ reset_files
-+ $i -a ./b b d/ 2>> out || fail=1
-+ reset_files
-+ returns_ 1 $i -a ./b b b/ 2>> out || fail=1
-+
- # cp succeeds with --backup=numbered.
-- rm -fr a d; touch a; mkdir d
-+ reset_files
- $i --backup=numbered a a d/ 2>> out || fail=1
-
- # But not with plain '--backup'
-- rm -fr a d; touch a; mkdir d
-- $i --backup a a d/ 2>> out && fail=1
-+ reset_files
-+ returns_ 1 $i --backup a a d/ 2>> out || fail=1
-+
- cat < exp
- $i: warning: source file 'a' specified more than once
- $i: warning: source file 'a' specified more than once
-+$i: warning: source directory 'b' specified more than once
-+$i: cannot copy a directory, './b', into itself, 'b/b'
-+$i: warning: source directory 'b' specified more than once
- $i: will not overwrite just-created 'd/a' with 'a'
- EOF
- compare exp out || fail=1
-@@ -50,14 +62,28 @@ done
-
- for i in mv; do
- # But mv *does* fail in this case (it has to).
-+ reset_files
-+ returns_ 1 $i a a d/ 2> out || fail=1
-+ returns_ 1 test -e a || fail=1
-+ reset_files
-+ returns_ 1 $i ./a a d/ 2>> out || fail=1
-+ returns_ 1 test -e a || fail=1
-+
-+ # Similarly for directories, also handling
-+ # source == dest appropriately.
-+ reset_files
-+ returns_ 1 $i ./b b d/ 2>> out || fail=1
-+ returns_ 1 test -e b || fail=1
-+ reset_files
-+ returns_ 1 $i --verbose ./b b b/ 2>> out || fail=1
-+ test -d b || fail=1
-
-- rm -fr a d; touch a; mkdir d
-- $i a a d/ 2> out && fail=1
-- rm -fr a d; touch a; mkdir d
-- $i ./a a d/ 2>> out && fail=1
- cat < exp
- $i: cannot stat 'a': No such file or directory
- $i: cannot stat 'a': No such file or directory
-+$i: cannot stat 'b': No such file or directory
-+$i: cannot move './b' to a subdirectory of itself, 'b/b'
-+$i: warning: source directory 'b' specified more than once
- EOF
- compare exp out || fail=1
- done
---
diff --git a/coreutils-i18n-cut.patch b/coreutils-i18n-cut.patch
index 0c694ed..ab72147 100644
--- a/coreutils-i18n-cut.patch
+++ b/coreutils-i18n-cut.patch
@@ -13,8 +13,8 @@
#include "error.h"
@@ -90,25 +95,16 @@ add_range_pair (size_t lo, size_t hi)
- ++n_rp;
- }
+ CURRENT_RP.HI then we make CURRENT_RP to point to the next range pair. */
+ static struct field_range_pair *current_rp;
-/* This buffer is used to support the semantics of the -s option
- (or lack of same) when the specified field list includes (does
@@ -58,8 +58,8 @@
-static unsigned char delim;
+static mbf_char_t delim;
- /* True if the --output-delimiter=STRING option was specified. */
- static bool output_delimiter_specified;
+ /* The delimiter for each line/record. */
+ static unsigned char line_delim = '\n';
@@ -135,7 +135,7 @@ static size_t output_delimiter_length;
/* The output field separator string. Defaults to the 1-character
@@ -240,24 +240,24 @@
+
+ print_delimiter = false;
+ char_idx = 0;
-+ current_rp = rp;
++ current_rp = frp;
+
+ mbf_init (mbf, stream);
+ while (true)
+ {
+ mbf_getc (c, mbf);
+
-+ if (mb_iseq (c, '\n'))
++ if (mb_iseq (c, line_delim))
+ {
-+ putc ('\n', stdout);
++ putc (line_delim, stdout);
+ char_idx = 0;
+ print_delimiter = false;
-+ current_rp = rp;
++ current_rp = frp;
+ }
+ else if (mb_iseof (c))
+ {
+ if (char_idx > 0)
-+ putc ('\n', stdout);
++ putc (line_delim, stdout);
+ break;
+ }
+ else
@@ -312,7 +312,7 @@
bool found_any_selected_field = false;
bool buffer_first_field;
- current_rp = rp;
+ current_rp = frp;
- c = getc (stream);
- if (c == EOF)
@@ -336,14 +336,14 @@
- size_t n_bytes;
+ size_t n_chars;
+ mbf_char_t nl;
-+ mb_setascii (&nl, '\n');
++ mb_setascii (&nl, line_delim);
+
+ len = mb_getndelim2 (&field_1_buffer, &field_1_bufsize,
+ GETNLINE_NO_LIMIT, d, nl, &mbf);
+
- len = getndelim2 (&field_1_buffer, &field_1_bufsize, 0,
-- GETNLINE_NO_LIMIT, delim, '\n', stream);
+- GETNLINE_NO_LIMIT, delim, line_delim, stream);
if (len < 0)
{
free (field_1_buffer);
@@ -376,11 +376,11 @@
+ mb_putc (field_1_buffer[i], stdout);
+
/* Make sure the output line is newline terminated. */
-- if (field_1_buffer[n_bytes - 1] != '\n')
-+ if (!mb_iseq (field_1_buffer[n_chars - 1], '\n'))
- putchar ('\n');
-- c = '\n';
-+ mb_setascii (&c,'\n');
+- if (field_1_buffer[n_bytes - 1] != line_delim)
++ if (!mb_iseq (field_1_buffer[n_chars - 1], line_delim))
+ putchar (line_delim);
+- c = line_delim;
++ mb_setascii (&c, line_delim);
}
continue;
}
@@ -392,8 +392,8 @@
+ mb_putc (field_1_buffer[i], stdout);
/* With -d$'\n' don't treat the last '\n' as a delimiter. */
-- if (delim == '\n')
-+ if (mb_iseq (d, '\n'))
+- if (delim == line_delim)
++ if (mb_iseq (d, line_delim))
{
- int last_c = getc (stream);
- if (last_c != EOF)
@@ -416,13 +416,13 @@
if (print_kth (field_idx))
{
-@@ -605,41 +822,46 @@ cut_fields (FILE *stream)
+@@ -605,42 +822,46 @@ cut_fields (FILE *stream)
}
found_any_selected_field = true;
-- while ((c = getc (stream)) != delim && c != '\n' && c != EOF)
+- while ((c = getc (stream)) != delim && c != line_delim && c != EOF)
+ mbf_getc (c, mbf);
-+ while (!mb_equal (c, d) && !mb_iseq (c, '\n') && !mb_iseof (c))
++ while (!mb_equal (c, d) && !mb_iseq (c, line_delim) && !mb_iseof (c))
{
- putchar (c);
- prev_c = c;
@@ -433,9 +433,9 @@
}
else
{
-- while ((c = getc (stream)) != delim && c != '\n' && c != EOF)
+- while ((c = getc (stream)) != delim && c != line_delim && c != EOF)
+ mbf_getc (c, mbf);
-+ while (!mb_equal (c, d) && !mb_iseq (c, '\n') && !mb_iseof (c))
++ while (!mb_equal (c, d) && !mb_iseq (c, line_delim) && !mb_iseof (c))
{
- prev_c = c;
+ mb_copy (&prev_c, &c);
@@ -444,8 +444,8 @@
}
/* With -d$'\n' don't treat the last '\n' as a delimiter. */
-- if (delim == '\n' && c == delim)
-+ if (mb_iseq (d, '\n') && mb_equal (c, d))
+- if (delim == line_delim && c == delim)
++ if (mb_iseq (d, line_delim) && mb_equal (c, d))
{
- int last_c = getc (stream);
- if (last_c != EOF)
@@ -462,21 +462,22 @@
- if (c == delim)
+ if (mb_equal (c, d))
next_item (&field_idx);
-- else if (c == '\n' || c == EOF)
-+ else if (mb_iseq (c, '\n') || mb_iseof (c))
+- else if (c == line_delim || c == EOF)
++ else if (mb_iseq (c, line_delim) || mb_iseof (c))
{
if (found_any_selected_field
|| !(suppress_non_delimited && field_idx == 1))
{
-- if (c == '\n' || prev_c != '\n' || delim == '\n')
-+ if (mb_iseq (c, '\n') || !mb_iseq (prev_c, '\n') || mb_iseq (d, '\n'))
- putchar ('\n');
+- if (c == line_delim || prev_c != line_delim
+- || delim == line_delim)
++ if (mb_iseq (c, line_delim) || !mb_iseq (prev_c, line_delim) || mb_iseq (d, line_delim))
+ putchar (line_delim);
}
- if (c == EOF)
+ if (mb_iseof (c))
break;
field_idx = 1;
- current_rp = rp;
+ current_rp = frp;
@@ -652,7 +874,14 @@ static void
cut_stream (FILE *stream)
{
@@ -512,7 +513,7 @@
+ mb_setascii (&delim, '\0');
have_read_stdin = false;
- while ((optc = getopt_long (argc, argv, "b:c:d:f:ns", longopts, NULL)) != -1)
+ while ((optc = getopt_long (argc, argv, "b:c:d:f:nsz", longopts, NULL)) != -1)
@@ -728,7 +960,6 @@ main (int argc, char **argv)
switch (optc)
{
@@ -565,7 +566,7 @@
case 's':
@@ -802,15 +1048,12 @@ main (int argc, char **argv)
- }
+ | (complement ? SETFLD_COMPLEMENT : 0) );
if (!delim_specified)
- delim = '\t';
diff --git a/coreutils-i18n-expand-unexpand.patch b/coreutils-i18n-expand-unexpand.patch
index 63813f9..d8a5968 100644
--- a/coreutils-i18n-expand-unexpand.patch
+++ b/coreutils-i18n-expand-unexpand.patch
@@ -433,14 +433,14 @@ index 0a40a1a..ed97fd4 100644
- {
- if (ferror (fp))
- {
-- error (0, errno, "%s", prev_file);
+- 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", prev_file);
+- error (0, errno, "%s", quotef (prev_file));
- exit_status = EXIT_FAILURE;
- }
- }
@@ -460,7 +460,7 @@ index 0a40a1a..ed97fd4 100644
- fadvise (fp, FADVISE_SEQUENTIAL);
- return fp;
- }
-- error (0, errno, "%s", file);
+- error (0, errno, "%s", quotef (file));
- exit_status = EXIT_FAILURE;
- }
- return NULL;
@@ -748,14 +748,14 @@ index e0f7c22..48fbb32 100644
- {
- if (ferror (fp))
- {
-- error (0, errno, "%s", prev_file);
+- 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", prev_file);
+- error (0, errno, "%s", quotef (prev_file));
- exit_status = EXIT_FAILURE;
- }
- }
@@ -775,7 +775,7 @@ index e0f7c22..48fbb32 100644
- fadvise (fp, FADVISE_SEQUENTIAL);
- return fp;
- }
-- error (0, errno, "%s", file);
+- error (0, errno, "%s", quotef (file));
- exit_status = EXIT_FAILURE;
- }
- return NULL;
diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch
index e876fe3..0538a64 100644
--- a/coreutils-i18n.patch
+++ b/coreutils-i18n.patch
@@ -150,7 +150,7 @@ diff -urNp coreutils-8.24-orig/src/fold.c coreutils-8.24/src/fold.c
-
- if (istream == NULL)
- {
-- error (0, errno, "%s", filename);
+- error (0, errno, "%s", quotef (filename));
- return false;
- }
@@ -394,7 +394,7 @@ diff -urNp coreutils-8.24-orig/src/fold.c coreutils-8.24/src/fold.c
+
if (ferror (istream))
{
- error (0, saved_errno, "%s", filename);
+ error (0, saved_errno, "%s", quotef (filename));
@@ -251,7 +498,8 @@ main (int argc, char **argv)
atexit (close_stdout);
@@ -493,7 +493,7 @@ diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c
+ else
{
/* Skip leading blanks before the first field. */
- while (isblank (to_uchar (*ptr)))
+ while (field_sep (*ptr))
@@ -305,6 +322,147 @@ xfields (struct line *line)
extract_field (line, ptr, lim - ptr);
}
@@ -1240,7 +1240,7 @@ diff -urNp coreutils-8.24-orig/src/pr.c coreutils-8.24/src/pr.c
- clump_buff = xmalloc (MAX (8, chars_per_input_tab));
+ clump_buff = xmalloc (mb_len * MAX (8, chars_per_input_tab));
}
-
+
/* Open the necessary files,
@@ -1383,7 +1506,7 @@ init_funcs (void)
@@ -2685,33 +2685,6 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c
}
break;
-@@ -4681,10 +5374,10 @@ main (int argc, char **argv)
-
- if (nfiles == 0)
- {
-- static char *minus = (char *) "-";
- nfiles = 1;
- free (files);
-- files = −
-+ files = xmalloc (sizeof *files);
-+ *files = (char *) "-";
- }
-
- /* Need to re-check that we meet the minimum requirement for memory
-@@ -4742,6 +5435,13 @@ main (int argc, char **argv)
- sort (files, nfiles, outfile, nthreads);
- }
-
-+#ifdef lint
-+ if (files_from)
-+ readtokens0_free (&tok);
-+ else
-+ free (files);
-+#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
@@ -2733,12 +2706,13 @@ diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c
#include "system.h"
#include "argmatch.h"
#include "linebuffer.h"
-@@ -32,7 +43,19 @@
+@@ -32,8 +43,20 @@
#include "stdio--.h"
#include "xmemcoll.h"
#include "xstrtol.h"
-#include "memcasecmp.h"
+#include "xmemcoll.h"
+ #include "quote.h"
+
+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
+ installation; work around this configuration error. */
diff --git a/coreutils-remove-test-update-copyright.patch b/coreutils-remove-test-update-copyright.patch
deleted file mode 100644
index 23ce342..0000000
--- a/coreutils-remove-test-update-copyright.patch
+++ /dev/null
@@ -1,50 +0,0 @@
---- coreutils-8.23/gnulib-tests/gnulib.mk.orig 2015-07-04 11:11:09.438579284 +0100
-+++ coreutils-8.23/gnulib-tests/gnulib.mk 2015-07-04 11:12:12.113643496 +0100
-@@ -2312,14 +2312,6 @@
-
- ## end gnulib module unsetenv-tests
-
--## begin gnulib module update-copyright-tests
--
--TESTS += test-update-copyright.sh
--TESTS_ENVIRONMENT += abs_aux_dir='$(abs_aux_dir)'
--EXTRA_DIST += test-update-copyright.sh
--
--## end gnulib module update-copyright-tests
--
- ## begin gnulib module userspec-tests
-
- TESTS += test-userspec
---- coreutils-8.23/gnulib-tests/Makefile.in.orig 2015-07-04 11:10:54.353323089 +0100
-+++ coreutils-8.23/gnulib-tests/Makefile.in 2015-07-04 11:12:45.542210970 +0100
-@@ -220,7 +220,6 @@
- test-u8-mbtoucr$(EXEEXT) test-u8-uctomb$(EXEEXT) \
- test-uc_width$(EXEEXT) uniwidth/test-uc_width2.sh \
- test-unlink$(EXEEXT) test-unlinkat$(EXEEXT) \
-- test-unsetenv$(EXEEXT) test-update-copyright.sh \
- test-userspec$(EXEEXT) test-utimens$(EXEEXT) \
- test-utimensat$(EXEEXT) test-vasnprintf$(EXEEXT) \
- test-vasprintf-posix$(EXEEXT) test-vasprintf$(EXEEXT) \
-@@ -3766,7 +3765,7 @@
- uniwidth/test-uc_width2.sh macros.h test-unlink.h \
- test-unlink.c signature.h macros.h test-unlinkat.c \
- test-rmdir.h test-unlink.h signature.h macros.h unlinkdir.h \
-- test-unsetenv.c signature.h macros.h test-update-copyright.sh \
-+ test-unsetenv.c signature.h macros.h \
- test-userspec.c nap.h test-futimens.h test-lutimens.h \
- test-utimens.h test-utimens-common.h test-utimens.c macros.h \
- nap.h test-lutimens.h test-utimens.h test-utimens-common.h \
-@@ -7787,13 +7786,6 @@
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
-- "$$tst" $(AM_TESTS_FD_REDIRECT)
--test-update-copyright.sh.log: test-update-copyright.sh
-- @p='test-update-copyright.sh'; \
-- b='test-update-copyright.sh'; \
-- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
-- --log-file $$b.log --trs-file $$b.trs \
-- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
- test-userspec.log: test-userspec$(EXEEXT)
- @p='test-userspec$(EXEEXT)'; \
diff --git a/coreutils.spec b/coreutils.spec
index c122e22..2e939fd 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
-Version: 8.24
-Release: 108%{?dist}
+Version: 8.25
+Release: 1%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -21,27 +21,18 @@ Source10: coreutils-find-requires.sh
%global __find_requires %{SOURCE10} %{_rpmconfigdir}/find-requires
# From upstream
-#mv: prevent dataloss when source directory is specified multiple t imes
-Patch1: coreutils-8.24-mv-duplicate-sources.patch
-
# Our patches
#general patch to workaround koji build system issues
Patch100: coreutils-6.10-configuration.patch
#add note about no difference between binary/text mode on Linux - md5sum manpage
Patch101: coreutils-6.10-manpages.patch
-#temporarily workaround probable kernel issue with TCSADRAIN(#504798)
-Patch102: coreutils-7.4-sttytcsadrain.patch
#do display processor type for uname -p/-i based on uname(2) syscall
Patch103: coreutils-8.2-uname-processortype.patch
#df --direct
Patch104: coreutils-df-direct.patch
#add note about mkdir --mode behaviour into info documentation(#610559)
Patch107: coreutils-8.4-mkdir-modenote.patch
-# Don't run the currently failing test-update-copyright.sh test
-Patch108: coreutils-remove-test-update-copyright.patch
-#avoid false failure due to extra stat() calls done by opendir() in glibc 2.22
-Patch109: glibc-2.22-test-fix.patch
# sh-utils
#add info about TZ envvar to date manpage
@@ -172,12 +163,9 @@ including documentation and translations.
# Our patches
%patch100 -p1 -b .configure
%patch101 -p1 -b .manpages
-%patch102 -p1 -b .tcsadrain
%patch103 -p1 -b .sysinfo
%patch104 -p1 -b .dfdirect
%patch107 -p1 -b .mkdirmode
-%patch108 -p1 -b .crtest
-%patch109 -p1 -b .opendir_stat
# sh-utils
%patch703 -p1 -b .dateman
@@ -192,13 +180,12 @@ including documentation and translations.
%patch908 -p1 -b .getgrouplist
%patch912 -p1 -b .overflow
%patch913 -p1 -b .testoff
-%patch1 -p1 -b .dupl
#SELinux
%patch950 -p1 -b .selinux
%patch951 -p1 -b .selinuxman
-chmod a+x tests/misc/sort-mb-tests.sh tests/df/direct.sh tests/mv-dup-source.sh || :
+chmod a+x tests/misc/sort-mb-tests.sh tests/df/direct.sh || :
#fix typos/mistakes in localized documentation(#439410, #440056)
find ./po/ -name "*.p*" | xargs \
@@ -359,6 +346,9 @@ fi
%license COPYING
%changelog
+* Wed Jan 20 2016 Ondrej Vasik - 8.25-1
+- new upstream release(#1300282)
+
* Fri Jan 15 2016 Ondrej Oprala - 8.24-108
- cut: be MB for ALL archs
diff --git a/glibc-2.22-test-fix.patch b/glibc-2.22-test-fix.patch
deleted file mode 100644
index efbe850..0000000
--- a/glibc-2.22-test-fix.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-From fd5f2b1569e2e0b31be755e14e236a7a02478fc0 Mon Sep 17 00:00:00 2001
-From: Bernhard Voelker
-Date: Sun, 30 Aug 2015 22:49:35 +0200
-Subject: [PATCH] tests: avoid FP of ls/stat-free-color.sh with newer glibc
-
-Since glibc-2.22, specifically commit [0], the opendir() implementation
-implicitly makes an additional stat call thus leading to a FP.
-Seen on openSUSE:Tumbleweed since snapshot 20150821.
-
-[0]
-https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=46f894d8c60a
-
-* tests/ls/stat-free-color.sh: Change the test to verify that ls(1)
-needs the same number of stat-like calls for a single, empty directory
-argument as for one with a few directory entries (sub-directory,
-regular file, symlink, etc.).
----
- tests/ls/stat-free-color.sh | 39 ++++++++++++++++++++++++---------------
- 1 file changed, 24 insertions(+), 15 deletions(-)
-
-diff --git a/tests/ls/stat-free-color.sh b/tests/ls/stat-free-color.sh
-index fb2ee8b..35816a3 100755
---- a/tests/ls/stat-free-color.sh
-+++ b/tests/ls/stat-free-color.sh
-@@ -27,8 +27,6 @@ stats='stat,lstat,stat64,lstat64,newfstatat'
- require_strace_ $stats
- require_dirent_d_type_
-
--ln -s nowhere dangle || framework_failure_
--
- # Disable enough features via LS_COLORS so that ls --color
- # can do its job without calling stat (other than the obligatory
- # one-call-per-command-line argument).
-@@ -54,22 +52,33 @@ EOF
- eval $(dircolors -b color-without-stat)
-
- # The system may perform additional stat-like calls before main.
--# To avoid counting those, first get a baseline count by running
--# ls with only the --help option. Then, compare that with the
-+# Furthermore, underlying library functions may also implicitly
-+# add an extra stat call, e.g. opendir since glibc-2.21-360-g46f894d.
-+# To avoid counting those, first get a baseline count for running
-+# ls with one empty directory argument. Then, compare that with the
- # invocation under test.
--strace -o log-help -e $stats ls --help >/dev/null || fail=1
--n_lines_help=$(wc -l < log-help)
-+mkdir d || framework_failure_
-+
-+strace -o log1 -e $stats ls --color=always d || fail=1
-+n_stat1=$(wc -l < log1) || framework_failure_
-+
-+test $n_stat1 = 0 \
-+ && skip_ 'No stat calls recognized on this platform'
-
--strace -o log -e $stats ls --color=always . || fail=1
--n_lines=$(wc -l < log)
-+# Populate the test directory.
-+mkdir d/subdir \
-+ && touch d/regf \
-+ && ln d/regf d/hlink \
-+ && ln -s regf d/slink \
-+ && ln -s nowhere d/dangle \
-+ || framework_failure_
-
--n_stat=$(expr $n_lines - $n_lines_help)
-+# Invocation under test.
-+strace -o log2 -e $stats ls --color=always d || fail=1
-+n_stat2=$(wc -l < log2) || framework_failure_
-
--# Expect one stat call.
--case $n_stat in
-- 0) skip_ 'No stat calls recognized on this platform' ;;
-- 1) ;; # Corresponding to stat(".")
-- *) fail=1; head -n30 log* ;;
--esac
-+# Expect the same number of stat calls.
-+test $n_stat1 = $n_stat2 \
-+ || { fail=1; head -n30 log*; }
-
- Exit $fail
---
-2.4.1
-
diff --git a/sources b/sources
index c53a0ef..2fd7001 100644
--- a/sources
+++ b/sources
@@ -1,2 +1 @@
-40efdbce865d2458d8da0a9dcee7c16c coreutils-8.24.tar.xz
-01b4406a1de25aa4af49b9c4b0057c19 coreutils-8.24.tar.xz.sig
+070e43ba7f618d747414ef56ab248a48 coreutils-8.25.tar.xz
From eccec8ba456ce92ccd1c7b3971b814e8aa2a7b18 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?=
Date: Wed, 20 Jan 2016 19:10:59 +0000
Subject: [PATCH 026/256] simplify/generalize 256 color TERM identifiers
Use globbing newly supported in coreutil 8.25
to reduce the number of entries and also support
other entries like the various screen TERMS at:
http://invisible-island.net/ncurses/terminfo.ti.html#tic-screen-256color
---
coreutils-DIR_COLORS.256color | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/coreutils-DIR_COLORS.256color b/coreutils-DIR_COLORS.256color
index 5290aea..cc8cf40 100644
--- a/coreutils-DIR_COLORS.256color
+++ b/coreutils-DIR_COLORS.256color
@@ -21,14 +21,8 @@ COLOR tty
OPTIONS -F -T 0
# Below, there should be one TERM entry for each termtype that is colorizable
-TERM putty-256color
-TERM rxvt-256color
-TERM rxvt-unicode-256color
+TERM *256color*
TERM rxvt-unicode256
-TERM screen-256color
-TERM xterm-256color
-TERM gnome-256color
-TERM st-256color
# EIGHTBIT, followed by '1' for on, '0' for off. (8-bit output)
EIGHTBIT 1
From ab00e1ea647bbe735809a2c71198f159a30ef1c6 Mon Sep 17 00:00:00 2001
From: Ondrej Oprala
Date: Thu, 21 Jan 2016 16:46:39 +0100
Subject: [PATCH 027/256] Adjust the i18n patch for coreutils-8.25
---
coreutils-i18n.patch | 25 +++++++++++++++++++------
coreutils.spec | 5 ++++-
2 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch
index 0538a64..79449d4 100644
--- a/coreutils-i18n.patch
+++ b/coreutils-i18n.patch
@@ -562,7 +562,7 @@ diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c
+ }
+ mblength = (mblength < 1) ? 1 : mblength;
+
-+ if (!iswblank(wc))
++ if (!iswblank(wc) && wc != '\n')
+ break;
+ ptr += mblength;
+ }
@@ -593,7 +593,7 @@ diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c
+ }
+ mblength = (mblength < 1) ? 1 : mblength;
+
-+ if (iswblank (wc))
++ if (iswblank (wc) || wc == '\n')
+ break;
+
+ sep += mblength;
@@ -626,7 +626,7 @@ diff -urNp coreutils-8.24-orig/src/join.c coreutils-8.24/src/join.c
+ }
+ mblength = (mblength < 1) ? 1 : mblength;
+
-+ if (!iswblank (wc))
++ if (!iswblank (wc) && wc != '\n')
+ break;
+
+ ptr += mblength;
@@ -1799,7 +1799,7 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c
+ }
+
+ *length = (mblength < 1) ? 1 : mblength;
-+ return iswblank (wc);
++ return iswblank (wc) || wc == '\n';
+}
+#endif
+
@@ -2685,6 +2685,19 @@ diff -urNp coreutils-8.24-orig/src/sort.c coreutils-8.24/src/sort.c
}
break;
+@@ -5444,12 +5444,10 @@ main (int argc, char **argv)
+ sort (files, nfiles, outfile, nthreads);
+ }
+
+-#ifdef lint
+ if (files_from)
+ readtokens0_free (&tok);
+ else
+ free (files);
+-#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
@@ -2799,7 +2812,7 @@ diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c
+ {
+ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
+
-+ if (convfail || !iswblank (wc))
++ if (convfail || !(iswblank (wc) || wc == '\n'))
+ {
+ pos += mblength;
+ break;
@@ -2811,7 +2824,7 @@ diff -urNp coreutils-8.24-orig/src/uniq.c coreutils-8.24/src/uniq.c
+ {
+ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
+
-+ if (!convfail && iswblank (wc))
++ if (!convfail && (iswblank (wc) || wc == '\n'))
+ break;
+
+ pos += mblength;
diff --git a/coreutils.spec b/coreutils.spec
index 2e939fd..50c1c63 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.25
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -346,6 +346,9 @@ fi
%license COPYING
%changelog
+* Thu Jan 21 2016 Ondrej Vasik - 8.25-2
+- Adjust the i18n patch for coreutils-8.25
+
* Wed Jan 20 2016 Ondrej Vasik - 8.25-1
- new upstream release(#1300282)
From cd5c4ef3552535f0c79d7174602448d54313493b Mon Sep 17 00:00:00 2001
From: Ondrej Oprala
Date: Wed, 27 Jan 2016 12:08:57 +0100
Subject: [PATCH 028/256] Downstream MB tarball of the new impl
---
rh_i18n_wip.tar.gz | Bin 0 -> 28954 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 rh_i18n_wip.tar.gz
diff --git a/rh_i18n_wip.tar.gz b/rh_i18n_wip.tar.gz
new file mode 100644
index 0000000000000000000000000000000000000000..24b7cdc4900b0cde562b1e8e70e4915972227e24
GIT binary patch
literal 28954
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