Add coreutils package

This commit is contained in:
Alexpux 2013-11-01 07:06:47 +04:00
parent 3f9607ac4b
commit 3ade1f55b2
12 changed files with 1860 additions and 0 deletions

78
coreutils/PKGBUILD Normal file
View File

@ -0,0 +1,78 @@
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
pkgname=coreutils
pkgver=8.21
pkgrel=1
pkgdesc="The basic file, shell and text manipulation utilities of the GNU operating system"
arch=('i686' 'x86_64')
license=('GPL3')
url="http://www.gnu.org/software/coreutils"
groups=('base')
depends=('gmp' 'libiconv' 'libintl8')
install=${pkgname}.install
source=(ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz{,.sig}
coreutils-8.21-cygwin.patch
coreutils-8.21-msys2.patch
coreutils-8.21-msys2-src.patch
coreutils-8.21-manifest.patch
coreutils-8.21-msys1-0x0d.patch
coreutils-8.21-msys2-add-to-gnulib.patch
coreutils-8.21-msys2-hasmntopt.patch
coreutils-8.21-fix-libstdbuf-link.patch
coreutils-8.21-fpending.patch
coreutils-8.21-fix-man.patch)
md5sums=('065ba41828644eca5dd8163446de5d64'
'SKIP'
'4ab2ad21f209c1c0f009ab039c6d71cd'
'ca54684c00a17e9d4a8afcc2edb4d9e6'
'eda2d867321c21fb448101676ea223d1'
'a61ed48fd8b57e6a7894d4532f7a2bfd'
'9113031fae1116be3359fceadb15c6b7'
'f5c8937709481a814de66728dd596883'
'e47212e297fd6a1c95cd00cd4d99ea14'
'a8eef34fce0a141652c18aa8e5fb63aa'
'3dc4d70c3bf03575c4f9f7faa54e7d8c'
'be1c37f8f16d9695d9987c65c0fd3595')
prepare() {
cd ${srcdir}/${pkgname}-${pkgver}
patch -p1 -i $srcdir/coreutils-8.21-cygwin.patch
patch -p1 -i $srcdir/coreutils-8.21-msys2.patch
patch -p1 -i $srcdir/coreutils-8.21-msys2-src.patch
patch -p2 -i $srcdir/coreutils-8.21-manifest.patch
patch -p2 -i $srcdir/coreutils-8.21-msys1-0x0d.patch
patch -p2 -i $srcdir/coreutils-8.21-msys2-add-to-gnulib.patch
patch -p2 -i $srcdir/coreutils-8.21-msys2-hasmntopt.patch
patch -p2 -i $srcdir/coreutils-8.21-fix-libstdbuf-link.patch
patch -p1 -i $srcdir/coreutils-8.21-fpending.patch
patch -p1 -i $srcdir/coreutils-8.21-fix-man.patch
}
build() {
cd ${srcdir}/${pkgname}-${pkgver}
./configure --build=${CHOST} \
--prefix=/usr \
--program-transform-name=s/kill/gkill/ \
--without-libintl-prefix \
--without-libiconv-prefix \
--enable-install-program=arch,hostname \
--enable-no-install-program=uptime \
ac_cv_header_spawn_h=no
make -j1
}
#check() {
# cd ${srcdir}/${pkgname}-${pkgver}
# make RUN_EXPENSIVE_TESTS=yes check
#}
package() {
cd ${srcdir}/${pkgname}-${pkgver}
make DESTDIR=${pkgdir} install
mkdir -p ${pkgdir}/usr/etc
install -m644 src/dircolors.hin ${pkgdir}/usr/etc/DIR_COLORS
}

View File

