new upstream release 8.21, update patches

This commit is contained in:
Ondřej Vašík 2013-02-15 17:50:47 +01:00
parent 9ae2bc3ca1
commit 4c4be9e1c9
10 changed files with 311 additions and 793 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@
/coreutils-8.18.tar.xz
/coreutils-8.19.tar.xz
/coreutils-8.20.tar.xz
/coreutils-8.21.tar.xz

View File

@ -1,59 +0,0 @@
diff -urNp coreutils-8.20-orig/doc/coreutils.texi coreutils-8.20/doc/coreutils.texi
--- coreutils-8.20-orig/doc/coreutils.texi 2013-02-05 14:32:51.609588591 +0100
+++ coreutils-8.20/doc/coreutils.texi 2013-02-05 14:38:11.486585193 +0100
@@ -13219,6 +13219,13 @@ Disable modem control signals. May be n
@cindex flow control, hardware
@cindex RTS/CTS flow control
Enable RTS/CTS flow control. Non-POSIX@. May be negated.
+
+@item cdtrdsr
+@opindex cdtrdsr
+@cindex hardware flow control
+@cindex flow control, hardware
+@cindex DTR/DSR flow control
+Enable DTR/DSR flow control. Non-POSIX@. May be negated.
@end table
diff -urNp coreutils-8.20-orig/src/stty.c coreutils-8.20/src/stty.c
--- coreutils-8.20-orig/src/stty.c 2013-02-05 14:32:51.579585712 +0100
+++ coreutils-8.20/src/stty.c 2013-02-05 14:33:33.600585688 +0100
@@ -74,6 +74,9 @@
#ifndef CINTR
# define CINTR Control ('c')
#endif
+#ifndef CDTRDSR
+# define CDTRDSR 004000000000 /* DTR/DSR flow control */
+#endif
#ifndef CQUIT
# define CQUIT 28
#endif
@@ -217,7 +220,7 @@ static struct mode_info const mode_info[
#ifdef CRTSCTS
{"crtscts", control, REV, CRTSCTS, 0},
#endif
-
+ {"cdtrdsr", control, REV, CDTRDSR, 0},
{"ignbrk", input, SANE_UNSET | REV, IGNBRK, 0},
{"brkint", input, SANE_SET | REV, BRKINT, 0},
{"ignpar", input, REV, IGNPAR, 0},
@@ -577,6 +580,7 @@ Control settings:\n\
[-]clocal disable modem control signals\n\
[-]cread allow input to be received\n\
* [-]crtscts enable RTS/CTS handshaking\n\
+ * [-]cdtrdsr enable DTR/DSR handshaking\n\
csN set character size to N bits, N in [5..8]\n\
"), stdout);
fputs (_("\
diff -urNp coreutils-8.20-orig/tests/misc/stty.sh coreutils-8.20/tests/misc/stty.sh
--- coreutils-8.20-orig/tests/misc/stty.sh 2012-10-23 16:14:12.000000000 +0200
+++ coreutils-8.20/tests/misc/stty.sh 2013-02-05 14:34:19.980586848 +0100
@@ -52,7 +52,7 @@ for opt in $options; do
# other serial control settings give the same error. So skip them.
# Also on ppc*|sparc* glibc platforms 'icanon' gives the same error.
# See: http://debbugs.gnu.org/7228#14
- case $opt in parenb|parodd|cstopb|crtscts|icanon) continue;; esac
+ case $opt in parenb|parodd|cstopb|crtscts|icanon|cdtrdsr) continue;; esac
stty $opt || fail=1

View File

@ -1,7 +1,7 @@
diff -urNp coreutils-8.13-orig/gnulib-tests/gnulib.mk coreutils-8.13/gnulib-tests/gnulib.mk
--- coreutils-8.13-orig/gnulib-tests/gnulib.mk 2011-09-08 17:09:08.000000000 +0200
+++ coreutils-8.13/gnulib-tests/gnulib.mk 2011-09-09 10:14:18.714689661 +0200
@@ -235,9 +235,9 @@ EXTRA_DIST += nap.h test-chown.h test-ch
diff -urNp coreutils-8.21-orig/gnulib-tests/gnulib.mk coreutils-8.21/gnulib-tests/gnulib.mk
--- coreutils-8.21-orig/gnulib-tests/gnulib.mk 2013-02-07 17:58:44.000000000 +0100
+++ coreutils-8.21/gnulib-tests/gnulib.mk 2013-02-15 10:12:28.110593165 +0100
@@ -267,9 +267,9 @@ EXTRA_DIST += nap.h test-chown.h test-ch
## begin gnulib module cloexec-tests
@ -14,7 +14,7 @@ diff -urNp coreutils-8.13-orig/gnulib-tests/gnulib.mk coreutils-8.13/gnulib-test
## end gnulib module cloexec-tests
@@ -321,9 +321,9 @@ EXTRA_DIST += test-dirname.c
@@ -378,9 +378,9 @@ EXTRA_DIST += test-dup.c signature.h mac
## begin gnulib module dup2-tests
@ -27,7 +27,7 @@ diff -urNp coreutils-8.13-orig/gnulib-tests/gnulib.mk coreutils-8.13/gnulib-test
## end gnulib module dup2-tests
@@ -373,10 +373,10 @@ EXTRA_DIST += test-fadvise.c
@@ -439,10 +439,10 @@ EXTRA_DIST += test-fadvise.c
## begin gnulib module fchdir-tests
@ -55,7 +55,7 @@ diff -urNp coreutils-8.13-orig/gnulib-tests/gnulib.mk coreutils-8.13/gnulib-test
## end gnulib module getlogin-tests
@@ -918,10 +918,10 @@ EXTRA_DIST += test-link.h test-link.c si
@@ -1119,10 +1119,10 @@ EXTRA_DIST += test-link.h test-link.c si
## begin gnulib module linkat-tests
@ -70,7 +70,7 @@ diff -urNp coreutils-8.13-orig/gnulib-tests/gnulib.mk coreutils-8.13/gnulib-test
## end gnulib module linkat-tests
@@ -1284,9 +1284,9 @@ EXTRA_DIST += test-memrchr.c zerosize-ptr.h signature.h macros.h
@@ -1331,9 +1331,9 @@ EXTRA_DIST += test-memcoll.c macros.h
## begin gnulib module memrchr-tests
@ -83,7 +83,7 @@ diff -urNp coreutils-8.13-orig/gnulib-tests/gnulib.mk coreutils-8.13/gnulib-test
## end gnulib module memrchr-tests
@@ -1824,9 +1824,9 @@
@@ -1978,9 +1978,9 @@ EXTRA_DIST += test-statat.c
## begin gnulib module stdalign-tests
@ -96,7 +96,7 @@ diff -urNp coreutils-8.13-orig/gnulib-tests/gnulib.mk coreutils-8.13/gnulib-test
## end gnulib module stdalign-tests
@@ -1891,9 +1891,9 @@ EXTRA_DIST += test-uname.c signature.h m
@@ -2323,9 +2323,9 @@ EXTRA_DIST += test-uname.c signature.h m
## begin gnulib module unistd-safer-tests
@ -109,24 +109,43 @@ diff -urNp coreutils-8.13-orig/gnulib-tests/gnulib.mk coreutils-8.13/gnulib-test
## end gnulib module unistd-safer-tests
@@ -1997,10 +1997,10 @@ EXTRA_DIST += test-usleep.c signature.h
@@ -2438,10 +2438,10 @@ EXTRA_DIST += test-usleep.c signature.h
## begin gnulib module utimens-tests
-TESTS += test-utimens
-check_PROGRAMS += test-utimens
-test_utimens_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
-test_utimens_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBINTL@
-EXTRA_DIST += nap.h test-futimens.h test-lutimens.h test-utimens.h test-utimens-common.h test-utimens.c macros.h
+#TESTS += test-utimens
+#check_PROGRAMS += test-utimens
+#test_utimens_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
+#test_utimens_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBINTL@
+#EXTRA_DIST += nap.h test-futimens.h test-lutimens.h test-utimens.h test-utimens-common.h test-utimens.c macros.h
## end gnulib module utimens-tests
diff -urNp coreutils-8.13-orig/tests/touch/no-dereference.sh coreutils-8.13/tests/touch/no-dereference.sh
--- coreutils-8.13-orig/tests/touch/no-dereference.sh 2011-08-08 09:42:16.000000000 +0200
+++ coreutils-8.13/tests/touch/no-dereference.sh 2011-09-09 10:15:21.167060702 +0200
diff -urNp coreutils-8.21-orig/tests/local.mk coreutils-8.21/tests/local.mk
--- coreutils-8.21-orig/tests/local.mk 2013-02-11 11:30:12.000000000 +0100
+++ coreutils-8.21/tests/local.mk 2013-02-15 10:10:55.890532258 +0100
@@ -131,6 +131,7 @@ all_root_tests = \
tests/rm/no-give-up.sh \
tests/rm/one-file-system.sh \
tests/rm/read-only.sh \
+ tests/tail-2/inotify-hash-abuse.sh \
tests/tail-2/append-only.sh \
tests/touch/now-owned-by-other.sh
@@ -163,7 +164,6 @@ all_tests = \
tests/rm/cycle.sh \
tests/cp/link-heap.sh \
tests/misc/tty-eof.pl \
- tests/tail-2/inotify-hash-abuse.sh \
tests/tail-2/inotify-hash-abuse2.sh \
tests/tail-2/F-vs-missing.sh \
tests/tail-2/F-vs-rename.sh \
diff -urNp coreutils-8.21-orig/tests/touch/no-dereference.sh coreutils-8.21/tests/touch/no-dereference.sh
--- coreutils-8.21-orig/tests/touch/no-dereference.sh 2013-01-31 01:46:25.000000000 +0100
+++ coreutils-8.21/tests/touch/no-dereference.sh 2013-02-15 10:10:55.889593383 +0100
@@ -42,6 +42,8 @@ test -f nowhere && fail=1
grep '^#define HAVE_UTIMENSAT 1' "$CONFIG_HEADER" > /dev/null ||
grep '^#define HAVE_LUTIMES 1' "$CONFIG_HEADER" > /dev/null ||
@ -136,22 +155,3 @@ diff -urNp coreutils-8.13-orig/tests/touch/no-dereference.sh coreutils-8.13/test
# Changing time of dangling symlink is okay.
# Skip the test if this fails, but the error text corresponds to
diff -urNp coreutils-8.20-orig/tests/local.mk coreutils-8.20/tests/local.mk
--- coreutils-8.20-orig/tests/local.mk 2013-01-23 09:50:18.388078004 +0100
+++ coreutils-8.20/tests/local.mk 2013-01-23 10:39:09.090085667 +0100
@@ -130,6 +130,7 @@ all_root_tests = \
tests/rm/no-give-up.sh \
tests/rm/one-file-system.sh \
tests/rm/read-only.sh \
+ tests/tail-2/inotify-hash-abuse.sh \
tests/tail-2/append-only.sh \
tests/touch/now-owned-by-other.sh
@@ -162,7 +163,6 @@ all_tests = \
tests/rm/cycle.sh \
tests/cp/link-heap.sh \
tests/misc/tty-eof.pl \
- tests/tail-2/inotify-hash-abuse.sh \
tests/tail-2/inotify-hash-abuse2.sh \
tests/tail-2/F-vs-missing.sh \
tests/tail-2/F-vs-rename.sh \

View File

@ -1,264 +0,0 @@
diff -urNp coreutils-8.20-orig/doc/coreutils.texi coreutils-8.20/doc/coreutils.texi
--- coreutils-8.20-orig/doc/coreutils.texi 2012-10-23 16:14:12.000000000 +0200
+++ coreutils-8.20/doc/coreutils.texi 2012-12-10 14:41:33.532650289 +0100
@@ -10597,6 +10597,14 @@ Normally the disk space is printed in un
1024 bytes, but this can be overridden (@pxref{Block size}).
Non-integer quantities are rounded up to the next higher unit.
+For bind mounts and without arguments, @command{df} only outputs the statistics
+for the first occurence of that device in the list of file systems (@var{mtab}),
+i.e., it hides duplicate entries, unless the @option{-a} option is specified.
+
+By default, @command{df} omits the early-boot pseudo file system type
+@samp{rootfs}, unless the @option{-a} option is specified or that file system
+type is explicitly to be included by using the @option{-t} option.
+
@cindex disk device file
@cindex device file, disk
If an argument @var{file} is a disk device file containing a mounted
diff -urNp coreutils-8.20-orig/src/df.c coreutils-8.20/src/df.c
--- coreutils-8.20-orig/src/df.c 2012-10-23 16:14:12.000000000 +0200
+++ coreutils-8.20/src/df.c 2012-12-10 14:41:33.534649048 +0100
@@ -46,6 +46,17 @@
/* If true, show inode information. */
static bool inode_format;
+/* Filled with device numbers of examined file systems to avoid
+ duplicities in output. */
+struct devlist
+{
+ dev_t dev_num;
+ struct devlist *next;
+};
+
+/* Store of already-processed device numbers. */
+static struct devlist *devlist_head;
+
/* If true, show even file systems with zero size or
uninteresting types. */
static bool show_all_fs;
@@ -57,6 +68,12 @@ static bool show_local_fs;
command line argument -- even if it's a dummy (automounter) entry. */
static bool show_listed_fs;
+/* If true, include rootfs in the output. */
+static bool show_rootfs;
+
+/* The literal name of the initial root file system. */
+static char const *ROOTFS = "rootfs";
+
/* Human-readable options for output. */
static int human_output_opts;
@@ -372,6 +389,29 @@ excluded_fstype (const char *fstype)
return false;
}
+/* Check if the device was already examined. */
+
+static bool
+dev_examined (char const *mount_dir, char const *devname)
+{
+ struct stat buf;
+ if (-1 == stat (mount_dir, &buf))
+ return false;
+
+ struct devlist *devlist = devlist_head;
+ for ( ; devlist; devlist = devlist->next)
+ if (devlist->dev_num == buf.st_dev)
+ return true;
+
+ /* Add the device number to the global list devlist. */
+ devlist = xmalloc (sizeof *devlist);
+ devlist->dev_num = buf.st_dev;
+ devlist->next = devlist_head;
+ devlist_head = devlist;
+
+ return false;
+}
+
/* Return true if N is a known integer value. On many file systems,
UINTMAX_MAX represents an unknown value; on AIX, UINTMAX_MAX - 1
represents unknown. Use a rule that works on AIX file systems, and
@@ -496,6 +536,15 @@ get_dev (char const *disk, char const *m
if (!selected_fstype (fstype) || excluded_fstype (fstype))
return;
+ if (process_all && !show_all_fs && !show_listed_fs)
+ {
+ /* No arguments nor "df -a", then check if df has to ... */
+ if (!show_rootfs && STREQ (disk, ROOTFS))
+ return; /* ... skip rootfs: (unless -trootfs is given. */
+ if (dev_examined (mount_point, disk))
+ return; /* ... skip duplicate entries (bind mounts). */
+ }
+
/* If MOUNT_POINT is NULL, then the file system is not mounted, and this
program reports on the file system that the special file is on.
It would be better to report on the unmounted file system,
@@ -1005,6 +1054,7 @@ main (int argc, char **argv)
/* Accept -F as a synonym for -t for compatibility with Solaris. */
case 't':
add_fs_type (optarg);
+ show_rootfs = selected_fstype (ROOTFS);
break;
case 'v': /* For SysV compatibility. */
@@ -1149,6 +1199,14 @@ main (int argc, char **argv)
diagnostic, e.g., if all have been excluded. */
if (exit_status == EXIT_SUCCESS && ! file_systems_processed)
error (EXIT_FAILURE, 0, _("no file systems processed"));
+ IF_LINT (
+ while (devlist_head)
+ {
+ struct devlist *devlist = devlist_head->next;
+ free (devlist_head);
+ devlist_head = devlist;
+ }
+ );
exit (exit_status);
}
diff -urNp coreutils-8.20-orig/tests/df/skip-duplicates.sh coreutils-8.20/tests/df/skip-duplicates.sh
--- coreutils-8.20-orig/tests/df/skip-duplicates.sh 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.20/tests/df/skip-duplicates.sh 2012-12-10 14:41:33.535280173 +0100
@@ -0,0 +1,77 @@
+#!/bin/sh
+# Test df's behavior when the mount list contains duplicate entries.
+# This test is skipped on systems that lack LD_PRELOAD support; that's fine.
+
+# Copyright (C) 2012 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
+print_ver_ df
+
+df || skip_ "df fails"
+
+# Simulate an mtab file with two entries of the same device number.
+cat > k.c <<'EOF' || framework_failure_
+#include <stdio.h>
+#include <mntent.h>
+
+struct mntent *getmntent (FILE *fp)
+{
+ /* Prove that LD_PRELOAD works. */
+ static int done = 0;
+ if (!done)
+ {
+ fclose (fopen ("x", "w"));
+ ++done;
+ }
+
+ static struct mntent mntent;
+
+ while (done++ < 3)
+ {
+ mntent.mnt_fsname = "fsname";
+ mntent.mnt_dir = "/";
+ mntent.mnt_type = "-";
+
+ return &mntent;
+ }
+ return NULL;
+}
+EOF
+
+# Then compile/link it:
+gcc --std=gnu99 -shared -fPIC -ldl -O2 k.c -o k.so \
+ || skip_ "getmntent hack does not work on this platform"
+
+# Test if LD_PRELOAD works:
+LD_PRELOAD=./k.so df
+test -f x || skip_ "internal test failure: maybe LD_PRELOAD doesn't work?"
+
+# The fake mtab file should only contain 2 entries, both
+# having the same device number; thus the output should
+# consist of a header and one entry.
+LD_PRELOAD=./k.so df >out || fail=1
+test $(wc -l <out) -eq 2 || { fail=1; cat out; }
+
+# Ensure that filtering duplicates does not affect -a processing.
+LD_PRELOAD=./k.so df -a >out || fail=1
+test $(wc -l <out) -eq 3 || { fail=1; cat out; }
+
+# Ensure that filtering duplcates does not affect
+# argument processing (now without the fake getmntent()).
+df '.' '.' >out || fail=1
+test $(wc -l <out) -eq 3 || { fail=1; cat out; }
+
+Exit $fail
diff -urNp coreutils-8.20-orig/tests/df/skip-rootfs.sh coreutils-8.20/tests/df/skip-rootfs.sh
--- coreutils-8.20-orig/tests/df/skip-rootfs.sh 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.20/tests/df/skip-rootfs.sh 2012-12-10 14:41:33.536310753 +0100
@@ -0,0 +1,46 @@
+#!/bin/sh
+# Test df's behavior for skipping the pseudo "rootfs" file system.
+
+# Copyright (C) 2012 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
+print_ver_ df
+
+df || skip_ "df fails"
+
+# Verify that rootfs is in mtab (and shown when the -a option is specified).
+df -a >out || fail=1
+grep '^rootfs' out || skip_ "no rootfs in mtab"
+
+# Ensure that rootfs is supressed when no options is specified.
+df >out || fail=1
+grep '^rootfs' out && { fail=1; cat out; }
+
+# Ensure that the rootfs is shown when explicitly specifying "-t rootfs".
+df -t rootfs >out || fail=1
+grep '^rootfs' out || { fail=1; cat out; }
+
+# Ensure that the rootfs is shown when explicitly specifying "-t rootfs",
+# even when the -a option is specified.
+df -t rootfs -a >out || fail=1
+grep '^rootfs' out || { fail=1; cat out; }
+
+# Ensure that the rootfs is omitted in all_fs mode when it is explicitly
+# black-listed.
+df -a -x rootfs >out || fail=1
+grep '^rootfs' out && { fail=1; cat out; }
+
+Exit $fail
diff -urNp coreutils-8.20-orig/tests/local.mk coreutils-8.20/tests/local.mk
--- coreutils-8.20-orig/tests/local.mk 2012-10-23 16:14:12.000000000 +0200
+++ coreutils-8.20/tests/local.mk 2012-12-10 14:41:33.536310753 +0100
@@ -456,6 +456,8 @@ all_tests = \
tests/df/unreadable.sh \
tests/df/total-unprocessed.sh \
tests/df/no-mtab-status.sh \
+ tests/df/skip-duplicates.sh \
+ tests/df/skip-rootfs.sh \
tests/dd/direct.sh \
tests/dd/misc.sh \
tests/dd/nocache.sh \

