commit:     68f6d38817f0cf156fa0e411a8650102b1aaf713
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 19 14:27:15 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Mar 19 14:27:15 2018 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=68f6d388

sys-apps/coreutils: sync and cleanup

Package-Manager: Portage-2.3.18-prefix, Repoman-2.3.6

 sys-apps/coreutils/Manifest                        |    9 -
 sys-apps/coreutils/coreutils-8.24.ebuild           |  203 ---
 sys-apps/coreutils/coreutils-8.25.ebuild           |  212 ---
 sys-apps/coreutils/coreutils-8.28-r1.ebuild        |  239 ----
 .../coreutils/files/coreutils-8.25-cygwin-3.patch  | 1407 --------------------
 sys-apps/coreutils/metadata.xml                    |    5 +-
 6 files changed, 3 insertions(+), 2072 deletions(-)

diff --git a/sys-apps/coreutils/Manifest b/sys-apps/coreutils/Manifest
index 9b00c6fe99..db2d3f03f5 100644
--- a/sys-apps/coreutils/Manifest
+++ b/sys-apps/coreutils/Manifest
@@ -1,11 +1,2 @@
-DIST coreutils-8.24-man.tar.xz 42920 BLAKE2B 
7cf9cdb5a94a9f5d46185d43d983c347d98dc0ec6698466ade5e87f5ad0398c817bd5dfc78cee0e018d1de31613cf62fd038ba4681207a7a8147506348c0490f
 SHA512 
9dfe614402bc35c43301ebf97d2d36ac5db1433f48171bda15f2ba76bd9944742665b30a764df0cf773ebcad1845aae57c8e36a1cd3848c1e82a7c996d6cc78a
-DIST coreutils-8.24-patches-1.1.tar.xz 6688 BLAKE2B 
a532126c80e7583c6373cafedcfa2fe12216335259ff9ac89b0604507e615d087c6040c9c71145e620658e8bb503671b055e487ab1acdc53b9601eea38111f71
 SHA512 
cf340ccb918e307be8bbfd19a299bcfe5b295a26f59a8eeb8657f5dda1361100a350e996b31097948e63890987a2f83d05d2e7175c6304f4a4812b9974679c2c
-DIST coreutils-8.24.tar.xz 5649896 BLAKE2B 
99888112a104086ec766dfdfff3f1fe2b8408e22279c9cdb4f59bffd8899d559075255f6cc94c1805ffda1f31268a30283ad9119549f0fa0c63ac3e37fd23333
 SHA512 
b42bb233340353647bb9a1c3d9122c1a5379cf3602ba9197c3c935fc899897e7d4685148dfaf93eccc096bee0a9b03416d79dc9bb81d5d2dea6e04ed134a3d1b
-DIST coreutils-8.25-man.tar.xz 43420 BLAKE2B 
b66108391546a3bc1942022bb2fc36f115bf7218d25e4ca46970a0245f9f837a72a8b1dc50fa7783936a9db95897f8b967f5d177258a2841f2908da71265c7fd
 SHA512 
412afc9909d30618ab9daba51c965c0fd22420c32f6c5a7e32ba32d957a92e8a65b977bccaba4b76c55d435a57065dc6103ff11c5fa31d02f117c13a2b09f75e
-DIST coreutils-8.25-patches-1.1.tar.xz 7196 BLAKE2B 
5c669bb0ae4b6a8a1a1499a824ff216502bd282726d4c685bb79c2a18a34eba8675e511aef87c8ed6fc57485f815e03bf2aae9266fe9689851cdfec779a5e3af
 SHA512 
19326ab7dd8d4515f7239133772f715aac4e722a1e28f4b0f19d8d629abe54a2309fa7c469797dc0f9e88991906883a891622c791ef940b9a5af6608d2e9110e
-DIST coreutils-8.25.tar.xz 5725008 BLAKE2B 
6dd5d6179476e0e0c801dc23fab006b3f81426bcde43c2f30c5a81e51a4fb694f91a922035fe67cdf09965cb237aba08b760235a3ede3eded8834557f1c59845
 SHA512 
571f95d44987d373081ed4c6ac82155ad3dcd95621d7b1a7163597e80ecbbafef2cd74b2ef594587a443a1a4355083879f898a286bb0230c48112d43d076ccd6
-DIST coreutils-8.28-man.tar.xz 43832 BLAKE2B 
18ea22a89daac64444da8b91c82c62e4c6dfe27e0e9c2d2ec1de4dc9c3ee44fb91f197e3122803a8a18c2619c6daf683e0b3b07c36e0e9b8dd73c2cdf44ba6b7
 SHA512 
363cf595e0f6fc69eb6a9d1ca258a5f012404cee99887494ab6e40fe2c6de5e49e7cad953aecb394c5612043efe6b407e657811d8251b10e159c97b849dd8b3e
-DIST coreutils-8.28-patches-1.1.tar.xz 7336 BLAKE2B 
9cd5db3e1d5545da5cb38f919ae5528d8642efb7f7e11994c6603f49b097f0f804cf1553dfce65682f9d725964cd6a3d142916cbc018f707cc617ad8c9b9f471
 SHA512 
af47aaa614550e5cd82b2386fafd9f90beb0564b8bbedfe92238906e7c6f040fb7468c1929f0951d4f98038b6e1df7da2408204be78219e6a041658507385957
-DIST coreutils-8.28.tar.xz 5252336 BLAKE2B 
30e3c05311834b19a941ddaa6a405cb0033b0e3518211dd0d33e9a1aa91c60f4d597fca9419b467ade2b54e3bf81ba5149cebfc93a02fa1e546c1b0f71ee91c9
 SHA512 
1e592d0dd03b9227bf92af9a82bed6dc3bcbee46e984c7fb09833dea0962e86b309aa34d5e43823b73d4522c066bfa5cdc8ec694aa190910fb246ff32ceb63a1
 DIST coreutils-8.29-patches-1.0.tar.xz 5772 BLAKE2B 
8f05185404d527ad524684231f0b8bef3b65e7752527b6bf55371f474035b8a92cdcaa8349a321784d14c6700a0d49e9d10ee2e3a96b78e8f6423ee8c5b9ec02
 SHA512 
0f7db6744a6a6bad8d582bb2d32e1a0ad0ab5f48a53b54c371d27494967832ddec2570e45dbf7e66c7091496bcecd66aab21644f603d2c8878a87f51a1a9b1a2
 DIST coreutils-8.29.tar.xz 5286588 BLAKE2B 
cbb66d9054bdd2db5b9a6010876484b16d178f8f4d935836b1e42830178647fac4e0a75052a6e7e2fbc50e74e4e7ff6f8da43f1137b96d0c2d027c4ebac28a98
 SHA512 
546bbcd5741beae7a68e7c4ca14d6d634f7c8be87feecdeddd00e226f4865bb89d503437c3a95622ba7bb0cb70addbb5bdf3767fa18d0b7410ab90ee53b29dfd