@ -0,0 +1,995 @@
diff -Naur coreutils-8.21-orig/lib/cygwin.c coreutils-8.21-cygwin/lib/cygwin.c
--- coreutils-8.21-orig/lib/cygwin.c 1970-01-01 00:00:00.000000000 +0000
+++ coreutils-8.21-cygwin/lib/cygwin.c 2013-05-17 09:48:23.539062500 +0000
@@ -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 not found, 0 if PATH spelled correctly, and 1 if PATH
+ had ".exe" automatically appended by cygwin. Don't change errno. */
+
+int
+cygwin_spelling (char const *path)
+{
+ int saved_errno = errno;
+ int result = 0; /* Start with assumption that PATH is okay. */
+ int len = strlen (path);
+
+ if (! path || ! *path || len > PATH_MAX)
+ /* PATH will cause EINVAL or ENAMETOOLONG, treat it as non-existing. */
+ return -1;
+ if (path[len - 1] == '/')
+ /* Don't change spelling if there is a trailing `/'. */
+ return 0;
+ if (readlink (path, NULL, 0) < 0)
+ { /* PATH is not a symlink. */
+ if (errno == EINVAL)
+ { /* PATH exists. */
+ char *path_exact = malloca (len + 5); /* adding ".exe" and NUL. */
+ struct stat st1;
+ struct stat st2;
+ strcat (stpcpy (path_exact, path), ".exe");
+ /* Avoid cost of double stat, if possible */
+ if (access (path_exact, F_OK) == 0
+ && lstat (path_exact, &st1) == 0
+ && lstat (path, &st2) == 0
+ && st1.st_ino == st2.st_ino)
+ /* So does PATH.exe, with same inode, so append .exe. */
+ result = 1;
+ freea (path_exact);
+ }
+ else
+ /* PATH does not exist. */
+ result = -1;
+ }
+ else
+ { /* PATH is a symlink. Don't append. */
+ }
+
+ errno = saved_errno;
+ return result;
+}
diff -Naur coreutils-8.21-orig/lib/cygwin.h coreutils-8.21-cygwin/lib/cygwin.h
--- coreutils-8.21-orig/lib/cygwin.h 1970-01-01 00:00:00.000000000 +0000
+++ coreutils-8.21-cygwin/lib/cygwin.h 2013-05-17 09:48:23.539062500 +0000
@@ -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 */
diff -Naur coreutils-8.21-orig/lib/hash-pjw.c coreutils-8.21-cygwin/lib/hash-pjw.c
--- coreutils-8.21-orig/lib/hash-pjw.c 2013-01-02 12:34:46.000000000 +0000
+++ coreutils-8.21-cygwin/lib/hash-pjw.c 2013-05-17 09:48:23.570312500 +0000
@@ -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 @@
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;
+}
diff -Naur coreutils-8.21-orig/lib/hash-pjw.h coreutils-8.21-cygwin/lib/hash-pjw.h
--- coreutils-8.21-orig/lib/hash-pjw.h 2013-01-02 12:34:46.000000000 +0000
+++ coreutils-8.21-cygwin/lib/hash-pjw.h 2013-05-17 09:48:23.585937500 +0000
@@ -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;
diff -Naur coreutils-8.21-orig/lib/hash-triple.c coreutils-8.21-cygwin/lib/hash-triple.c
--- coreutils-8.21-orig/lib/hash-triple.c 2013-01-02 12:34:46.000000000 +0000
+++ coreutils-8.21-cygwin/lib/hash-triple.c 2013-05-17 09:48:23.601562500 +0000
@@ -34,7 +34,14 @@
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, so that copy.c can then account for case-insensitive
+ renames. */
+ size_t tmp = hash_pjw_case (p->name, table_size);
+#endif /* __CYGWIN__ */
/* Ignoring the device number here should be fine. */
return (tmp ^ p->st_ino) % table_size;
diff -Naur coreutils-8.21-orig/lib/root-dev-ino.c coreutils-8.21-cygwin/lib/root-dev-ino.c
--- coreutils-8.21-orig/lib/root-dev-ino.c 2013-01-31 00:46:24.000000000 +0000
+++ coreutils-8.21-cygwin/lib/root-dev-ino.c 2013-05-17 09:48:23.617187500 +0000
@@ -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;
}
diff -Naur coreutils-8.21-orig/lib/root-dev-ino.h coreutils-8.21-cygwin/lib/root-dev-ino.h
--- coreutils-8.21-orig/lib/root-dev-ino.h 2013-01-31 00:46:24.000000000 +0000
+++ coreutils-8.21-cygwin/lib/root-dev-ino.h 2013-05-17 09:48:23.632812500 +0000
@@ -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"), \
quote (Dirname)); \
else \
diff -Naur coreutils-8.21-orig/lib/same.c coreutils-8.21-cygwin/lib/same.c
--- coreutils-8.21-orig/lib/same.c 2013-01-02 12:34:46.000000000 +0000
+++ coreutils-8.21-cygwin/lib/same.c 2013-05-17 09:48:23.648437500 +0000
@@ -40,6 +40,12 @@
#include "error.h"
#include "same-inode.h"
+#if __CYGWIN__
+# include <sys/cygwin.h>
+# include "memcasecmp.h"
+# include "xalloc.h"
+#endif
+
#ifndef MIN
# define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
@@ -58,6 +64,30 @@
bool identical_basenames =
(source_baselen == dest_baselen
&& memcmp (source_basename, dest_basename, dest_baselen) == 0);
+#if __CYGWIN__
+ /* 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 (! identical_basenames && source_baselen == dest_baselen)
+ {
+ ssize_t wsrclen = cygwin_conv_path (CCP_POSIX_TO_WIN_W | CCP_RELATIVE,
+ source_basename, NULL, 0);
+ ssize_t wdstlen = cygwin_conv_path (CCP_POSIX_TO_WIN_W | CCP_RELATIVE,
+ dest_basename, NULL, 0);
+ char *wsrc = xcharalloc (wsrclen);
+ char *wdst = xcharalloc (wdstlen);
+ if (cygwin_conv_path (CCP_POSIX_TO_WIN_W | CCP_RELATIVE, source_basename,
+ wsrc, wsrclen))
+ error (EXIT_FAILURE, errno, "unable to convert path name %s", source);
+ if (cygwin_conv_path (CCP_POSIX_TO_WIN_W | CCP_RELATIVE, dest_basename,
+ wdst, wdstlen))
+ error (EXIT_FAILURE, errno, "unable to convert path name %s", dest);
+ if (wsrclen == wdstlen && memcasecmp (wsrc, wdst, wsrclen) == 0)
+ identical_basenames = true;
+ free (wsrc);
+ free (wdst);
+ }
+#endif /* __CYGWIN__ */
bool compare_dirs = identical_basenames;
bool same = false;
diff -Naur coreutils-8.21-orig/lib/xfreopen.c coreutils-8.21-cygwin/lib/xfreopen.c
--- coreutils-8.21-orig/lib/xfreopen.c 2013-01-02 12:34:46.000000000 +0000
+++ coreutils-8.21-cygwin/lib/xfreopen.c 2013-05-17 09:48:23.679687500 +0000
@@ -18,6 +18,8 @@
#include "xfreopen.h"
#include <errno.h>
+#include <fcntl.h>
+
#include "error.h"
#include "exitfail.h"
#include "quote.h"
@@ -26,9 +28,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
diff -Naur coreutils-8.21-orig/Makefile.in coreutils-8.21-cygwin/Makefile.in
--- coreutils-8.21-orig/Makefile.in 2013-02-14 16:22:58.000000000 +0000
+++ coreutils-8.21-cygwin/Makefile.in 2013-05-17 10:18:44.589843800 +0000
@@ -396,7 +396,8 @@
lib/c-strcase.h lib/c-strcasecmp.c lib/c-strncasecmp.c \
lib/c-strtod.c lib/c-strtold.c lib/canon-host.c \
lib/canonicalize.c lib/careadlinkat.c lib/cloexec.c \
- lib/close-stream.c lib/closein.c lib/closeout.c lib/md5.c \
+ lib/close-stream.c lib/closein.c lib/closeout.c \
+ lib/cygwin.h lib/cygwin.c lib/md5.c \
lib/sha1.c lib/sha256.c lib/sha512.c lib/cycle-check.c \
lib/di-set.c lib/di-set.h lib/diacrit.h lib/diacrit.c \
lib/opendir-safer.c lib/dirname.c lib/basename.c \
diff -Naur coreutils-8.21-orig/src/chcon.c coreutils-8.21-cygwin/src/chcon.c
--- coreutils-8.21-orig/src/chcon.c 2013-01-31 00:46:24.000000000 +0000
+++ coreutils-8.21-cygwin/src/chcon.c 2013-05-17 09:48:29.460937500 +0000
@@ -48,7 +48,7 @@
/* 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;
@@ -572,7 +572,7 @@
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"),
diff -Naur coreutils-8.21-orig/src/chgrp.c coreutils-8.21-cygwin/src/chgrp.c
--- coreutils-8.21-orig/src/chgrp.c 2013-01-31 00:46:24.000000000 +0000
+++ coreutils-8.21-cygwin/src/chgrp.c 2013-05-17 09:48:29.492187500 +0000
@@ -299,7 +299,7 @@
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"),
diff -Naur coreutils-8.21-orig/src/chmod.c coreutils-8.21-cygwin/src/chmod.c
--- coreutils-8.21-orig/src/chmod.c 2013-01-31 00:46:24.000000000 +0000
+++ coreutils-8.21-cygwin/src/chmod.c 2013-05-17 09:48:29.507812500 +0000
@@ -81,7 +81,7 @@
/* 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. */
@@ -549,7 +549,7 @@
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"),
diff -Naur coreutils-8.21-orig/src/chown.c coreutils-8.21-cygwin/src/chown.c
--- coreutils-8.21-orig/src/chown.c 2013-01-31 00:46:24.000000000 +0000
+++ coreutils-8.21-cygwin/src/chown.c 2013-05-17 09:48:29.539062500 +0000
@@ -313,7 +313,7 @@
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"),
diff -Naur coreutils-8.21-orig/src/chown-core.h coreutils-8.21-cygwin/src/chown-core.h
--- coreutils-8.21-orig/src/chown-core.h 2013-01-31 00:46:24.000000000 +0000
+++ coreutils-8.21-cygwin/src/chown-core.h 2013-05-17 09:48:29.523437500 +0000
@@ -50,7 +50,7 @@
/* 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;
diff -Naur coreutils-8.21-orig/src/cksum.c coreutils-8.21-cygwin/src/cksum.c
--- coreutils-8.21-orig/src/cksum.c 2013-01-31 00:46:24.000000000 +0000
+++ coreutils-8.21-cygwin/src/cksum.c 2013-05-17 09:48:29.554687500 +0000
@@ -301,6 +301,9 @@
have_read_stdin = false;
+ if (O_BINARY)
+ xfreopen (NULL, "wb", stdout);
+
if (optind == argc)
ok = cksum ("-", false);
else
diff -Naur coreutils-8.21-orig/src/copy.c coreutils-8.21-cygwin/src/copy.c
--- coreutils-8.21-orig/src/copy.c 2013-02-07 09:37:05.000000000 +0000
+++ coreutils-8.21-cygwin/src/copy.c 2013-05-17 09:48:29.570312500 +0000
@@ -68,6 +68,10 @@
# include "verror.h"
#endif
+#if __CYGWIN__
+# include "cygwin.h"
+#endif
+
#ifndef HAVE_FCHOWN
# define HAVE_FCHOWN false
# define fchown(fd, uid, gid) (-1)
@@ -1207,7 +1211,11 @@
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, bool *unlink_src)
+ const struct cp_options *x, bool *return_now, bool *unlink_src
+#if __CYGWIN__
+ , bool *case_change
+#endif /* __CYGWIN__ */
+ )
{
const struct stat *src_sb_link;
const struct stat *dst_sb_link;
@@ -1355,6 +1363,18 @@
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)) != 0)
+ {
+ *case_change = true;
+ return true;
+ }
+#endif /* __CYGWIN__ */
+
if (same_link
&& 1 < dst_sb_link->st_nlink
&& ! same_name (src_name, dst_name))
@@ -1684,10 +1704,20 @@
&& ! (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)
{
@@ -1704,10 +1734,17 @@
that it is stat'able or lstat'able. */
bool return_now;
bool unlink_src;
+#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, &unlink_src))
+ x, &return_now, &unlink_src
+#if __CYGWIN__
+ , &case_change
+#endif /* __CYGWIN__ */
+ ))
{
error (0, 0, _("%s and %s are the same file"),
quote_n (0, src_name), quote_n (1, dst_name));
@@ -1766,6 +1803,9 @@
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)
|| (unlink_src && unlink (src_name) == 0))
{
@@ -1930,7 +1970,11 @@
/* 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))
))
@@ -2682,6 +2726,21 @@
{
assert (valid_options (options));
+#if __CYGWIN__
+ /* .exe magic - if src exists with an implicit .exe suffix, 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 == 1
+ && ((p = strchr (dst_name, '\0') - 4) <= dst_name
+ || strcasecmp (p, ".exe") != 0))
+ {
+ cygwin = 2;
+ 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
@@ -2693,10 +2752,15 @@
top_level_dst_name = dst_name;
bool first_dir_created_per_command_line_arg = false;
- return copy_internal (src_name, dst_name, nonexistent_dst, 0, NULL,
+ bool result = copy_internal (src_name, dst_name, nonexistent_dst, 0, NULL,
options, true,
&first_dir_created_per_command_line_arg,
copy_into_self, rename_succeeded);
+#if __CYGWIN__
+ if (cygwin == 2)
+ freea ((char *) dst_name);
+#endif /* __CYGWIN__ */
+ return result;
}
/* Set *X to the default options for a value of type struct cp_options. */
diff -Naur coreutils-8.21-orig/src/dd.c coreutils-8.21-cygwin/src/dd.c
--- coreutils-8.21-orig/src/dd.c 2013-02-07 09:37:05.000000000 +0000
+++ coreutils-8.21-cygwin/src/dd.c 2013-05-17 10:02:22.528320300 +0000
@@ -37,6 +37,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"
@@ -1781,6 +1785,13 @@
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);
@@ -2203,6 +2214,8 @@
}
else
{
+ if ((input_flags & (O_BINARY | O_TEXT)) == 0)
+ input_flags |= O_BINARY;
if (fd_reopen (STDIN_FILENO, input_file, O_RDONLY | input_flags, 0) < 0)
error (EXIT_FAILURE, errno, _("failed to open %s"), quote (input_file));
}
@@ -2225,6 +2238,8 @@
| (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
diff -Naur coreutils-8.21-orig/src/dircolors.c coreutils-8.21-cygwin/src/dircolors.c
--- coreutils-8.21-orig/src/dircolors.c 2013-01-31 00:46:24.000000000 +0000
+++ coreutils-8.21-cygwin/src/dircolors.c 2013-05-17 09:48:29.632812500 +0000
@@ -494,8 +494,12 @@
}
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);
diff -Naur coreutils-8.21-orig/src/install.c coreutils-8.21-cygwin/src/install.c
--- coreutils-8.21-orig/src/install.c 2013-02-07 09:37:05.000000000 +0000
+++ coreutils-8.21-cygwin/src/install.c 2013-05-17 10:03:20.325195300 +0000
@@ -44,6 +44,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"
@@ -527,6 +531,16 @@
error (EXIT_FAILURE, 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)
+ && cygwin_spelling (name) > 0)
+ CYGWIN_APPEND_EXE (p, name);
+ }
+#endif /* __CYGWIN__ */
execlp (strip_program, strip_program, name, NULL);
error (EXIT_FAILURE, errno, _("cannot run %s"), strip_program);
break;
diff -Naur coreutils-8.21-orig/src/ls.c coreutils-8.21-cygwin/src/ls.c
--- coreutils-8.21-orig/src/ls.c 2013-02-03 03:24:02.000000000 +0000
+++ coreutils-8.21-cygwin/src/ls.c 2013-05-17 09:48:29.679687500 +0000
@@ -115,6 +115,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"))
@@ -745,6 +749,11 @@
N_("%b %e %H:%M")
};
+#if __CYGWIN__
+/* Whether .exe should be appended to command-line args as needed. */
+static bool append_exe = false;
+#endif /* __CYGWIN__ */
+
/* The set of signals that are caught. */
static sigset_t caught_signals;
@@ -780,6 +789,9 @@
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,
@@ -841,6 +853,9 @@
{"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}
@@ -1944,6 +1959,12 @@
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);
@@ -2869,6 +2890,12 @@
uintmax_t blocks = 0;
struct fileinfo *f;
+#if __CYGWIN__
+ char *name_alt = NULL;
+ if (command_line_arg && append_exe && cygwin_spelling (name) == 1)
+ 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);
@@ -2980,11 +3007,19 @@
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;
}
@@ -3163,6 +3198,9 @@
f->name = xstrdup (name);
cwd_n_used++;
+#if __CYGWIN__
+ freea (name_alt);
+#endif /* __CYGWIN__ */
return blocks;
}
@@ -4859,6 +4897,11 @@
-Z, --context print any SELinux security context of each file\n\
-1 list one file per line\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 ();
diff -Naur coreutils-8.21-orig/src/md5sum.c coreutils-8.21-cygwin/src/md5sum.c
--- coreutils-8.21-orig/src/md5sum.c 2013-01-31 00:46:24.000000000 +0000
+++ coreutils-8.21-cygwin/src/md5sum.c 2013-05-17 09:48:29.695312500 +0000
@@ -809,6 +809,9 @@
if (optind == argc)
argv[argc++] = bad_cast ("-");
+ if (O_BINARY)
+ xfreopen (NULL, "wb", stdout);
+
for (; optind < argc; ++optind)
{
char *file = argv[optind];
diff -Naur coreutils-8.21-orig/src/mv.c coreutils-8.21-cygwin/src/mv.c
--- coreutils-8.21-orig/src/mv.c 2013-02-07 09:37:05.000000000 +0000
+++ coreutils-8.21-cygwin/src/mv.c 2013-05-17 09:48:29.726562500 +0000
@@ -91,7 +91,7 @@
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"),
@@ -453,6 +453,16 @@
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)
diff -Naur coreutils-8.21-orig/src/pwd.c coreutils-8.21-cygwin/src/pwd.c
--- coreutils-8.21-orig/src/pwd.c 2013-01-31 00:46:24.000000000 +0000
+++ coreutils-8.21-cygwin/src/pwd.c 2013-05-17 09:48:29.757812500 +0000
@@ -265,8 +265,8 @@
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)
@@ -279,7 +279,7 @@
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++);
@@ -288,6 +288,9 @@
/* 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);
}
diff -Naur coreutils-8.21-orig/src/remove.h coreutils-8.21-cygwin/src/remove.h
--- coreutils-8.21-orig/src/remove.h 2013-01-31 00:46:24.000000000 +0000
+++ coreutils-8.21-cygwin/src/remove.h 2013-05-17 10:12:44.856445300 +0000
@@ -54,7 +54,7 @@
/* 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;
diff -Naur coreutils-8.21-orig/src/rm.c coreutils-8.21-cygwin/src/rm.c
--- coreutils-8.21-orig/src/rm.c 2013-01-31 00:46:24.000000000 +0000
+++ coreutils-8.21-cygwin/src/rm.c 2013-05-17 09:48:31.476562500 +0000
@@ -325,7 +325,7 @@
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"),
diff -Naur coreutils-8.21-orig/src/stat.c coreutils-8.21-cygwin/src/stat.c
--- coreutils-8.21-orig/src/stat.c 2013-01-31 00:46:24.000000000 +0000
+++ coreutils-8.21-cygwin/src/stat.c 2013-05-17 09:48:31.507812500 +0000
@@ -73,6 +73,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 = false;
+# define APPEND_EXE_OPTION 10000
+#endif
+
#if USE_STATVFS
# define STRUCT_STATVFS struct statvfs
# define STRUCT_STATXFS_F_FSID_IS_INTEGER STRUCT_STATVFS_F_FSID_IS_INTEGER
@@ -185,6 +192,9 @@
{"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}
@@ -1203,14 +1213,26 @@
return false;
}
+#if __CYGWIN__
+ char *name_alt = NULL;
+ if (append_exe && cygwin_spelling (filename) == 1)
+ CYGWIN_APPEND_EXE (name_alt, filename);
+#endif /* __CYGWIN__ */
+
if (STATFS (filename, &statfsbuf) != 0)
{
error (0, errno, _("cannot read file system information for %s"),
quote (filename));
+#if __CYGWIN__
+ freea (name_alt);
+#endif /* __CYGWIN__ */
return false;
}
bool fail = print_it (format, filename, print_statfs, &statfsbuf);
+#if __CYGWIN__
+ freea (name_alt);
+#endif /* __CYGWIN__ */
return ! fail;
}
@@ -1220,6 +1242,7 @@
char const *format2)
{
struct stat statbuf;
+ char *name_alt = NULL;
if (STREQ (filename, "-"))
{
@@ -1232,18 +1255,29 @@
/* 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"), quote (filename));
- return false;
+ if ((follow_links
+ ? stat (filename, &statbuf)
+ : lstat (filename, &statbuf)) != 0)
+ {
+ error (0, errno, _("cannot stat %s"), quote (filename));
+ return false;
+ }
+
+#if __CYGWIN__
+ if (append_exe && cygwin_spelling (filename) == 1)
+ 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, filename, print_stat, &statbuf);
+#if __CYGWIN__
+ freea (name_alt);
+#endif /* __CYGWIN__ */
return ! fail;
}
@@ -1365,6 +1399,11 @@
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);
@@ -1485,6 +1524,12 @@
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);

