Jim Meyering [Wed, 17 Nov 2010 20:38:38 +0000 (21:38 +0100)]
tests: convert the multi-prog $VERBOSE/--version uses
E.g.,
-test "$VERBOSE" = yes && { env -- pwd --version; readlink --version; }
+print_ver_ pwd readlink
-test "$VERBOSE" = yes && { stdbuf --version; mv --version; }
+print_ver_ stdbuf mv
Use this command:
git grep -l 'VERBOSE.*--version'|xargs perl -ni \
-e '/^test "\$VERBOSE" = yes && { .*--version/ or print,next;' \
-e 's/env -- //g;' \
-e 's/test "\$VERBOSE" = yes && { /print_ver_ /;' \
-e ' s/(\w+) --version;/$1/g; s/ *}$//; print'
Jim Meyering [Wed, 17 Nov 2010 20:42:13 +0000 (21:42 +0100)]
tests: convert "... env -- prog --version" uses
E.g.,
-test "$VERBOSE" = yes && env -- pwd --version
+print_ver_ pwd
git grep -l 'VERBOSE.*--version'|xargs perl -pi -e \
's/test "\$VERBOSE" = yes && env -- (\w+) --version/print_ver_ $1/'
Jim Meyering [Wed, 17 Nov 2010 20:35:31 +0000 (21:35 +0100)]
tests: substitute the single-program $VERBOSE/--version uses
Automatically make all of the changes like this:
-test "$VERBOSE" = yes && chgrp --version
+print_ver_ chgrp
git grep -l 'VERBOSE.*--version'|xargs perl -pi -e \
's/test "\$VERBOSE" = yes && (\w+) --version/print_ver_ $1/'
Jim Meyering [Tue, 16 Nov 2010 07:05:11 +0000 (08:05 +0100)]
tests: factor out VERBOSE-only --version-printing code
* tests/init.cfg (print_ver_): New function.
Jim Meyering [Sun, 14 Nov 2010 11:13:58 +0000 (12:13 +0100)]
tests: remove test-lib.sh; now all tests use gnulib's init.sh
* tests/test-lib.sh: Remove file. No longer used.
* tests/Makefile.am (EXTRA_DIST): Remove it here, too.
* tests/sample-test: Correct a comment.
Jim Meyering [Sun, 14 Nov 2010 11:07:57 +0000 (12:07 +0100)]
tests: convert remaining uses of test-lib.sh to init.sh
RHS='. "\${srcdir=.}/init.sh"; path_prepend_ ../src'
git grep -l test-lib.sh \
| xargs perl -pi -e 's,^\. \$srcdir/test-lib\.sh$,'"$RHS",
Jim Meyering [Sun, 14 Nov 2010 11:02:39 +0000 (12:02 +0100)]
tests: convert 'if test "$VERBOSE" = yes; then' to test ... &&
Jim Meyering [Sun, 14 Nov 2010 10:05:05 +0000 (11:05 +0100)]
tests: convert first batch of tests from test-lib.sh to init.sh
Initially, I did this,
git grep -l srcdir/test-lib.sh|xargs perl -p0i -e '~180-byte script'
but that line would have been much longer than the maximum permitted
by coreutils' commit hook, and wasn't readable besides, so here's a
more readable version:
lhs=$(printf '%s\\n' \
'if test "$VERBOSE" = yes; then' \
' set -x' \
' touch --version' \
'fi' \
'' \
'. $srcdir/test-lib.sh' \
| sed 's/\$/\\\$/g;s/touch/(\\w+)/')
rhs=$(printf '%s\\n' \
'. "${srcdir=.}/init.sh"; path_prepend_ ../src' \
'test "$VERBOSE" = yes && FIXME --version' \
| sed 's/\$/\\\$/g;s/FIXME/\$1/')
git grep -l srcdir/test-lib.sh|xargs perl -p0i -e "s,$lhs,$rhs,"
Jim Meyering [Sun, 14 Nov 2010 10:01:25 +0000 (11:01 +0100)]
tests: move a comment so automated conversion works
Jim Meyering [Sun, 14 Nov 2010 09:16:27 +0000 (10:16 +0100)]
maint: add a NEWS-checking syntax-check rule
* cfg.mk (sc_NEWS_two_empty_lines): New syntax-check rule.
Pádraig Brady [Tue, 16 Nov 2010 07:32:32 +0000 (07:32 +0000)]
build: add `patch` as a bootstrap dependency
* bootstrap.conf (buildreq): require `patch` as it's used
by gnulib-tool to apply local diffs to gnulib modules
Pádraig Brady [Sun, 7 Nov 2010 03:09:38 +0000 (03:09 +0000)]
split: fail immediately if impossible to create a large file
* src/split.c (main): Error if -[bC] value > OFF_T_MAX
* tests/misc/split-fail: Adjust for the new lower limits
Pádraig Brady [Sun, 24 Oct 2010 21:44:52 +0000 (22:44 +0100)]
truncate: fix a very unlikely case for undiagnosed errors
src/truncate.c (main): Use a bool to store if an error occurred,
rather than an int, to protect against overflow.
(do_ftruncate): Likewise. Also change 0/false to mean failure
rather than success.
Pádraig Brady [Tue, 16 Nov 2010 00:31:05 +0000 (00:31 +0000)]
maint: fix a new -Wpointer-sign gcc warning
* src/csplit.c (max_out): Fix a new warning introduced with
commit
6568b173, 2010-11-10, "csplit: do not rely on..."
Pádraig Brady [Mon, 25 Oct 2010 10:16:37 +0000 (11:16 +0100)]
build: enable the -Wpointer-sign gcc warning
... when configured with the --enable-gcc-warnings option.
This follows on from commit
34ef0a01, 2010-10-14,
"sort: fix unportable cast of unsigned char * -> char *"
* configure.ac: -Wall implicitly enables this warning
so remove the explicit disabling.
Pádraig Brady [Mon, 15 Nov 2010 09:36:16 +0000 (09:36 +0000)]
maint: add a missed fadvise-tests module
* gl/modules/fadvise-tests: Add the module previously missed
in commit
63b5e816, 2010-07-14, "fadvise: new module ...".
* gl/tests/test-fadvise.c: Add a comment as to why we don't
check return values.
Paul Eggert [Sat, 13 Nov 2010 21:02:29 +0000 (22:02 +0100)]
doc: tweak NEWS and coreutils.texi
* doc/coreutils.texi (stat invocation): Add sentence-ending period.
* NEWS: Correct stat change description: s/floating point //.
* cfg.mk (old_NEWS_hash): Update, to match this NEWS change.
Jim Meyering [Sat, 13 Nov 2010 16:37:18 +0000 (17:37 +0100)]
post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
Jim Meyering [Sat, 13 Nov 2010 16:21:08 +0000 (17:21 +0100)]
version 8.7
* NEWS: Record release date.
Jim Meyering [Sat, 13 Nov 2010 12:28:24 +0000 (13:28 +0100)]
build: update gnulib...
...to fix the failing update-copyright test,
and for the openat portability fix.
Jim Meyering [Sat, 13 Nov 2010 09:12:49 +0000 (10:12 +0100)]
build: update gnulib for linux 2.6.9 nanosleep workaround
Also, do the following to avoid "make syntax-check" failure
induced by new rules.
* .x-sc_bindtextdomain: Exempt files with an #ifdef'd "main".
* Makefile.am: Add this file.
Jim Meyering [Sat, 13 Nov 2010 07:04:13 +0000 (08:04 +0100)]
maint: remove fstimeprec (variable precision time stamp) support
The implementation of variable-precision time stamps relied
on heuristics that made the output subtly nondeterministic,
or at least hard to reproduce:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/21531/focus=21538
So, for now at least, we're removing that feature.
* bootstrap.conf (gnulib_modules): Remove fstimeprec.
* gl/lib/fstimeprec.c, gl/lib/fstimeprec.h: Remove files.
* gl/modules/fstimeprec, gl/modules/fstimeprec-tests: Likewise.
* gl/tests/test-fstimeprec.c: Remove file.
Jim Meyering [Sat, 13 Nov 2010 07:02:02 +0000 (08:02 +0100)]
stat: do not provide variable precision time stamps
* src/stat.c: Don't include fstimeprec.c.
(out_epoch_sec): Don't call fstimeprec.
* NEWS: Update description.
* doc/coreutils.texi: Likewise.
Paul Eggert [Thu, 11 Nov 2010 04:34:52 +0000 (20:34 -0800)]
csplit: do not rely on undefined behavior in printf formats
* doc/coreutils.texi (csplit invocation): Say that %d and %i are
aliases for %u.
* src/csplit.c (FLAG_THOUSANDS, FLAG_ALTERNATIVE): New constants.
(get_format_flags): Now take char const * and int * and return
size_t. It now stores info about the flags instead of merely
scanning them. Also, it handles '0' correctly. Drop support for
the undocumented '+' and ' ' flags since the value is unsigned.
Add support for the (undocumented) "'" flag. All uses changed.
(get_format_width, get_format_prec): Remove.
(check_format_conv_type): Renamed from get_format_conv_type, with
a different signature. It now converts the format to one that is
compatible with unsigned int, and checks flags. All uses changed.
(max_out): Have snprintf compute the number of bytes needed rather
than attempting to do it ourselves (which doesn't work portably
with outlandish formats such as %
4294967296d).
(check_format_conv_type, main): Check for overflow in size
calculations. Don't assume size_t fits in unsigned int.
* tests/misc/csplit: Check for proper handling of flags, with
%0#6.3x. Coreutils 8.6 mishandles this somewhat-weird example.
Pádraig Brady [Wed, 10 Nov 2010 14:35:17 +0000 (14:35 +0000)]
csplit: fix a memory leak per input buffer
* src/csplit.c (free_buffer): Also free the line offsets buffers
(remove_line): Also free the containing structure
* tests/misc/csplit-heap: A new test to trigger with leaks of
this magnitude.
* tests/Makefile.am: Reference the new test
* NEWS: Mention the fix
Reported by David Hofstee
Jim Meyering [Wed, 10 Nov 2010 20:54:57 +0000 (21:54 +0100)]
tests: fix comments and --version invocation in new test
* tests/misc/csplit-1000: Fix comments and --version invocation.
Jim Meyering [Wed, 10 Nov 2010 12:53:38 +0000 (13:53 +0100)]
csplit: avoid buffer overrun when writing more than 999 files
Without this fix, seq 1000 | csplit - /./ '{*}' would write
the NUL-terminated file name, xx1000, into a buffer of size 6.
* src/csplit.c (main): Use properly sized file name buffer.
* NEWS (Bug fixes): Mention it.
* tests/misc/csplit-1000: New test to trigger the bug.
* tests/Makefile.am (TESTS): Add misc/csplit-1000.
Pádraig Brady [Tue, 9 Nov 2010 12:43:20 +0000 (12:43 +0000)]
tests: avoid portability problem with dash vs. symlinked ttys
* tests/mv/i-3: Adjust so that the symlink is resolved
before redirecting to the background command, as otherwise
the stdin descriptor passed to the command will fail the
isatty() or ttyname() test.
Pádraig Brady [Mon, 8 Nov 2010 10:26:08 +0000 (11:26 +0100)]
tests: avoid portability problem with dash vs. local v=$splittable_val
* tests/init.cfg (retry_delay_): Adjust awk script to print a single
floating point value, rather than many.
Jim Meyering [Sun, 7 Nov 2010 13:23:32 +0000 (14:23 +0100)]
tests: don't disqualify FreeBSD 8.1's /bin/sh just yet,
because dash-0.5.6-2.fc14.x86_64 would also be disqualified.
This reverts part of yesterday's commit
6c058b2d, "tests: avoid
failure due to bug in FreeBSD 8.1's /bin/sh". Note that the offending
aspect of those shells is not officially a bug, since "local" is not
specified by POSIX. However, it is very unintuitive that prepending
"local" to an existing, standards-compliant assignment would evoke
such a fundamental change in semantics.
* tests/init.sh: Remove snippet requiring sane "local" support.
Upstream dash bug report:
http://thread.gmane.org/gmane.comp.shells.dash/419
Paul Eggert [Sat, 6 Nov 2010 20:57:08 +0000 (13:57 -0700)]
stat: do not rely on undefined behavior in printf formats
* src/stat.c (digits, printf_flags): New static vars.
(make_format): New function.
(out_string, out_int, out_uint, out_uint_o, out_uint_x):
(out_minus_zero): Use it to avoid undefined behavior when invoking
printf.
(print_it): Check for invalid conversion specifications such as
%..X and %1-X, which would otherwise rely on undefined behavior
when invoking printf.
* tests/misc/stat-nanoseconds: Check that the "I" printf flag
doesn't mess up in the C locale, as it formerly did on non-GNU
hosts.
Jim Meyering [Sat, 6 Nov 2010 14:20:06 +0000 (15:20 +0100)]
tests: avoid failure due to bug in FreeBSD 8.1's /bin/sh
* tests/init.sh: Arrange not to accept FreeBSD 8.1's /bin/sh, since
it fails this test: /bin/sh -c 'f(){ local s=$IFS; test -n "$s"; }; f'
* tests/init.cfg (sanitize_path_): Stop-gap measure to work around
a bug in FreeBSD 8.1's /bin/sh. We'll un-do this change once all
300+ tests use init.sh.
Jim Meyering [Sat, 6 Nov 2010 07:57:44 +0000 (08:57 +0100)]
build: update gnulib to latest for strtod and icc fixes
Paul Eggert [Sat, 6 Nov 2010 02:35:12 +0000 (19:35 -0700)]
stat: use e.g. %.3X instead of %X.%3:X for sub-second precision
* NEWS: Document this.
* doc/coreutils.texi (stat invocation): Likewise.
* gl/lib/fstimeprec.c, gl/lib/fstimeprec.h, gl/modules/fstimeprec:
* gl/modules/fstimeprec-tests, gl/tests/test-fstimeprec.c:
New files.
* bootstrap.conf (gnulib_modules): Add fstimeprec.
* src/stat.c: Include fstimeprec.h. Don't include xstrtol.h.
(decimal_point, decimal_point_len): New static vars.
(main): Initialize them.
(epoch_sec, out_ns): Remove.
(out_int, out_uint): Now returns whatever printf returned.
(out_minus_zero, out_epoch_secs): New functions.
(print_stat): Use out_epoch_sec instead of out_ns and epoch_sec.
(print_stat, print_it, usage): Remove the %:X-style formats.
* tests/misc/stat-nanoseconds: Set TZ=UTC0 to avoid problems
with weird time zones. Use a time stamp near the Epoch so that we
don't have to worry about leap seconds. Redo test cases to match
new behavior.
* tests/touch/60-seconds: Change %Y.%:Y to %.9Y, to adjust to
new behavior.
Eric Blake [Thu, 4 Nov 2010 16:49:21 +0000 (10:49 -0600)]
cp: NEWS entry for previous fix
Resolves bug#7324
* NEWS: Document the extent of the Solaris crash.
Eric Blake [Thu, 4 Nov 2010 14:16:04 +0000 (08:16 -0600)]
cp, mv, touch: fix file time manipulation on Solaris 10
* gnulib: Update to latest, for futimens fix.
* .gitignore: Ignore another recent gnulib-generated file.
Jim Meyering [Wed, 3 Nov 2010 12:11:21 +0000 (13:11 +0100)]
build: update gnulib to latest
Jim Meyering [Thu, 21 Oct 2010 16:41:24 +0000 (18:41 +0200)]
stat: revert %X-%Y-%Z change; use e.g., %:X to print fractional seconds
This reverts part of the recent commit
9069af45,
"stat: print timestamps to full resolution", which made %X, %Y, %Z
print floating point numbers. We prefer to retain portability of
%X, %Y and %Z uses, while still providing access to full-resolution
time stamps via modified format strings. Also make the new
%W consistent.
* src/stat.c: Include "xstrtol.h".
(print_it): Accept a new %...:[XYZ] format directive,
e.g., %:X, to print the nanoseconds portion of the corresponding time.
For example, %3.3:Y prints the zero-padded, truncated, milliseconds
part of the time of last modification.
(print_it): Update print_func signature to match.
(neg_to_zero): New helper function.
(epoch_time): Remove function; replace with...
(epoch_sec): New function; use timetostr.
(out_ns): New function. Use "09" only when no other modifier
is specified.
(print_statfs): Change type of "m" to unsigned int,
now that it must accommodate values larger than 255.
(print_stat): Likewise.
Map :X to a code of 'X' + 256. Likewise for Y, Z and W.
(usage): Update.
* tests/touch/60-seconds: Use %Y.%:Y in place of %Y.
* tests/misc/stat-nanoseconds: New file.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Changes in behavior): Mention this.
With improvements by Pádraig Brady.
Thanks to Andreas Schwab for raising the issue.
Nix [Mon, 1 Nov 2010 15:46:01 +0000 (15:46 +0000)]
tests: fix a false positive for 32 bit on 64 bit hosts
* tests/ls/stat-free-symlinks: strace currently outputs an
informational message about arch difference to stdout.
Therefore we need to strip that before comparison.
Patrick W. Plusnick II [Thu, 28 Oct 2010 12:54:53 +0000 (14:54 +0200)]
maint: remove an unnecessary FIXME comment
* src/seq.c (terminator): This does not need to be specifiable
via an option. Remove the FIXME comment.
Pádraig Brady [Tue, 26 Oct 2010 16:55:10 +0000 (17:55 +0100)]
cp: make --attributes-only override --reflink completely
* doc/coreutils.texi (cp invocation): Change the description slightly
so as users might not immediately discount using this option.
Mention that --reflink is overridden by the other linking options and
--attributes-only, and give an example where this might be useful.
* src/copy.c (copy_internal): Bypass the reflink if
--attributes-only is specifed.
* tests/cp/reflink-perm: Ensure both --reflink modes are
overridden by --attributes-only.
* NEWS: Mention the change in behavior.
Reported by Jim Meyering.
Jim Meyering [Tue, 26 Oct 2010 14:34:51 +0000 (16:34 +0200)]
tests: mention that btrfs also causes failure of misc/ls-time
* tests/misc/ls-time: Mention that this test also fails on btrfs,
at least until http://bugzilla.redhat.com/591068 is addressed.
Eric Blake [Mon, 25 Oct 2010 17:51:45 +0000 (11:51 -0600)]
maint: update THANKS
* THANKS: Update.
Tobias Quathamer [Thu, 21 Oct 2010 07:15:00 +0000 (09:15 +0200)]
date: correct typos in date --help
* src/date.c (usage): Use "e.g." correctly.
Pádraig Brady [Sun, 24 Oct 2010 13:02:12 +0000 (14:02 +0100)]
tail: support rechecking currently missing remote dirs
src/tail.c (main): As an optimization, don't bother checking
for stdin or remote files, when ---disable-inotify is specified.
To improve the fix in commit
61b77891, set the disable_inotify
flag when we fall back to polling, so that we recheck remote files.
NEWS: Mention the fix
Paul Eggert [Sun, 24 Oct 2010 00:20:01 +0000 (17:20 -0700)]
du: don't print junk when diagnosing out-of-range time stamps
* src/du.c (show_date): Fix call to fputs with a buffer that
contains some uninitialized data.
* tests/Makefile.am (TESTS): Add du/big-timestamp.
* tests/du/bigtime: New file, which checks for the bug.
Rodrigo Campos [Tue, 19 Oct 2010 22:48:46 +0000 (19:48 -0300)]
doc: add a cross reference from cat's man page to "tac"
* man/cat.x: See also "tac".
Jim Meyering [Tue, 19 Oct 2010 07:19:59 +0000 (09:19 +0200)]
tests: trigger and test for md5sum's new diagnostics
* tests/misc/md5sum: Test for new diagnostics.
Benno Schulenberg [Mon, 18 Oct 2010 20:35:39 +0000 (22:35 +0200)]
md5sum: print a summary warning for improperly formatted lines
And remove the now-superfluous totals from the other two warnings,
so the plurals will also work in other languages than English.
* src/md5sum.c (digest_check): Change as above.
* tests/misc/md5sum (check-quiet2): Adjust accordingly.
Jim Meyering [Sun, 17 Oct 2010 17:08:44 +0000 (19:08 +0200)]
build: enable -Werror for gnulib-tests, too
* gnulib: Update to latest for warning-free tests.
* gnulib-tests/Makefile.am (AM_CFLAGS): Uncomment $(WERROR_CFLAGS),
now that these tests are warning-free.
Jim Meyering [Sun, 17 Oct 2010 13:32:03 +0000 (15:32 +0200)]
maint: update bootstrap from gnulib
* bootstrap: Update from gnulib.
Jim Meyering [Sun, 17 Oct 2010 10:47:38 +0000 (12:47 +0200)]
.gitignore: anchor patterns
* .gitignore: Anchor most patterns. Remove .tarball-version.
* doc/.gitignore: Anchor all patterns.
Remove getdate.texi and get_date.texi.
Jim Meyering [Sat, 16 Oct 2010 18:18:19 +0000 (20:18 +0200)]
tests: sort-float: avoid spurious test failure on ppc/ppc64
* tests/misc/sort-float: On systems with DBL_MIN < LDBL_MIN,
this test would fail because the expected output was not sorted.
Detect that case, and if needed, reverse those two values.
Andreas Schwab [Sat, 16 Oct 2010 11:32:04 +0000 (13:32 +0200)]
fold: fix fadvise hint
* src/fold.c (fold_file): Apply fadvise to istream, not stdin.
This bug would have inhibited the fadvise optimization when not
reading from standard input.
Jim Meyering [Fri, 15 Oct 2010 15:06:56 +0000 (17:06 +0200)]
post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
Jim Meyering [Fri, 15 Oct 2010 14:50:15 +0000 (16:50 +0200)]
version 8.6
* NEWS: Record release date.
Jim Meyering [Fri, 15 Oct 2010 05:49:54 +0000 (07:49 +0200)]
build: update gnulib for vasnprintf fix
Paul Eggert [Thu, 14 Oct 2010 07:12:23 +0000 (00:12 -0700)]
bug#7213: [PATCH] sort: fix buffer overrun on 32-bit hosts when warning re obsolete keys
* src/sort.c (key_warnings): Local buffer should be of size
INT_BUFSIZE_BOUND (uintmax_t), not INT_BUFSIZE_BOUND (sword).
This bug was discovered by running 'make check' on a 32-bit
Solaris 8 sparc host, using Sun cc. I saw several other instances
of invoking umaxtostr on a buffer declared to be of size
INT_BUFSIZE_BOUND (VAR), and these instances should at some point
be replaced by INT_BUFSIZE_BOUND (uintmax_t) too, as that's a
less error-prone style.
Paul Eggert [Thu, 14 Oct 2010 06:39:50 +0000 (23:39 -0700)]
tests: work around portability and clock-skew problems
* tests/misc/ls-misc (push_ls_colors): Don't assume LS_COLORS
is set. This part of the fix is by Jim Meyering.
(sl-dangle2, sl-dangle3, sl-dangle4, sl-dangle5): Don't assume
that newly-created files will have time stamps in the past. They
might not, due to clock skew, if the file systems are remote.
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/21322/focus=21346
Paul Eggert [Thu, 14 Oct 2010 03:44:12 +0000 (20:44 -0700)]
install: avoid warning with Solaris 10 cc
* src/install.c (extra_mode): Don't assign ~S_IRWXUGO & ~S_IFMT
to a mode_t variable, as the number might be too big to fit.
Solaris 10 cc warns about this, and the C standard says it
has undefined behavior.
Paul Eggert [Thu, 14 Oct 2010 03:39:28 +0000 (20:39 -0700)]
mbsalign: avoid warning with Solaris 10 cc
* gl/lib/mbsalign.c: Include <stdint.h> for SIZE_MAX.
Use SIZE_MAX rather than (size_t) -1, to avoid warning for
"size_t x = -1" on Solaris 10 cc.
* gl/modules/mbsalign (Depends-on): Add stdint.
Paul Eggert [Thu, 14 Oct 2010 03:35:50 +0000 (20:35 -0700)]
sort: fix unportable cast of unsigned char * -> char *
* src/sort.c (fold_toupper): Change this back from char to
unsigned char, fixing a portability issue introduced in commit
59e2e55d0f154a388adc9bac37d2b45f2ba971f8 dated February 26, as the
C Standard doesn't let you convert from unsigned char * to char *
without a cast, and the (in theory more portable) style here is to
convert char values, not pointer values.
(getmonth): Convert char to unsigned char when needed for
comparison.
Jim Meyering [Wed, 13 Oct 2010 09:20:18 +0000 (11:20 +0200)]
build: prepare to enable -Werror also for gnulib-tests/
* configure.ac (GNULIB_WARN_CFLAGS): Define new variable, for use
in gnulib-tests.
* gnulib-tests/Makefile.am: Disable specific -W___ options,
but only for a few specific offending tests:
(test_xvasprintf_CFLAGS): Define.
(test_lock_CFLAGS, test_tls_CFLAGS): Define.
Paul Eggert [Wed, 13 Oct 2010 07:03:41 +0000 (09:03 +0200)]
tests: fix rand-isaac test
* gl/tests/test-rand-isaac.c (main): Fix swapped arguments to strtol.
Pádraig Brady [Tue, 12 Oct 2010 00:39:58 +0000 (01:39 +0100)]
tail: fix checking of currently unavailable directories
* src/tail.c (tail_forever_inotify): Handle the case where
tail --follow=name with inotify, is not able to add a watch on
a specified directory. This may happen due to inotify resource
limits or if the directory is currently missing or inaccessible.
In all these cases, revert to polling which will try to reopen
the file later. Note inotify returns ENOSPC when it runs out
of resources, and instead we report a particular error message,
lest users think one of their file systems is full.
(main): Document another caveat with using inotify, where we
currently don't recheck directories recreated after the
initial watch is setup.
* tests/tail-2/F-vs-rename: Fix the endless loop triggered by
the above issue.
* tests/tail-2/inotify-hash-abuse: Likewise.
* tests/tail-2/wait: Don't fail in the resource exhaustion case.
* tests/tail-2/F-vs-missing: A new test for this failure mode
which was until now just triggered on older buggy linux kernels
which returned ENOSPC constantly from inotify_add_watch().
* NEWS: Mention the fix.
Jim Meyering [Mon, 11 Oct 2010 20:41:12 +0000 (22:41 +0200)]
build: update gnulib to latest; to fix failing Solaris 5.11 test
Jim Meyering [Mon, 11 Oct 2010 17:50:44 +0000 (19:50 +0200)]
maint: add new file: .mailmap
* .mailmap: Map git author names and email addresses to
canonical/preferred form. This file is used e.g., by "git shortlog".
Jim Meyering [Fri, 8 Oct 2010 20:15:15 +0000 (22:15 +0200)]
build: update gnulib, to fix OpenBSD test failures
Jim Meyering [Fri, 8 Oct 2010 06:08:39 +0000 (08:08 +0200)]
build: update gnulib to latest; for parse-datetime.y fix
Jim Meyering [Thu, 7 Oct 2010 06:57:26 +0000 (08:57 +0200)]
build: update gnulib to latest, to avoid FreeBSD compilation failure:
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/23501
Pádraig Brady [Thu, 7 Oct 2010 12:12:36 +0000 (13:12 +0100)]
split: fix reporting of read errors
The bug was introduced with commit
23f6d41f, 19-02-2003.
* src/split.c (bytes_split, lines_split, line_bytes_split):
Correctly check the return from full_read().
* tests/misc/split-fail: Ensure split fails when
it can't read its input.
* NEWS: Mention the fix.
Jim Meyering [Wed, 6 Oct 2010 07:31:21 +0000 (09:31 +0200)]
build: update gnulib to latest, for memmem/strstr fix
Jim Meyering [Tue, 5 Oct 2010 08:50:48 +0000 (10:50 +0200)]
maint: describe coreutils' policy on copyright year number ranges
* README: Mention coreutils' long-standing policy on use of M-N
ranges in copyright year lists. Requested by Richard Stallman.
Eric Blake [Tue, 5 Oct 2010 17:47:21 +0000 (11:47 -0600)]
build: complete the rename of get_date
* gnulib: Update to latest.
* src/date.c (includes, batch_convert, main): Track rename.
* src/touch.c (includes, get_reldate): Likewise.
* doc/coreutils.texi (Top, Date input formats): Likewise.
* bootstrap.conf (gnulib_modules): Likewise.
* doc/Makefile.am (EXTRA_DIST): Likewise.
* doc/.gitignore: Likewise.
* bootstrap: Synchronize from upstream.
Eric Blake [Tue, 5 Oct 2010 15:02:37 +0000 (09:02 -0600)]
stat: drop %C support when printing file system details
* src/stat.c (print_statfs, usage): Drop %C, since it applies to
files, not file systems.
(out_file_context): Match style of other out_* functions.
(print_stat): Update caller.
* doc/coreutils.texi (stat invocation): Document %C.
* NEWS: Document the change.
Eric Blake [Tue, 5 Oct 2010 14:38:22 +0000 (08:38 -0600)]
build: fix build on Solaris 10
* gnulib: Update to latest, for reduced -lgen scope.
* bootstrap: Synchronize from upstream.
Reported by Clemens Brogi, as bug #7142.
Pádraig Brady [Tue, 5 Oct 2010 07:40:17 +0000 (08:40 +0100)]
stat: adjust the printing of SELinux context
* src/stat.c (default_format): Don't print SELinux context
when in file system (-f) mode, as the context is associated
with the file, not the file system.
Fix logic inversion, so that in terse mode, %C is included
only when is_selinux_enabled and not vice versa.
Pádraig Brady [Mon, 4 Oct 2010 15:54:22 +0000 (16:54 +0100)]
tests: refactor the stat-birthtime test to use retry_delay_
* tests/misc/stat-birthtime: This recently added test
fits the pattern of requiring a delay to pass, so get
it to use retry_delay_()
Jim Meyering [Sun, 3 Oct 2010 18:48:53 +0000 (20:48 +0200)]
maint: add a release prerequisite: check the NixOS/Hydra autobuilder
* README-release: Add a note to check the autobuilder.
Jim Meyering [Sun, 3 Oct 2010 17:24:58 +0000 (19:24 +0200)]
build: update gnulib submodule to latest
Jim Meyering [Fri, 1 Oct 2010 09:07:23 +0000 (11:07 +0200)]
maint: suppress a bogus used-uninitialized warning in tr.c
* src/tr.c (string2_extend): Insert an abort call to tell
gcc that char_to_repeat is not used uninitialized.
Eric Blake [Fri, 1 Oct 2010 21:43:23 +0000 (15:43 -0600)]
tests: output --version of program under test
This touches all new tests added since commit
b062bbd9, when
init.cfg was added. Older tests still exist that could use
conversion, but we can address those later.
* tests/sample-test: Restore hint for --version output.
* tests/misc/stat-birthtime: Include --version if verbose.
* tests/misc/tr-case-class: Likewise.
* tests/misc/stat-mount: Likewise.
* tests/misc/sort-unique: Likewise.
* tests/misc/sort-benchmark-random: Likewise.
Suggested by Jim Meyering.
Eric Blake [Fri, 1 Oct 2010 17:54:34 +0000 (11:54 -0600)]
stat: print SELinux context when available
* src/stat.c (default_format): Include context when present.
* NEWS: Update blurb explaining the replacement for -Z.
Eric Blake [Fri, 1 Oct 2010 17:44:05 +0000 (11:44 -0600)]
stat: optimize and translate default format strings
Yes, this patch intentionally leaks the results of default_format(),
since it is called only twice, and since the results are in scope
until main() exits. Not worth the extra code to pacify valgrind.
* src/stat.c (main): Hoist default format computation out of loop.
(do_statfs, do_stat): Move default format generation...
(default_format): ...into new function. Allocate the result in
pieces, rather than repeating mostly-similar chunks. Allow
translation of verbose format. Pass a second format to do_stat,
for the one aspect of the default format that is conditional on
file type.
* NEWS: Document the translation aspect.
Eric Blake [Thu, 30 Sep 2010 22:42:13 +0000 (16:42 -0600)]
stat: print timestamps to full resolution
* src/stat.c (epoch_time): New function.
(print_stat): Use it for %[WXYZ].
* NEWS: Document this.
* tests/touch/60-seconds: Adjust test to match.
* tests/misc/stat-birthtime: Likewise.
Eric Blake [Thu, 30 Sep 2010 22:31:50 +0000 (16:31 -0600)]
stat: support printing birthtime
* src/stat.c (print_stat): New %w and %W formats.
(do_stat): Include %w in default format.
(usage): Document new specifiers.
* doc/coreutils.texi (stat invocation): Likewise.
* NEWS: Likewise.
Eric Blake [Fri, 1 Oct 2010 15:38:50 +0000 (09:38 -0600)]
maint: update sample test template
* tests/sample-test: Recommend modern idiom.
Pádraig Brady [Fri, 1 Oct 2010 13:28:18 +0000 (14:28 +0100)]
maint: ensure the mbsalign module is C89 compatible
This module may be moved to gnulib at some stage,
so keep it C89 compatible.
* gl/lib/mbsalign.c (mbsalign): Declare variables at start of scope
(ambsalign): Likewise
* gl/lib/mbsalign.h: Remove trailing comma from enum
Reported by Andrei Suhan
Eric Blake [Thu, 30 Sep 2010 21:57:19 +0000 (15:57 -0600)]
maint: update gnulib
* gnulib: Update to latest.
* doc/coreutils.texi (date): Reflect new module name.
* doc/Makefile.am (EXTRA_DIST): Likewise.
* doc/.gitignore: Likewise.
Eric Blake [Thu, 30 Sep 2010 15:44:27 +0000 (09:44 -0600)]
maint: update gnulib
* gnulib: Update to latest.
* bootstrap.conf (gnulib_modules): Reflect new module name.
* bootstrap: Resync from upstream.
Jim Meyering [Thu, 30 Sep 2010 12:24:42 +0000 (14:24 +0200)]
maint: mention the du-exclude--vs--cycle-dir fix
* NEWS (Bug fixes): Mention the du-exclude--vs--cycle-dir fix.
Reported by Graham Cobb in http://bugs.debian.org/598438,
that bug was fixed by the 2010-07-24 commit,
77428214f,
"du: tune, and fix some -L bugs with dangling or cyclic symlinks"
Jim Meyering [Wed, 29 Sep 2010 12:34:20 +0000 (14:34 +0200)]
build: update gnulib submodule to latest
Pádraig Brady [Mon, 27 Sep 2010 06:16:44 +0000 (07:16 +0100)]
tr: fix various issues with case conversion
This valid translation spec aborted:
LC_ALL=en_US.iso-8859-1 tr '[:upper:]- ' '[:lower:]_'
This invalid translation spec aborted:
LC_ALL=en_US.iso-8859-1 tr '[:upper:] ' '[:lower:]'
This was caused by commit
6efd1046, 05-01-2008,
"Avoid tr case-conversion failure in some locales"
This misaligned conversion spec was allowed:
LC_ALL=C tr 'A-Y[:lower:]' 'a-z[:upper:]'
This was caused by commit
af5d0c36, 21-10-2007,
"tr: do not reject an unmatched [:lower:] or [:upper:] in SET1"
This misaligned spec was allowed by extending the class:
LC_ALL=C tr '[:upper:] ' '[:lower:]'
* src/tr.c (validate_case_classes): A new function to check
alignment of case conversion classes. Also it adjusts the
length of the sets so that locales with different numbers of
upper and lower case characters, don't cause issues.
(string2_extend): Disallow extending the case conversion
class as in the above example. That is locale dependent
and most likely not what the user wants.
(validate): Do the simple test for "restricted" char classes
earlier, so we don't redundantly do more expensive validation.
(main): Remove the case class validation, and simplify.
* tests/misc/tr-case-class: A new test to test the various
alignment and locale issues, associated with case conversion.
* tests/misc/tr: Move case conversion tests to new tr-case-class.
* tests/Makefile.am: Reference the new test.
* NEWS: Mention the fixes.
Paul Eggert [Mon, 20 Sep 2010 23:27:11 +0000 (16:27 -0700)]
build: update gnulib submodule to latest
Paul Eggert [Mon, 20 Sep 2010 22:44:31 +0000 (15:44 -0700)]
sort: destroy spin locks portably
* src/sort.c (sortlines, sort): Use pthread_spin_destroy when a
spin lock is no longer used. This isn't needed on GNU/Linux or
Solaris, but POSIX says it may free up resources on some platforms.
Pádraig Brady [Mon, 20 Sep 2010 14:23:20 +0000 (15:23 +0100)]
tests: fix a printf portability issue
* tests/misc/sort-debug-keys: Don't depend on
printf supporting \xhh format, which isn't supported
by dash for example. Also change from double quoted
strings to single quoted, when we don't need any
variable interpolation.
Pádraig Brady [Mon, 20 Sep 2010 14:07:02 +0000 (15:07 +0100)]
tests: fix an erroneous stat failure with bind mounts
* tests/misc/stat-mount: Don't try to correlate the
mount points output by df and stat, as they're similar,
but sometimes different in the presence of bind mounts.
* doc/coretuils.texi (stat invocation): Clarify the
bind mount difference between stat and df.
Jim Meyering [Sat, 18 Sep 2010 20:35:04 +0000 (22:35 +0200)]
build: update gnulib submodule to latest
Jim Meyering [Sat, 18 Sep 2010 19:22:16 +0000 (21:22 +0200)]
tests: sync tests/init.sh from gnulib
* tests/init.sh: Update from gnulib.
Jim Meyering [Sat, 18 Sep 2010 18:24:41 +0000 (20:24 +0200)]
build: use gnulib's new termios module
With it, we can remove the two sole tests of HAVE_TERMIOS_H.
* bootstrap.conf (gnulib_modules): Add termios.
* src/ls.c: Don't test HAVE_TERMIOS_H.
* src/stty.c: Likewise.
* m4/jm-macros.m4 (gl_CHECK_ALL_TYPES): Remove configure-time
test for termios.h.