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 001/244] 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 002/244] 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 003/244] 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 004/244] 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 005/244] 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 006/244] 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 007/244] 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 008/244] 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 009/244] 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 010/244] 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 011/244] 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 012/244] 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 013/244] 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 014/244] 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 015/244] 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 016/244] 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
zcmV(?K-a$?iwFP_rKnZ_1MD1WciYA>U&~*yR$7Y`35qu<%1Xn?l+E{axS|v%P4e(S
zU@4*|0R{jiD~|trXJ&VCLx-KFNh>}l1oxPoot>QMKlYXX~*}u3M3>kmFHXN(Aam2%r8J5LXn`L0n
zZUfHz&3f&6L1~AXt~0lh%G8}`zeEqNV=hrCtCi9mb{e%FtKwImLBo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