diff --git a/sys-apps/coreutils/coreutils-8.24.ebuild 
b/sys-apps/coreutils/coreutils-8.24.ebuild
deleted file mode 100644
index 091607aa42..0000000000
--- a/sys-apps/coreutils/coreutils-8.24.ebuild
+++ /dev/null
@@ -1,203 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/coreutils/coreutils-8.24.ebuild,v 
1.2 2015/08/05 07:49:24 vapier Exp $
-
-# To generate the man pages, unpack the upstream tarball and run:
-# ./configure --enable-install-program=arch,coreutils
-# make
-# cd ..
-# tar cf - coreutils-*/man/*.[0-9] | xz > coreutils-<ver>-man.tar.xz
-
-EAPI="4"
-
-inherit eutils flag-o-matic toolchain-funcs multilib
-
-PATCH_VER="1.1"
-DESCRIPTION="Standard GNU file utilities (chmod, cp, dd, dir, ls...), text 
utilities (sort, tr, head, wc..), and shell utilities (whoami, who,...)"
-HOMEPAGE="http://www.gnu.org/software/coreutils/";
-SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
-       mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz
-       http://dev.gentoo.org/~vapier/dist/${P}-patches-${PATCH_VER}.tar.xz
-       mirror://gentoo/${P}-man.tar.xz
-       http://dev.gentoo.org/~vapier/dist/${P}-man.tar.xz";
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos 
~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="acl caps gmp multicall nls selinux static elibc_glibc vanilla xattr"
-
-LIB_DEPEND="acl? ( sys-apps/acl[static-libs] )
-       caps? ( sys-libs/libcap )
-       gmp? ( dev-libs/gmp[static-libs] )
-       xattr? ( elibc_glibc? ( sys-apps/attr[static-libs] ) )"
-RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs]} )
-       selinux? ( sys-libs/libselinux )
-       nls? ( virtual/libintl )
-       !app-misc/realpath
-       !<sys-apps/util-linux-2.13
-       !sys-apps/stat
-       !net-mail/base64
-       !sys-apps/mktemp
-       !<app-forensics/tct-1.18-r1
-       !<net-fs/netatalk-2.0.3-r4
-       !<sci-chemistry/ccp4-6.1.1"
-DEPEND="${RDEPEND}
-       static? ( ${LIB_DEPEND} )
-       app-arch/xz-utils"
-
-src_prepare() {
-       if ! use vanilla ; then
-               use_if_iuse unicode || rm -f 
"${WORKDIR}"/patch/000_all_coreutils-i18n.patch
-               EPATCH_SUFFIX="patch" \
-               PATCHDIR="${WORKDIR}/patch" \
-               EPATCH_EXCLUDE="001_all_coreutils-gen-progress-bar.patch" \
-               epatch
-       fi
-
-       epatch "${FILESDIR}"/${PN}-8.22-mint.patch
-
-       # fixup libstdbuf non-libtool stuff
-       if [[ ${CHOST} == *-darwin* ]] ; then
-               sed -i \
-                       -e "/src_libstdbuf_so_LDFLAGS = 
-shared/s:-shared:-dynamiclib -install_name 
${EPREFIX}/usr/libexec/coreutils/libstdbuf.dylib:" \
-                       Makefile.in \
-                       || die
-       fi
-       sed -i \
-               -e "s/libstdbuf\\.so/libstdbuf$(get_libname)/" \
-               src/stdbuf.c \
-               Makefile.in \
-               configure \
-               || die
-
-       # Since we've patched many .c files, the make process will try to
-       # re-build the manpages by running `./bin --help`.  When doing a
-       # cross-compile, we can't do that since 'bin' isn't a native bin.
-       # Also, it's not like we changed the usage on any of these things,
-       # so let's just update the timestamps and skip the help2man step.
-       set -- man/*.x
-       touch ${@/%x/1}
-       # docs depend on configure as well
-       touch -r doc/stamp-vti configure
-
-       # Avoid perl dep for compiled in dircolors default #348642
-       if ! has_version dev-lang/perl ; then
-               touch src/dircolors.h
-               touch ${@/%x/1}
-       fi
-}
-
-src_configure() {
-       local myconf=''
-       if tc-is-cross-compiler && [[ ${CHOST} == *linux* ]] ; then
-               export fu_cv_sys_stat_statfs2_bsize=yes #311569
-               export gl_cv_func_realpath_works=yes #416629
-       fi
-
-       export gl_cv_func_mknod_works=yes #409919
-       use static && append-ldflags -static && sed -i '/elf_sys=yes/s:yes:no:' 
configure #321821
-       use selinux || export 
ac_cv_{header_selinux_{context,flash,selinux}_h,search_setfilecon}=no #301782
-       use userland_BSD && myconf="${myconf} -program-prefix=g 
--program-transform-name=s/stat/nustat/"
-       # kill/uptime - procps
-       # groups/su   - shadow
-       # hostname    - net-tools
-       if [[ ${CHOST} == *-mint* ]]; then
-               myconf="${myconf} 
--enable-install-program=arch,hostname,kill,uptime"
-               myconf="${myconf} --enable-no-install-program=groups,su,stdbuf"
-       else
-               myconf="${myconf} --enable-install-program=arch"
-               myconf="${myconf} 
--enable-no-install-program=groups,hostname,kill,su,uptime"
-       fi
-
-       econf \
-               --with-packager="Gentoo" \
-               --with-packager-version="${PVR} (p${PATCH_VER:-0})" \
-               --with-packager-bug-reports="http://bugs.gentoo.org/"; \
-               --enable-largefile \
-               $(use caps || echo --disable-libcap) \
-               $(use_enable nls) \
-               $(use_enable acl) \
-               $(use_enable multicall single-binary) \
-               $(use_enable xattr) \
-               $(use_with gmp) \
-               ${myconf}
-}
-
-src_test() {
-       # Non-root tests will fail if the full path isn't
-       # accessible to non-root users
-       chmod -R go-w "${WORKDIR}"
-       chmod a+rx "${WORKDIR}"
-
-       # coreutils tests like to do `mount` and such with temp dirs
-       # so make sure /etc/mtab is writable #265725
-       # make sure /dev/loop* can be mounted #269758
-       mkdir -p "${T}"/mount-wrappers
-       mkwrap() {
-               local w ww
-               for w in "$@" ; do
-                       ww="${T}/mount-wrappers/${w}"
-                       cat <<-EOF > "${ww}"
-                               #!${EPREFIX}/bin/sh
-                               exec env 
SANDBOX_WRITE="\${SANDBOX_WRITE}:/etc/mtab:/dev/loop" $(type -P $w) "\$@"
-                       EOF
-                       chmod a+rx "${ww}"
-               done
-       }
-       mkwrap mount umount
-
-       addwrite /dev/full
-       #export RUN_EXPENSIVE_TESTS="yes"
-       #export FETISH_GROUPS="portage wheel"
-       env PATH="${T}/mount-wrappers:${PATH}" \
-       emake -j1 -k check
-}
-
-src_install() {
-       default
-
-       insinto /etc
-       newins src/dircolors.hin DIR_COLORS
-
-       if [[ ${USERLAND} == "GNU" ]] ; then
-               cd "${ED}"/usr/bin
-               dodir /bin
-               # move critical binaries into /bin (required by FHS)
-               local fhs="cat chgrp chmod chown cp date dd df echo false ln ls
-                          mkdir mknod mv pwd rm rmdir stty sync true uname"
-
-               [[ ${CHOST} == *-mint* ]] && fhs="${fhs} hostname"
-
-               mv ${fhs} ../../bin/ || die "could not move fhs bins"
-               # move critical binaries into /bin (common scripts)
-               local com="basename chroot cut dir dirname du env expr head 
mkfifo
-                          mktemp readlink seq sleep sort tail touch tr tty 
vdir wc yes"
-               mv ${com} ../../bin/ || die "could not move common bins"
-               # create a symlink for uname in /usr/bin/ since autotools 
require it
-               local x
-               for x in ${com} uname ; do
-                       dosym /bin/${x} /usr/bin/${x}
-               done
-       else
-               # For now, drop the man pages, collides with the ones of the 
system.
-               rm -rf "${ED}"/usr/share/man
-       fi
-
-}
-
-pkg_postinst() {
-       ewarn "Make sure you run 'hash -r' in your active shells."
-       ewarn "You should also re-source your shell settings for LS_COLORS"
-       ewarn "  changes, such as: source /etc/profile"
-
-       # Help out users using experimental filesystems
-       if grep -qs btrfs "${EROOT}"/etc/fstab /proc/mounts ; then
-               case $(uname -r) in
-               2.6.[12][0-9]|2.6.3[0-7]*)
-                       ewarn "You are running a system with a buggy btrfs 
driver."
-                       ewarn "Please upgrade your kernel to avoid silent 
corruption."
-                       ewarn "See: https://bugs.gentoo.org/353907";
-                       ;;
-               esac
-       fi
-}

diff --git a/sys-apps/coreutils/coreutils-8.25.ebuild 
b/sys-apps/coreutils/coreutils-8.25.ebuild
deleted file mode 100644
index a7c0fbdce4..0000000000
--- a/sys-apps/coreutils/coreutils-8.25.ebuild
+++ /dev/null
@@ -1,212 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-# To generate the man pages, unpack the upstream tarball and run:
-# ./configure --enable-install-program=arch,coreutils,hostname,kill
-# make
-# cd ..
-# tar cf - coreutils-*/man/*.[0-9] | xz > coreutils-<ver>-man.tar.xz
-
-EAPI="4"
-
-inherit eutils flag-o-matic toolchain-funcs multilib
-
-PATCH_VER="1.1"
-DESCRIPTION="Standard GNU file utilities (chmod, cp, dd, dir, ls...), text 
utilities (sort, tr, head, wc..), and shell utilities (whoami, who,...)"
-HOMEPAGE="https://www.gnu.org/software/coreutils/";
-SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
-       mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz
-       https://dev.gentoo.org/~vapier/dist/${P}-patches-${PATCH_VER}.tar.xz
-       mirror://gentoo/${P}-man.tar.xz
-       https://dev.gentoo.org/~vapier/dist/${P}-man.tar.xz";
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos 
~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="acl caps elibc_glibc gmp hostname kill multicall nls selinux static 
+stdbuf uptime userland_BSD vanilla xattr"
-
-LIB_DEPEND="acl? ( sys-apps/acl[static-libs] )
-       caps? ( sys-libs/libcap )
-       gmp? ( dev-libs/gmp[static-libs] )
-       xattr? ( elibc_glibc? ( sys-apps/attr[static-libs] ) )"
-RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs]} )
-       selinux? ( sys-libs/libselinux )
-       nls? ( virtual/libintl )"
-DEPEND="${RDEPEND}
-       static? ( ${LIB_DEPEND} )
-       app-arch/xz-utils"
-RDEPEND+="
-       hostname? ( !sys-apps/net-tools[hostname] )
-       kill? (
-               !sys-apps/util-linux[kill]
-               !sys-process/procps[kill]
-       )
-       !app-misc/realpath
-       !<sys-apps/util-linux-2.13
-       !sys-apps/stat
-       !net-mail/base64
-       !sys-apps/mktemp
-       !<app-forensics/tct-1.18-r1
-       !<net-fs/netatalk-2.0.3-r4"
-
-src_prepare() {
-       if ! use vanilla ; then
-               use_if_iuse unicode || rm -f 
"${WORKDIR}"/patch/000_all_coreutils-i18n.patch
-               EPATCH_SUFFIX="patch" \
-               PATCHDIR="${WORKDIR}/patch" \
-               EPATCH_EXCLUDE="001_all_coreutils-gen-progress-bar.patch" \
-               epatch
-       fi
-
-       epatch "${FILESDIR}"/${PN}-8.22-mint.patch
-
-       # fixup libstdbuf non-libtool stuff
-       if [[ ${CHOST} == *-darwin* ]] ; then
-               sed -i \
-                       -e "/src_libstdbuf_so_LDFLAGS = 
-shared/s:-shared:-dynamiclib -install_name 
${EPREFIX}/usr/libexec/coreutils/libstdbuf.dylib:" \
-                       Makefile.in \
-                       || die
-       elif use elibc_Cygwin ; then
-               epatch "${FILESDIR}"/${P}-cygwin-3.patch
-               sed -i -e 's|\(libstdbuf\.so\)$(EXEEXT)|\1|g' Makefile.in || die
-       fi
-       sed -i \
-               -e "s/libstdbuf\\.so/libstdbuf$(get_libname)/" \
-               src/stdbuf.c \
-               Makefile.in \
-               configure \
-               || die
-
-       # Since we've patched many .c files, the make process will try to
-       # re-build the manpages by running `./bin --help`.  When doing a
-       # cross-compile, we can't do that since 'bin' isn't a native bin.
-       # Also, it's not like we changed the usage on any of these things,
-       # so let's just update the timestamps and skip the help2man step.
-       set -- man/*.x
-       touch ${@/%x/1}
-       # docs depend on configure as well
-       touch -r doc/stamp-vti configure
-
-       # Avoid perl dep for compiled in dircolors default #348642
-       if ! has_version dev-lang/perl ; then
-               touch src/{dircolors,fs-is-local,fs}.h # more?
-               touch ${@/%x/1}
-       fi
-}
-
-src_configure() {
-       local myconf=''
-       if tc-is-cross-compiler && [[ ${CHOST} == *linux* ]] ; then
-               export fu_cv_sys_stat_statfs2_bsize=yes #311569
-               export gl_cv_func_realpath_works=yes #416629
-       fi
-
-       export gl_cv_func_mknod_works=yes #409919
-       use static && append-ldflags -static && sed -i '/elf_sys=yes/s:yes:no:' 
configure #321821
-       use selinux || export 
ac_cv_{header_selinux_{context,flash,selinux}_h,search_setfilecon}=no #301782
-       use userland_BSD && myconf="${myconf} -program-prefix=g 
--program-transform-name=s/stat/nustat/"
-       # kill/uptime - procps
-       # groups/su   - shadow
-       # hostname    - net-tools
-       econf \
-               --with-packager="Gentoo" \
-               --with-packager-version="${PVR} (p${PATCH_VER:-0})" \
-               --with-packager-bug-reports="https://bugs.gentoo.org/"; \
-               --enable-install-program="arch,$(usev hostname),$(usev 
kill),$(usev stdbuf),$(usev uptime)" \
-               --enable-no-install-program="groups,$(usev !hostname),$(usev 
!kill),$(usev !stdbuf),su,$(usev !uptime)" \
-               --enable-largefile \
-               $(use caps || echo --disable-libcap) \
-               $(use_enable nls) \
-               $(use_enable acl) \
-               $(use_enable multicall single-binary) \
-               $(use_enable xattr) \
-               $(use_with gmp) \
-               ${myconf}
-}
-
-src_test() {
-       # Non-root tests will fail if the full path isn't
-       # accessible to non-root users
-       chmod -R go-w "${WORKDIR}"
-       chmod a+rx "${WORKDIR}"
-
-       # coreutils tests like to do `mount` and such with temp dirs
-       # so make sure /etc/mtab is writable #265725
-       # make sure /dev/loop* can be mounted #269758
-       mkdir -p "${T}"/mount-wrappers
-       mkwrap() {
-               local w ww
-               for w in "$@" ; do
-                       ww="${T}/mount-wrappers/${w}"
-                       cat <<-EOF > "${ww}"
-                               #!${EPREFIX}/bin/sh
-                               exec env 
SANDBOX_WRITE="\${SANDBOX_WRITE}:/etc/mtab:/dev/loop" $(type -P $w) "\$@"
-                       EOF
-                       chmod a+rx "${ww}"
-               done
-       }
-       mkwrap mount umount
-
-       addwrite /dev/full
-       #export RUN_EXPENSIVE_TESTS="yes"
-       #export FETISH_GROUPS="portage wheel"
-       env PATH="${T}/mount-wrappers:${PATH}" \
-       emake -j1 -k check
-}
-
-src_install() {
-       default
-
-       insinto /etc
-       newins src/dircolors.hin DIR_COLORS
-
-       if [[ ${USERLAND} == "GNU" ]] ; then
-               cd "${ED}"/usr/bin
-               dodir /bin
-               # move critical binaries into /bin (required by FHS)
-               local fhs="cat chgrp chmod chown cp date dd df echo false ln ls
-                          mkdir mknod mv pwd rm rmdir stty sync true uname
-                          $(usev hostname)"
-               mv ${fhs} ../../bin/ || die "could not move fhs bins"
-               if use kill; then
-                       mv kill ../../bin/ || die
-               fi
-               # move critical binaries into /bin (common scripts)
-               local com="basename chroot cut dir dirname du env expr head 
mkfifo
-                          mktemp readlink seq sleep sort tail touch tr tty 
vdir wc yes"
-               mv ${com} ../../bin/ || die "could not move common bins"
-               # create a symlink for uname in /usr/bin/ since autotools 
require it,
-               # as long as /bin resolves to a different directory than 
/usr/bin
-               local x
-               [[ ${EROOT}bin/. -ef ${EROOT}usr/bin/. ]] ||
-               for x in ${com} uname ; do
-                       dosym /bin/${x} /usr/bin/${x}
-               done
-       else
-               # For now, drop the man pages, collides with the ones of the 
system.
-               rm -rf "${ED}"/usr/share/man
-       fi
-
-       if use elibc_Cygwin ; then
-               ! use kill || mv "${ED}"/bin/{,g}kill || die
-               mv "${ED}"/usr/libexec/${PN}/libstdbuf$(get_libname){.exe,} || 
die
-       fi
-}
-
-pkg_postinst() {
-       ewarn "Make sure you run 'hash -r' in your active shells."
-       ewarn "You should also re-source your shell settings for LS_COLORS"
-       ewarn "  changes, such as: source /etc/profile"
-
-       # Help out users using experimental filesystems
-       if grep -qs btrfs "${EROOT}"/etc/fstab /proc/mounts ; then
-               case $(uname -r) in
-               2.6.[12][0-9]|2.6.3[0-7]*)
-                       ewarn "You are running a system with a buggy btrfs 
driver."
-                       ewarn "Please upgrade your kernel to avoid silent 
corruption."
-                       ewarn "See: https://bugs.gentoo.org/353907";
-                       ;;
-               esac
-       fi
-}

diff --git a/sys-apps/coreutils/coreutils-8.28-r1.ebuild 
b/sys-apps/coreutils/coreutils-8.28-r1.ebuild
deleted file mode 100644
index 814ca215cf..0000000000
--- a/sys-apps/coreutils/coreutils-8.28-r1.ebuild
+++ /dev/null
@@ -1,239 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-# To generate the man pages, unpack the upstream tarball and run:
-# ./configure --enable-install-program=arch,coreutils,hostname,kill
-# make
-# cd ..
-# tar cf - coreutils-*/man/*.[0-9] | xz > coreutils-<ver>-man.tar.xz
-
-EAPI="6"
-
-PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
-
-inherit eutils flag-o-matic python-any-r1 toolchain-funcs multilib
-
-PATCH_VER="1.1"
-DESCRIPTION="Standard GNU utilities (chmod, cp, dd, ls, sort, tr, head, wc, 
who,...)"
-HOMEPAGE="https://www.gnu.org/software/coreutils/";
-SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
-       mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz
-       
https://dev.gentoo.org/~whissi/dist/${PN}/${P}-patches-${PATCH_VER}.tar.xz
-       mirror://gentoo/${P}-man.tar.xz
-       https://dev.gentoo.org/~polynomial-c/dist/${P}-man.tar.xz";
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos 
~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="acl caps elibc_glibc gmp hostname kill multicall nls selinux static 
+stdbuf test uptime userland_BSD vanilla xattr"
-
-LIB_DEPEND="acl? ( sys-apps/acl[static-libs] )
-       caps? ( sys-libs/libcap )
-       gmp? ( dev-libs/gmp:=[static-libs] )
-       xattr? ( !elibc_glibc? ( sys-apps/attr[static-libs] ) )"
-RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs]} )
-       selinux? ( sys-libs/libselinux )
-       nls? ( virtual/libintl )"
-DEPEND="${RDEPEND}
-       static? ( ${LIB_DEPEND} )
-       app-arch/xz-utils
-       test? (
-               dev-lang/perl
-               dev-perl/Expect
-               !userland_BSD? (
-                       dev-util/strace
-               )
-               ${PYTHON_DEPS}
-               $(python_gen_any_dep 'dev-python/pyinotify[${PYTHON_USEDEP}]')
-       )"
-RDEPEND+="
-       hostname? ( !sys-apps/net-tools[hostname] )
-       kill? (
-               !sys-apps/util-linux[kill]
-               !sys-process/procps[kill]
-       )
-       !app-misc/realpath
-       !<sys-apps/util-linux-2.13
-       !<sys-apps/sandbox-2.10-r4
-       !sys-apps/stat
-       !net-mail/base64
-       !sys-apps/mktemp
-       !<app-forensics/tct-1.18-r1
-       !<net-fs/netatalk-2.0.3-r4"
-
-pkg_setup() {
-       if use test ; then
-               python-any-r1_pkg_setup
-       fi
-}
-
-src_prepare() {
-       if ! use vanilla ; then
-               use_if_iuse unicode || rm -f 
"${WORKDIR}"/patch/000_all_coreutils-i18n.patch
-               #rm "${WORKDIR}"/patch/001_all_coreutils-gen-progress-bar.patch 
|| die
-               eapply "${WORKDIR}"/patch/*.patch
-       fi
-
-       eapply_user
-
-       epatch "${FILESDIR}"/${PN}-8.22-mint.patch
-
-       # fixup libstdbuf non-libtool stuff
-       if [[ ${CHOST} == *-darwin* ]] ; then
-               sed -i \
-                       -e "/src_libstdbuf_so_LDFLAGS = 
-shared/s:-shared:-dynamiclib -install_name 
${EPREFIX}/usr/libexec/coreutils/libstdbuf.dylib:" \
-                       Makefile.in \
-                       || die
-       elif use elibc_Cygwin ; then
-               epatch "${FILESDIR}"/${P}-cygwin-8.26-3.patch
-               sed -i -e 's|\(libstdbuf\.so\)$(EXEEXT)|\1|g' Makefile.in || die
-       fi
-       sed -i \
-               -e "s/libstdbuf\\.so/libstdbuf$(get_libname)/" \
-               src/stdbuf.c \
-               Makefile.in \
-               configure \
-               || die
-
-       # Since we've patched many .c files, the make process will try to
-       # re-build the manpages by running `./bin --help`.  When doing a
-       # cross-compile, we can't do that since 'bin' isn't a native bin.
-       # Also, it's not like we changed the usage on any of these things,
-       # so let's just update the timestamps and skip the help2man step.
-       set -- man/*.x
-       touch ${@/%x/1}
-       # docs depend on configure as well
-       touch -r doc/stamp-vti configure
-
-       # Avoid perl dep for compiled in dircolors default #348642
-       if ! has_version dev-lang/perl ; then
-               touch src/{dircolors,fs-is-local,fs}.h # more?
-               touch ${@/%x/1}
-       fi
-}
-
-src_configure() {
-       local myconf=(
-               --with-packager="Gentoo"
-               --with-packager-version="${PVR} (p${PATCH_VER:-0})"
-               --with-packager-bug-reports="https://bugs.gentoo.org/";
-               --enable-install-program="arch,$(usev hostname),$(usev 
kill),$(usev stdbuf),$(usev uptime)"
-               --enable-no-install-program="groups,$(usev !hostname),$(usev 
!kill),$(usev !stdbuf),su,$(usev !uptime)"
-               --enable-largefile
-               $(use caps || echo --disable-libcap)
-               $(use_enable nls)
-               $(use_enable acl)
-               $(use_enable multicall single-binary)
-               $(use_enable xattr)
-               $(use_with gmp)
-       )
-       if tc-is-cross-compiler && [[ ${CHOST} == *linux* ]] ; then
-               export fu_cv_sys_stat_statfs2_bsize=yes #311569
-               export gl_cv_func_realpath_works=yes #416629
-       fi
-
-       export gl_cv_func_mknod_works=yes #409919
-       use static && append-ldflags -static && sed -i '/elf_sys=yes/s:yes:no:' 
configure #321821
-       use selinux || export 
ac_cv_{header_selinux_{context,flash,selinux}_h,search_setfilecon}=no #301782
-       use userland_BSD && myconf+=( -program-prefix=g 
--program-transform-name=s/stat/nustat/ )
-       # kill/uptime - procps
-       # groups/su   - shadow
-       # hostname    - net-tools
-       econf "${myconf[@]}"
-}
-
-src_test() {
-       # Known to fail with FEATURES=usersandbox (bug #439574):
-       #   -  tests/du/long-from-unreadable.sh} (bug #413621)
-       #   -  tests/rm/deep-2.sh (bug #413621)
-       #   -  tests/dd/no-allocate.sh (bug #629660)
-       if has usersandbox $FEATURES ; then
-               ewarn "You are emerging ${P} with 'usersandbox' enabled." \
-                       "Expect some test failures or emerge with 
'FEATURES=-usersandbox'!"
-       fi
-
-       # Non-root tests will fail if the full path isn't
-       # accessible to non-root users
-       chmod -R go-w "${WORKDIR}"
-       chmod a+rx "${WORKDIR}"
-
-       # coreutils tests like to do `mount` and such with temp dirs
-       # so make sure /etc/mtab is writable #265725
-       # make sure /dev/loop* can be mounted #269758
-       mkdir -p "${T}"/mount-wrappers
-       mkwrap() {
-               local w ww
-               for w in "$@" ; do
-                       ww="${T}/mount-wrappers/${w}"
-                       cat <<-EOF > "${ww}"
-                               #!${EPREFIX}/bin/sh
-                               exec env 
SANDBOX_WRITE="\${SANDBOX_WRITE}:/etc/mtab:/dev/loop" $(type -P $w) "\$@"
-                       EOF
-                       chmod a+rx "${ww}"
-               done
-       }
-       mkwrap mount umount
-
-       addwrite /dev/full
-       #export RUN_EXPENSIVE_TESTS="yes"
-       #export FETISH_GROUPS="portage wheel"
-       env PATH="${T}/mount-wrappers:${PATH}" \
-       emake -j1 -k check
-}
-
-src_install() {
-       default
-
-       insinto /etc
-       newins src/dircolors.hin DIR_COLORS
-
-       if [[ ${USERLAND} == "GNU" ]] ; then
-               cd "${ED%/}"/usr/bin || die
-               dodir /bin
-               # move critical binaries into /bin (required by FHS)
-               local fhs="cat chgrp chmod chown cp date dd df echo false ln ls
-                          mkdir mknod mv pwd rm rmdir stty sync true uname
-                          $(usev hostname)"
-               mv ${fhs} ../../bin/ || die "could not move fhs bins"
-               if use kill; then
-                       mv kill ../../bin/ || die
-               fi
-               # move critical binaries into /bin (common scripts)
-               local com="basename chroot cut dir dirname du env expr head 
mkfifo
-                          mktemp readlink seq sleep sort tail touch tr tty 
vdir wc yes"
-               mv ${com} ../../bin/ || die "could not move common bins"
-               # create a symlink for uname in /usr/bin/ since autotools 
require it
-               # as long as /bin resolves to a different directory than 
/usr/bin
-               local x
-               [[ ${EROOT}bin/. -ef ${EROOT}usr/bin/. ]] ||
-               for x in ${com} uname ; do
-                       dosym ../../bin/${x} /usr/bin/${x}
-               done
-       else
-               # For now, drop the man pages, collides with the ones of the 
system.
-               rm -rf "${ED%/}"/usr/share/man
-       fi
-
-       if use elibc_Cygwin ; then
-               ! use kill || mv "${ED}"/bin/{,g}kill || die
-               mv "${ED}"/usr/libexec/${PN}/libstdbuf$(get_libname){.exe,} || 
die
-       fi
-}
-
-pkg_postinst() {
-       ewarn "Make sure you run 'hash -r' in your active shells."
-       ewarn "You should also re-source your shell settings for LS_COLORS"
-       ewarn "  changes, such as: source /etc/profile"
-
-       # Help out users using experimental filesystems
-       if grep -qs btrfs "${EROOT%/}"/etc/fstab /proc/mounts ; then
-               case $(uname -r) in
-               2.6.[12][0-9]|2.6.3[0-7]*)
-                       ewarn "You are running a system with a buggy btrfs 
driver."
-                       ewarn "Please upgrade your kernel to avoid silent 
corruption."
-                       ewarn "See: https://bugs.gentoo.org/353907";
-                       ;;
-               esac
-       fi
-}

diff --git a/sys-apps/coreutils/files/coreutils-8.25-cygwin-3.patch 
b/sys-apps/coreutils/files/coreutils-8.25-cygwin-3.patch
deleted file mode 100644
index 7d2604f806..0000000000
--- a/sys-apps/coreutils/files/coreutils-8.25-cygwin-3.patch
+++ /dev/null
@@ -1,1407 +0,0 @@
-This is a copy of coreutils-8.25-3.src.patch from the official Cygwin
-coreutils-8.25-3 source package, modified to avoid re-running autotools:
-
-* Hunks for ./configure.ac go to ./configure instead.
-* Hunks for ./lib/local.mk go to ./Makefile.in instead.
-
---- origsrc/coreutils-8.25/ChangeLog   2016-01-20 03:55:17.000000000 -0700
-+++ src/coreutils-8.25/ChangeLog       2016-04-12 12:50:05.042257400 -0600
-@@ -1,3 +1,235 @@
-+2016-03-08  Eric Blake <[email protected]>
-+
-+      Cygwin release 8.25-1.
-+      * lib/set-permissions.c (set_acls_from_mode): Fix missing return.
-+
-+2015-08-26  Eric Blake  <[email protected]>
-+
-+      Cygwin release 8.24-3.
-+      * lib/cygwin.c (cygwin_spelling): Fix uninitialized variable that
-+      broke 'cp -r' depending on stack contents.
-+
-+2015-08-26  Eric Blake  <[email protected]>
-+
-+      Cygwin release 8.24-2.
-+      Enable stdbuf (requires hacks to Makefile.in).
-+
-+
-+2015-08-25  Eric Blake  <[email protected]>
-+
-+      Cygwin release 8.24-1.
-+
-+2014-09-24  Eric Blake  <[email protected]>
-+
-+      Cygwin release 8.23-3.
-+      * lib/cygwin.c (cygwin_spelling): Skip .exe magic if .exe is
-+      already present.  Also honor .exe magic on symlinks.
-+      * lib/same.c (same_name): Treat files as same if only difference
-+      is .exe magic.
-+      * src/copy.c (copy): Move symlink special casing here.
-+      * src/install.c (strip): Update caller.
-+      * src/ls.c (gobble_file): Likewise.
-+      * src/stat.c (do_statfs, do_stat): Likewise.
-+
-+2014-08-12  Eric Blake  <[email protected]>
-+
-+      Cygwin release 8.23-2.
-+      Drop hostname.
-+
-+2014-08-01  Eric Blake  <[email protected]>
-+
-+      Cygwin release 8.23-1.
-+      * configure.ac: Disable stdbuf.
-+      * lib/local.mk: Upstream switched to flat make, impacting how
-+      we build local cygwin.c code.
-+      * lib/canonicalize.c: Accepted upstream.
-+      * lib/file-has-acl.c: Likewise.
-+      * src/realpath.c: Likewise.
-+      * src/su.c: Upstream dropped su.
-+      * src/Makefile.am: Drop su changes.
-+      * src/chroot.c: Adapt to new upstream code.
-+
-+2012-02-04  Eric Blake  <[email protected]>
-+
-+      Cygwin release 8.15-1.
-+      * lib/fts.c: Early gnulib fix is now upstream.
-+      * lib/canonicalize.c: Backport gnulib fix for /// -> /.
-+      * src/realpath.c: Backport gnulib fix for --relative-to.
-+
-+2011-10-27  Eric Blake  <[email protected]>
-+
-+      Cygwin release 8.14-1.
-+      * lib/ftc.c: Backport gnulib fix to make rm close before rmdir.
-+      * lib/cygwin.c (cygwin_spelling): Fix logic when 'f' and 'f.exe'
-+      exist but are different files.
-+      * src/stat.c: Fix --append-exe.
-+
-+2011-02-04  Eric Blake  <[email protected]>
-+
-+      Cygwin release 8.10-1.
-+
-+2010-12-24  Eric Blake  <[email protected]>
-+
-+      Cygwin release 8.8-1.
-+      * lib/mountlist.c (ME_REMOTE): Restore previous cygwin hack to
-+      determine remote drives, lost since 6.11-1.
-+
-+2010-04-29  Eric Blake  <[email protected]>
-+
-+      Cygwin release 8.5-1.
-+
-+2010-03-11  Eric Blake  <[email protected]>
-+
-+      Cygwin release 8.4-1.
-+      * lib/xfreopen.c (xfreopen): Consolidate workaround for broken
-+      freopen usage into one place.
-+      * src/copy.c (copy): Reinstate .exe magic handling when copying
-+      files with implicit .exe.
-+
-+2008-12-13  Eric Blake  <[email protected]>
-+
-+      Cygwin release 7.0-1.
-+
-+2008-06-02  Eric Blake  <[email protected]>
-+
-+      Cygwin release 6.12-1.
-+
-+2008-05-12  Eric Blake  <[email protected]>
-+
-+      Cygwin release 6.11-1, requires cygwin 1.7.0.
-+      * lib/cygwin.h (CYGWIN_APPEND_EXE): Accomodate new PATH_MAX.
-+      * lib/cygwin.c (cygwin_spelling): Accomodate new trailing
-+      `.' semantics.
-+      * lib/same.c (same_name): Accomodate new PATH_MAX.
-+
-+2008-01-24  Eric Blake  <[email protected]>
-+
-+      Cygwin release 6.10-1.
-+      * lib/hash-triple.c (triple_hash): Hash case-insensitively.
-+      * lib/hash-pjw.h (hash_pjw_case): New interface.
-+      * lib/hash-pjw.c (hash_pjw_case): New function.
-+      * src/chcon.c (main): Support my root_dev_ino tweaks.
-+
-+2007-08-21  Eric Blake  <[email protected]>
-+
-+      Cygwin release 6.9-5.
-+      * same.c (same_name): Detect same file differing only by case.
-+      * src/copy.c (same_file_ok): Add parameter to detect when case
-+      change is being attempted.
-+      (triple_hash): Hash names case-insensitively.
-+      (copy_internal): Accommodate case-change attempts.
-+      * src/mv.c (do_move): Allow 'mv foo/ Foo/' as shorthand for
-+      'mv -T foo/ Foo/'.
-+
-+2007-07-23  Eric Blake  <[email protected]>
-+
-+      Cygwin release 6.9-4.
-+      * src/dd.c (main): Fix typo in earlier cygwin patch.
-+
-+2007-05-29  Eric Blake  <[email protected]>
-+
-+      Cygwin release 6.9-3.
-+      * src/cksum.c (main): Don't lose append mode.
-+      * src/md5sum.c (main): Likewise.
-+      * src/cat.c (main): Likewise.
-+      * src/head.c (main): Likewise.
-+      * src/tac.c (main): Likewise.
-+      * src/tail.c (main): Likewise.
-+      * src/tee.c (main): Likewise.
-+      * src/tr.c (main): Likewise.
-+
-+2006-11-24  Eric Blake  <[email protected]>
-+
-+      Cygwin release 6.6-2.
-+      * lib/cygwin.c (cygwin_spelling): Work even with old-style
-+      symlinks, which lacked .lnk suffix.
-+
-+2006-04-14  Eric Blake  <[email protected]>
-+
-+      Cygwin release 5.94-5. Experimental only, depends on cygwin
-+      snapshot 20060329 or later.
-+      * src/dd.c (main): Default to binary mode.
-+      * src/system.h (rpl_freopen): Remove this hack, now that cygwin
-+      freopen(NULL) works.
-+      * lib/quotearg.c (quote_eight_bit): New variable, so I can...
-+      (quotearg_buffer_restyled): treat 8-bit characters as printable
-+      when outputting to a terminal.
-+      * lib/quote.c (quote_n): Use it.
-+
-+2006-02-28  Eric Blake  <[email protected]>
-+
-+      Cygwin release 5.94-4. Experimental only, depends on cygwin
-+      snapshot 20060227 or later.
-+      * lib/root-dev-ino.h (struct root_dev_ino): New struct.
-+      (ROOT_DEV_INO_CHECK, ROOT_DEV_INO_WARN): Also track //.
-+      * lib/root-dev-ino.c (get_root_dev_ino): Also track //.
-+      * src/chmod.c (root_dev_ino): Use new type.
-+      (main): Ditto.
-+      * src/chown-core.h (struct Chown_option): Ditto.
-+      * src/chown.c (main): Ditto.
-+      * src/remove.h (struct rm_options): Ditto.
-+      * src/rm.c (main): Ditto.
-+      * src/pwd.c (robust_getcwd): Ditto.  Also fix bug when in / or //.
-+
-+2006-01-24  Eric Blake  <[email protected]>
-+
-+      Cygwin release 5.93-3, depends on cygwin-1.5.19-1 or later.
-+      * src/cksum.c (main): Always output binary files.
-+      * src/md5sum.c (main): Likewise.
-+      * src/su.c (correct_password): On NT machines, attempt
-+      passwordless login first, and give better error message if
-+      password check fails.  I still don't know how to distinguish
-+      between insufficient privileges vs. incorrect password.
-+      * src/dircolors.c (main): Silence warning from tcsh 6.14.00.
-+
-+2005-10-15  Eric Blake  <[email protected]>
-+
-+      Cygwin release 5.90-3, depends on snapshot 20051003 or later (will
-+      become cygwin 1.5.19).
-+      * doc/coreutils.texi (ls invocation, stat invocation): Document
-+      --append-exe.
-+      * src/ls.c (usage): Ditto.
-+      (gobble_file): Append .exe as needed when requested.
-+      * src/stat.c (usage): Document --append-exe.
-+      (do_stat, do_statfs): Append .exe as needed when requested.
-+
-+2005-10-08  Eric Blake  <[email protected]>
-+
-+      Cygwin release 5.90-2, depends on snapshot 20051003 or later (will
-+      become cygwin 1.5.19).
-+      * lib/mkdir-p.c (make_dir_parents): Fix bug in last patch.
-+      * lib/cygwin.h (CYGWIN_APPEND_EXE): Factor into common macro.
-+      * src/copy.c (copy): Use new macro.
-+      * src/install.c (strip): Ditto.
-+      * src/ln.c (do_link): Ditto.
-+
-+2005-07-13  Eric Blake  <[email protected]>
-+
-+      * doc/coreutils.texi (ln invocation): Document --disable-exe-magic.
-+      * src/ln.c (usage): Likewise.
-+      (do_link): Skip .exe magic when requested.
-+
-+2005-07-12  Eric Blake  <[email protected]>
-+
-+      * lib/cygwin.c (cygwin_spelling): Don't append .exe to directories.
-+      Make sure .exe exists before returning 1, because otherwise
-+      virtual directories such as /cygdrive have problems.
-+
-+2005-07-07  Eric Blake  <[email protected]>
-+
-+      * lib/cygwin.h: New file, defining cygwin_spelling.
-+      * lib/cygwin.c: New file.
-+      * lib/Makefile.am: Compile it.
-+      * src/copy.c (copy_internal, copy): Use new cygwin_spelling() to
-+      undo .exe magic.
-+      * src/link.c (do_link): Likewise.
-+      * src/install.c (strip): Likewise.
-+
-+2005-01-03  Corinna Vinschen  <[email protected]>
-+
-+      * src/install.c (strip): Check for .exe here since strip doesn't.
-+
-+
- 2016-01-20  Pádraig Brady  <[email protected]>
- 
-       version 8.25
---- origsrc/coreutils-8.25/configure.ac        2016-01-01 06:48:50.000000000 
-0700
-+++ src/coreutils-8.25/configure.ac    2016-04-12 12:49:47.302692100 -0600
-#@@ -468,7 +468,8 @@ gl_WARN_ADD([-Werror], [CFLAGS])
- gl_WARN_ADD([-errwarn], [CFLAGS])
- # Put this message here, after gl_WARN_ADD's chatter.
- AC_MSG_CHECKING([whether this system supports stdbuf])
--CFLAGS="-fPIC $CFLAGS"
-+# -fPIC on cygwin is a warning
-+# CFLAGS="-fPIC $CFLAGS"
- LDFLAGS="-shared $LDFLAGS"
- stdbuf_supported=no
- # Note we only LINK here rather than RUN to support cross compilation
-#@@ -486,7 +487,7 @@ AC_LINK_IFELSE(
-   ],
-   [stdbuf_supported=yes])
- AC_MSG_RESULT([$stdbuf_supported])
--if test "$stdbuf_supported" = "yes" && test -z "$EXEEXT"; then
-+if test "$stdbuf_supported" = "yes"; then
-   gl_ADD_PROG([optional_bin_progs], [stdbuf])
- fi
- CFLAGS=$ac_save_CFLAGS
---- origsrc/coreutils-8.25/configure
-+++ src/coreutils-8.25/configure
-@@ -63050,7 +63050,8 @@
- # Put this message here, after gl_WARN_ADD's chatter.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this system 
supports stdbuf" >&5
- $as_echo_n "checking whether this system supports stdbuf... " >&6; }
--CFLAGS="-fPIC $CFLAGS"
-+# -fPIC on cygwin is a warning
-+# CFLAGS="-fPIC $CFLAGS"
- LDFLAGS="-shared $LDFLAGS"
- stdbuf_supported=no
- # Note we only LINK here rather than RUN to support cross compilation
-@@ -63082,7 +63083,7 @@
-     conftest$ac_exeext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $stdbuf_supported" >&5
- $as_echo "$stdbuf_supported" >&6; }
--if test "$stdbuf_supported" = "yes" && test -z "$EXEEXT"; then
-+if test "$stdbuf_supported" = "yes"; then
-   {
-   if test -z "$optional_bin_progs"; then
-     optional_bin_progs=stdbuf
---- origsrc/coreutils-8.25/doc/coreutils.texi  2016-01-13 04:16:39.000000000 
-0700
-+++ src/coreutils-8.25/doc/coreutils.texi      2016-04-12 12:49:47.318287500 
-0600
-#@@ -7665,6 +7665,14 @@ These options change how file names them
- 
- @table @samp
- 
-+@item --append-exe
-+@opindex --append-exe
-+@cindex appending exe on cygwin
-+Cygwin only: Cygwin normally performs @samp{.exe} magic, where a
-+command line argument typed without an .exe extension transparently
-+refers to the existing file with an extension.  Specifying this option
-+will make the .exe show if cygwin magic was involved.
-+
- @item -b
- @itemx --escape
- @itemx --quoting-style=escape
-#@@ -11679,6 +11687,14 @@ With this option, @command{stat} acts on
- by each symbolic link argument.
- Without it, @command{stat} acts on any symbolic link argument directly.
- 
-+@item --append-exe
-+@opindex --append-exe
-+@cindex appending exe on cygwin
-+Cygwin only: Cygwin normally performs .exe magic, where a command line
-+argument typed without an .exe extension transparently refers to the
-+existing file with an extension.  Specifying this option will make
-+the .exe show if cygwin magic was involved.
-+
- @item -f
- @itemx --file-system
- @opindex -f
---- origsrc/coreutils-8.25/lib/cygwin.c        1969-12-31 17:00:00.000000000 
-0700
-+++ src/coreutils-8.25/lib/cygwin.c    2016-04-12 12:49:47.318287500 -0600
-@@ -0,0 +1,73 @@
-+/* cygwin.c - helper functions unique to Cygwin
-+
-+   Copyright (C) 2005, 2006, 2008, 2011 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, 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, write to the Free Software Foundation,
-+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+   Written by Eric Blake.  */
-+
-+#include <config.h>
-+
-+#include "cygwin.h"
-+
-+#include <errno.h>
-+#include <limits.h>
-+#include <string.h>
-+#include <unistd.h>
-+
-+/* Return -1 if PATH is not found, 0 if PATH will not have .exe
-+   appended (it is possible that a PATH that does not exist still
-+   returns 0 instead of -1, or fails for a PATH that exists but cannot
-+   be stat'ed), and positive if PATH has ".exe" automatically appended
-+   by cygwin (1 if PATH is a symlink, 2 otherwise).  Won't change errno.  */
-+
-+int
-+cygwin_spelling (char const *path)
-+{
-+  int saved_errno = errno;
-+  int result = 0; /* Start with assumption that PATH is okay.  */
-+  size_t len;
-+  struct stat st1;
-+  struct stat st2;
-+  char *path_exe;
-+
-+  /* If PATH will cause EINVAL or ENAMETOOLONG, treat it as missing.  */
-+  if (! path || ! *path)
-+    return -1;
-+  if (PATH_MAX < (len = strlen (path)))
-+    return -1;
-+  /* Don't change spelling if there is a trailing `/' or '.exe'.  */
-+  if (path[len - 1] == '/'
-+      || (len > 4 && !strcasecmp (&path[len - 4], ".exe")))
-+    return 0;
-+  if (lstat (path, &st1) < 0)
-+    {
-+      errno = saved_errno;
-+      return -1;
-+    }
-+  if (S_ISDIR(st1.st_mode))
-+    {
-+      errno = saved_errno;
-+      return 0;
-+    }
-+  path_exe = malloca (len + 5); /* adding ".exe" and NUL.  */
-+  strcat (stpcpy (path_exe, path), ".exe");
-+  if (lstat (path_exe, &st2) == 0 && st1.st_ino == st2.st_ino)
-+    result = 1 + !S_ISLNK(st1.st_mode);
-+  freea (path_exe);
-+
-+  errno = saved_errno;
-+  return result;
-+}
---- origsrc/coreutils-8.25/lib/cygwin.h        1969-12-31 17:00:00.000000000 
-0700
-+++ src/coreutils-8.25/lib/cygwin.h    2016-04-12 12:49:47.318287500 -0600
-@@ -0,0 +1,38 @@
-+/* cygwin.h - helper functions unique to Cygwin
-+
-+   Copyright (C) 2005, 2006, 2008, 2010, 2011 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, 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, write to the Free Software Foundation,
-+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+   Written by Eric Blake.  */
-+
-+#ifndef CYGWIN_H
-+# define CYGWIN_H 1
-+
-+#include "malloca.h"
-+
-+int cygwin_spelling (char const *);
-+
-+/* Append ".exe" to char *__NAME_ORIG, where __NAME is either NULL or
-+   between __NAME_ORIG and the nul terminator.  Both params will be
-+   evaluated more than once and assigned the new value.  The user must
-+   later call freea(__NAME).  */
-+#define CYGWIN_APPEND_EXE(__name, __name_orig)                          \
-+  __name_orig = __name =                                                \
-+    strcat (strcpy (malloca (strchr (__name ? __name : __name_orig, '\0') \
-+                             - (__name_orig) + 5),                      \
-+                    __name_orig), ".exe")
-+
-+#endif /* CYGWIN_H */
---- origsrc/coreutils-8.25/lib/hash-pjw.c      2016-01-01 06:45:55.000000000 
-0700
-+++ src/coreutils-8.25/lib/hash-pjw.c  2016-04-12 12:49:47.318287500 -0600
-@@ -19,6 +19,7 @@
- 
- #include "hash-pjw.h"
- 
-+#include <ctype.h>
- #include <limits.h>
- 
- #define SIZE_BITS (sizeof (size_t) * CHAR_BIT)
-@@ -38,3 +39,16 @@ hash_pjw (const void *x, size_t tablesiz
- 
-   return h % tablesize;
- }
-+
-+/* Likewise, but case-insensitive.  */
-+size_t
-+hash_pjw_case (const void *x, size_t tablesize)
-+{
-+  const unsigned char *s;
-+  size_t h = 0;
-+
-+  for (s = x; *s; s++)
-+    h = tolower (*s) + ((h << 9) | (h >> (SIZE_BITS - 9)));
-+
-+  return h % tablesize;
-+}
---- origsrc/coreutils-8.25/lib/hash-pjw.h      2016-01-01 06:45:55.000000000 
-0700
-+++ src/coreutils-8.25/lib/hash-pjw.h  2016-04-12 12:49:47.318287500 -0600
-@@ -21,3 +21,4 @@
-    The result is platform dependent: it depends on the size of the 'size_t'
-    type and on the signedness of the 'char' type.  */
- extern size_t hash_pjw (void const *x, size_t tablesize) _GL_ATTRIBUTE_PURE;
-+extern size_t hash_pjw_case (void const *x, size_t tablesize) 
_GL_ATTRIBUTE_PURE;
---- origsrc/coreutils-8.25/lib/hash-triple.c   2016-01-01 06:45:55.000000000 
-0700
-+++ src/coreutils-8.25/lib/hash-triple.c       2016-04-12 12:49:47.318287500 
-0600
-@@ -34,7 +34,13 @@ size_t
- triple_hash (void const *x, size_t table_size)
- {
-   struct F_triple const *p = x;
-+#if !__CYGWIN__
-   size_t tmp = hash_pjw (p->name, table_size);
-+#else // cygwin
-+  /* Hash case-insensitively, to force collisions on names that differ by
-+     case; copy.c can then account for case-insensitive renames. */
-+  size_t tmp = hash_pjw_case (p->name, table_size);
-+#endif
- 
-   /* Ignoring the device number here should be fine.  */
-   return (tmp ^ p->st_ino) % table_size;
---- origsrc/coreutils-8.25/lib/local.mk        2012-11-13 06:51:53.000000000 
-0700
-+++ src/coreutils-8.25/lib/local.mk    2016-04-12 12:49:47.318287500 -0600
-#@@ -3,3 +3,6 @@ include lib/gnulib.mk
- # Allow "make distdir" to succeed before "make all" has run.
- dist-hook: $(noinst_LIBRARIES)
- .PHONY: dist-hook
-+
-+# Hook in cygwin helper
-+lib_libcoreutils_a_SOURCES += lib/cygwin.c lib/cygwin.h
---- origsrc/coreutils-8.25/Makefile.in
-+++ src/coreutils-8.25/Makefile.in
-@@ -694,7 +694,8 @@
-       lib/xstriconv.h lib/xstriconv.c lib/xstrndup.h lib/xstrndup.c \
-       lib/xstrtod.c lib/xstrtoimax.c lib/xstrtol.c lib/xstrtoul.c \
-       lib/xstrtol-error.c lib/xstrtold.c lib/xstrtoumax.c \
--      lib/xvasprintf.h lib/xvasprintf.c lib/xasprintf.c lib/yesno.c
-+      lib/xvasprintf.h lib/xvasprintf.c lib/xasprintf.c lib/yesno.c \
-+      lib/cygwin.c lib/cygwin.h
- am__dirstamp = $(am__leading_dot)dirstamp
- @LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE@am__objects_1 = 
lib/unistr/u8-mbtoucr.$(OBJEXT)
- @LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE@am__objects_2 = 
lib/unistr/u8-uctomb.$(OBJEXT) \
-@@ -799,7 +800,8 @@
-       lib/xstrtol.$(OBJEXT) lib/xstrtoul.$(OBJEXT) \
-       lib/xstrtol-error.$(OBJEXT) lib/xstrtold.$(OBJEXT) \
-       lib/xstrtoumax.$(OBJEXT) lib/xvasprintf.$(OBJEXT) \
--      lib/xasprintf.$(OBJEXT) lib/yesno.$(OBJEXT)
-+      lib/xasprintf.$(OBJEXT) lib/yesno.$(OBJEXT) \
-+      lib/cygwin.$(OBJEXT)
- lib_libcoreutils_a_OBJECTS = $(am_lib_libcoreutils_a_OBJECTS)
- src_libsinglebin___a_AR = $(AR) $(ARFLAGS)
- src_libsinglebin___a_LIBADD =
-@@ -4215,6 +4217,8 @@
- #     mv $@-t $@
- #EXTRA_DIST += script.in
- #MOSTLYCLEANFILES += script script-t
-+
-+# Hook in cygwin helper
- lib_libcoreutils_a_SOURCES = lib/copy-acl.c lib/set-acl.c \
-       lib/acl-errno-valid.c lib/acl-internal.c lib/get-permissions.c \
-       lib/set-permissions.c lib/allocator.c lib/areadlink.c \
-@@ -4288,7 +4292,8 @@
-       lib/xstriconv.h lib/xstriconv.c lib/xstrndup.h lib/xstrndup.c \
-       lib/xstrtod.c lib/xstrtoimax.c lib/xstrtol.c lib/xstrtoul.c \
-       lib/xstrtol-error.c lib/xstrtold.c lib/xstrtoumax.c \
--      lib/xvasprintf.h lib/xvasprintf.c lib/xasprintf.c lib/yesno.c
-+      lib/xvasprintf.h lib/xvasprintf.c lib/xasprintf.c lib/yesno.c \
-+      lib/cygwin.c lib/cygwin.h
- lib_libcoreutils_a_LIBADD = $(gl_LIBOBJS) @ALLOCA@
- lib_libcoreutils_a_DEPENDENCIES = $(gl_LIBOBJS) @ALLOCA@
- EXTRA_lib_libcoreutils_a_SOURCES = lib/acl_entries.c lib/alloca.c \
-@@ -6321,6 +6326,8 @@
- lib/xasprintf.$(OBJEXT): lib/$(am__dirstamp) \
-       lib/$(DEPDIR)/$(am__dirstamp)
- lib/yesno.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp)
-+lib/cygwin.$(OBJEXT): lib/$(am__dirstamp) \
-+      lib/$(DEPDIR)/$(am__dirstamp)
- lib/acl_entries.$(OBJEXT): lib/$(am__dirstamp) \
-       lib/$(DEPDIR)/$(am__dirstamp)
- lib/alloca.$(OBJEXT): lib/$(am__dirstamp) \
-@@ -8262,6 +8269,7 @@
- @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/copy-acl.Po@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/creat-safer.Po@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/cycle-check.Po@am__quote@
-+@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/cygwin.Po@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/di-set.Po@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/diacrit.Po@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dirchownmod.Po@am__quote@
---- origsrc/coreutils-8.25/lib/root-dev-ino.c  2016-01-01 06:48:50.000000000 
-0700
-+++ src/coreutils-8.25/lib/root-dev-ino.c      2016-04-12 12:49:47.318287500 
-0600
-@@ -25,13 +25,17 @@
- /* Call lstat to get the device and inode numbers for '/'.
-    Upon failure, return NULL.  Otherwise, set the members of
-    *ROOT_D_I accordingly and return ROOT_D_I.  */
--struct dev_ino *
--get_root_dev_ino (struct dev_ino *root_d_i)
-+struct root_dev_ino *
-+get_root_dev_ino (struct root_dev_ino *root_d_i)
- {
-   struct stat statbuf;
-   if (lstat ("/", &statbuf))
-     return NULL;
--  root_d_i->st_ino = statbuf.st_ino;
--  root_d_i->st_dev = statbuf.st_dev;
-+  root_d_i->single_slash.st_ino = statbuf.st_ino;
-+  root_d_i->single_slash.st_dev = statbuf.st_dev;
-+  if (lstat ("//", &statbuf))
-+    return NULL;
-+  root_d_i->double_slash.st_ino = statbuf.st_ino;
-+  root_d_i->double_slash.st_dev = statbuf.st_dev;
-   return root_d_i;
- }
---- origsrc/coreutils-8.25/lib/root-dev-ino.h  2016-01-01 06:48:50.000000000 
-0700
-+++ src/coreutils-8.25/lib/root-dev-ino.h      2016-04-12 12:49:47.318287500 
-0600
-@@ -21,19 +21,26 @@
- # include "dev-ino.h"
- # include "same-inode.h"
- 
--struct dev_ino *
--get_root_dev_ino (struct dev_ino *root_d_i);
-+struct root_dev_ino
-+{
-+  struct dev_ino single_slash;
-+  struct dev_ino double_slash;
-+};
-+
-+struct root_dev_ino *
-+get_root_dev_ino (struct root_dev_ino *root_d_i);
- 
- /* These macros are common to the programs that support the
-    --preserve-root and --no-preserve-root options.  */
- 
- # define ROOT_DEV_INO_CHECK(Root_dev_ino, Dir_statbuf) \
--    (Root_dev_ino && SAME_INODE (*Dir_statbuf, *Root_dev_ino))
-+  (Root_dev_ino && (SAME_INODE (*Dir_statbuf, (Root_dev_ino)->single_slash) \
-+                    || SAME_INODE (*Dir_statbuf, 
(Root_dev_ino)->double_slash)))
- 
- # define ROOT_DEV_INO_WARN(Dirname)                                   \
-   do                                                                  \
-     {                                                                 \
--      if (STREQ (Dirname, "/"))                                               
\
-+      if (STREQ (Dirname, "/") || STREQ (Dirname, "//"))                \
-         error (0, 0, _("it is dangerous to operate recursively on %s"),       
\
-                quoteaf (Dirname));                                    \
-       else                                                            \
---- origsrc/coreutils-8.25/lib/same.c  2016-01-01 06:45:55.000000000 -0700
-+++ src/coreutils-8.25/lib/same.c      2016-04-12 12:49:47.318287500 -0600
-@@ -40,6 +40,13 @@
- #include "error.h"
- #include "same-inode.h"
- 
-+#if __CYGWIN__
-+# include <sys/cygwin.h>
-+# include "cygwin.h"
-+# include "malloca.h"
-+# include "memcasecmp.h"
-+#endif
-+
- #ifndef MIN
- # define MIN(a, b) ((a) < (b) ? (a) : (b))
- #endif
-@@ -59,6 +66,45 @@ same_name (const char *source, const cha
-     (source_baselen == dest_baselen
-      && memcmp (source_basename, dest_basename, dest_baselen) == 0);
-   bool compare_dirs = identical_basenames;
-+#if __CYGWIN__
-+  /* If two names differ case-insensitively by only an '.exe' suffix,
-+     do some sleuthing to see if .exe magic matters on the shorter
-+     name.  Swapping the longer name to dest avoids duplication.  */
-+  if (source_baselen == dest_baselen + 4)
-+    {
-+      char const *tmp_basename = source_basename;
-+      size_t tmp_baselen = source_baselen;
-+      source_basename = dest_basename;
-+      source_baselen = dest_baselen;
-+      dest_basename = tmp_basename;
-+      dest_baselen = tmp_baselen;
-+    }
-+  if (source_baselen + 4 == dest_baselen
-+      && !memcasecmp (dest_basename - 4, ".exe", 4)
-+      && !memcasecmp (source_basename, dest_basename, source_baselen)
-+      && 0 < cygwin_spelling(source))
-+    dest_baselen -= 4;
-+  /* Some, but not all, files are case-insensitive (depending on mount
-+     options, CYGWIN=case settings, and virtual file systems).  Do
-+     some sleuthing to decide whether case-insensitivity matters.  */
-+  if (! compare_dirs && source_baselen == dest_baselen)
-+    {
-+      ssize_t wsrclen = cygwin_conv_path (CCP_POSIX_TO_WIN_W,
-+                                          source, NULL, 0);
-+      ssize_t wdstlen = cygwin_conv_path (CCP_POSIX_TO_WIN_W,
-+                                          dest, NULL, 0);
-+      char *wsrc = malloca (wsrclen);
-+      char *wdst = malloca (wdstlen);
-+      if (cygwin_conv_path (CCP_POSIX_TO_WIN_W, source, wsrc, wsrclen))
-+        error (EXIT_FAILURE, errno, "unable to convert path name %s", source);
-+      if (cygwin_conv_path (CCP_POSIX_TO_WIN_W, dest, wdst, wdstlen))
-+        error (EXIT_FAILURE, errno, "unable to convert path name %s", dest);
-+      if (wsrclen == wdstlen && memcasecmp (wsrc, wdst, wsrclen) == 0)
-+        compare_dirs = true;
-+      freea (wsrc);
-+      freea (wdst);
-+    }
-+#endif /* __CYGWIN__ */
-   bool same = false;
- 
- #if ! _POSIX_NO_TRUNC && HAVE_PATHCONF && defined _PC_NAME_MAX
---- origsrc/coreutils-8.25/lib/set-permissions.c       2016-01-01 
06:45:55.000000000 -0700
-+++ src/coreutils-8.25/lib/set-permissions.c   2016-04-12 12:49:47.318287500 
-0600
-@@ -269,6 +269,7 @@ set_acls_from_mode (const char *name, in
-         }
-       return -1;
-       }
-+    return 0;
-   }
- }
- 
-@@ -494,7 +495,7 @@ set_acls (struct permission_context *ctx
- 
- #   ifndef HAVE_ACL_FROM_TEXT
- #    error Must have acl_from_text (see POSIX 1003.1e draft 17).
--#   endif
-+ #   endif
- #   ifndef HAVE_ACL_DELETE_DEF_FILE
- #    error Must have acl_delete_def_file (see POSIX 1003.1e draft 17).
- #   endif
---- origsrc/coreutils-8.25/lib/sys_select.in.h 2016-01-01 07:17:01.000000000 
-0700
-+++ src/coreutils-8.25/lib/sys_select.in.h     2016-04-12 12:48:36.181822100 
-0600
-@@ -81,8 +81,8 @@
-    of 'struct timeval', and no definition of this type.
-    Also, Mac OS X, AIX, HP-UX, IRIX, Solaris, Interix declare select()
-    in <sys/time.h>.
--   But avoid namespace pollution on glibc systems.  */
--# ifndef __GLIBC__
-+   But avoid namespace pollution on glibc/Cygwin systems.  */
-+# if !(defined __GLIBC__ || defined __CYGWIN__)
- #  include <sys/time.h>
- # endif
- 
-@@ -103,7 +103,7 @@
-    But avoid namespace pollution on glibc systems.
-    Do this after the include_next (for the sake of OpenBSD 5.0) but before
-    the split double-inclusion guard (for the sake of Solaris).  */
--#if !(defined __GLIBC__ && !defined __UCLIBC__)
-+#if !((defined __GLIBC__ || defined __CYGWIN__) && !defined __UCLIBC__)
- # include <signal.h>
- #endif
- 
---- origsrc/coreutils-8.25/lib/xfreopen.c      2016-01-01 06:45:55.000000000 
-0700
-+++ src/coreutils-8.25/lib/xfreopen.c  2016-04-12 12:49:47.318287500 -0600
-@@ -18,6 +18,7 @@
- #include "xfreopen.h"
- 
- #include <errno.h>
-+#include <fcntl.h>
- #include "error.h"
- #include "exitfail.h"
- #include "quote.h"
-@@ -26,9 +27,17 @@
- #include "gettext.h"
- #define _(msgid) gettext (msgid)
- 
-+#define STREQ(s1, s2) (strcmp (s1, s2) == 0)
-+
- void
- xfreopen (char const *filename, char const *mode, FILE *fp)
- {
-+  if (!filename && STREQ (mode, "wb"))
-+    {
-+      int flag = fcntl (fileno (fp), F_GETFL);
-+      if (0 <= flag && (flag & O_APPEND))
-+        mode = "ab";
-+    }
-   if (!freopen (filename, mode, fp))
-     {
-       char const *f = (filename ? filename
---- origsrc/coreutils-8.25/src/chcon.c 2016-01-01 06:48:50.000000000 -0700
-+++ src/coreutils-8.25/src/chcon.c     2016-04-12 12:49:47.318287500 -0600
-@@ -47,7 +47,7 @@ static bool verbose;
- 
- /* Pointer to the device and inode numbers of '/', when --recursive.
-    Otherwise NULL.  */
--static struct dev_ino *root_dev_ino;
-+static struct root_dev_ino *root_dev_ino;
- 
- /* The name of the context file is being given. */
- static char const *specified_context;
-@@ -569,7 +569,7 @@ main (int argc, char **argv)
- 
-   if (recurse && preserve_root)
-     {
--      static struct dev_ino dev_ino_buf;
-+      static struct root_dev_ino dev_ino_buf;
-       root_dev_ino = get_root_dev_ino (&dev_ino_buf);
-       if (root_dev_ino == NULL)
-         error (EXIT_FAILURE, errno, _("failed to get attributes of %s"),
---- origsrc/coreutils-8.25/src/chgrp.c 2016-01-01 06:48:50.000000000 -0700
-+++ src/coreutils-8.25/src/chgrp.c     2016-04-12 12:49:47.318287500 -0600
-@@ -300,7 +300,7 @@ main (int argc, char **argv)
- 
-   if (chopt.recurse && preserve_root)
-     {
--      static struct dev_ino dev_ino_buf;
-+      static struct root_dev_ino dev_ino_buf;
-       chopt.root_dev_ino = get_root_dev_ino (&dev_ino_buf);
-       if (chopt.root_dev_ino == NULL)
-         error (EXIT_FAILURE, errno, _("failed to get attributes of %s"),
---- origsrc/coreutils-8.25/src/chmod.c 2016-01-01 06:48:50.000000000 -0700
-+++ src/coreutils-8.25/src/chmod.c     2016-04-12 12:49:47.318287500 -0600
-@@ -80,7 +80,7 @@ static enum Verbosity verbosity = V_off;
- 
- /* Pointer to the device and inode numbers of '/', when --recursive.
-    Otherwise NULL.  */
--static struct dev_ino *root_dev_ino;
-+static struct root_dev_ino *root_dev_ino;
- 
- /* For long options that have no equivalent short option, use a
-    non-character as a pseudo short option, starting with CHAR_MAX + 1.  */
-@@ -551,7 +551,7 @@ main (int argc, char **argv)
- 
-   if (recurse && preserve_root)
-     {
--      static struct dev_ino dev_ino_buf;
-+      static struct root_dev_ino dev_ino_buf;
-       root_dev_ino = get_root_dev_ino (&dev_ino_buf);
-       if (root_dev_ino == NULL)
-         error (EXIT_FAILURE, errno, _("failed to get attributes of %s"),
---- origsrc/coreutils-8.25/src/chown-core.h    2016-01-01 06:48:50.000000000 
-0700
-+++ src/coreutils-8.25/src/chown-core.h        2016-04-12 12:49:47.333906200 
-0600
-@@ -50,7 +50,7 @@ struct Chown_option
- 
-   /* Pointer to the device and inode numbers of '/', when --recursive.
-      Need not be freed.  Otherwise NULL.  */
--  struct dev_ino *root_dev_ino;
-+  struct root_dev_ino *root_dev_ino;
- 
-   /* This corresponds to the --dereference (opposite of -h) option.  */
-   bool affect_symlink_referent;
---- origsrc/coreutils-8.25/src/chown.c 2016-01-01 06:48:50.000000000 -0700
-+++ src/coreutils-8.25/src/chown.c     2016-04-12 12:49:47.333906200 -0600
-@@ -312,7 +312,7 @@ main (int argc, char **argv)
- 
-   if (chopt.recurse && preserve_root)
-     {
--      static struct dev_ino dev_ino_buf;
-+      static struct root_dev_ino dev_ino_buf;
-       chopt.root_dev_ino = get_root_dev_ino (&dev_ino_buf);
-       if (chopt.root_dev_ino == NULL)
-         error (EXIT_FAILURE, errno, _("failed to get attributes of %s"),
---- origsrc/coreutils-8.25/src/chroot.c        2016-01-01 06:48:50.000000000 
-0700
-+++ src/coreutils-8.25/src/chroot.c    2016-04-12 12:49:47.333906200 -0600
-@@ -170,7 +170,8 @@ static bool
- is_root (const char* dir)
- {
-   char *resolved = canonicalize_file_name (dir);
--  bool is_res_root = resolved && STREQ ("/", resolved);
-+  bool is_res_root = resolved && (STREQ ("/", resolved)
-+                                || STREQ ("//", resolved));
-   free (resolved);
-   return is_res_root;
- }
---- origsrc/coreutils-8.25/src/cksum.c 2016-01-01 06:48:50.000000000 -0700
-+++ src/coreutils-8.25/src/cksum.c     2016-04-12 12:49:47.333906200 -0600
-@@ -301,6 +301,9 @@ main (int argc, char **argv)
- 
-   have_read_stdin = false;
- 
-+  if (O_BINARY)
-+    xfreopen (NULL, "wb", stdout);
-+
-   if (optind == argc)
-     ok = cksum ("-", false);
-   else
---- origsrc/coreutils-8.25/src/copy.c  2016-01-16 12:09:33.000000000 -0700
-+++ src/coreutils-8.25/src/copy.c      2016-04-12 12:49:47.333906200 -0600
-@@ -74,6 +74,10 @@
- # include <linux/falloc.h>
- #endif
- 
-+#if __CYGWIN__
-+# include "cygwin.h"
-+#endif
-+
- #ifndef HAVE_FCHOWN
- # define HAVE_FCHOWN false
- # define fchown(fd, uid, gid) (-1)
-@@ -1416,7 +1420,11 @@ close_src_desc:
- static bool
- same_file_ok (char const *src_name, struct stat const *src_sb,
-               char const *dst_name, struct stat const *dst_sb,
--              const struct cp_options *x, bool *return_now)
-+              const struct cp_options *x, bool *return_now
-+#if __CYGWIN__
-+            , bool *case_change
-+#endif
-+            )
- {
-   const struct stat *src_sb_link;
-   const struct stat *dst_sb_link;
-@@ -1560,6 +1568,18 @@ same_file_ok (char const *src_name, stru
-       if (S_ISLNK (dst_sb_link->st_mode))
-         return true;
- 
-+#if __CYGWIN__
-+      /* If the files have the same name, but differ in case, then let
-+       rename() change the case.  */
-+      if (same_link && x->move_mode && same_name (src_name, dst_name)
-+        && memcmp (last_component (src_name), last_component (dst_name),
-+                   base_len (src_name)))
-+      {
-+        *case_change = true;
-+        return true;
-+      }
-+#endif /* __CYGWIN__ */
-+
-       /* It's not ok if they're distinct hard links to the same file as
-          this causes a race condition and we may lose data in this case.  */
-       if (same_link
-@@ -1907,10 +1927,20 @@ copy_internal (char const *src_name, cha
-          && ! (x->move_mode || x->symbolic_link || x->hard_link
-                || x->backup_type != no_backups
-                || x->unlink_dest_before_opening));
--      if ((use_stat
--           ? stat (dst_name, &dst_sb)
--           : lstat (dst_name, &dst_sb))
--          != 0)
-+      int res = (use_stat
-+                 ? stat (dst_name, &dst_sb)
-+                 : lstat (dst_name, &dst_sb));
-+#if __CYGWIN__
-+      /* stat("a") succeeds even if it was really "a.exe".  */
-+      if (! res && cygwin_spelling (dst_name) != 0)
-+        {
-+          /* Only DST_NAME.exe exists, but we want the non-existant
-+             DST_NAME.  */
-+          res = -1;
-+          errno = ENOENT;
-+        }
-+#endif /* __CYGWIN__ */
-+      if (res != 0)
-         {
-           if (errno != ENOENT)
-             {
-@@ -1926,10 +1956,17 @@ copy_internal (char const *src_name, cha
-         { /* Here, we know that dst_name exists, at least to the point
-              that it is stat'able or lstat'able.  */
-           bool return_now;
-+#if __CYGWIN__
-+        bool case_change = false;
-+#endif /* __CYGWIN__ */
- 
-           have_dst_lstat = !use_stat;
-           if (! same_file_ok (src_name, &src_sb, dst_name, &dst_sb,
--                              x, &return_now))
-+                              x, &return_now
-+#if __CYGWIN__
-+                            , &case_change
-+#endif /* __CYGWIN__ */
-+                            ))
-             {
-               error (0, 0, _("%s and %s are the same file"),
-                      quoteaf_n (0, src_name), quoteaf_n (1, dst_name));
-@@ -1988,6 +2025,9 @@ copy_internal (char const *src_name, cha
-              cp and mv treat -i and -f differently.  */
-           if (x->move_mode)
-             {
-+#if __CYGWIN__
-+            if (!case_change)
-+#endif /* __CYGWIN__ */
-               if (abandon_move (x, dst_name, &dst_sb))
-                 {
-                   /* Pretend the rename succeeded, so the caller (mv)
-@@ -2144,7 +2184,11 @@ copy_internal (char const *src_name, cha
-                    /* Never unlink dst_name when in move mode.  */
-                    && ! x->move_mode
-                    && (x->unlink_dest_before_opening
--                       || (x->preserve_links && 1 < dst_sb.st_nlink)
-+                       || (x->preserve_links && 1 < dst_sb.st_nlink
-+#if __CYGWIN__
-+                           && !case_change
-+#endif /* __CYGWIN__ */
-+                         )
-                        || (x->dereference == DEREF_NEVER
-                            && ! S_ISREG (src_sb.st_mode))
-                        ))
-@@ -2920,6 +2964,21 @@ copy (char const *src_name, char const *
- {
-   assert (valid_options (options));
- 
-+#if __CYGWIN__
-+  /* .exe magic - if src exists with an implicit .exe suffix and is
-+     not a symlink, but dst does not exist and was also specified
-+     without a suffix, then append .exe to dst.  */
-+  int cygwin = cygwin_spelling (src_name);
-+  char *p;
-+  if (cygwin == 2
-+      && ((p = strchr (dst_name, '\0') - 4) <= dst_name
-+          || strcasecmp (p, ".exe") != 0))
-+    {
-+      cygwin = 3;
-+      CYGWIN_APPEND_EXE (p, dst_name);
-+    }
-+#endif /* __CYGWIN__ */
-+
-   /* Record the file names: they're used in case of error, when copying
-      a directory into itself.  I don't like to make these tools do *any*
-      extra work in the common case when that work is solely to handle
-@@ -2931,10 +2990,15 @@ copy (char const *src_name, char const *
-   top_level_dst_name = dst_name;
- 
-   bool first_dir_created_per_command_line_arg = false;
--  return copy_internal (src_name, dst_name, nonexistent_dst, NULL, NULL,
-+  bool result = copy_internal (src_name, dst_name, nonexistent_dst, NULL, 
NULL,
-                         options, true,
-                         &first_dir_created_per_command_line_arg,
-                         copy_into_self, rename_succeeded);
-+#if __CYGWIN__
-+  if (cygwin == 3)
-+    freea ((char *) dst_name);
-+#endif /* __CYGWIN__ */
-+  return result;
- }
- 
- /* Set *X to the default options for a value of type struct cp_options.  */
---- origsrc/coreutils-8.25/src/dd.c    2016-01-13 04:16:39.000000000 -0700
-+++ src/coreutils-8.25/src/dd.c        2016-04-12 12:49:47.333906200 -0600
-@@ -36,6 +36,10 @@
- #include "xstrtol.h"
- #include "xtime.h"
- 
-+#if __CYGWIN__
-+# include <io.h>
-+#endif
-+
- /* The official name of this program (e.g., no 'g' prefix).  */
- #define PROGRAM_NAME "dd"
- 
-@@ -1984,6 +1988,13 @@ copy_with_unblock (char const *buf, size
- static void
- set_fd_flags (int fd, int add_flags, char const *name)
- {
-+#if __CYGWIN__
-+  /* Cygwin does not allow fcntl to set the mode.  */
-+  int mode_flags = add_flags & (O_BINARY | O_TEXT);
-+  add_flags &= ~(O_BINARY | O_TEXT);
-+  if (mode_flags && setmode (fd, mode_flags) == -1)
-+    error (EXIT_FAILURE, errno, _("setting flags for %s"), quote (name));
-+#endif /* __CYGWIN__ */
-   /* Ignore file creation flags that are no-ops on file descriptors.  */
-   add_flags &= ~ (O_NOCTTY | O_NOFOLLOW);
- 
-@@ -2374,6 +2385,8 @@ main (int argc, char **argv)
-     }
-   else
-     {
-+      if ((input_flags & (O_BINARY | O_TEXT)) == 0)
-+      input_flags |= O_BINARY;
-       if (ifd_reopen (STDIN_FILENO, input_file, O_RDONLY | input_flags, 0) < 
0)
-         error (EXIT_FAILURE, errno, _("failed to open %s"),
-                quoteaf (input_file));
-@@ -2397,6 +2410,8 @@ main (int argc, char **argv)
-            | (conversions_mask & C_NOCREAT ? 0 : O_CREAT)
-            | (conversions_mask & C_EXCL ? O_EXCL : 0)
-            | (seek_records || (conversions_mask & C_NOTRUNC) ? 0 : O_TRUNC));
-+      if ((opts & (O_BINARY | O_TEXT)) == 0)
-+        opts |= O_BINARY;
- 
-       /* Open the output file with *read* access only if we might
-          need to read to satisfy a 'seek=' request.  If we can't read
---- origsrc/coreutils-8.25/src/dircolors.c     2016-01-01 06:48:50.000000000 
-0700
-+++ src/coreutils-8.25/src/dircolors.c 2016-04-12 12:49:47.333906200 -0600
-@@ -495,8 +495,12 @@ main (int argc, char **argv)
-             }
-           else
-             {
-+              /* tcsh treats LS_COLORS as a magic shell variable for its
-+                 builtin ls-F, but does not recognize all the categories
-+                 that coreutils ls does.  Therefore, silence stderr to
-+                 avoid messages like "Unknown colorls variable `su'.".  */
-               prefix = "setenv LS_COLORS '";
--              suffix = "'\n";
-+              suffix = "' >&/dev/null\n";
-             }
-           fputs (prefix, stdout);
-           fwrite (s, 1, len, stdout);
---- origsrc/coreutils-8.25/src/install.c       2016-01-03 05:59:44.000000000 
-0700
-+++ src/coreutils-8.25/src/install.c   2016-04-12 12:49:47.333906200 -0600
-@@ -43,6 +43,10 @@
- #include "utimens.h"
- #include "xstrtol.h"
- 
-+#if __CYGWIN__
-+# include "cygwin.h"
-+#endif
-+
- /* The official name of this program (e.g., no 'g' prefix).  */
- #define PROGRAM_NAME "install"
- 
-@@ -531,6 +535,16 @@ strip (char const *name)
-       error (0, errno, _("fork system call failed"));
-       break;
-     case 0:                   /* Child. */
-+#if __CYGWIN__
-+      {
-+      /* Check for .exe here, since strip doesn't.  */
-+      char *p;
-+      if (((p = strchr (name, '\0') - 4) <= name
-+           || strcasecmp (p, ".exe") != 0)
-+          && 0 < cygwin_spelling (name))
-+          CYGWIN_APPEND_EXE (p, name);
-+      }
-+#endif /* __CYGWIN__ */
-       execlp (strip_program, strip_program, name, NULL);
-       error (EXIT_FAILURE, errno, _("cannot run %s"), quoteaf 
(strip_program));
-       break;
---- origsrc/coreutils-8.25/src/ls.c    2016-01-14 05:16:23.000000000 -0700
-+++ src/coreutils-8.25/src/ls.c        2016-04-12 12:49:47.333906200 -0600
-@@ -117,6 +117,10 @@
- # include <sys/capability.h>
- #endif
- 
-+#if __CYGWIN__
-+# include "cygwin.h"
-+#endif
-+
- #define PROGRAM_NAME (ls_mode == LS_LS ? "ls" \
-                       : (ls_mode == LS_MULTI_COL \
-                          ? "dir" : "vdir"))
-@@ -753,6 +757,11 @@ static char const *long_time_format[2] =
-     N_("%b %e %H:%M")
-   };
- 
-+#if __CYGWIN__
-+/* Whether .exe should be appended to command-line args as needed.  */
-+static bool append_exe;
-+#endif /* __CYGWIN__ */
-+
- /* The set of signals that are caught.  */
- 
- static sigset_t caught_signals;
-@@ -788,6 +797,9 @@ enum
- enum
- {
-   AUTHOR_OPTION = CHAR_MAX + 1,
-+#if __CYGWIN__
-+  APPEND_EXE_OPTION,
-+#endif /* __CYGWIN__ */
-   BLOCK_SIZE_OPTION,
-   COLOR_OPTION,
-   DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION,
-@@ -849,6 +861,9 @@ static struct option const long_options[
-   {"block-size", required_argument, NULL, BLOCK_SIZE_OPTION},
-   {"context", no_argument, 0, 'Z'},
-   {"author", no_argument, NULL, AUTHOR_OPTION},
-+#if __CYGWIN__
-+  {"append-exe", no_argument, NULL, APPEND_EXE_OPTION},
-+#endif /* __CYGWIN__ */
-   {GETOPT_HELP_OPTION_DECL},
-   {GETOPT_VERSION_OPTION_DECL},
-   {NULL, 0, NULL, 0}
-@@ -1953,6 +1968,12 @@ decode_switches (int argc, char **argv)
-           print_scontext = true;
-           break;
- 
-+#if __CYGWIN__
-+        case APPEND_EXE_OPTION:
-+          append_exe = true;
-+          break;
-+#endif /* __CYGWIN__ */
-+
-         case_GETOPT_HELP_CHAR;
- 
-         case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
-@@ -2943,6 +2964,12 @@ gobble_file (char const *name, enum file
-   uintmax_t blocks = 0;
-   struct fileinfo *f;
- 
-+#if __CYGWIN__
-+  char *name_alt = NULL;
-+  if (command_line_arg && append_exe && 0 < cygwin_spelling (name))
-+    CYGWIN_APPEND_EXE (name_alt, name);
-+#endif /* __CYGWIN__ */
-+
-   /* An inode value prior to gobble_file necessarily came from readdir,
-      which is not used for command line arguments.  */
-   assert (! command_line_arg || inode == NOT_AN_INODE_NUMBER);
-@@ -3053,11 +3080,19 @@ gobble_file (char const *name, enum file
-           file_failure (command_line_arg,
-                         _("cannot access %s"), absolute_name);
-           if (command_line_arg)
--            return 0;
-+            {
-+#if __CYGWIN__
-+              freea (name_alt);
-+#endif /* __CYGWIN__ */
-+              return 0;
-+            }
- 
-           f->name = xstrdup (name);
-           cwd_n_used++;
- 
-+#if __CYGWIN__
-+          freea (name_alt);
-+#endif /* __CYGWIN__ */
-           return 0;
-         }
- 
-@@ -3241,6 +3276,9 @@ gobble_file (char const *name, enum file
-   f->name = xstrdup (name);
-   cwd_n_used++;
- 
-+#if __CYGWIN__
-+  freea (name_alt);
-+#endif /* __CYGWIN__ */
-   return blocks;
- }
- 
-@@ -4961,6 +4999,11 @@ Sort entries alphabetically if none of -
-   -1                         list one file per line.  Avoid '\\n' with -q or 
-b\
- \n\
- "), stdout);
-+#if __CYGWIN__
-+      fputs (_("\
-+      --append-exe           append .exe if cygwin magic was needed\n\
-+"), stdout);
-+#endif /* __CYGWIN__ */
-       fputs (HELP_OPTION_DESCRIPTION, stdout);
-       fputs (VERSION_OPTION_DESCRIPTION, stdout);
-       emit_size_note ();
---- origsrc/coreutils-8.25/src/md5sum.c        2016-01-01 06:48:50.000000000 
-0700
-+++ src/coreutils-8.25/src/md5sum.c    2016-04-12 12:49:47.333906200 -0600
-@@ -867,6 +867,9 @@ main (int argc, char **argv)
-   if (optind == argc)
-     argv[argc++] = bad_cast ("-");
- 
-+  if (O_BINARY)
-+    xfreopen (NULL, "wb", stdout);
-+
-   for (; optind < argc; ++optind)
-     {
-       char *file = argv[optind];
---- origsrc/coreutils-8.25/src/mv.c    2016-01-12 04:41:44.000000000 -0700
-+++ src/coreutils-8.25/src/mv.c        2016-04-12 12:49:47.333906200 -0600
-@@ -91,7 +91,7 @@ rm_option_init (struct rm_options *x)
-   x->require_restore_cwd = true;
- 
-   {
--    static struct dev_ino dev_ino_buf;
-+    static struct root_dev_ino dev_ino_buf;
-     x->root_dev_ino = get_root_dev_ino (&dev_ino_buf);
-     if (x->root_dev_ino == NULL)
-       error (EXIT_FAILURE, errno, _("failed to get attributes of %s"),
-@@ -466,6 +466,16 @@ main (int argc, char **argv)
-   else if (!target_directory)
-     {
-       assert (2 <= n_files);
-+#if __CYGWIN__
-+      struct stat s1, s2;
-+      if (2 == n_files
-+        && lstat (file[0], &s1) == 0 && lstat (file[1], &s2) == 0
-+        && s1.st_ino == s2.st_ino)
-+      {
-+        /* Allow 'mv foo Foo' to change case of the directory foo.  */
-+      }
-+      else
-+#endif /* __CYGWIN__ */
-       if (target_directory_operand (file[n_files - 1]))
-         target_directory = file[--n_files];
-       else if (2 < n_files)
---- origsrc/coreutils-8.25/src/pwd.c   2016-01-01 06:48:50.000000000 -0700
-+++ src/coreutils-8.25/src/pwd.c       2016-04-12 12:49:47.333906200 -0600
-@@ -268,8 +268,8 @@ static void
- robust_getcwd (struct file_name *file_name)
- {
-   size_t height = 1;
--  struct dev_ino dev_ino_buf;
--  struct dev_ino *root_dev_ino = get_root_dev_ino (&dev_ino_buf);
-+  struct root_dev_ino dev_ino_buf;
-+  struct root_dev_ino *root_dev_ino = get_root_dev_ino (&dev_ino_buf);
-   struct stat dot_sb;
- 
-   if (root_dev_ino == NULL)
-@@ -282,7 +282,7 @@ robust_getcwd (struct file_name *file_na
-   while (1)
-     {
-       /* If we've reached the root, we're done.  */
--      if (SAME_INODE (dot_sb, *root_dev_ino))
-+      if (ROOT_DEV_INO_CHECK (root_dev_ino, &dot_sb))
-         break;
- 
-       find_dir_entry (&dot_sb, file_name, height++);
-@@ -291,6 +291,9 @@ robust_getcwd (struct file_name *file_na
-   /* See if a leading slash is needed; file_name_prepend adds one.  */
-   if (file_name->start[0] == '\0')
-     file_name_prepend (file_name, "", 0);
-+  /* If we aren't in `/', we must be in `//'.  */
-+  if (! SAME_INODE (root_dev_ino->single_slash, dot_sb))
-+    file_name_prepend (file_name, "", 0);
- }
- 
- 
---- origsrc/coreutils-8.25/src/remove.h        2016-01-01 06:48:50.000000000 
-0700
-+++ src/coreutils-8.25/src/remove.h    2016-04-12 12:49:47.333906200 -0600
-@@ -54,7 +54,7 @@ struct rm_options
- 
-   /* Pointer to the device and inode numbers of '/', when --recursive
-      and preserving '/'.  Otherwise NULL.  */
--  struct dev_ino *root_dev_ino;
-+  struct root_dev_ino *root_dev_ino;
- 
-   /* If nonzero, stdin is a tty.  */
-   bool stdin_tty;
---- origsrc/coreutils-8.25/src/rm.c    2016-01-01 06:48:50.000000000 -0700
-+++ src/coreutils-8.25/src/rm.c        2016-04-12 12:49:47.333906200 -0600
-@@ -323,7 +323,7 @@ main (int argc, char **argv)
- 
-   if (x.recursive && preserve_root)
-     {
--      static struct dev_ino dev_ino_buf;
-+      static struct root_dev_ino dev_ino_buf;
-       x.root_dev_ino = get_root_dev_ino (&dev_ino_buf);
-       if (x.root_dev_ino == NULL)
-         error (EXIT_FAILURE, errno, _("failed to get attributes of %s"),
---- origsrc/coreutils-8.25/src/stat.c  2016-01-13 04:16:39.000000000 -0700
-+++ src/coreutils-8.25/src/stat.c      2016-04-12 12:49:47.333906200 -0600
-@@ -72,6 +72,13 @@
- #include "find-mount-point.h"
- #include "xvasprintf.h"
- 
-+#if __CYGWIN__
-+# include "cygwin.h"
-+/* Whether .exe should be appended to command-line args as needed.  */
-+static bool append_exe;
-+# define APPEND_EXE_OPTION 10000
-+#endif
-+
- #if USE_STATVFS
- # define STRUCT_STATXFS_F_FSID_IS_INTEGER STRUCT_STATVFS_F_FSID_IS_INTEGER
- # define HAVE_STRUCT_STATXFS_F_TYPE HAVE_STRUCT_STATVFS_F_TYPE
-@@ -189,6 +196,9 @@ static struct option const long_options[
-   {"format", required_argument, NULL, 'c'},
-   {"printf", required_argument, NULL, PRINTF_OPTION},
-   {"terse", no_argument, NULL, 't'},
-+#if __CYGWIN__
-+  {"append-exe", no_argument, NULL, APPEND_EXE_OPTION},
-+#endif /* __CYGWIN__ */
-   {GETOPT_HELP_OPTION_DECL},
-   {GETOPT_VERSION_OPTION_DECL},
-   {NULL, 0, NULL, 0}
-@@ -1284,14 +1294,26 @@ do_statfs (char const *filename, char co
-       return false;
-     }
- 
-+#if __CYGWIN__
-+  char *name_alt = NULL;
-+  if (append_exe && 0 < cygwin_spelling (filename))
-+    CYGWIN_APPEND_EXE (name_alt, filename);
-+#endif /* __CYGWIN__ */
-+
-   if (STATFS (filename, &statfsbuf) != 0)
-     {
-       error (0, errno, _("cannot read file system information for %s"),
-              quoteaf (filename));
-+#if __CYGWIN__
-+      freea (name_alt);
-+#endif /* __CYGWIN__ */
-       return false;
-     }
- 
-   bool fail = print_it (format, -1, filename, print_statfs, &statfsbuf);
-+#if __CYGWIN__
-+  freea (name_alt);
-+#endif /* __CYGWIN__ */
-   return ! fail;
- }
- 
-@@ -1302,6 +1324,7 @@ do_stat (char const *filename, char cons
- {
-   int fd = STREQ (filename, "-") ? 0 : -1;
-   struct stat statbuf;
-+  char *name_alt = NULL;
- 
-   if (0 <= fd)
-     {
-@@ -1314,18 +1337,28 @@ do_stat (char const *filename, char cons
-   /* We can't use the shorter
-      (follow_links?stat:lstat) (filename, &statbug)
-      since stat might be a function-like macro.  */
--  else if ((follow_links
--            ? stat (filename, &statbuf)
--            : lstat (filename, &statbuf)) != 0)
-+  else
-     {
--      error (0, errno, _("cannot stat %s"), quoteaf (filename));
--      return false;
-+      if ((follow_links
-+         ? stat (filename, &statbuf)
-+         : lstat (filename, &statbuf)) != 0)
-+      {
-+        error (0, errno, _("cannot stat %s"), quoteaf (filename));
-+        return false;
-+      }
-+#if __CYGWIN__
-+      if (append_exe && 0 < cygwin_spelling (filename))
-+        CYGWIN_APPEND_EXE (name_alt, filename);
-+#endif /* __CYGWIN__ */
-     }
- 
-   if (S_ISBLK (statbuf.st_mode) || S_ISCHR (statbuf.st_mode))
-     format = format2;
- 
-   bool fail = print_it (format, fd, filename, print_stat, &statbuf);
-+#if __CYGWIN__
-+  freea (name_alt);
-+#endif /* __CYGWIN__ */
-   return ! fail;
- }
- 
-@@ -1447,6 +1480,11 @@ Display file or file system status.\n\
-                           if you want a newline, include \\n in FORMAT\n\
-   -t, --terse           print the information in terse form\n\
- "), stdout);
-+#if __CYGWIN__
-+      fputs (_("\
-+      --append-exe      append .exe if cygwin magic was needed\n\
-+"), stdout);
-+#endif /* __CYGWIN__ */
-       fputs (HELP_OPTION_DESCRIPTION, stdout);
-       fputs (VERSION_OPTION_DESCRIPTION, stdout);
- 
-@@ -1567,6 +1605,12 @@ main (int argc, char *argv[])
-           terse = true;
-           break;
- 
-+#if __CYGWIN__
-+        case APPEND_EXE_OPTION:
-+          append_exe = true;
-+          break;
-+#endif /* __CYGWIN__ */
-+
-         case_GETOPT_HELP_CHAR;
- 
-         case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);

diff --git a/sys-apps/coreutils/metadata.xml b/sys-apps/coreutils/metadata.xml
index 53ffd8755e..9241968a46 100644
--- a/sys-apps/coreutils/metadata.xml
+++ b/sys-apps/coreutils/metadata.xml
@@ -5,12 +5,13 @@
        <email>[email protected]</email>
        <name>Gentoo Base System</name>
 </maintainer>
+<longdescription>Standard GNU file utilities (chmod, cp, dd, dir, ls, ...), 
text utilities (sort, tr, head, wc, ...), and shell utilities (whoami, who, ...)
+</longdescription>
 <use>
+       <flag name="caps">Add Linux capabilities support in output of file 
utilities (ls, dir, ...) via <pkg>sys-libs/libcap</pkg></flag>
        <flag name="hostname">Build the hostname program</flag>
        <flag name="kill">Build the kill program</flag>
        <flag name="multicall">Build all tools into a single `coreutils` 
program akin to busybox to save space</flag>
-    <flag name="stdbuf">Build the stdbuf program</flag>
-    <flag name="uptime">Build the uptime program</flag>
 </use>
 <upstream>
        <remote-id type="cpe">cpe:/a:gnu:coreutils</remote-id>

Reply via email to