View File

@ -1,96 +0,0 @@
From 9d9cdfd5df898ade2e680aab5ce37fcd0032c687 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Wed, 19 Dec 2012 19:27:10 +0000
Subject: [PATCH] seq: fix newline output when -s specified
This regression was introduced in commit v8.19-132-g3786fb6.
* src/seq.c (seq_fast): Don't use puts() to output the first number,
and instead insert it into the buffer as for other numbers.
Also output the terminator unconditionally.
* tests/misc/seq.pl: Add some basic tests for the -s option.
* THANKS.in: Reported by Philipp Gortan.
---
THANKS.in | 1 +
src/seq.c | 20 +++++++++++++-------
tests/misc/seq.pl | 5 +++++
3 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/THANKS.in b/THANKS.in
index c2651e7..67b60b9 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -505,6 +505,7 @@ Phil Richards phil.richards@vf.vodafone.co.uk
Philippe De Muyter phdm@macqel.be
Philippe Schnoebelen Philippe.Schnoebelen@imag.fr
Phillip Jones mouse@datastacks.com
+Philipp Gortan gortan@gmail.com
Philipp Thomas pth@suse.de
Piergiorgio Sartor sartor@sony.de
Pieter Bowman bowman@math.utah.edu
diff --git a/src/seq.c b/src/seq.c
index 9c2c51f..108808b 100644
--- a/src/seq.c
+++ b/src/seq.c
@@ -419,30 +419,36 @@ seq_fast (char const *a, char const *b)
bool ok = cmp (p, p_len, q, q_len) <= 0;
if (ok)
{
- /* Buffer at least this many output lines per fwrite call.
+ /* Buffer at least this many numbers per fwrite call.
This gives a speed-up of more than 2x over the unbuffered code
when printing the first 10^9 integers. */
enum {N = 40};
char *buf = xmalloc (N * (n + 1));
char const *buf_end = buf + N * (n + 1);
- puts (p);
char *z = buf;
+
+ /* Write first number to buffer. */
+ z = mempcpy (z, p, p_len);
+
+ /* Append separator then number. */
while (cmp (p, p_len, q, q_len) < 0)
{
+ *z++ = *separator;
incr (&p, &p_len);
z = mempcpy (z, p, p_len);
- *z++ = *separator;
- if (buf_end - n - 1 < z)
+ /* If no place for another separator + number then
+ output buffer so far, and reset to start of buffer. */
+ if (buf_end - (n + 1) < z)
{
fwrite (buf, z - buf, 1, stdout);
z = buf;
}
}
- /* Write any remaining, buffered output. */
- if (buf < z)
- fwrite (buf, z - buf, 1, stdout);
+ /* Write any remaining buffered output, and the terminator. */
+ *z++ = *terminator;
+ fwrite (buf, z - buf, 1, stdout);
IF_LINT (free (buf));
}
diff --git a/tests/misc/seq.pl b/tests/misc/seq.pl
index 447baa4..416b839 100755
--- a/tests/misc/seq.pl
+++ b/tests/misc/seq.pl
@@ -128,6 +128,11 @@ my @Tests =
['long-leading-zeros2', qw(000 02), {OUT => [qw(0 1 2)]}],
['long-leading-zeros3', qw(00 02), {OUT => [qw(0 1 2)]}],
['long-leading-zeros4', qw(0 02), {OUT => [qw(0 1 2)]}],
+
+ # Exercise the -s option, which was broken in 8.20
+ ['sep-1', qw(-s, 1 3), {OUT => [qw(1,2,3)]}],
+ ['sep-2', qw(-s, 1 1), {OUT => [qw(1)]}],
+ ['sep-3', qw(-s,, 1 3), {OUT => [qw(1,,2,,3)]}],
);
# Append a newline to each entry in the OUT array.
--
1.7.6.4

View File