View File

@ -0,0 +1,11 @@
--- src/coreutils-8.21/Makefile.in.orig 2013-06-29 22:56:26.000000000 +0400
+++ src/coreutils-8.21/Makefile.in 2013-06-29 23:02:02.000000000 +0400
@@ -3294,7 +3294,7 @@
# Ensure we don't link against libcoreutils.a as that lib is
# not compiled with -fPIC which causes issues on 64 bit at least
-src_libstdbuf_so_LDADD =
+src_libstdbuf_so_LDADD = $(LDADD)
# Note libstdbuf is only compiled if GCC is available
# (as per the check in configure.ac), so these flags should be available.

View File

@ -0,0 +1,9 @@
--- coreutils-8.21/man/local.mk.orig 2013-02-05 18:01:21.000000000 +0400
+++ coreutils-8.21/man/local.mk 2013-10-31 23:15:34.058400000 +0400
@@ -192,5 +192,5 @@
--output=$$t/$$name.1 $$t/$$name \
&& sed 's|$*\.td/||g' $$t/$$name.1 > $@-t \
&& rm -rf $$t \
- && chmod -w $@-t \
+ && chmod a-w $@-t \
&& mv $@-t $@

View File

@ -0,0 +1,86 @@
diff -Naur coreutils-8.21-fpending/lib/config.hin coreutils-8.21/lib/config.hin
--- coreutils-8.21-fpending/lib/config.hin 2013-10-20 10:11:10.369000000 +0400
+++ coreutils-8.21/lib/config.hin 2013-10-20 10:24:12.124800000 +0400
@@ -1298,10 +1298,6 @@
don't. */
#undef HAVE_DECL__SYS_SIGLIST
-/* Define to 1 if you have the declaration of `__fpending', and to 0 if you
- don't. */
-#undef HAVE_DECL___FPENDING
-
/* Define to 1 if you have the declaration of `__fsetlocking', and to 0 if you
don't. */
#undef HAVE_DECL___FSETLOCKING
@@ -2519,9 +2515,6 @@
member named physmem. */
#undef HAVE__SYSTEM_CONFIGURATION
-/* Define to 1 if you have the `__fpending' function. */
-#undef HAVE___FPENDING
-
/* Define to 1 if you have the `__fpurge' function. */
#undef HAVE___FPURGE
diff -Naur coreutils-8.21-fpending/lib/fpending.h coreutils-8.21/lib/fpending.h
--- coreutils-8.21-fpending/lib/fpending.h 2013-09-22 19:25:57.000000000 +0400
+++ coreutils-8.21/lib/fpending.h 2013-10-20 10:26:22.710600000 +0400
@@ -20,11 +20,10 @@
#include <stddef.h>
#include <stdio.h>
+#if HAVE_STDIO_EXT_H
+# include <stdio_ext.h>
+#endif
-#if HAVE_DECL___FPENDING
-# if HAVE_STDIO_EXT_H
-# include <stdio_ext.h>
-# endif
-#else
+#ifndef __fpending
size_t __fpending (FILE *);
#endif
diff -Naur coreutils-8.21-fpending/m4/fpending.m4 coreutils-8.21/m4/fpending.m4
--- coreutils-8.21-fpending/m4/fpending.m4 2013-09-22 19:25:57.000000000 +0400
+++ coreutils-8.21/m4/fpending.m4 2013-10-20 10:27:26.603600000 +0400
@@ -16,14 +16,19 @@
AC_DEFUN([gl_FUNC_FPENDING],
[
AC_CHECK_HEADERS_ONCE([stdio_ext.h])
- AC_CHECK_FUNCS_ONCE([__fpending])
- fp_headers='
-# include <stdio.h>
-# if HAVE_STDIO_EXT_H
-# include <stdio_ext.h>
-# endif
-'
- AC_CHECK_DECLS([__fpending], , , $fp_headers)
+ AC_CACHE_CHECK([for __fpending], [gl_cv_func___fpending],
+ [
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdio.h>
+ #if HAVE_STDIO_EXT_H
+ # include <stdio_ext.h>
+ #endif
+ ]],
+ [[return ! __fpending (stdin);]])],
+ [gl_cv_func___fpending=yes],
+ [gl_cv_func___fpending=no])
+ ])
])
AC_DEFUN([gl_PREREQ_FPENDING],
diff -Naur coreutils-8.21-fpending/m4/gnulib-comp.m4 coreutils-8.21/m4/gnulib-comp.m4
--- coreutils-8.21-fpending/m4/gnulib-comp.m4 2013-09-22 19:29:16.000000000 +0400
+++ coreutils-8.21/m4/gnulib-comp.m4 2013-10-20 10:28:16.554800000 +0400
@@ -679,7 +679,7 @@
gl_STDIO_MODULE_INDICATOR([fopen])
gl_MODULE_INDICATOR([fopen-safer])
gl_FUNC_FPENDING
- if test $ac_cv_func___fpending = no; then
+ if test $gl_cv_func___fpending = no; then
AC_LIBOBJ([fpending])
gl_PREREQ_FPENDING
fi

View File

@ -0,0 +1,55 @@
--- src/coreutils-8.21/Makefile.in.orig 2013-07-27 08:10:23.000000000 +0400
+++ src/coreutils-8.21/Makefile.in 2013-07-27 08:18:52.000000000 +0400
@@ -2495,6 +2495,7 @@
WERROR_CFLAGS = @WERROR_CFLAGS@
WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDRES = windres
WINT_T_SUFFIX = @WINT_T_SUFFIX@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
@@ -5247,9 +5248,9 @@
src/$(DEPDIR)/$(am__dirstamp)
src/src_ginstall-extent-scan.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
-src/ginstall$(EXEEXT): $(src_ginstall_OBJECTS) $(src_ginstall_DEPENDENCIES) $(EXTRA_src_ginstall_DEPENDENCIES) src/$(am__dirstamp)
+src/ginstall$(EXEEXT): $(src_ginstall_OBJECTS) src/src_ginstall-manifest.res $(src_ginstall_DEPENDENCIES) $(EXTRA_src_ginstall_DEPENDENCIES) src/$(am__dirstamp)
@rm -f src/ginstall$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(src_ginstall_OBJECTS) $(src_ginstall_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(src_ginstall_OBJECTS) src/src_ginstall-manifest.res $(src_ginstall_LDADD) $(LIBS)
src/groups.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/group-list.$(OBJEXT): src/$(am__dirstamp) \
@@ -6673,6 +6674,9 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+src/src_ginstall-manifest.res: src/install.rc src/install.manifest
+ $(WINDRES) --input $< --output $@ --output-format=coff
+
src/src_ginstall-install.o: src/install.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_ginstall_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/src_ginstall-install.o -MD -MP -MF src/$(DEPDIR)/src_ginstall-install.Tpo -c -o src/src_ginstall-install.o `test -f 'src/install.c' || echo '$(srcdir)/'`src/install.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_ginstall-install.Tpo src/$(DEPDIR)/src_ginstall-install.Po
--- /dev/null 2013-07-12 17:17:55.297805948 +0400
+++ src/coreutils-8.21/src/install.manifest 2013-07-27 08:20:00.000000000 +0400
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <assemblyIdentity version="1.0.0.0"
+ processorArchitecture="x86"
+ name="GNU.coreutils.install"
+ type="win32"/>
+
+ <!-- Identify the application security requirements. -->
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+</assembly>
--- /dev/null 2013-07-12 17:17:55.297805948 +0400
+++ src/coreutils-8.21/src/install.rc 2013-07-27 08:20:12.000000000 +0400
@@ -0,0 +1 @@
+1 24 install.manifest

View File

@ -0,0 +1,19 @@
--- src/coreutils-8.21/src/md5sum.c.orig 2013-07-11 16:13:02.000000000 +0400
+++ src/coreutils-8.21/src/md5sum.c 2013-07-12 16:36:12.000000000 +0400
@@ -394,6 +394,16 @@
significant -- that includes leading and trailing white space. */
*file_name = &s[i];
+#if __CYGWIN__
+ /* But on cygwin, where \r is only permitted on managed mounts (and is
+ relatively rare anyways), strip it from the line end since older
+ cygwin releases (which includes practically all msys1 releases)
+ of coreutils mistakenly output md5sums in text mode.
+ \r is not a legal character for use in file names on W32 anyway. */
+ if (s[s_len - 1] == '\r')
+ s[--s_len] = '\0';
+#endif /* __CYGWIN__ */
+
if (escaped_filename)
return filename_unescape (&s[i], s_len - i) != NULL;

View File

@ -0,0 +1,18 @@
--- src/coreutils-8.21/lib/gnulib.mk.orig 2013-06-29 06:19:40.000000000 +0400
+++ src/coreutils-8.21/lib/gnulib.mk 2013-06-29 22:26:24.000000000 +0400
@@ -483,6 +483,15 @@
## end gnulib module cycle-check
+## begin gnulib module cygwin
+
+
+EXTRA_DIST += lib/cygwin.c
+
+EXTRA_lib_libcoreutils_a_SOURCES += lib/cygwin.c
+
+## end gnulib module cygwin
+
## begin gnulib module dev-ino

View File

@ -0,0 +1,56 @@
--- src/coreutils-8.21/lib/mountlist.c.orig 2013-02-07 20:44:47.000000000 +0400
+++ src/coreutils-8.21/lib/mountlist.c 2013-06-29 22:19:56.000000000 +0400
@@ -167,15 +167,48 @@
/* for Irix 6.5 */ \
|| strcmp (Fs_type, "ignore") == 0)
+/* Search MNT->mnt_opts for an option matching OPT.
+ Returns the address of the substring, or null if none found. */
+char *
+hasmntopt (const struct mntent *mnt, const char *opt)
+{
+ const size_t optlen = strlen (opt);
+ char *rest = mnt->mnt_opts, *p;
+
+ while ((p = strstr (rest, opt)) != NULL)
+ {
+ if (p == rest
+ || (p[-1] == ','
+ && (p[optlen] == '\0' ||
+ p[optlen] == '=' ||
+ p[optlen] == ',')))
+ return p;
+
+ rest = strchr (rest, ',');
+ if (rest == NULL)
+ break;
+ ++rest;
+ }
+
+ return NULL;
+}
+#define HAVE_HASMNTOPT
+
/* Historically, we have marked as "dummy" any file system of type "none",
but now that programs like du need to know about bind-mounted directories,
we grant an exception to any with "bind" in its list of mount options.
I.e., those are *not* dummy entries. */
-#ifdef MOUNTED_GETMNTENT1
-# define ME_DUMMY(Fs_name, Fs_type, Fs_ent) \
- (ME_DUMMY_0 (Fs_name, Fs_type) \
- || (strcmp (Fs_type, "none") == 0 \
- && !hasmntopt (Fs_ent, "bind")))
+#if defined MOUNTED_GETMNTENT1 && defined HAVE_HASMNTOPT
+# if defined HAVE_HASMNTOPT
+# define ME_DUMMY(Fs_name, Fs_type, Fs_ent) \
+ (ME_DUMMY_0 (Fs_name, Fs_type) \
+ || (strcmp (Fs_type, "none") == 0 \
+ && !hasmntopt (Fs_ent, "bind")))
+# else
+# define ME_DUMMY(Fs_name, Fs_type, Fs_ent) \
+ (ME_DUMMY_0 (Fs_name, Fs_type) \
+ || (strcmp (Fs_type, "none") == 0))
+# endif
#else
# define ME_DUMMY(Fs_name, Fs_type) \
(ME_DUMMY_0 (Fs_name, Fs_type) || strcmp (Fs_type, "none") == 0)

View File

@ -0,0 +1,65 @@
diff -Naur coreutils-8.21/lib/Makefile.in coreutils-8.21-msys/lib/Makefile.in
--- coreutils-8.21/Makefile.in 2013-05-01 08:22:57.715820300 +0000
+++ coreutils-8.21-msys/Makefile.in 2013-03-04 08:25:50.146484300 +0000
@@ -392,13 +392,13 @@
lib/argmatch.c lib/argv-iter.c lib/argv-iter.h \
lib/backupfile.c lib/base64.h lib/base64.c lib/binary-io.h \
lib/binary-io.c lib/bitrotate.h lib/bitrotate.c \
- lib/buffer-lcm.c lib/buffer-lcm.h lib/c-ctype.h lib/c-ctype.c \
+ lib/buffer-lcm.c lib/buffer-lcm.h lib/cygwin.c lib/cygwin.h lib/c-ctype.h lib/c-ctype.c \
lib/c-strcase.h lib/c-strcasecmp.c lib/c-strncasecmp.c \
lib/c-strtod.c lib/c-strtold.c lib/canon-host.c \
lib/canonicalize.c lib/careadlinkat.c lib/cloexec.c \
lib/close-stream.c lib/closein.c lib/closeout.c \
lib/cygwin.h lib/cygwin.c lib/md5.c \
- lib/sha1.c lib/sha256.c lib/sha512.c lib/cycle-check.c \
+ lib/sha1.c lib/sha256.c lib/sha512.c lib/cycle-check.c lib/cygwin.c \
lib/di-set.c lib/di-set.h lib/diacrit.h lib/diacrit.c \
lib/opendir-safer.c lib/dirname.c lib/basename.c \
lib/dirname-lgpl.c lib/basename-lgpl.c lib/stripslash.c \
@@ -476,7 +476,7 @@
lib/argmatch.$(OBJEXT) lib/argv-iter.$(OBJEXT) \
lib/backupfile.$(OBJEXT) lib/base64.$(OBJEXT) \
lib/binary-io.$(OBJEXT) lib/bitrotate.$(OBJEXT) \
- lib/buffer-lcm.$(OBJEXT) lib/c-ctype.$(OBJEXT) \
+ lib/buffer-lcm.$(OBJEXT) lib/cygwin.$(OBJEXT) lib/c-ctype.$(OBJEXT) \
lib/c-strcasecmp.$(OBJEXT) lib/c-strncasecmp.$(OBJEXT) \
lib/c-strtod.$(OBJEXT) lib/c-strtold.$(OBJEXT) \
lib/canon-host.$(OBJEXT) lib/canonicalize.$(OBJEXT) \
@@ -484,7 +484,7 @@
lib/close-stream.$(OBJEXT) lib/closein.$(OBJEXT) \
lib/closeout.$(OBJEXT) lib/md5.$(OBJEXT) lib/sha1.$(OBJEXT) \
lib/sha256.$(OBJEXT) lib/sha512.$(OBJEXT) \
- lib/cycle-check.$(OBJEXT) lib/di-set.$(OBJEXT) \
+ lib/cycle-check.$(OBJEXT) lib/cygwin.$(OBJEXT) lib/di-set.$(OBJEXT) \
lib/diacrit.$(OBJEXT) lib/opendir-safer.$(OBJEXT) \
lib/dirname.$(OBJEXT) lib/basename.$(OBJEXT) \
lib/dirname-lgpl.$(OBJEXT) lib/basename-lgpl.$(OBJEXT) \
@@ -2889,13 +2889,13 @@
lib/areadlink-with-size.c lib/areadlinkat.c lib/argmatch.c \
lib/argv-iter.c lib/argv-iter.h lib/backupfile.c lib/base64.h \
lib/base64.c lib/binary-io.h lib/binary-io.c lib/bitrotate.h \
- lib/bitrotate.c lib/buffer-lcm.c lib/buffer-lcm.h \
+ lib/bitrotate.c lib/buffer-lcm.c lib/cygwin.c lib/cygwin.h lib/buffer-lcm.h \
lib/c-ctype.h lib/c-ctype.c lib/c-strcase.h lib/c-strcasecmp.c \
lib/c-strncasecmp.c lib/c-strtod.c lib/c-strtold.c \
lib/canon-host.c lib/canonicalize.c lib/careadlinkat.c \
lib/cloexec.c lib/close-stream.c lib/closein.c lib/closeout.c \
lib/md5.c lib/sha1.c lib/sha256.c lib/sha512.c \
- lib/cycle-check.c lib/di-set.c lib/di-set.h lib/diacrit.h \
+ lib/cycle-check.c lib/cygwin.c lib/di-set.c lib/di-set.h lib/diacrit.h \
lib/diacrit.c lib/opendir-safer.c lib/dirname.c lib/basename.c \
lib/dirname-lgpl.c lib/basename-lgpl.c lib/stripslash.c \
lib/dtoastr.c lib/dtotimespec.c lib/exclude.c lib/exitfail.c \
diff -Naur coreutils-8.15/src/install.c coreutils-8.15-msys/src/install.c
--- coreutils-8.21/src/install.c 2013-05-01 05:36:30.586914000 +0000
+++ coreutils-8.21-msys/src/install.c 2013-03-04 10:35:28.122070300 +0000
@@ -44,7 +44,7 @@
#include "utimens.h"
#include "xstrtol.h"
-#if __CYGWIN__
+#ifdef __CYGWIN__
# include "cygwin.h"
#endif

View File

@ -0,0 +1,451 @@
diff -Naur coreutils-8.21-cygwin/build-aux/compile coreutils-8.21-msys/build-aux/compile
--- coreutils-8.21-cygwin/build-aux/compile 2013-02-14 14:58:02.000000000 +0000
+++ coreutils-8.21-msys/build-aux/compile 2013-05-17 10:27:58.446289100 +0000
@@ -54,7 +54,7 @@
MINGW*)
file_conv=mingw
;;
- CYGWIN*)
+ CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
@@ -68,7 +68,7 @@
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin/*)
+ cygwin/* | msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
diff -Naur coreutils-8.21-cygwin/build-aux/config.guess coreutils-8.21-msys/build-aux/config.guess
--- coreutils-8.21-cygwin/build-aux/config.guess 2013-02-07 16:44:47.000000000 +0000
+++ coreutils-8.21-msys/build-aux/config.guess 2013-05-17 10:31:55.508789100 +0000
@@ -845,6 +845,9 @@
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
+ amd64:MSYS*:*:* | x86_64:MSYS*:*:*)
+ echo x86_64-unknown-msys
+ exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit ;;
diff -Naur coreutils-8.21-cygwin/build-aux/config.rpath coreutils-8.21-msys/build-aux/config.rpath
--- coreutils-8.21-cygwin/build-aux/config.rpath 2013-01-02 12:34:45.000000000 +0000
+++ coreutils-8.21-msys/build-aux/config.rpath 2013-05-17 10:27:58.446289100 +0000
@@ -57,7 +57,7 @@
aix*)
wl='-Wl,'
;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | cygwin* | msys* | pw32* | os2* | cegcc*)
;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
@@ -149,7 +149,7 @@
hardcode_minus_L=no
case "$host_os" in
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | msys* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
@@ -198,7 +198,7 @@
ld_shlibs=no
fi
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | msys* | mingw* | pw32* | cegcc*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
@@ -348,7 +348,7 @@
;;
bsdi[45]*)
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | msys* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -537,7 +537,7 @@
bsdi[45]*)
library_names_spec='$libname$shrext'
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | msys* | mingw* | pw32* | cegcc*)
shrext=.dll
library_names_spec='$libname.dll.a $libname.lib'
;;
diff -Naur coreutils-8.21-cygwin/configure coreutils-8.21-msys/configure
--- coreutils-8.21-cygwin/configure 2013-02-14 15:54:18.000000000 +0000
+++ coreutils-8.21-msys/configure 2013-05-17 10:33:57.739257800 +0000
@@ -7171,7 +7171,7 @@
else
case "$host_os" in
osf*) gl_use_threads=no ;;
- cygwin*)
+ cygwin* | msys*)
case `uname -r` in
1.[0-5].*) gl_use_threads=no ;;
*) gl_use_threads=yes ;;
@@ -9051,7 +9051,7 @@
# special semantics and is distinct from /, please report it to
# <bug-gnulib@gnu.org>.
case $host in
- *-cygwin | i370-ibm-openedition)
+ *-cygwin | *-msys | i370-ibm-openedition)
gl_cv_double_slash_root=yes ;;
*)
# Be optimistic and assume that / and // are the same when we
@@ -13066,7 +13066,7 @@
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_getcwd_null="guessing yes";;
# Guess yes on Cygwin.
- cygwin*) gl_cv_func_getcwd_null="guessing yes";;
+ cygwin* | msys*) gl_cv_func_getcwd_null="guessing yes";;
# If we don't know, assume the worst.
*) gl_cv_func_getcwd_null="guessing no";;
esac
@@ -23531,7 +23531,7 @@
openbsd*) gl_cv_func_printf_directive_ls="guessing no";;
irix*) gl_cv_func_printf_directive_ls="guessing no";;
solaris*) gl_cv_func_printf_directive_ls="guessing no";;
- cygwin*) gl_cv_func_printf_directive_ls="guessing no";;
+ cygwin* | msys*) gl_cv_func_printf_directive_ls="guessing no";;
beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";;
*) gl_cv_func_printf_directive_ls="guessing yes";;
esac
@@ -23615,7 +23615,7 @@
if test "$cross_compiling" = yes; then :
case "$host_os" in
- cygwin*) gl_cv_func_printf_flag_grouping="guessing no";;
+ cygwin* | msys*) gl_cv_func_printf_flag_grouping="guessing no";;
netbsd*) gl_cv_func_printf_flag_grouping="guessing no";;
mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
*) gl_cv_func_printf_flag_grouping="guessing yes";;
@@ -25145,7 +25145,7 @@
case "$host_os" in
# Guess no on Cygwin.
- cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
+ cygwin* | msys*) gl_cv_func_btowc_nul="guessing no" ;;
# Guess yes otherwise.
*) gl_cv_func_btowc_nul="guessing yes" ;;
esac
@@ -26321,7 +26321,7 @@
# special semantics and is distinct from /, please report it to
# <bug-gnulib@gnu.org>.
case $host in
- *-cygwin | i370-ibm-openedition)
+ *-cygwin | *-msys | i370-ibm-openedition)
gl_cv_double_slash_root=yes ;;
*)
# Be optimistic and assume that / and // are the same when we
@@ -26411,7 +26411,7 @@
case "$host_os" in
mingw*) # on this platform, dup2 always returns 0 for success
gl_cv_func_dup2_works="guessing no" ;;
- cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
+ cygwin* | msys*) # on cygwin 1.5.x, dup2(1,1) returns 0
gl_cv_func_dup2_works="guessing no" ;;
linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
# closed fd may yield -EBADF instead of -1 / errno=EBADF.
@@ -36608,7 +36608,7 @@
case "$host_os" in
# Guess yes on platforms where we know the result.
*-gnu* | freebsd* | netbsd* | openbsd* \
- | hpux* | solaris* | cygwin* | mingw*)
+ | hpux* | solaris* | cygwin* | msys* | mingw*)
ac_cv_func_malloc_0_nonnull=yes ;;
# If we don't know, assume the worst.
*) ac_cv_func_malloc_0_nonnull=no ;;
@@ -43008,7 +43008,7 @@
case "$host_os" in
# Guess yes on platforms where we know the result.
*-gnu* | freebsd* | netbsd* | openbsd* \
- | hpux* | solaris* | cygwin* | mingw*)
+ | hpux* | solaris* | cygwin* | msys* | mingw*)
ac_cv_func_realloc_0_nonnull=yes ;;
# If we don't know, assume the worst.
*) ac_cv_func_realloc_0_nonnull=no ;;
@@ -57682,7 +57682,7 @@
case "$host_os" in
mingw*) REPLACE_SETLOCALE=1 ;;
- cygwin*)
+ cygwin* | msys*)
case `uname -r` in
1.5.*) REPLACE_SETLOCALE=1 ;;
esac
@@ -58733,7 +58733,7 @@
gnu[0-9]* | \
linux-* | linux | \
freebsd2.2* | freebsd[3-9]* | freebsd[1-9][0-9]* | \
- cygwin | \
+ cygwin | msys | \
mingw*)
$as_echo "#define UNLINK_CANNOT_UNLINK_DIR 1" >>confdefs.h
@@ -59396,13 +59396,13 @@
case "$host_os" in
# Guess no on Solaris <= 9 and Cygwin.
- solaris2.[1-9] | solaris2.[1-9].* | cygwin*)
+ solaris2.[1-9] | solaris2.[1-9].* | cygwin* | msys*)
gl_cv_func_wctob_works="guessing no" ;;
# Guess yes otherwise.
*) gl_cv_func_wctob_works="guessing yes" ;;
esac
case "$host_os" in
- cygwin*)
+ cygwin* | msys*)
if test "$cross_compiling" = yes; then :
:
else
diff -Naur coreutils-8.21-cygwin/gnulib-tests/test-copy-acl.sh coreutils-8.21-msys/gnulib-tests/test-copy-acl.sh
--- coreutils-8.21-cygwin/gnulib-tests/test-copy-acl.sh 2012-07-12 13:49:26.000000000 +0000
+++ coreutils-8.21-msys/gnulib-tests/test-copy-acl.sh 2013-05-17 10:27:58.524414100 +0000
@@ -128,7 +128,7 @@
# the programs.
# func_test_same_acls file1 file2
case $acl_flavor in
- linux | cygwin | freebsd | solaris)
+ linux | cygwin | msys | freebsd | solaris)
func_test_same_acls ()
{
getfacl "$1" | sed -e "s/$1/FILENAME/g" > tmpaclout1
@@ -302,7 +302,7 @@
;;
- cygwin)
+ cygwin | msys)
# Set an ACL for a group.
setfacl -m group:0:1 tmpfile0
diff -Naur coreutils-8.21-cygwin/gnulib-tests/test-file-has-acl.sh coreutils-8.21-msys/gnulib-tests/test-file-has-acl.sh
--- coreutils-8.21-cygwin/gnulib-tests/test-file-has-acl.sh 2012-07-12 13:49:26.000000000 +0000
+++ coreutils-8.21-msys/gnulib-tests/test-file-has-acl.sh 2013-05-17 10:27:58.540039100 +0000
@@ -247,7 +247,7 @@
fi
;;
- cygwin)
+ cygwin | msys)
# Set an ACL for a group.
if setfacl -m group:0:1 tmpfile0; then
diff -Naur coreutils-8.21-cygwin/gnulib-tests/test-set-mode-acl.sh coreutils-8.21-msys/gnulib-tests/test-set-mode-acl.sh
--- coreutils-8.21-cygwin/gnulib-tests/test-set-mode-acl.sh 2012-07-12 13:49:26.000000000 +0000
+++ coreutils-8.21-msys/gnulib-tests/test-set-mode-acl.sh 2013-05-17 10:27:58.540039100 +0000
@@ -177,7 +177,7 @@
linux | freebsd | solaris)
setfacl -m user:$auid:1 tmpfile0
;;
- cygwin)
+ cygwin | msys)
setfacl -m group:0:1 tmpfile0
;;
hpux)
diff -Naur coreutils-8.21-cygwin/install.exe.manifest coreutils-8.21-msys/install.exe.manifest
--- coreutils-8.21-cygwin/install.exe.manifest 1970-01-01 00:00:00.000000000 +0000
+++ coreutils-8.21-msys/install.exe.manifest 2013-05-17 10:27:58.540039100 +0000
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <v3:trustInfo xmlns:v3="urn:schemas-microsoft-com:asm.v3">
+ <v3:security>
+ <v3:requestedPrivileges>
+ <v3:requestedExecutionLevel level="asInvoker" />
+ </v3:requestedPrivileges>
+ </v3:security>
+ </v3:trustInfo>
+</assembly>
+
diff -Naur coreutils-8.21-cygwin/lib/gnulib.mk coreutils-8.21-msys/lib/gnulib.mk
--- coreutils-8.21-cygwin/lib/gnulib.mk 2013-02-14 14:57:23.000000000 +0000
+++ coreutils-8.21-msys/lib/gnulib.mk 2013-05-17 10:27:58.540039100 +0000
@@ -1887,7 +1887,7 @@
case '$(host_os)' in \
darwin[56]*) \
need_charset_alias=true ;; \
- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
+ darwin* | cygwin* | msys* | mingw* | pw32* | cegcc*) \
need_charset_alias=false ;; \
*) \
need_charset_alias=true ;; \
diff -Naur coreutils-8.21-cygwin/m4/btowc.m4 coreutils-8.21-msys/m4/btowc.m4
--- coreutils-8.21-cygwin/m4/btowc.m4 2013-01-02 12:34:46.000000000 +0000
+++ coreutils-8.21-msys/m4/btowc.m4 2013-05-17 10:28:02.352539100 +0000
@@ -49,7 +49,7 @@
changequote(,)dnl
case "$host_os" in
# Guess no on Cygwin.
- cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
+ cygwin* | msys*) gl_cv_func_btowc_nul="guessing no" ;;
# Guess yes otherwise.
*) gl_cv_func_btowc_nul="guessing yes" ;;
esac
diff -Naur coreutils-8.21-cygwin/m4/double-slash-root.m4 coreutils-8.21-msys/m4/double-slash-root.m4
--- coreutils-8.21-cygwin/m4/double-slash-root.m4 2013-01-02 12:34:46.000000000 +0000
+++ coreutils-8.21-msys/m4/double-slash-root.m4 2013-05-17 10:28:02.368164100 +0000
@@ -16,7 +16,7 @@
# special semantics and is distinct from /, please report it to
# <bug-gnulib@gnu.org>.
case $host in
- *-cygwin | i370-ibm-openedition)
+ *-cygwin | *-msys | i370-ibm-openedition)
gl_cv_double_slash_root=yes ;;
*)
# Be optimistic and assume that / and // are the same when we
diff -Naur coreutils-8.21-cygwin/m4/dup2.m4 coreutils-8.21-msys/m4/dup2.m4
--- coreutils-8.21-cygwin/m4/dup2.m4 2013-01-02 12:34:46.000000000 +0000
+++ coreutils-8.21-msys/m4/dup2.m4 2013-05-17 10:38:24.763671900 +0000
@@ -49,7 +49,7 @@
[case "$host_os" in
mingw*) # on this platform, dup2 always returns 0 for success
gl_cv_func_dup2_works="guessing no" ;;
- cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
+ cygwin* | msys*) # on cygwin 1.5.x, dup2(1,1) returns 0
gl_cv_func_dup2_works="guessing no" ;;
linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
# closed fd may yield -EBADF instead of -1 / errno=EBADF.
diff -Naur coreutils-8.21-cygwin/m4/getcwd.m4 coreutils-8.21-msys/m4/getcwd.m4
--- coreutils-8.21-cygwin/m4/getcwd.m4 2013-01-02 12:34:46.000000000 +0000
+++ coreutils-8.21-msys/m4/getcwd.m4 2013-05-17 10:38:59.138671900 +0000
@@ -49,7 +49,7 @@
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_getcwd_null="guessing yes";;
# Guess yes on Cygwin.
- cygwin*) gl_cv_func_getcwd_null="guessing yes";;
+ cygwin* | msys*) gl_cv_func_getcwd_null="guessing yes";;
# If we don't know, assume the worst.
*) gl_cv_func_getcwd_null="guessing no";;
esac
diff -Naur coreutils-8.21-cygwin/m4/malloc.m4 coreutils-8.21-msys/m4/malloc.m4
--- coreutils-8.21-cygwin/m4/malloc.m4 2013-01-02 12:34:46.000000000 +0000
+++ coreutils-8.21-msys/m4/malloc.m4 2013-05-17 10:39:37.419921900 +0000
@@ -30,7 +30,7 @@
[case "$host_os" in
# Guess yes on platforms where we know the result.
*-gnu* | freebsd* | netbsd* | openbsd* \
- | hpux* | solaris* | cygwin* | mingw*)
+ | hpux* | solaris* | cygwin* | msys* | mingw*)
ac_cv_func_malloc_0_nonnull=yes ;;
# If we don't know, assume the worst.
*) ac_cv_func_malloc_0_nonnull=no ;;
diff -Naur coreutils-8.21-cygwin/m4/printf.m4 coreutils-8.21-msys/m4/printf.m4
--- coreutils-8.21-cygwin/m4/printf.m4 2013-01-02 12:34:46.000000000 +0000
+++ coreutils-8.21-msys/m4/printf.m4 2013-05-17 10:28:02.383789100 +0000
@@ -735,7 +735,7 @@
openbsd*) gl_cv_func_printf_directive_ls="guessing no";;
irix*) gl_cv_func_printf_directive_ls="guessing no";;
solaris*) gl_cv_func_printf_directive_ls="guessing no";;
- cygwin*) gl_cv_func_printf_directive_ls="guessing no";;
+ cygwin* | msys*) gl_cv_func_printf_directive_ls="guessing no";;
beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";;
*) gl_cv_func_printf_directive_ls="guessing yes";;
esac
@@ -812,7 +812,7 @@
[
changequote(,)dnl
case "$host_os" in
- cygwin*) gl_cv_func_printf_flag_grouping="guessing no";;
+ cygwin* | msys*) gl_cv_func_printf_flag_grouping="guessing no";;
netbsd*) gl_cv_func_printf_flag_grouping="guessing no";;
mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
*) gl_cv_func_printf_flag_grouping="guessing yes";;
@@ -1464,7 +1464,7 @@
darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
# Guess yes on Cygwin.
- cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ cygwin* | msys*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
# Guess yes on Solaris >= 2.6.
solaris2.[0-5] | solaris2.[0-5].*)
gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
diff -Naur coreutils-8.21-cygwin/m4/realloc.m4 coreutils-8.21-msys/m4/realloc.m4
--- coreutils-8.21-cygwin/m4/realloc.m4 2013-01-02 12:34:46.000000000 +0000
+++ coreutils-8.21-msys/m4/realloc.m4 2013-05-17 10:40:41.154296900 +0000
@@ -30,7 +30,7 @@
[case "$host_os" in
# Guess yes on platforms where we know the result.
*-gnu* | freebsd* | netbsd* | openbsd* \
- | hpux* | solaris* | cygwin* | mingw*)
+ | hpux* | solaris* | cygwin* | msys* | mingw*)
ac_cv_func_realloc_0_nonnull=yes ;;
# If we don't know, assume the worst.
*) ac_cv_func_realloc_0_nonnull=no ;;
diff -Naur coreutils-8.21-cygwin/m4/setlocale.m4 coreutils-8.21-msys/m4/setlocale.m4
--- coreutils-8.21-cygwin/m4/setlocale.m4 2013-01-02 12:34:46.000000000 +0000
+++ coreutils-8.21-msys/m4/setlocale.m4 2013-05-17 10:28:02.383789100 +0000
@@ -14,7 +14,7 @@
mingw*) REPLACE_SETLOCALE=1 ;;
dnl On Cygwin 1.5.x, setlocale always succeeds but setlocale(LC_CTYPE,NULL)
dnl is then still "C".
- cygwin*)
+ cygwin* | msys*)
case `uname -r` in
1.5.*) REPLACE_SETLOCALE=1 ;;
esac
diff -Naur coreutils-8.21-cygwin/m4/threadlib.m4 coreutils-8.21-msys/m4/threadlib.m4
--- coreutils-8.21-cygwin/m4/threadlib.m4 2013-01-02 12:34:46.000000000 +0000
+++ coreutils-8.21-msys/m4/threadlib.m4 2013-05-17 10:28:02.383789100 +0000
@@ -68,7 +68,7 @@
dnl bugs that lead to endless loops or crashes. See
dnl <http://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
osf*) gl_use_threads=no ;;
- cygwin*)
+ cygwin* | msys*)
case `uname -r` in
1.[0-5].*) gl_use_threads=no ;;
*) gl_use_threads=yes ;;
diff -Naur coreutils-8.21-cygwin/m4/unlinkdir.m4 coreutils-8.21-msys/m4/unlinkdir.m4
--- coreutils-8.21-cygwin/m4/unlinkdir.m4 2013-01-02 12:34:46.000000000 +0000
+++ coreutils-8.21-msys/m4/unlinkdir.m4 2013-05-17 10:28:02.383789100 +0000
@@ -24,7 +24,7 @@
gnu[[0-9]]* | \
linux-* | linux | \
freebsd2.2* | freebsd[[3-9]]* | freebsd[[1-9]][[0-9]]* | \
- cygwin | \
+ cygwin | msys | \
mingw*)
AC_DEFINE([UNLINK_CANNOT_UNLINK_DIR], [1],
[Define to 1 if unlink (dir) cannot possibly succeed.]);;
diff -Naur coreutils-8.21-cygwin/m4/wctob.m4 coreutils-8.21-msys/m4/wctob.m4
--- coreutils-8.21-cygwin/m4/wctob.m4 2013-01-02 12:34:46.000000000 +0000
+++ coreutils-8.21-msys/m4/wctob.m4 2013-05-17 10:41:41.685546900 +0000
@@ -29,14 +29,14 @@
changequote(,)dnl
case "$host_os" in
# Guess no on Solaris <= 9 and Cygwin.
- solaris2.[1-9] | solaris2.[1-9].* | cygwin*)
+ solaris2.[1-9] | solaris2.[1-9].* | cygwin* | msys*)
gl_cv_func_wctob_works="guessing no" ;;
# Guess yes otherwise.
*) gl_cv_func_wctob_works="guessing yes" ;;
esac
changequote([,])dnl
case "$host_os" in
- cygwin*)
+ cygwin* | msys*)
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <locale.h>
diff -Naur coreutils-8.21-cygwin/Makefile.in coreutils-8.21-msys/Makefile.in
--- coreutils-8.21-cygwin/Makefile.in 2013-05-17 10:18:44.589843800 +0000
+++ coreutils-8.21-msys/Makefile.in 2013-05-17 10:36:31.981445300 +0000
@@ -8230,7 +8230,7 @@
case '$(host_os)' in \
darwin[56]*) \
need_charset_alias=true ;; \
- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
+ darwin* | cygwin* | msys* | mingw* | pw32* | cegcc*) \
need_charset_alias=false ;; \
*) \
need_charset_alias=true ;; \

View File

@ -0,0 +1,17 @@
infodir=usr/share/info
file=coreutils.info
post_install() {
[[ -x usr/bin/install-info ]]
install-info $infodir/$file.gz $infodir/dir 2> /dev/null
}
post_upgrade() {
post_install $1
}
pre_remove() {
[[ -x usr/bin/install-info ]]
install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
}