@ -1,7 +1,7 @@
diff -urNp coreutils-8.16-orig/doc/coreutils.texi coreutils-8.16/doc/coreutils.texi
--- coreutils-8.16-orig/doc/coreutils.texi 2012-03-26 07:38:37.000000000 +0200
+++ coreutils-8.16/doc/coreutils.texi 2012-03-26 17:31:31.101014556 +0200
@@ -10584,6 +10584,13 @@ pseudo-file-systems, such as automounter
diff -urNp coreutils-8.21-orig/doc/coreutils.texi coreutils-8.21/doc/coreutils.texi
--- coreutils-8.21-orig/doc/coreutils.texi 2013-02-11 10:37:28.000000000 +0100
+++ coreutils-8.21/doc/coreutils.texi 2013-02-15 10:15:26.497593689 +0100
@@ -10961,6 +10961,13 @@ pseudo-file-systems, such as automounter
Scale sizes by @var{size} before printing them (@pxref{Block size}).
For example, @option{-BG} prints sizes in units of 1,073,741,824 bytes.
@ -15,23 +15,23 @@ diff -urNp coreutils-8.16-orig/doc/coreutils.texi coreutils-8.16/doc/coreutils.t
@item --total
@opindex --total
@cindex grand total of disk size, usage and available space
diff -urNp coreutils-8.16-orig/src/df.c coreutils-8.16/src/df.c
--- coreutils-8.16-orig/src/df.c 2012-03-24 21:26:51.000000000 +0100
+++ coreutils-8.16/src/df.c 2012-03-26 17:31:31.102014797 +0200
@@ -113,6 +113,9 @@ static bool print_type;
diff -urNp coreutils-8.21-orig/src/df.c coreutils-8.21/src/df.c
--- coreutils-8.21-orig/src/df.c 2013-02-05 00:40:31.000000000 +0100
+++ coreutils-8.21/src/df.c 2013-02-15 10:26:41.158651782 +0100
@@ -116,6 +116,9 @@ static bool print_type;
/* If true, print a grand total at the end. */
static bool print_grand_total;
+/* If true, show statistics for a file instead of mount point. */
+static bool direct_statfs;
+
/* Grand total data. */
/* Grand total data. */
static struct fs_usage grand_fsu;
@@ -167,13 +170,15 @@ static size_t nrows;
{
NO_SYNC_OPTION = CHAR_MAX + 1,
@@ -238,13 +241,15 @@ enum
SYNC_OPTION,
TOTAL_OPTION,
OUTPUT_OPTION,
- MEGABYTES_OPTION /* FIXME: remove long opt in Aug 2013 */
+ MEGABYTES_OPTION, /* FIXME: remove long opt in Aug 2013 */
+ DIRECT_OPTION
@ -45,20 +45,19 @@ diff -urNp coreutils-8.16-orig/src/df.c coreutils-8.16/src/df.c
{"inodes", no_argument, NULL, 'i'},
{"human-readable", no_argument, NULL, 'h'},
{"si", no_argument, NULL, 'H'},
@@ -260,7 +265,11 @@ get_header (void)
}
@@ -500,7 +505,10 @@ get_header (void)
for (col = 0; col < ncolumns; col++)
{
char *cell = NULL;
- char const *header = _(headers[field][header_mode]);
+
+ char const *header = (field == MNT_FIELD && direct_statfs)?
+ _("File") :
+ _(headers[field][header_mode]);
+
if (!header)
header = _(headers[field][DEFAULT_MODE]);
- char const *header = _(columns[col]->caption);
+ char const *header = (columns[col]->field == TARGET_FIELD
+ && direct_statfs)?
+ _("File") :
+ _(columns[col]->caption);
@@ -790,6 +799,17 @@ get_point (const char *point, const stru
if (columns[col]->field == SIZE_FIELD
&& (header_mode == DEFAULT_MODE
@@ -1150,6 +1158,17 @@ get_point (const char *point, const stru
static void
get_entry (char const *name, struct stat const *statp)
{
@ -76,7 +75,7 @@ diff -urNp coreutils-8.16-orig/src/df.c coreutils-8.16/src/df.c
if ((S_ISBLK (statp->st_mode) || S_ISCHR (statp->st_mode))
&& get_disk (name))
return;
@@ -857,6 +877,7 @@ Mandatory arguments to long options are
@@ -1219,6 +1238,7 @@ or all file systems by default.\n\
-B, --block-size=SIZE scale sizes by SIZE before printing them. E.g.,\n\
'-BM' prints sizes in units of 1,048,576 bytes.\n\
See SIZE format below.\n\
@ -84,7 +83,7 @@ diff -urNp coreutils-8.16-orig/src/df.c coreutils-8.16/src/df.c
--total produce a grand total\n\
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)\
\n\
@@ -933,6 +954,9 @@ main (int argc, char **argv)
@@ -1305,6 +1325,9 @@ main (int argc, char **argv)
xstrtol_fatal (e, oi, c, long_options, optarg);
}
break;
@ -92,9 +91,9 @@ diff -urNp coreutils-8.16-orig/src/df.c coreutils-8.16/src/df.c
+ direct_statfs = true;
+ break;
case 'i':
inode_format = true;
break;
@@ -993,6 +1017,13 @@ main (int argc, char **argv)
if (header_mode == OUTPUT_MODE)
{
@@ -1408,6 +1431,13 @@ main (int argc, char **argv)
}
}
@ -108,9 +107,9 @@ diff -urNp coreutils-8.16-orig/src/df.c coreutils-8.16/src/df.c
if (human_output_opts == -1)
{
if (posix_format)
diff -urNp coreutils-8.16-orig/tests/df/direct.sh coreutils-8.16/tests/df/direct.sh
--- coreutils-8.16-orig/tests/df/direct.sh 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.16/tests/df/direct.sh 2012-03-26 17:31:31.102897406 +0200
diff -urNp coreutils-8.21-orig/tests/df/direct.sh coreutils-8.21/tests/df/direct.sh
--- coreutils-8.21-orig/tests/df/direct.sh 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.21/tests/df/direct.sh 2013-02-15 10:15:26.503644446 +0100
@@ -0,0 +1,55 @@
+#!/bin/sh
+# Ensure "df --direct" works as documented

View File

@ -1,6 +1,6 @@
diff -urNp coreutils-8.20-orig/lib/linebuffer.h coreutils-8.20/lib/linebuffer.h
--- coreutils-8.20-orig/lib/linebuffer.h 2012-10-23 16:17:24.000000000 +0200
+++ coreutils-8.20/lib/linebuffer.h 2013-01-23 09:24:24.619090620 +0100
diff -urNp coreutils-8.21-orig/lib/linebuffer.h coreutils-8.21/lib/linebuffer.h
--- coreutils-8.21-orig/lib/linebuffer.h 2013-01-02 13:34:46.000000000 +0100
+++ coreutils-8.21/lib/linebuffer.h 2013-02-15 14:25:07.758469108 +0100
@@ -21,6 +21,11 @@
# include <stdio.h>
@ -23,9 +23,9 @@ diff -urNp coreutils-8.20-orig/lib/linebuffer.h coreutils-8.20/lib/linebuffer.h
};
/* Initialize linebuffer LINEBUFFER for use. */
diff -urNp coreutils-8.20-orig/src/cut.c coreutils-8.20/src/cut.c
--- coreutils-8.20-orig/src/cut.c 2012-10-23 16:14:12.000000000 +0200
+++ coreutils-8.20/src/cut.c 2013-01-23 09:24:24.621092254 +0100
diff -urNp coreutils-8.21-orig/src/cut.c coreutils-8.21/src/cut.c
--- coreutils-8.21-orig/src/cut.c 2013-02-05 00:40:31.000000000 +0100
+++ coreutils-8.21/src/cut.c 2013-02-15 14:25:07.760467982 +0100
@@ -28,6 +28,11 @@
#include <assert.h>
#include <getopt.h>
@ -170,7 +170,7 @@ diff -urNp coreutils-8.20-orig/src/cut.c coreutils-8.20/src/cut.c
/* True if the --output-delimiter=STRING option was specified. */
static bool output_delimiter_specified;
@@ -206,7 +283,7 @@ Mandatory arguments to long options are
@@ -205,7 +282,7 @@ Print selected parts of lines from each
-f, --fields=LIST select only these fields; also print any line\n\
that contains no delimiter character, unless\n\
the -s option is specified\n\
@ -179,35 +179,7 @@ diff -urNp coreutils-8.20-orig/src/cut.c coreutils-8.20/src/cut.c
"), stdout);
fputs (_("\
--complement complement the set of selected bytes, characters\n\
@@ -365,7 +442,7 @@ set_fields (const char *fieldstr)
in_digits = false;
/* Starting a range. */
if (dash_found)
- FATAL_ERROR (_("invalid byte or field list"));
+ FATAL_ERROR (_("invalid byte, character or field list"));
dash_found = true;
fieldstr++;
@@ -389,14 +466,16 @@ set_fields (const char *fieldstr)
if (!rhs_specified)
{
/* 'n-'. From 'initial' to end of line. */
- eol_range_start = initial;
+ if (eol_range_start == 0 ||
+ (eol_range_start != 0 && eol_range_start > initial))
+ eol_range_start = initial;
field_found = true;
}
else
{
/* 'm-n' or '-n' (1-n). */
if (value < initial)
- FATAL_ERROR (_("invalid decreasing range"));
+ FATAL_ERROR (_("invalid byte, character or field list"));
/* Is there already a range going to end of line? */
if (eol_range_start != 0)
@@ -476,6 +555,9 @@ set_fields (const char *fieldstr)
@@ -480,6 +557,9 @@ set_fields (const char *fieldstr)
if (operating_mode == byte_mode)
error (0, 0,
_("byte offset %s is too large"), quote (bad_num));
@ -217,16 +189,7 @@ diff -urNp coreutils-8.20-orig/src/cut.c coreutils-8.20/src/cut.c
else
error (0, 0,
_("field number %s is too large"), quote (bad_num));
@@ -486,7 +568,7 @@ set_fields (const char *fieldstr)
fieldstr++;
}
else
- FATAL_ERROR (_("invalid byte or field list"));
+ FATAL_ERROR (_("invalid byte, character or field list"));
}
max_range_endpoint = 0;
@@ -581,6 +663,77 @@ cut_bytes (FILE *stream)
@@ -588,6 +668,77 @@ cut_bytes (FILE *stream)
}
}
@ -304,7 +267,7 @@ diff -urNp coreutils-8.20-orig/src/cut.c coreutils-8.20/src/cut.c
/* Read from stream STREAM, printing to standard output any selected fields. */
static void
@@ -703,13 +856,195 @@ cut_fields (FILE *stream)
@@ -709,13 +860,195 @@ cut_fields (FILE *stream)
}
}
@ -503,7 +466,7 @@ diff -urNp coreutils-8.20-orig/src/cut.c coreutils-8.20/src/cut.c
}
/* Process file FILE to standard output.
@@ -761,6 +1096,8 @@ main (int argc, char **argv)
@@ -767,6 +1100,8 @@ main (int argc, char **argv)
bool ok;
bool delim_specified = false;
char *spec_list_string IF_LINT ( = NULL);
@ -512,7 +475,7 @@ diff -urNp coreutils-8.20-orig/src/cut.c coreutils-8.20/src/cut.c
initialize_main (&argc, &argv);
set_program_name (argv[0]);
@@ -783,7 +1120,6 @@ main (int argc, char **argv)
@@ -789,7 +1124,6 @@ main (int argc, char **argv)
switch (optc)
{
case 'b':
@ -520,7 +483,7 @@ diff -urNp coreutils-8.20-orig/src/cut.c coreutils-8.20/src/cut.c
/* Build the byte list. */
if (operating_mode != undefined_mode)
FATAL_ERROR (_("only one type of list may be specified"));
@@ -791,6 +1127,14 @@ main (int argc, char **argv)
@@ -797,6 +1131,14 @@ main (int argc, char **argv)
spec_list_string = optarg;
break;
@ -535,7 +498,7 @@ diff -urNp coreutils-8.20-orig/src/cut.c coreutils-8.20/src/cut.c
case 'f':
/* Build the field list. */
if (operating_mode != undefined_mode)
@@ -802,10 +1146,35 @@ main (int argc, char **argv)
@@ -808,10 +1150,35 @@ main (int argc, char **argv)
case 'd':
/* New delimiter. */
/* Interpret -d '' to mean 'use the NUL byte as the delimiter.' */
@ -575,7 +538,7 @@ diff -urNp coreutils-8.20-orig/src/cut.c coreutils-8.20/src/cut.c
break;
case OUTPUT_DELIMITER_OPTION:
@@ -818,6 +1187,7 @@ main (int argc, char **argv)
@@ -824,6 +1191,7 @@ main (int argc, char **argv)
break;
case 'n':
@ -583,16 +546,7 @@ diff -urNp coreutils-8.20-orig/src/cut.c coreutils-8.20/src/cut.c
break;
case 's':
@@ -840,7 +1210,7 @@ main (int argc, char **argv)
if (operating_mode == undefined_mode)
FATAL_ERROR (_("you must specify a list of bytes, characters, or fields"));
- if (delim != '\0' && operating_mode != field_mode)
+ if (delim_specified && operating_mode != field_mode)
FATAL_ERROR (_("an input delimiter may be specified only\
when operating on fields"));
@@ -867,15 +1237,34 @@ main (int argc, char **argv)
@@ -873,15 +1241,34 @@ main (int argc, char **argv)
}
if (!delim_specified)
@ -633,9 +587,10 @@ diff -urNp coreutils-8.20-orig/src/cut.c coreutils-8.20/src/cut.c
}
if (optind == argc)
diff -urNp coreutils-8.20-orig/src/expand.c coreutils-8.20/src/expand.c
--- coreutils-8.20-orig/src/expand.c 2012-10-23 16:14:12.000000000 +0200
+++ coreutils-8.20/src/expand.c 2013-01-23 09:24:24.622088030 +0100
Binary files coreutils-8.21-orig/src/.cut.c.swp and coreutils-8.21/src/.cut.c.swp differ
diff -urNp coreutils-8.21-orig/src/expand.c coreutils-8.21/src/expand.c
--- coreutils-8.21-orig/src/expand.c 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/src/expand.c 2013-02-15 14:25:07.774467536 +0100
@@ -37,12 +37,29 @@
#include <stdio.h>
#include <getopt.h>
@ -666,7 +621,7 @@ diff -urNp coreutils-8.20-orig/src/expand.c coreutils-8.20/src/expand.c
/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "expand"
@@ -358,6 +375,142 @@ expand (void)
@@ -357,6 +374,142 @@ expand (void)
}
}
@ -809,7 +764,7 @@ diff -urNp coreutils-8.20-orig/src/expand.c coreutils-8.20/src/expand.c
int
main (int argc, char **argv)
{
@@ -422,7 +575,12 @@ main (int argc, char **argv)
@@ -421,7 +574,12 @@ main (int argc, char **argv)
file_list = (optind < argc ? &argv[optind] : stdin_argv);
@ -823,9 +778,9 @@ diff -urNp coreutils-8.20-orig/src/expand.c coreutils-8.20/src/expand.c
if (have_read_stdin && fclose (stdin) != 0)
error (EXIT_FAILURE, errno, "-");
diff -urNp coreutils-8.20-orig/src/fold.c coreutils-8.20/src/fold.c
--- coreutils-8.20-orig/src/fold.c 2012-10-23 16:14:12.000000000 +0200
+++ coreutils-8.20/src/fold.c 2013-01-23 09:24:24.623090499 +0100
diff -urNp coreutils-8.21-orig/src/fold.c coreutils-8.21/src/fold.c
--- coreutils-8.21-orig/src/fold.c 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/src/fold.c 2013-02-15 14:25:07.789467891 +0100
@@ -22,12 +22,34 @@
#include <getopt.h>
#include <sys/types.h>
@ -907,15 +862,15 @@ diff -urNp coreutils-8.20-orig/src/fold.c coreutils-8.20/src/fold.c
{"spaces", no_argument, NULL, 's'},
{"width", required_argument, NULL, 'w'},
{GETOPT_HELP_OPTION_DECL},
@@ -77,6 +120,7 @@ Mandatory arguments to long options are
"), stdout);
@@ -76,6 +119,7 @@ standard output.\n\
fputs (_("\
-b, --bytes count bytes rather than columns\n\
+ -c, --characters count characters rather than columns\n\
-s, --spaces break at spaces\n\
-w, --width=WIDTH use WIDTH columns instead of 80\n\
"), stdout);
@@ -94,7 +138,7 @@ Mandatory arguments to long options are
@@ -93,7 +137,7 @@ standard output.\n\
static size_t
adjust_column (size_t column, char c)
{
@ -924,7 +879,7 @@ diff -urNp coreutils-8.20-orig/src/fold.c coreutils-8.20/src/fold.c
{
if (c == '\b')
{
@@ -117,30 +161,14 @@ adjust_column (size_t column, char c)
@@ -116,30 +160,14 @@ adjust_column (size_t column, char c)
to stdout, with maximum line length WIDTH.
Return true if successful. */
@ -957,7 +912,7 @@ diff -urNp coreutils-8.20-orig/src/fold.c coreutils-8.20/src/fold.c
fadvise (istream, FADVISE_SEQUENTIAL);
@@ -170,6 +198,15 @@ fold_file (char const *filename, size_t
@@ -169,6 +197,15 @@ fold_file (char const *filename, size_t
bool found_blank = false;
size_t logical_end = offset_out;
@ -973,7 +928,7 @@ diff -urNp coreutils-8.20-orig/src/fold.c coreutils-8.20/src/fold.c
/* Look for the last blank. */
while (logical_end)
{
@@ -216,11 +253,221 @@ fold_file (char const *filename, size_t
@@ -215,11 +252,221 @@ fold_file (char const *filename, size_t
line_out[offset_out++] = c;
}
@ -1196,7 +1151,7 @@ diff -urNp coreutils-8.20-orig/src/fold.c coreutils-8.20/src/fold.c
if (ferror (istream))
{
error (0, saved_errno, "%s", filename);
@@ -253,7 +500,8 @@ main (int argc, char **argv)
@@ -252,7 +499,8 @@ main (int argc, char **argv)
atexit (close_stdout);
@ -1206,7 +1161,7 @@ diff -urNp coreutils-8.20-orig/src/fold.c coreutils-8.20/src/fold.c
while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
{
@@ -262,7 +510,15 @@ main (int argc, char **argv)
@@ -261,7 +509,15 @@ main (int argc, char **argv)
switch (optc)
{
case 'b': /* Count bytes rather than columns. */
@ -1223,9 +1178,9 @@ diff -urNp coreutils-8.20-orig/src/fold.c coreutils-8.20/src/fold.c
break;
case 's': /* Break at word boundaries. */
diff -urNp coreutils-8.20-orig/src/join.c coreutils-8.20/src/join.c
--- coreutils-8.20-orig/src/join.c 2012-10-23 16:14:12.000000000 +0200
+++ coreutils-8.20/src/join.c 2013-01-23 09:29:53.877170828 +0100
diff -urNp coreutils-8.21-orig/src/join.c coreutils-8.21/src/join.c
--- coreutils-8.21-orig/src/join.c 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/src/join.c 2013-02-15 14:25:07.804467922 +0100
@@ -22,18 +22,32 @@
#include <sys/types.h>
#include <getopt.h>
@ -1716,9 +1671,9 @@ diff -urNp coreutils-8.20-orig/src/join.c coreutils-8.20/src/join.c
break;
case NOCHECK_ORDER_OPTION:
diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
--- coreutils-8.20-orig/src/pr.c 2012-10-23 16:14:12.000000000 +0200
+++ coreutils-8.20/src/pr.c 2013-01-23 09:24:24.629439021 +0100
diff -urNp coreutils-8.21-orig/src/pr.c coreutils-8.21/src/pr.c
--- coreutils-8.21-orig/src/pr.c 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/src/pr.c 2013-02-15 14:25:07.819467936 +0100
@@ -312,6 +312,32 @@
#include <getopt.h>
@ -1839,7 +1794,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
/* (-i) The width of the output tab. */
static int chars_per_output_tab = 8;
@@ -638,7 +692,13 @@ static int power_10;
@@ -634,7 +688,13 @@ static int line_number;
static bool numbered_lines = false;
/* (-n) Character which follows each line number. */
@ -1854,7 +1809,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
/* (-n) line counting starts with 1st line of input file (not with 1st
line of 1st page printed). */
@@ -691,6 +751,7 @@ static bool use_col_separator = false;
@@ -687,6 +747,7 @@ static bool use_col_separator = false;
-a|COLUMN|-m is a 'space' and with the -J option a 'tab'. */
static char *col_sep_string = (char *) "";
static int col_sep_length = 0;
@ -1862,7 +1817,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
static char *column_separator = (char *) " ";
static char *line_separator = (char *) "\t";
@@ -847,6 +908,13 @@ separator_string (const char *optarg_S)
@@ -843,6 +904,13 @@ separator_string (const char *optarg_S)
col_sep_length = (int) strlen (optarg_S);
col_sep_string = xmalloc (col_sep_length + 1);
strcpy (col_sep_string, optarg_S);
@ -1876,7 +1831,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
}
int
@@ -871,6 +939,21 @@ main (int argc, char **argv)
@@ -867,6 +935,21 @@ main (int argc, char **argv)
atexit (close_stdout);
@ -1898,7 +1853,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
n_files = 0;
file_names = (argc > 1
? xmalloc ((argc - 1) * sizeof (char *))
@@ -947,8 +1030,12 @@ main (int argc, char **argv)
@@ -943,8 +1026,12 @@ main (int argc, char **argv)
break;
case 'e':
if (optarg)
@ -1913,7 +1868,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
/* Could check tab width > 0. */
untabify_input = true;
break;
@@ -961,8 +1048,12 @@ main (int argc, char **argv)
@@ -957,8 +1044,12 @@ main (int argc, char **argv)
break;
case 'i':
if (optarg)
@ -1928,7 +1883,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
/* Could check tab width > 0. */
tabify_output = true;
break;
@@ -989,8 +1080,8 @@ main (int argc, char **argv)
@@ -985,8 +1076,8 @@ main (int argc, char **argv)
case 'n':
numbered_lines = true;
if (optarg)
@ -1939,7 +1894,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
break;
case 'N':
skip_count = false;
@@ -1029,7 +1120,7 @@ main (int argc, char **argv)
@@ -1025,7 +1116,7 @@ main (int argc, char **argv)
old_s = false;
/* Reset an additional input of -s, -S dominates -s */
col_sep_string = bad_cast ("");
@ -1948,7 +1903,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
use_col_separator = true;
if (optarg)
separator_string (optarg);
@@ -1186,10 +1277,45 @@ main (int argc, char **argv)
@@ -1182,10 +1273,45 @@ main (int argc, char **argv)
a number. */
static void
@ -1996,7 +1951,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
if (*arg)
{
long int tmp_long;
@@ -1211,6 +1337,11 @@ static void
@@ -1207,6 +1333,11 @@ static void
init_parameters (int number_of_files)
{
int chars_used_by_number = 0;
@ -2008,7 +1963,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
lines_per_body = lines_per_page - lines_per_header - lines_per_footer;
if (lines_per_body <= 0)
@@ -1248,7 +1379,7 @@ init_parameters (int number_of_files)
@@ -1244,7 +1375,7 @@ init_parameters (int number_of_files)
else
col_sep_string = column_separator;
@ -2017,7 +1972,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
use_col_separator = true;
}
/* It's rather pointless to define a TAB separator with column
@@ -1279,11 +1410,11 @@ init_parameters (int number_of_files)
@@ -1274,11 +1405,11 @@ init_parameters (int number_of_files)
+ TAB_WIDTH (chars_per_input_tab, chars_per_number); */
/* Estimate chars_per_text without any margin and keep it constant. */
@ -2031,7 +1986,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
/* The number is part of the column width unless we are
printing files in parallel. */
@@ -1298,7 +1429,7 @@ init_parameters (int number_of_files)
@@ -1287,7 +1418,7 @@ init_parameters (int number_of_files)
}
chars_per_column = (chars_per_line - chars_used_by_number
@ -2040,7 +1995,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
if (chars_per_column < 1)
error (EXIT_FAILURE, 0, _("page width too narrow"));
@@ -1315,7 +1446,7 @@ init_parameters (int number_of_files)
@@ -1305,7 +1436,7 @@ init_parameters (int number_of_files)
We've to use 8 as the lower limit, if we use chars_per_default_tab = 8
to expand a tab which is not an input_tab-char. */
free (clump_buff);
@ -2049,7 +2004,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
}
/* Open the necessary files,
@@ -1423,7 +1554,7 @@ init_funcs (void)
@@ -1413,7 +1544,7 @@ init_funcs (void)
/* Enlarge p->start_position of first column to use the same form of
padding_not_printed with all columns. */
@ -2058,7 +2013,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
/* This loop takes care of all but the rightmost column. */
@@ -1457,7 +1588,7 @@ init_funcs (void)
@@ -1447,7 +1578,7 @@ init_funcs (void)
}
else
{
@ -2067,7 +2022,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
h_next = h + chars_per_column;
}
}
@@ -1748,9 +1879,9 @@ static void
@@ -1738,9 +1869,9 @@ static void
align_column (COLUMN *p)
{
padding_not_printed = p->start_position;
@ -2079,7 +2034,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
padding_not_printed = ANYWHERE;
}
@@ -2021,13 +2152,13 @@ store_char (char c)
@@ -2011,13 +2142,13 @@ store_char (char c)
/* May be too generous. */
buff = X2REALLOC (buff, &buff_allocated);
}
@ -2093,9 +2048,9 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
- int i;
+ int i, j;
char *s;
int left_cut;
int num_width;
@@ -2050,22 +2181,24 @@ add_line_number (COLUMN *p)
@@ -2034,22 +2165,24 @@ add_line_number (COLUMN *p)
/* Tabification is assumed for multiple columns, also for n-separators,
but 'default n-separator = TAB' hasn't been given priority over
equal column_width also specified by POSIX. */
@ -2124,7 +2079,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
output_position = POS_AFTER_TAB (chars_per_output_tab,
output_position);
}
@@ -2226,7 +2359,7 @@ print_white_space (void)
@@ -2210,7 +2343,7 @@ print_white_space (void)
while (goal - h_old > 1
&& (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal)
{
@ -2133,7 +2088,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
h_old = h_new;
}
while (++h_old <= goal)
@@ -2246,6 +2379,7 @@ print_sep_string (void)
@@ -2230,6 +2363,7 @@ print_sep_string (void)
{
char *s;
int l = col_sep_length;
@ -2141,7 +2096,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
s = col_sep_string;
@@ -2259,6 +2393,7 @@ print_sep_string (void)
@@ -2243,6 +2377,7 @@ print_sep_string (void)
{
for (; separators_not_printed > 0; --separators_not_printed)
{
@ -2149,7 +2104,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
while (l-- > 0)
{
/* 3 types of sep_strings: spaces only, spaces and chars,
@@ -2272,12 +2407,15 @@ print_sep_string (void)
@@ -2256,12 +2391,15 @@ print_sep_string (void)
}
else
{
@ -2166,7 +2121,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
/* sep_string ends with some spaces */
if (spaces_not_printed > 0)
print_white_space ();
@@ -2305,7 +2443,7 @@ print_clump (COLUMN *p, int n, char *clu
@@ -2289,7 +2427,7 @@ print_clump (COLUMN *p, int n, char *clu
required number of tabs and spaces. */
static void
@ -2175,7 +2130,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
{
if (tabify_output)
{
@@ -2329,6 +2467,74 @@ print_char (char c)
@@ -2313,6 +2451,74 @@ print_char (char c)
putchar (c);
}
@ -2250,7 +2205,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
/* Skip to page PAGE before printing.
PAGE may be larger than total number of pages. */
@@ -2508,9 +2714,9 @@ read_line (COLUMN *p)
@@ -2492,9 +2698,9 @@ read_line (COLUMN *p)
align_empty_cols = false;
}
@ -2262,7 +2217,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
padding_not_printed = ANYWHERE;
}
@@ -2611,9 +2817,9 @@ print_stored (COLUMN *p)
@@ -2595,9 +2801,9 @@ print_stored (COLUMN *p)
}
}
@ -2274,7 +2229,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
padding_not_printed = ANYWHERE;
}
@@ -2626,8 +2832,8 @@ print_stored (COLUMN *p)
@@ -2610,8 +2816,8 @@ print_stored (COLUMN *p)
if (spaces_not_printed == 0)
{
output_position = p->start_position + end_vector[line];
@ -2285,7 +2240,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
}
return true;
@@ -2646,7 +2852,7 @@ print_stored (COLUMN *p)
@@ -2630,7 +2836,7 @@ print_stored (COLUMN *p)
number of characters is 1.) */
static int
@ -2294,7 +2249,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
{
unsigned char uc = c;
char *s = clump_buff;
@@ -2656,10 +2862,10 @@ char_to_clump (char c)
@@ -2640,10 +2846,10 @@ char_to_clump (char c)
int chars;
int chars_per_c = 8;
@ -2307,7 +2262,7 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
{
width = TAB_WIDTH (chars_per_c, input_position);
@@ -2740,6 +2946,154 @@ char_to_clump (char c)
@@ -2724,6 +2930,154 @@ char_to_clump (char c)
return chars;
}
@ -2462,9 +2417,9 @@ diff -urNp coreutils-8.20-orig/src/pr.c coreutils-8.20/src/pr.c
/* We've just printed some files and need to clean up things before
looking for more options and printing the next batch of files.
diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
--- coreutils-8.20-orig/src/sort.c 2012-10-23 16:14:12.000000000 +0200
+++ coreutils-8.20/src/sort.c 2013-01-23 09:35:36.091438847 +0100
diff -urNp coreutils-8.21-orig/src/sort.c coreutils-8.21/src/sort.c
--- coreutils-8.21-orig/src/sort.c 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/src/sort.c 2013-02-15 14:25:07.828467769 +0100
@@ -29,6 +29,14 @@
#include <sys/wait.h>
#include <signal.h>
@ -2533,7 +2488,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
/* Flag to remove consecutive duplicate lines from the output.
Only the last of a sequence of equal lines will be output. */
@@ -784,6 +812,46 @@ reap_all (void)
@@ -783,6 +811,46 @@ reap_all (void)
reap (-1);
}
@ -2580,7 +2535,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
/* Clean up any remaining temporary files. */
static void
@@ -1224,7 +1292,7 @@ zaptemp (char const *name)
@@ -1223,7 +1291,7 @@ zaptemp (char const *name)
free (node);
}
@ -2589,7 +2544,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
static int
struct_month_cmp (void const *m1, void const *m2)
@@ -1239,7 +1307,7 @@ struct_month_cmp (void const *m1, void c
@@ -1238,7 +1306,7 @@ struct_month_cmp (void const *m1, void c
/* Initialize the character class tables. */
static void
@ -2598,7 +2553,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
{
size_t i;
@@ -1251,7 +1319,7 @@ inittables (void)
@@ -1250,7 +1318,7 @@ inittables (void)
fold_toupper[i] = toupper (i);
}
@ -2607,7 +2562,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
/* If we're not in the "C" locale, read different names for months. */
if (hard_LC_TIME)
{
@@ -1333,6 +1401,84 @@ specify_nmerge (int oi, char c, char con
@@ -1332,6 +1400,84 @@ specify_nmerge (int oi, char c, char con
xstrtol_fatal (e, oi, c, long_options, s);
}
@ -2692,7 +2647,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
/* Specify the amount of main memory to use when sorting. */
static void
specify_sort_size (int oi, char c, char const *s)
@@ -1565,7 +1711,7 @@ buffer_linelim (struct buffer const *buf
@@ -1564,7 +1710,7 @@ buffer_linelim (struct buffer const *buf
by KEY in LINE. */
static char *
@ -2701,7 +2656,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
{
char *ptr = line->text, *lim = ptr + line->length - 1;
size_t sword = key->sword;
@@ -1574,10 +1720,10 @@ begfield (struct line const *line, struc
@@ -1573,10 +1719,10 @@ begfield (struct line const *line, struc
/* The leading field separator itself is included in a field when -t
is absent. */
@ -2714,7 +2669,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
++ptr;
if (ptr < lim)
++ptr;
@@ -1603,11 +1749,70 @@ begfield (struct line const *line, struc
@@ -1602,11 +1748,70 @@ begfield (struct line const *line, struc
return ptr;
}
@ -2786,7 +2741,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
{
char *ptr = line->text, *lim = ptr + line->length - 1;
size_t eword = key->eword, echar = key->echar;
@@ -1622,10 +1827,10 @@ limfield (struct line const *line, struc
@@ -1621,10 +1826,10 @@ limfield (struct line const *line, struc
'beginning' is the first character following the delimiting TAB.
Otherwise, leave PTR pointing at the first 'blank' character after
the preceding field. */
@ -2799,7 +2754,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
++ptr;
if (ptr < lim && (eword || echar))
++ptr;
@@ -1671,10 +1876,10 @@ limfield (struct line const *line, struc
@@ -1670,10 +1875,10 @@ limfield (struct line const *line, struc
*/
/* Make LIM point to the end of (one byte past) the current field. */
@ -2812,7 +2767,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
if (newlim)
lim = newlim;
}
@@ -1705,6 +1910,130 @@ limfield (struct line const *line, struc
@@ -1704,6 +1909,130 @@ limfield (struct line const *line, struc
return ptr;
}
@ -2943,7 +2898,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
/* Fill BUF reading from FP, moving buf->left bytes from the end
of buf->buf to the beginning first. If EOF is reached and the
file wasn't terminated by a newline, supply one. Set up BUF's line
@@ -1791,8 +2120,22 @@ fillbuf (struct buffer *buf, FILE *fp, c
@@ -1790,8 +2119,22 @@ fillbuf (struct buffer *buf, FILE *fp, c
else
{
if (key->skipsblanks)
@ -2968,7 +2923,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
line->keybeg = line_start;
}
}
@@ -1913,7 +2256,7 @@ human_numcompare (char const *a, char co
@@ -1912,7 +2255,7 @@ human_numcompare (char const *a, char co
hideously fast. */
static int
@ -2977,7 +2932,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
{
while (blanks[to_uchar (*a)])
a++;
@@ -1923,6 +2266,25 @@ numcompare (char const *a, char const *b
@@ -1922,6 +2265,25 @@ numcompare (char const *a, char const *b
return strnumcmp (a, b, decimal_point, thousands_sep);
}
@ -3003,7 +2958,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
/* Work around a problem whereby the long double value returned by glibc's
strtold ("NaN", ...) contains uninitialized bits: clear all bytes of
A and B before calling strtold. FIXME: remove this function once
@@ -1973,7 +2335,7 @@ general_numcompare (char const *sa, char
@@ -1972,7 +2334,7 @@ general_numcompare (char const *sa, char
Return 0 if the name in S is not recognized. */
static int
@ -3012,7 +2967,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
{
size_t lo = 0;
size_t hi = MONTHS_PER_YEAR;
@@ -2248,15 +2610,14 @@ debug_key (struct line const *line, stru
@@ -2247,15 +2609,14 @@ debug_key (struct line const *line, stru
char saved = *lim;
*lim = '\0';
@ -3030,7 +2985,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
else if (key->general_numeric)
ignore_value (strtold (beg, &tighter_lim));
else if (key->numeric || key->human_numeric)
@@ -2400,7 +2761,7 @@ key_warnings (struct keyfield const *gke
@@ -2399,7 +2760,7 @@ key_warnings (struct keyfield const *gke
bool maybe_space_aligned = !hard_LC_COLLATE && default_key_compare (key)
&& !(key->schar || key->echar);
bool line_offset = key->eword == 0 && key->echar != 0; /* -k1.x,1.y */
@ -3039,7 +2994,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
&& ((!key->skipsblanks && !(implicit_skip || maybe_space_aligned))
|| (!key->skipsblanks && key->schar)
|| (!key->skipeblanks && key->echar)))
@@ -2458,11 +2819,87 @@ key_warnings (struct keyfield const *gke
@@ -2457,11 +2818,87 @@ key_warnings (struct keyfield const *gke
error (0, 0, _("option '-r' only applies to last-resort comparison"));
}
@ -3128,7 +3083,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
{
struct keyfield *key = keylist;
@@ -2547,7 +2984,7 @@ keycompare (struct line const *a, struct
@@ -2546,7 +2983,7 @@ keycompare (struct line const *a, struct
else if (key->human_numeric)
diff = human_numcompare (ta, tb);
else if (key->month)
@ -3137,7 +3092,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
else if (key->random)
diff = compare_random (ta, tlena, tb, tlenb);
else if (key->version)
@@ -2663,6 +3100,181 @@ keycompare (struct line const *a, struct
@@ -2662,6 +3099,181 @@ keycompare (struct line const *a, struct
return key->reverse ? -diff : diff;
}
@ -3319,7 +3274,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
/* Compare two lines A and B, returning negative, zero, or positive
depending on whether A compares less than, equal to, or greater than B. */
@@ -4158,7 +4770,7 @@ main (int argc, char **argv)
@@ -4157,7 +4769,7 @@ main (int argc, char **argv)
initialize_exit_failure (SORT_FAILURE);
hard_LC_COLLATE = hard_locale (LC_COLLATE);
@ -3328,7 +3283,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
hard_LC_TIME = hard_locale (LC_TIME);
#endif
@@ -4179,6 +4791,29 @@ main (int argc, char **argv)
@@ -4178,6 +4790,29 @@ main (int argc, char **argv)
thousands_sep = -1;
}
@ -3358,7 +3313,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
have_read_stdin = false;
inittables ();
@@ -4453,13 +5088,34 @@ main (int argc, char **argv)
@@ -4452,13 +5087,34 @@ main (int argc, char **argv)
case 't':
{
@ -3397,7 +3352,7 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
else
{
/* Provoke with 'sort -txx'. Complain about
@@ -4470,9 +5126,12 @@ main (int argc, char **argv)
@@ -4469,9 +5125,12 @@ main (int argc, char **argv)
quote (optarg));
}
}
@ -3412,9 +3367,9 @@ diff -urNp coreutils-8.20-orig/src/sort.c coreutils-8.20/src/sort.c
}
break;
diff -urNp coreutils-8.20-orig/src/unexpand.c coreutils-8.20/src/unexpand.c
--- coreutils-8.20-orig/src/unexpand.c 2012-10-23 16:14:12.000000000 +0200
+++ coreutils-8.20/src/unexpand.c 2013-01-23 09:24:24.636292411 +0100
diff -urNp coreutils-8.21-orig/src/unexpand.c coreutils-8.21/src/unexpand.c
--- coreutils-8.21-orig/src/unexpand.c 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/src/unexpand.c 2013-02-15 14:25:07.834467715 +0100
@@ -38,12 +38,29 @@
#include <stdio.h>
#include <getopt.h>
@ -3654,7 +3609,7 @@ diff -urNp coreutils-8.20-orig/src/unexpand.c coreutils-8.20/src/unexpand.c
void
usage (int status)
{
@@ -524,7 +743,12 @@ main (int argc, char **argv)
@@ -523,7 +742,12 @@ main (int argc, char **argv)
file_list = (optind < argc ? &argv[optind] : stdin_argv);
@ -3668,9 +3623,9 @@ diff -urNp coreutils-8.20-orig/src/unexpand.c coreutils-8.20/src/unexpand.c
if (have_read_stdin && fclose (stdin) != 0)
error (EXIT_FAILURE, errno, "-");
diff -urNp coreutils-8.20-orig/src/uniq.c coreutils-8.20/src/uniq.c
--- coreutils-8.20-orig/src/uniq.c 2012-10-23 16:14:12.000000000 +0200
+++ coreutils-8.20/src/uniq.c 2013-01-23 09:46:33.757064880 +0100
diff -urNp coreutils-8.21-orig/src/uniq.c coreutils-8.21/src/uniq.c
--- coreutils-8.21-orig/src/uniq.c 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/src/uniq.c 2013-02-15 14:25:07.839467991 +0100
@@ -21,6 +21,16 @@
#include <getopt.h>
#include <sys/types.h>
@ -3720,7 +3675,7 @@ diff -urNp coreutils-8.20-orig/src/uniq.c coreutils-8.20/src/uniq.c
static struct option const longopts[] =
{
{"count", no_argument, NULL, 'c'},
@@ -206,7 +232,7 @@ size_opt (char const *opt, char const *m
@@ -205,7 +231,7 @@ size_opt (char const *opt, char const *m
return a pointer to the beginning of the line's field to be compared. */
static char * _GL_ATTRIBUTE_PURE
@ -3729,7 +3684,7 @@ diff -urNp coreutils-8.20-orig/src/uniq.c coreutils-8.20/src/uniq.c
{
size_t count;
char const *lp = line->buffer;
@@ -226,6 +252,83 @@ find_field (struct linebuffer const *lin
@@ -225,6 +251,83 @@ find_field (struct linebuffer const *lin
return line->buffer + i;
}
@ -3813,7 +3768,7 @@ diff -urNp coreutils-8.20-orig/src/uniq.c coreutils-8.20/src/uniq.c
/* Return false if two strings OLD and NEW match, true if not.
OLD and NEW point not to the beginnings of the lines
but rather to the beginnings of the fields to compare.
@@ -234,6 +337,8 @@ find_field (struct linebuffer const *lin
@@ -233,6 +336,8 @@ find_field (struct linebuffer const *lin
static bool
different (char *old, char *new, size_t oldlen, size_t newlen)
{
@ -3822,7 +3777,7 @@ diff -urNp coreutils-8.20-orig/src/uniq.c coreutils-8.20/src/uniq.c
if (check_chars < oldlen)
oldlen = check_chars;
if (check_chars < newlen)
@@ -241,14 +346,100 @@ different (char *old, char *new, size_t
@@ -240,14 +345,100 @@ different (char *old, char *new, size_t
if (ignore_case)
{
@ -3928,7 +3883,7 @@ diff -urNp coreutils-8.20-orig/src/uniq.c coreutils-8.20/src/uniq.c
/* Output the line in linebuffer LINE to standard output
provided that the switches say it should be output.
@@ -304,15 +495,43 @@ check_file (const char *infile, const ch
@@ -303,15 +494,43 @@ check_file (const char *infile, const ch
{
char *prevfield IF_LINT ( = NULL);
size_t prevlen IF_LINT ( = 0);
@ -3972,7 +3927,7 @@ diff -urNp coreutils-8.20-orig/src/uniq.c coreutils-8.20/src/uniq.c
if (prevline->length == 0
|| different (thisfield, prevfield, thislen, prevlen))
{
@@ -331,17 +550,26 @@ check_file (const char *infile, const ch
@@ -330,17 +549,26 @@ check_file (const char *infile, const ch
size_t prevlen;
uintmax_t match_count = 0;
bool first_delimiter = true;
@ -3999,7 +3954,7 @@ diff -urNp coreutils-8.20-orig/src/uniq.c coreutils-8.20/src/uniq.c
if (readlinebuffer_delim (thisline, stdin, delimiter) == 0)
{
if (ferror (stdin))
@@ -350,6 +578,14 @@ check_file (const char *infile, const ch
@@ -349,6 +577,14 @@ check_file (const char *infile, const ch
}
thisfield = find_field (thisline);
thislen = thisline->length - 1 - (thisfield - thisline->buffer);
@ -4014,7 +3969,7 @@ diff -urNp coreutils-8.20-orig/src/uniq.c coreutils-8.20/src/uniq.c
match = !different (thisfield, prevfield, thislen, prevlen);
match_count += match;
@@ -382,6 +618,9 @@ check_file (const char *infile, const ch
@@ -381,6 +617,9 @@ check_file (const char *infile, const ch
SWAP_LINES (prevline, thisline);
prevfield = thisfield;
prevlen = thislen;
@ -4024,7 +3979,7 @@ diff -urNp coreutils-8.20-orig/src/uniq.c coreutils-8.20/src/uniq.c
if (!match)
match_count = 0;
}
@@ -427,6 +666,19 @@ main (int argc, char **argv)
@@ -426,6 +665,19 @@ main (int argc, char **argv)
atexit (close_stdout);
@ -4044,10 +3999,10 @@ diff -urNp coreutils-8.20-orig/src/uniq.c coreutils-8.20/src/uniq.c
skip_chars = 0;
skip_fields = 0;
check_chars = SIZE_MAX;
diff -urNp coreutils-8.20-orig/tests/misc/local.mk coreutils-8.20/tests/misc/local.mk
--- coreutils-8.20-orig/tests/local.mk 2013-02-07 15:26:29.559370456 +0100
+++ coreutils-8.20/tests/local.mk 2013-02-07 15:24:51.625470679 +0100
@@ -323,6 +323,7 @@ all_tests = \
diff -urNp coreutils-8.21-orig/tests/local.mk coreutils-8.21/tests/local.mk
--- coreutils-8.21-orig/tests/local.mk 2013-02-15 14:24:32.645654553 +0100
+++ coreutils-8.21/tests/local.mk 2013-02-15 14:25:07.873467648 +0100
@@ -325,6 +325,7 @@ all_tests = \
tests/misc/sort-discrim.sh \
tests/misc/sort-files0-from.pl \
tests/misc/sort-float.sh \
@ -4055,10 +4010,10 @@ diff -urNp coreutils-8.20-orig/tests/misc/local.mk coreutils-8.20/tests/misc/loc
tests/misc/sort-merge.pl \
tests/misc/sort-merge-fdlimit.sh \
tests/misc/sort-month.sh \
diff -urNp coreutils-8.20-orig/tests/misc/cut.pl coreutils-8.20/tests/misc/cut.pl
--- coreutils-8.20-orig/tests/misc/cut.pl 2012-10-23 16:14:12.000000000 +0200
+++ coreutils-8.20/tests/misc/cut.pl 2013-01-23 09:24:24.639346707 +0100
@@ -23,14 +23,15 @@ use strict;
diff -urNp coreutils-8.21-orig/tests/misc/cut.pl coreutils-8.21/tests/misc/cut.pl
--- coreutils-8.21-orig/tests/misc/cut.pl 2013-02-05 00:40:31.000000000 +0100
+++ coreutils-8.21/tests/misc/cut.pl 2013-02-15 14:27:18.974468564 +0100
@@ -23,9 +23,10 @@ use strict;
# Turn off localization of executable's output.
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
@ -4072,24 +4027,9 @@ diff -urNp coreutils-8.20-orig/tests/misc/cut.pl coreutils-8.20/tests/misc/cut.p
my $prog = 'cut';
my $try = "Try '$prog --help' for more information.\n";
my $from_1 = "$prog: fields and positions are numbered from 1\n$try";
-my $inval = "$prog: invalid byte or field list\n$try";
+my $inval = "$prog: invalid byte, character or field list\n$try";
my $no_endpoint = "$prog: invalid range with no endpoint: -\n$try";
my @Tests =
@@ -147,7 +148,7 @@ my @Tests =
# None of the following invalid ranges provoked an error up to coreutils-6.9.
['inval1', qw(-f 2-0), {IN=>''}, {OUT=>''}, {EXIT=>1},
- {ERR=>"$prog: invalid decreasing range\n$try"}],
+ {ERR=>"$prog: invalid byte, character or field list\n$try"}],
['inval2', qw(-f -), {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],
['inval3', '-f', '4,-', {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],
['inval4', '-f', '1-2,-', {IN=>''}, {OUT=>''}, {EXIT=>1},
diff -urNp coreutils-8.20-orig/tests/misc/expand.pl coreutils-8.20/tests/misc/expand.pl
--- coreutils-8.20-orig/tests/misc/expand.pl 2012-10-23 16:14:12.000000000 +0200
+++ coreutils-8.20/tests/misc/expand.pl 2013-01-23 09:24:24.640439471 +0100
diff -urNp coreutils-8.21-orig/tests/misc/expand.pl coreutils-8.21/tests/misc/expand.pl
--- coreutils-8.21-orig/tests/misc/expand.pl 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/tests/misc/expand.pl 2013-02-15 14:25:07.891468472 +0100
@@ -23,6 +23,15 @@ use strict;
# Turn off localization of executable's output.
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
@ -4144,41 +4084,41 @@ diff -urNp coreutils-8.20-orig/tests/misc/expand.pl coreutils-8.20/tests/misc/ex
my $save_temps = $ENV{DEBUG};
my $verbose = $ENV{VERBOSE};
diff -urNp coreutils-8.20-orig/tests/misc/mb1.I coreutils-8.20/tests/misc/mb1.I
--- coreutils-8.20-orig/tests/misc/mb1.I 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.20/tests/misc/mb1.I 2013-01-23 09:24:24.640439471 +0100
diff -urNp coreutils-8.21-orig/tests/misc/mb1.I coreutils-8.21/tests/misc/mb1.I
--- coreutils-8.21-orig/tests/misc/mb1.I 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.21/tests/misc/mb1.I 2013-02-15 14:25:07.902467891 +0100
@@ -0,0 +1,4 @@
+Apple10
+Banana5
+Citrus20
+Cherry30
diff -urNp coreutils-8.20-orig/tests/misc/mb1.X coreutils-8.20/tests/misc/mb1.X
--- coreutils-8.20-orig/tests/misc/mb1.X 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.20/tests/misc/mb1.X 2013-01-23 09:24:24.641395635 +0100
diff -urNp coreutils-8.21-orig/tests/misc/mb1.X coreutils-8.21/tests/misc/mb1.X
--- coreutils-8.21-orig/tests/misc/mb1.X 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.21/tests/misc/mb1.X 2013-02-15 14:25:07.917467426 +0100
@@ -0,0 +1,4 @@
+Banana5
+Apple10
+Citrus20
+Cherry30
diff -urNp coreutils-8.20-orig/tests/misc/mb2.I coreutils-8.20/tests/misc/mb2.I
--- coreutils-8.20-orig/tests/misc/mb2.I 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.20/tests/misc/mb2.I 2013-01-23 09:24:24.642441918 +0100
diff -urNp coreutils-8.21-orig/tests/misc/mb2.I coreutils-8.21/tests/misc/mb2.I
--- coreutils-8.21-orig/tests/misc/mb2.I 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.21/tests/misc/mb2.I 2013-02-15 14:25:07.933467390 +0100
@@ -0,0 +1,4 @@
+Apple1020
+Banana530
+Citrus205
+Cherry3010
diff -urNp coreutils-8.20-orig/tests/misc/mb2.X coreutils-8.20/tests/misc/mb2.X
--- coreutils-8.20-orig/tests/misc/mb2.X 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.20/tests/misc/mb2.X 2013-01-23 09:24:24.642441918 +0100
diff -urNp coreutils-8.21-orig/tests/misc/mb2.X coreutils-8.21/tests/misc/mb2.X
--- coreutils-8.21-orig/tests/misc/mb2.X 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.21/tests/misc/mb2.X 2013-02-15 14:25:08.002467808 +0100
@@ -0,0 +1,4 @@
+Citrus205
+Cherry3010
+Apple1020
+Banana530
diff -urNp coreutils-8.20-orig/tests/misc/sort-mb-tests.sh coreutils-8.20/tests/misc/sort-mb-tests.sh
--- coreutils-8.20-orig/tests/misc/sort-mb-tests.sh 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.20/tests/misc/sort-mb-tests.sh 2013-01-23 09:24:24.643201093 +0100
diff -urNp coreutils-8.21-orig/tests/misc/sort-mb-tests.sh coreutils-8.21/tests/misc/sort-mb-tests.sh
--- coreutils-8.21-orig/tests/misc/sort-mb-tests.sh 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.21/tests/misc/sort-mb-tests.sh 2013-02-15 14:25:08.020467562 +0100
@@ -0,0 +1,63 @@
+#! /bin/sh
+

View File

@ -1,7 +1,7 @@
diff -urNp coreutils-8.13-orig/configure.ac coreutils-8.13/configure.ac
--- coreutils-8.13-orig/configure.ac 2011-09-09 10:29:52.584690353 +0200
+++ coreutils-8.13/configure.ac 2011-09-09 10:30:39.524564991 +0200
@@ -141,6 +141,13 @@ if test "$gl_gcc_warnings" = yes; then
diff -urNp coreutils-8.21-orig/configure.ac coreutils-8.21/configure.ac
--- coreutils-8.21-orig/configure.ac 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/configure.ac 2013-02-15 14:31:58.937482694 +0100
@@ -204,6 +204,13 @@ if test "$gl_gcc_warnings" = yes; then
AC_SUBST([GNULIB_TEST_WARN_CFLAGS])
fi
@ -15,18 +15,32 @@ diff -urNp coreutils-8.13-orig/configure.ac coreutils-8.13/configure.ac
AC_FUNC_FORK
optional_bin_progs=
diff -urNp coreutils-8.13-orig/man/chcon.x coreutils-8.13/man/chcon.x
--- coreutils-8.13-orig/man/chcon.x 2009-09-01 13:01:16.000000000 +0200
+++ coreutils-8.13/man/chcon.x 2011-09-09 10:30:39.524564991 +0200
diff -urNp coreutils-8.21-orig/init.cfg coreutils-8.21/init.cfg
--- coreutils-8.21-orig/init.cfg 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/init.cfg 2013-02-15 14:31:58.957469955 +0100
@@ -308,8 +308,8 @@ require_selinux_()
# Independent of whether SELinux is enabled system-wide,
# the current file system may lack SELinux support.
- case $(ls -Zd .) in
- '? .'|'unlabeled .')
+ case $(ls -Zd . | cut -f4 -d" ") in
+ '?'|'unlabeled')
skip_ "this system (or maybe just" \
"the current file system) lacks SELinux support"
;;
diff -urNp coreutils-8.21-orig/man/chcon.x coreutils-8.21/man/chcon.x
--- coreutils-8.21-orig/man/chcon.x 2011-08-23 15:44:01.000000000 +0200
+++ coreutils-8.21/man/chcon.x 2013-02-15 14:31:58.937482694 +0100
@@ -1,4 +1,4 @@
[NAME]
-chcon \- change file security context
+chcon \- change file SELinux security context
[DESCRIPTION]
.\" Add any additional description here
diff -urNp coreutils-8.13-orig/man/runcon.x coreutils-8.13/man/runcon.x
--- coreutils-8.13-orig/man/runcon.x 2009-09-01 13:01:16.000000000 +0200
+++ coreutils-8.13/man/runcon.x 2011-09-09 10:30:39.544686472 +0200
diff -urNp coreutils-8.21-orig/man/runcon.x coreutils-8.21/man/runcon.x
--- coreutils-8.21-orig/man/runcon.x 2011-08-23 15:44:01.000000000 +0200
+++ coreutils-8.21/man/runcon.x 2013-02-15 14:31:58.938486496 +0100
@@ -1,5 +1,5 @@
[NAME]
-runcon \- run command with specified security context
@ -34,22 +48,22 @@ diff -urNp coreutils-8.13-orig/man/runcon.x coreutils-8.13/man/runcon.x
[DESCRIPTION]
Run COMMAND with completely-specified CONTEXT, or with current or
transitioned security context modified by one or more of LEVEL,
diff -urNp coreutils-8.13-orig/src/chcon.c coreutils-8.13/src/chcon.c
--- coreutils-8.13-orig/src/chcon.c 2011-07-28 12:38:27.000000000 +0200
+++ coreutils-8.13/src/chcon.c 2011-09-09 10:30:39.562561252 +0200
@@ -356,7 +356,7 @@ Usage: %s [OPTION]... CONTEXT FILE...\n\
diff -urNp coreutils-8.21-orig/src/chcon.c coreutils-8.21/src/chcon.c
--- coreutils-8.21-orig/src/chcon.c 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/src/chcon.c 2013-02-15 14:31:58.939469828 +0100
@@ -355,7 +355,7 @@ Usage: %s [OPTION]... CONTEXT FILE...\n\
"),
program_name, program_name, program_name);
fputs (_("\
-Change the security context of each FILE to CONTEXT.\n\
+Change the SELinux security context of each FILE to CONTEXT.\n\
With --reference, change the security context of each FILE to that of RFILE.\n\
\n\
"), stdout);
diff -urNp coreutils-8.13-orig/src/copy.c coreutils-8.13/src/copy.c
--- coreutils-8.13-orig/src/copy.c 2011-07-28 12:38:27.000000000 +0200
+++ coreutils-8.13/src/copy.c 2011-09-09 10:30:39.564562214 +0200
@@ -2244,6 +2244,8 @@ copy_internal (char const *src_name, cha
diff -urNp coreutils-8.21-orig/src/copy.c coreutils-8.21/src/copy.c
--- coreutils-8.21-orig/src/copy.c 2013-02-07 10:37:05.000000000 +0100
+++ coreutils-8.21/src/copy.c 2013-02-15 14:31:58.941467872 +0100
@@ -2315,6 +2315,8 @@ copy_internal (char const *src_name, cha
{
/* Here, we are crossing a file system boundary and cp's -x option
is in effect: so don't copy the contents of this directory. */
@ -58,10 +72,10 @@ diff -urNp coreutils-8.13-orig/src/copy.c coreutils-8.13/src/copy.c
}
else
{
diff -urNp coreutils-8.13-orig/src/copy.h coreutils-8.13/src/copy.h
--- coreutils-8.13-orig/src/copy.h 2011-07-28 12:38:27.000000000 +0200
+++ coreutils-8.13/src/copy.h 2011-09-09 10:30:39.565563712 +0200
@@ -158,6 +158,9 @@ struct cp_options
diff -urNp coreutils-8.21-orig/src/copy.h coreutils-8.21/src/copy.h
--- coreutils-8.21-orig/src/copy.h 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/src/copy.h 2013-02-15 14:31:58.943470982 +0100
@@ -159,6 +159,9 @@ struct cp_options
bool preserve_timestamps;
bool explicit_no_preserve_mode;
@ -71,9 +85,9 @@ diff -urNp coreutils-8.13-orig/src/copy.h coreutils-8.13/src/copy.h
/* Enabled for mv, and for cp by the --preserve=links option.
If true, attempt to preserve in the destination files any
logical hard links between the source files. If used with cp's
diff -urNp coreutils-8.13-orig/src/cp.c coreutils-8.13/src/cp.c
--- coreutils-8.13-orig/src/cp.c 2011-07-28 12:38:27.000000000 +0200
+++ coreutils-8.13/src/cp.c 2011-09-09 10:30:39.566562062 +0200
diff -urNp coreutils-8.21-orig/src/cp.c coreutils-8.21/src/cp.c
--- coreutils-8.21-orig/src/cp.c 2013-02-07 10:37:05.000000000 +0100
+++ coreutils-8.21/src/cp.c 2013-02-15 14:31:58.945468929 +0100
@@ -141,6 +141,7 @@ static struct option const long_opts[] =
{"target-directory", required_argument, NULL, 't'},
{"update", no_argument, NULL, 'u'},
@ -82,7 +96,7 @@ diff -urNp coreutils-8.13-orig/src/cp.c coreutils-8.13/src/cp.c
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
{NULL, 0, NULL, 0}
@@ -204,6 +205,9 @@ Mandatory arguments to long options are
@@ -201,6 +202,9 @@ Copy SOURCE to DEST, or multiple SOURCE(
all\n\
"), stdout);
fputs (_("\
@ -92,7 +106,7 @@ diff -urNp coreutils-8.13-orig/src/cp.c coreutils-8.13/src/cp.c
--no-preserve=ATTR_LIST don't preserve the specified attributes\n\
--parents use full source file name under DIRECTORY\n\
"), stdout);
@@ -230,6 +234,7 @@ Mandatory arguments to long options are
@@ -227,6 +231,7 @@ Copy SOURCE to DEST, or multiple SOURCE(
destination file is missing\n\
-v, --verbose explain what is being done\n\
-x, --one-file-system stay on this file system\n\
@ -100,7 +114,7 @@ diff -urNp coreutils-8.13-orig/src/cp.c coreutils-8.13/src/cp.c
"), stdout);
fputs (HELP_OPTION_DESCRIPTION, stdout);
fputs (VERSION_OPTION_DESCRIPTION, stdout);
@@ -786,6 +791,7 @@ cp_option_init (struct cp_options *x)
@@ -784,6 +789,7 @@ cp_option_init (struct cp_options *x)
x->explicit_no_preserve_mode = false;
x->preserve_security_context = false;
x->require_preserve_context = false;
@ -134,7 +148,7 @@ diff -urNp coreutils-8.13-orig/src/cp.c coreutils-8.13/src/cp.c
case 'd':
x.preserve_links = true;
x.dereference = DEREF_NEVER;
@@ -1090,6 +1106,27 @@ main (int argc, char **argv)
@@ -1091,6 +1107,27 @@ main (int argc, char **argv)
x.one_file_system = true;
break;
@ -162,10 +176,10 @@ diff -urNp coreutils-8.13-orig/src/cp.c coreutils-8.13/src/cp.c
case 'S':
make_backups = true;
backup_suffix_string = optarg;
diff -urNp coreutils-8.13-orig/src/id.c coreutils-8.13/src/id.c
--- coreutils-8.13-orig/src/id.c 2011-07-28 12:38:27.000000000 +0200
+++ coreutils-8.13/src/id.c 2011-09-09 10:30:39.567562153 +0200
@@ -107,7 +107,7 @@ int
diff -urNp coreutils-8.21-orig/src/id.c coreutils-8.21/src/id.c
--- coreutils-8.21-orig/src/id.c 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/src/id.c 2013-02-15 14:31:58.946469154 +0100
@@ -106,7 +106,7 @@ int
main (int argc, char **argv)
{
int optc;
@ -174,10 +188,10 @@ diff -urNp coreutils-8.13-orig/src/id.c coreutils-8.13/src/id.c
/* If true, output the list of all group IDs. -G */
bool just_group_list = false;
diff -urNp coreutils-8.13-orig/src/install.c coreutils-8.13/src/install.c
--- coreutils-8.13-orig/src/install.c 2011-07-28 12:38:27.000000000 +0200
+++ coreutils-8.13/src/install.c 2011-09-09 10:30:39.569562422 +0200
@@ -261,6 +261,7 @@ cp_option_init (struct cp_options *x)
diff -urNp coreutils-8.21-orig/src/install.c coreutils-8.21/src/install.c
--- coreutils-8.21-orig/src/install.c 2013-02-07 10:37:05.000000000 +0100
+++ coreutils-8.21/src/install.c 2013-02-15 14:31:58.948469440 +0100
@@ -280,6 +280,7 @@ cp_option_init (struct cp_options *x)
x->data_copy_required = true;
x->require_preserve = false;
x->require_preserve_context = false;
@ -185,7 +199,7 @@ diff -urNp coreutils-8.13-orig/src/install.c coreutils-8.13/src/install.c
x->require_preserve_xattr = false;
x->recursive = false;
x->sparse_mode = SPARSE_AUTO;
@@ -622,7 +623,7 @@ Mandatory arguments to long options are
@@ -639,7 +640,7 @@ In the 4th form, create all components o
-v, --verbose print the name of each directory as it is created\n\
"), stdout);
fputs (_("\
@ -194,7 +208,7 @@ diff -urNp coreutils-8.13-orig/src/install.c coreutils-8.13/src/install.c
-Z, --context=CONTEXT set SELinux security context of files and directories\
\n\
"), stdout);
@@ -765,7 +766,7 @@ main (int argc, char **argv)
@@ -782,7 +783,7 @@ main (int argc, char **argv)
we'll actually use backup_suffix_string. */
backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX");
@ -203,7 +217,7 @@ diff -urNp coreutils-8.13-orig/src/install.c coreutils-8.13/src/install.c
NULL)) != -1)
{
switch (optc)
@@ -835,6 +836,7 @@ main (int argc, char **argv)
@@ -853,6 +854,7 @@ main (int argc, char **argv)
no_target_directory = true;
break;
@ -211,7 +225,7 @@ diff -urNp coreutils-8.13-orig/src/install.c coreutils-8.13/src/install.c
case PRESERVE_CONTEXT_OPTION:
if ( ! selinux_enabled)
{
@@ -842,6 +844,10 @@ main (int argc, char **argv)
@@ -860,6 +862,10 @@ main (int argc, char **argv)
"this kernel is not SELinux-enabled"));
break;
}
@ -222,7 +236,7 @@ diff -urNp coreutils-8.13-orig/src/install.c coreutils-8.13/src/install.c
x.preserve_security_context = true;
use_default_selinux_context = false;
break;
@@ -853,6 +859,7 @@ main (int argc, char **argv)
@@ -871,6 +877,7 @@ main (int argc, char **argv)
break;
}
scontext = optarg;
@ -230,10 +244,10 @@ diff -urNp coreutils-8.13-orig/src/install.c coreutils-8.13/src/install.c
use_default_selinux_context = false;
break;
case_GETOPT_HELP_CHAR;
diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
--- coreutils-8.13-orig/src/ls.c 2011-07-28 12:38:27.000000000 +0200
+++ coreutils-8.13/src/ls.c 2011-09-09 10:30:39.575562845 +0200
@@ -166,7 +166,8 @@ enum filetype
diff -urNp coreutils-8.21-orig/src/ls.c coreutils-8.21/src/ls.c
--- coreutils-8.21-orig/src/ls.c 2013-02-03 04:24:02.000000000 +0100
+++ coreutils-8.21/src/ls.c 2013-02-15 14:31:58.953469008 +0100
@@ -165,7 +165,8 @@ enum filetype
symbolic_link,
sock,
whiteout,
@ -243,7 +257,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
};
/* Display letters and indicators for each filetype.
@@ -282,6 +283,7 @@
@@ -281,6 +282,7 @@ static void queue_directory (char const
bool command_line_arg);
static void sort_files (void);
static void parse_ls_color (void);
@ -251,7 +265,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
/* Initial size of hash table.
Most hierarchies are likely to be shallower than this. */
@@ -352,7 +354,7 @@ static struct pending *pending_dirs;
@@ -350,7 +352,7 @@ static struct pending *pending_dirs;
static struct timespec current_time;
@ -260,7 +274,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
static char UNKNOWN_SECURITY_CONTEXT[] = "?";
/* Whether any of the files has an ACL. This affects the width of the
@@ -392,7 +394,9 @@ enum format
@@ -390,7 +392,9 @@ enum format
one_per_line, /* -1 */
many_per_line, /* -C */
horizontal, /* -x */
@ -271,7 +285,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
};
static enum format format;
@@ -794,6 +798,9 @@ enum
@@ -793,6 +797,9 @@ enum
SHOW_CONTROL_CHARS_OPTION,
SI_OPTION,
SORT_OPTION,
@ -353,7 +367,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
/* FIXME: put this in a function. */
{
@@ -1947,13 +1957,27 @@ decode_switches (int argc, char **argv)
@@ -1941,13 +1951,27 @@ decode_switches (int argc, char **argv)
break;
case 'Z':
@ -382,7 +396,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
default:
usage (LS_FAILURE);
}
@@ -2757,6 +2783,7 @@ gobble_file (char const *name, enum file
@@ -2883,6 +2907,7 @@ gobble_file (char const *name, enum file
memset (f, '\0', sizeof *f);
f->stat.st_ino = inode;
f->filetype = type;
@ -390,7 +404,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
if (command_line_arg
|| format_needs_stat
@@ -2869,7 +2896,7 @@ gobble_file (char const *name, enum file
@@ -2995,7 +3020,7 @@ gobble_file (char const *name, enum file
&& print_with_color && is_colored (C_CAP))
f->has_capability = has_capability_cache (absolute_name, f);
@ -399,7 +413,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
{
bool have_selinux = false;
bool have_acl = false;
@@ -2892,7 +2919,7 @@ gobble_file (char const *name, enum file
@@ -3016,7 +3041,7 @@ gobble_file (char const *name, enum file
err = 0;
}
@ -408,7 +422,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
{
int n = file_has_acl_cache (absolute_name, f);
err = (n < 0);
@@ -2911,7 +2938,8 @@ gobble_file (char const *name, enum file
@@ -3035,7 +3060,8 @@ gobble_file (char const *name, enum file
}
if (S_ISLNK (f->stat.st_mode)
@ -418,7 +432,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
{
struct stat linkstats;
@@ -2931,6 +2959,7 @@ gobble_file (char const *name, enum file
@@ -3054,6 +3080,7 @@ gobble_file (char const *name, enum file
command line are automatically traced if not being
listed as files. */
if (!command_line_arg || format == long_format
@ -426,7 +440,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
|| !S_ISDIR (linkstats.st_mode))
{
/* Get the linked-to file's mode for the filetype indicator
@@ -2970,7 +2999,7 @@ gobble_file (char const *name, enum file
@@ -3087,7 +3114,7 @@ gobble_file (char const *name, enum file
block_size_width = len;
}
@ -435,7 +449,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
{
if (print_owner)
{
@@ -3471,6 +3500,13 @@ print_current_files (void)
@@ -3591,6 +3618,13 @@ print_current_files (void)
print_long_format (sorted_file[i]);
DIRED_PUTCHAR ('\n');
}
@ -449,7 +463,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
break;
}
}
@@ -3633,6 +3669,67 @@ format_inode (char *buf, size_t buflen,
@@ -3753,6 +3787,67 @@ format_inode (char *buf, size_t buflen,
: (char *) "?");
}
@ -517,7 +531,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
/* Print information about F in long format. */
static void
print_long_format (const struct fileinfo *f)
@@ -3724,9 +3821,15 @@ print_long_format (const struct fileinfo
@@ -3844,9 +3939,15 @@ print_long_format (const struct fileinfo
The latter is wrong when nlink_width is zero. */
p += strlen (p);
@ -534,7 +548,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
{
DIRED_FPUTS (buf, stdout, p - buf);
@@ -3739,9 +3842,6 @@ print_long_format (const struct fileinfo
@@ -3859,9 +3960,6 @@ print_long_format (const struct fileinfo
if (print_author)
format_user (f->stat.st_author, author_width, f->stat_ok);
@ -544,7 +558,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
p = buf;
}
@@ -4086,9 +4186,6 @@ print_file_name_and_frills (const struct
@@ -4207,9 +4305,6 @@ print_file_name_and_frills (const struct
: human_readable (ST_NBLOCKS (f->stat), buf, human_output_opts,
ST_NBLOCKSIZE, output_block_size));
@ -554,7 +568,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
size_t width = print_name_with_quoting (f, false, NULL, start_col);
if (indicator_style != none)
@@ -4292,9 +4389,6 @@ length_of_file_name_and_frills (const st
@@ -4417,9 +4512,6 @@ length_of_file_name_and_frills (const st
output_block_size))
: block_size_width);
@ -564,7 +578,7 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
quote_name (NULL, f->name, filename_quoting_options, &name_width);
len += name_width;
@@ -4733,9 +4827,16 @@ Mandatory arguments to long options are
@@ -4856,9 +4948,16 @@ Sort entries alphabetically if none of -
-w, --width=COLS assume screen width instead of current value\n\
-x list entries by lines instead of by columns\n\
-X sort alphabetically by entry extension\n\
@ -582,9 +596,9 @@ diff -urNp coreutils-8.13-orig/src/ls.c coreutils-8.13/src/ls.c
fputs (HELP_OPTION_DESCRIPTION, stdout);
fputs (VERSION_OPTION_DESCRIPTION, stdout);
emit_size_note ();
diff -urNp coreutils-8.13-orig/src/mkdir.c coreutils-8.13/src/mkdir.c
--- coreutils-8.13-orig/src/mkdir.c 2011-07-28 12:38:27.000000000 +0200
+++ coreutils-8.13/src/mkdir.c 2011-09-09 10:30:39.576564256 +0200
diff -urNp coreutils-8.21-orig/src/mkdir.c coreutils-8.21/src/mkdir.c
--- coreutils-8.21-orig/src/mkdir.c 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/src/mkdir.c 2013-02-15 14:31:58.954469576 +0100
@@ -38,6 +38,7 @@
static struct option const longopts[] =
{
@ -593,9 +607,9 @@ diff -urNp coreutils-8.13-orig/src/mkdir.c coreutils-8.13/src/mkdir.c
{"mode", required_argument, NULL, 'm'},
{"parents", no_argument, NULL, 'p'},
{"verbose", no_argument, NULL, 'v'},
diff -urNp coreutils-8.13-orig/src/mknod.c coreutils-8.13/src/mknod.c
--- coreutils-8.13-orig/src/mknod.c 2011-07-28 12:38:27.000000000 +0200
+++ coreutils-8.13/src/mknod.c 2011-09-09 10:30:39.577563177 +0200
diff -urNp coreutils-8.21-orig/src/mknod.c coreutils-8.21/src/mknod.c
--- coreutils-8.21-orig/src/mknod.c 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/src/mknod.c 2013-02-15 14:31:58.955470548 +0100
@@ -35,7 +35,7 @@
static struct option const longopts[] =
@ -605,10 +619,10 @@ diff -urNp coreutils-8.13-orig/src/mknod.c coreutils-8.13/src/mknod.c
{"mode", required_argument, NULL, 'm'},
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
diff -urNp coreutils-8.13-orig/src/mv.c coreutils-8.13/src/mv.c
--- coreutils-8.13-orig/src/mv.c 2011-07-28 12:38:27.000000000 +0200
+++ coreutils-8.13/src/mv.c 2011-09-09 10:30:39.578562234 +0200
@@ -118,6 +118,7 @@ cp_option_init (struct cp_options *x)
diff -urNp coreutils-8.21-orig/src/mv.c coreutils-8.21/src/mv.c
--- coreutils-8.21-orig/src/mv.c 2013-02-07 10:37:05.000000000 +0100
+++ coreutils-8.21/src/mv.c 2013-02-15 14:31:58.956469593 +0100
@@ -120,6 +120,7 @@ cp_option_init (struct cp_options *x)
x->preserve_timestamps = true;
x->explicit_no_preserve_mode= false;
x->preserve_security_context = selinux_enabled;
@ -616,35 +630,21 @@ diff -urNp coreutils-8.13-orig/src/mv.c coreutils-8.13/src/mv.c
x->reduce_diagnostics = false;
x->data_copy_required = true;
x->require_preserve = false; /* FIXME: maybe make this an option */
diff -urNp coreutils-8.13-orig/src/runcon.c coreutils-8.13/src/runcon.c
--- coreutils-8.13-orig/src/runcon.c 2011-07-28 12:38:27.000000000 +0200
+++ coreutils-8.13/src/runcon.c 2011-09-09 10:30:39.579564283 +0200
@@ -86,7 +86,7 @@ Usage: %s CONTEXT COMMAND [args]\n\
diff -urNp coreutils-8.21-orig/src/runcon.c coreutils-8.21/src/runcon.c
--- coreutils-8.21-orig/src/runcon.c 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/src/runcon.c 2013-02-15 14:31:58.956469593 +0100
@@ -85,7 +85,7 @@ Usage: %s CONTEXT COMMAND [args]\n\
or: %s [ -c ] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] COMMAND [args]\n\
"), program_name, program_name);
fputs (_("\
-Run a program in a different security context.\n\
+Run a program in a different SELinux security context.\n\
With neither CONTEXT nor COMMAND, print the current security context.\n\
\n\
CONTEXT Complete security context\n\
diff -urNp coreutils-8.20-orig/init.cfg coreutils-8.20/init.cfg
--- coreutils-8.20-orig/init.cfg
+++ coreutils-8.20/init.cfg
@@ -253,8 +253,8 @@ require_selinux_()
"), stdout);
# Independent of whether SELinux is enabled system-wide,
# the current file system may lack SELinux support.
- case $(ls -Zd .) in
- '? .'|'unlabeled .')
+ case $(ls -Zd . | cut -f4 -d" ") in
+ '?'|'unlabeled')
skip_ "this system (or maybe just" \
"the current file system) lacks SELinux support"
;;
diff -urNp coreutils-8.20-orig/tests/misc/selinux coreutils-8.20/tests/misc/selinux.sh
--- coreutils-8.20-orig/tests/misc/selinux.sh
+++ coreutils-8.20/tests/misc/selinux.sh
diff -urNp coreutils-8.21-orig/tests/misc/selinux.sh coreutils-8.21/tests/misc/selinux.sh
--- coreutils-8.21-orig/tests/misc/selinux.sh 2013-01-31 01:46:24.000000000 +0100
+++ coreutils-8.21/tests/misc/selinux.sh 2013-02-15 14:31:58.957469955 +0100
@@ -37,7 +37,7 @@ chcon $ctx f d p ||
# inspect that context with both ls -Z and stat.

View File

@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.20
Release: 8%{?dist}
Version: 8.21
Release: 1%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@ -15,8 +15,6 @@ Source106: coreutils-colorls.csh
# From upstream
Patch1: coreutils-8.20-powerpcfactor.patch
Patch2: coreutils-8.20-df-duplicates.patch
Patch3: coreutils-8.20-seq-s.patch
# Our patches
#general patch to workaround koji build system issues
@ -31,8 +29,6 @@ Patch103: coreutils-8.2-uname-processortype.patch
Patch104: coreutils-df-direct.patch
#add note about mkdir --mode behaviour into info documentation(#610559)
Patch107: coreutils-8.4-mkdir-modenote.patch
#add support for dtr/dsr to stty
Patch108: coreutils-445213-stty-dtrdsr.patch
# sh-utils
#add info about TZ envvar to date manpage
@ -132,8 +128,6 @@ the old GNU fileutils, sh-utils, and textutils packages.
# From upstream
%patch1 -p1 -b .ppcfactor
%patch2 -p1 -b .duplic
%patch3 -p1 -b .newline
# Our patches
%patch100 -p1 -b .configure
@ -142,7 +136,6 @@ the old GNU fileutils, sh-utils, and textutils packages.
%patch103 -p1 -b .sysinfo
%patch104 -p1 -b .dfdirect
%patch107 -p1 -b .mkdirmode
%patch108 -p1 -b .dtrdsr
# sh-utils
%patch703 -p1 -b .dateman
@ -339,6 +332,7 @@ fi
%{_bindir}/nl
%{_bindir}/nohup
%{_bindir}/nproc
%{_bindir}/numfmt
%{_bindir}/od
%{_bindir}/paste
%{_bindir}/pathchk
@ -384,6 +378,9 @@ fi
%{_sbindir}/chroot
%changelog
* Fri Feb 15 2013 Ondrej Vasik <ovasik@redhat.com> 8.21-1
- new upstream release 8.21, update patches
* Thu Feb 07 2013 Ondrej Oprala <ooprala@redhat.com> 8.20-8
- add missing sort-mb-tests.sh to local.mk

View File

@ -1 +1 @@
3d69af8f561fce512538a9fe85f147ff coreutils-8.20.tar.xz
065ba41828644eca5dd8163446de5d64 coreutils-8.21.tar.xz