platform/upstream/coreutils.git
15 years agotests: df/total-verify: avoid test failure with older Perl
Jim Meyering [Thu, 19 Mar 2009 17:48:46 +0000 (18:48 +0100)]
tests: df/total-verify: avoid test failure with older Perl

* tests/df/total-verify: Don't use perl's -f option.
Reported by Matthew Woehlke.

15 years ago* gnulib: Update submodule to latest.
Jim Meyering [Thu, 19 Mar 2009 06:55:03 +0000 (07:55 +0100)]
* gnulib: Update submodule to latest.

15 years agotests: adjust sort-continue not to fail under valgrind
Jim Meyering [Tue, 17 Mar 2009 20:23:51 +0000 (21:23 +0100)]
tests: adjust sort-continue not to fail under valgrind

* tests/misc/sort-continue: Don't run cat inside fd-limited shell.
If sort fails to run in an fd-limited shell, skip the test.

15 years agotests: add another sort/nmerge test
Paul Eggert [Mon, 9 Mar 2009 21:56:13 +0000 (14:56 -0700)]
tests: add another sort/nmerge test

* tests/Makefile.am (TESTS): Add sort-merge-fdlimit.
* tests/misc/sort-merge-fdlimit: New file.
* doc/coreutils.texi (sort invocation): Document that we now silently
lower nmerge if necessary.
Patch by Paul Eggert, Nima Nikzad, Max Chang, Alexander Nguyen,
Sahil Amoli, and Nick Graham.

15 years agosort: handle fd exhaustion better when merging
Paul Eggert [Fri, 13 Mar 2009 22:48:30 +0000 (15:48 -0700)]
sort: handle fd exhaustion better when merging

This is an alternative to my 9 March patch labeled "Silently lower
nmerge; don't (sometimes incorrectly) range-check"
<http://lists.gnu.org/archive/html/bug-coreutils/2009-03/msg00070.html>.
It differs by not using 'dup' to probe for extra file descriptors;
instead, it simply calls 'open' (and 'pipe') to open files and pipes,
until one of these calls fails due to file descriptor exhaustion; it
then backs off by 1, does a merge with the files that it has opened,
and then retries with the (now-smaller) number of files.

This patch requires quite a few more changes to the source code than
the earlier patch, but it is in some sense "better" because it doesn't
need to call "dup" ahead of time in order to decide whether "open" or
"pipe" will fail.  Also, it's more robust in the case where "open" or
"pipe" fails with errno==EMFILE because some system-wide limit is
exhausted.

* src/sort.c (create_temp_file): New arg SURVIVE_FD_EXHAUSTION.
(stream_open): New function, containing guts of xfopen.
(xfopen): Use it.
(pipe_fork): Set errno on failure.
(maybe_create_temp): New function, containing guts of create_temp.
(create_temp): Use it.
(open_temp): Distinguish failures due to file descriptor exhaustion
from other failures, and on fd exhaustion return a notice to caller
rather than dying.  Don't test execlp's return value; when it returns,
it *always* returns -1.
(open_input_files): New function.
(mergefps): New arg FPS. It's now the caller's responsibility to open
the input and output files.  All callers changed.
(mergefiles): New function.
(avoid_trashing_input, merge): Handle the case where a single merge
can't merge as much as we wanted due to file descriptor exhaustion, by
merging as much as we can and then retrying.
* tests/Makefile.am (TESTS): Add misc/sort-continue.
* tests/misc/sort-continue: New file.
* THANKS: Add Glen Lenker and Matt Pham who coauthored this patch.

15 years agomaint: normalize leading-TAB indentation in Makefiles
Jim Meyering [Wed, 18 Mar 2009 11:20:32 +0000 (12:20 +0100)]
maint: normalize leading-TAB indentation in Makefiles

* maint.mk (sc_makefile_TAB_only_indentation): New rule.
Replace each TAB+8-space sequence with two TABs.
* man/Makefile.am: Likewise.
* build-aux/check.mk: Likewise.
I used this command (run it more than once, if needed):
t=$'\t'; git grep -l -E "$t {8}"|grep -E 'Makefile|\.mk$' \
| xargs perl -pi -e 's/\t {8}/\t\t/'

15 years agomaint: remove long-unused Makefile
Jim Meyering [Sun, 15 Mar 2009 20:40:54 +0000 (21:40 +0100)]
maint: remove long-unused Makefile

* tests/sort-time/Makefile: Remove long-unused file.

15 years agomaint: remove unused include and definitions
Jim Meyering [Sat, 14 Mar 2009 11:48:44 +0000 (12:48 +0100)]
maint: remove unused include and definitions

* gl/lib/randread.c (__attribute__): Remove unused definition.
(ATTRIBUTE_UNUSED): Likewise.
* gl/lib/selinux-at.c (_): Remove unused definition.
Don't include <gettext.h>.  No longer needed.

15 years ago* gnulib: Update submodule to latest.
Jim Meyering [Sun, 15 Mar 2009 07:09:53 +0000 (08:09 +0100)]
* gnulib: Update submodule to latest.

15 years agosystem.h: correct compilation error: MAX not defined
Jim Meyering [Sat, 14 Mar 2009 20:29:33 +0000 (21:29 +0100)]
system.h: correct compilation error: MAX not defined

* src/system.h (io_blksize): Move definition down, so it follows that
of MAX -- to avoid compilation failure on OpenSolaris.  Reported by
David Bartley.  Details in
http://lists.gnu.org/archive/html/bug-coreutils/2009-03/msg00190.html

15 years ago* gnulib: Update to pull in select/interix work-around.
Jim Meyering [Sat, 14 Mar 2009 10:49:56 +0000 (11:49 +0100)]
* gnulib: Update to pull in select/interix work-around.

15 years agodoc: update "version sort" documentation
Kamil Dudka [Wed, 25 Feb 2009 09:10:36 +0000 (10:10 +0100)]
doc: update "version sort" documentation

* doc/coreutils.texi: Reflect current filevercmp behavior.

15 years agotests: groups-version: don't require that id be built
Jim Meyering [Thu, 12 Mar 2009 13:41:38 +0000 (14:41 +0100)]
tests: groups-version: don't require that id be built

* tests/misc/groups-version: groups is now independent of id.

15 years agotests: skip the groups-dash test when "groups" is not built
Jim Meyering [Thu, 12 Mar 2009 13:40:45 +0000 (14:40 +0100)]
tests: skip the groups-dash test when "groups" is not built

* tests/misc/groups-dash: Skip if groups is not being installed.
Suggested by Mike Frysinger.
Also fail if groups exits with nonzero status.

15 years agomaint: mention Autoconf version required to build Automake
Pádraig Brady [Thu, 12 Mar 2009 14:16:54 +0000 (14:16 +0000)]
maint: mention Autoconf version required to build Automake

* README-prereq: coreutils currently requires an unreleased
version of Automake, so mention the minimum version of Autoconf
required to build that. Suggestion from James Youngman.

15 years ago* gnulib: Update submodule to latest.
Jim Meyering [Thu, 12 Mar 2009 09:46:31 +0000 (10:46 +0100)]
* gnulib: Update submodule to latest.

15 years agocp: make -a option preserve xattrs, but with reduced diagnostics
Ondřej Vašík [Wed, 11 Mar 2009 15:08:20 +0000 (16:08 +0100)]
cp: make -a option preserve xattrs, but with reduced diagnostics

* copy.c (copy_attr_by_fd): Reduce xattr diagnostics for 'cp -a'.
(copy_attr_by_name): Likewise.
* cp.c (main): Preserve xattrs with -a option, when possible.
* doc/coreutils.texi: Document that xattrs are preserved with
cp -a, with no added diagnostics.
* NEWS: Mention the change.
* tests/misc/xattr: Add tests for 'cp --preserve=all' and 'cp -a'.

15 years agomaint: Document how to best to enable gcc warnings for developers
Pádraig Brady [Wed, 11 Mar 2009 12:09:08 +0000 (12:09 +0000)]
maint: Document how to best to enable gcc warnings for developers

* README-hacking: Mention --enable-gcc-warnings configure option
* configure.ac: Don't scare developers away from using gcc warnings

15 years agomaint: remove an obsolete FIXME comment
Jim Meyering [Tue, 10 Mar 2009 09:04:23 +0000 (10:04 +0100)]
maint: remove an obsolete FIXME comment

* src/Makefile.am (../AUTHORS): Remove obsolete FIXME comment.
There are no longer any installed *.sh programs.

15 years agocat: Fix immediate output of processed data
Pádraig Brady [Wed, 11 Mar 2009 11:39:33 +0000 (11:39 +0000)]
cat: Fix immediate output of processed data

Introduced by commit 790892db, 2006-06-08 "Ensure that cat works ...".
* NEWS: Mention the bugfix.
* src/cat.c (cat): Fix the typo which stopped the writing
of processed data before a blocking read() is done.
* tests/misc/cat-buf: Add to ensure processed data is not buffered.
* tests/Makefile.am: Reference the new test.

15 years agocat,cp,mv,install,split: Set the minimum IO block size used to 32KiB
Pádraig Brady [Fri, 6 Mar 2009 22:30:55 +0000 (22:30 +0000)]
cat,cp,mv,install,split: Set the minimum IO block size used to 32KiB

This is following on from this change:
[02c3dc9d 2008-03-06 cat: use larger buffer sizes ...]
which increased the IO block size used by cat by 8 times,
but also capped it at 32KiB.
* NEWS: Mention the change in behavior.
* src/system.h: Add a new io_blksize() function that
returns the max of ST_BLKSIZE or 32KiB, as this was
seen as a good value for a minimum block size to use
to get good performance while minimizing system call overhead.
* src/cat.c: Use it.
* src/copy.c: ditto
* src/split.c: ditto

15 years agotests: add a test for newly-fixed bug in comm --check-order
Jim Meyering [Sun, 8 Mar 2009 17:37:08 +0000 (18:37 +0100)]
tests: add a test for newly-fixed bug in comm --check-order

* tests/misc/comm (ooo-prefix): Add a test for today's fix.
* NEWS (Bug fixes): Mention it.

15 years agocomm: fix a bug in its new --check-order option
Bruno Haible [Sun, 8 Mar 2009 17:25:29 +0000 (18:25 +0100)]
comm: fix a bug in its new --check-order option

* src/comm.c: Include memcmp2.h.
(check_order): Use memcmp2 instead of memcmp.
* bootstrap.conf (gnulib_modules): Add memcmp2.

15 years agotests: ls -v: exercise the bug fixed by gnulib's new filevercmp
Jim Meyering [Sat, 7 Mar 2009 19:41:00 +0000 (20:41 +0100)]
tests: ls -v: exercise the bug fixed by gnulib's new filevercmp

* tests/misc/ls-misc (version-sort): New test.
(mk_file): New function.
Reported by Josh Triplett in <http://bugs.debian.org/517558>.
Details in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/16902
* NEWS (Bug fixes): Mention it.

15 years agognulib: sync submodule to latest
Jim Meyering [Sun, 8 Mar 2009 20:16:30 +0000 (21:16 +0100)]
gnulib: sync submodule to latest

15 years agopr: fix a bug whereby --indent=N (-o) did not indent header lines
Jim Meyering [Fri, 6 Mar 2009 19:03:26 +0000 (20:03 +0100)]
pr: fix a bug whereby --indent=N (-o) did not indent header lines

* src/pr.c (print_header): Honor chars_per_margin also for the header.
Inspired by a patch from C de-Avillez.
This change also adjusts two other %*s directives to be %*.*s instead,
(for the padding on either side of "file_text") to correct a bug that
could make pr print one space of padding instead of none.
* NEWS (Bug fixes): Mention it.
* tests/pr/o3Jml24f-lm-lo: Adjust for new expected output.
* tests/pr/o3a3Sl24f-tn: Likewise.
* tests/pr/o3a3Snl24f-tn: Likewise.
* tests/pr/o3a3l24f-tn: Likewise.
* tests/pr/o3b3Sl24f-tn: Likewise.
* tests/pr/o3b3Snl24f-tn: Likewise.
* tests/pr/o3b3l24f-tn: Likewise.
* tests/pr/o3mSl24f-bl-tn: Likewise.
* tests/pr/o3mSnl24fbltn: Likewise.
* tests/pr/o3ml24f-bl-tn: Likewise.

15 years agobootstrap: add to XGETTEXT_OPTIONS
Jim Meyering [Sat, 7 Mar 2009 15:20:55 +0000 (16:20 +0100)]
bootstrap: add to XGETTEXT_OPTIONS

* bootstrap.conf (XGETTEXT_OPTIONS): Add c-format --flag options
for verror and verror_at_line; alphabetize.

15 years agomaint: use a git submodule for gnulib
Jim Meyering [Sat, 7 Mar 2009 09:19:46 +0000 (10:19 +0100)]
maint: use a git submodule for gnulib

* .gitmodules: New file, to track gnulib.
* gnulib: New file, created by running this:
git submodule add git://git.sv.gnu.org/gnulib.git gnulib

15 years agobuild: allow ./bootstrap --srcdir=... to work with a git submodule
Jim Meyering [Sat, 7 Mar 2009 15:11:54 +0000 (16:11 +0100)]
build: allow ./bootstrap --srcdir=... to work with a git submodule

* bootstrap (git_modules_config): Use GIT_CONFIG, not GIT_CONFIG_LOCAL.
The latter was removed in v1.5.6.1-109-gdc87183.

15 years agobuild: avoid "multiply defined..." warning from automake
Jim Meyering [Sat, 7 Mar 2009 12:27:29 +0000 (13:27 +0100)]
build: avoid "multiply defined..." warning from automake

* Makefile.am (AM_CFLAGS): Add $(WARN_CFLAGS) via +=, not =, to
avoid "multiply defined..." warning from automake.

15 years agocat: use larger buffer sizes to reduce read/write-syscall overhead
Jim Meyering [Fri, 6 Mar 2009 09:27:43 +0000 (10:27 +0100)]
cat: use larger buffer sizes to reduce read/write-syscall overhead

* src/cat.c (max): Remove definition.  Use MAX from system.h instead.
(compute_buffer_size): New function to compute the input and output
buffer sizes, which are now set at 8 times st_blksize with a maximum
of 32KiB. Previously the typical block sizes used were 1KiB for pipes
and 4KiB for files, and now will be 8KiB and 32KiB respectively.
(main): Use it.
This change can double throughput on modern systems.  For timings,
see http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/16040
Suggestion from Tzvi Rotshtein.

15 years agomaint: avoid new unused-macro warnings from gcc
Jim Meyering [Fri, 6 Mar 2009 09:49:18 +0000 (10:49 +0100)]
maint: avoid new unused-macro warnings from gcc

* src/ls.c (ASSERT_MATCHING_DEV_INO): Comment-out unused definition,
to match commented-out use.
* src/install.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE):
(READ_SIZE): Remove definitions of unused macros.
* src/mv.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE): Likewise.
* src/dd.c (max): Likewise.
* src/expand.c (OUTPUT_BLOCK): Likewise.
* src/csplit.c (ALLOC_SIZE): Likewise.
* src/pr.c (NULLCOL): Likewise.
* src/ptx.c (Sword): Likewise.
* src/unexpand.c (OUTPUT_BLOCK): Likewise.
* src/factor.c (NDEBUG): Likewise.

15 years agotests: fix just-introduced typo in rm/ext3-perf
Jim Meyering [Fri, 6 Mar 2009 10:12:32 +0000 (11:12 +0100)]
tests: fix just-introduced typo in rm/ext3-perf

* tests/rm/ext3-perf: Fix typo in commit 2b1e6636bea,
2009-02-27 "tests: rm/ext3-perf: relax this test".

15 years agomaint: remove spurious case-ignoring option from a test
Jim Meyering [Fri, 6 Mar 2009 06:18:09 +0000 (07:18 +0100)]
maint: remove spurious case-ignoring option from a test

* maint.mk (sc_trailing_blank): Remove useless/harmless ignore_case=1.

15 years agopolicy: use git to help avoid trailing white space
Ralf Wildenhues [Mon, 2 Mar 2009 21:33:05 +0000 (22:33 +0100)]
policy: use git to help avoid trailing white space

* HACKING (Avoid trailing white space): Describe how git can help.

15 years agoUpdate Andreas Schwab's email address
Andreas Schwab [Tue, 3 Mar 2009 17:12:25 +0000 (18:12 +0100)]
Update Andreas Schwab's email address

* THANKS: Update Andreas Schwab's email address.

15 years agomaint: improve release-related process and documentation
Jim Meyering [Tue, 3 Mar 2009 07:24:29 +0000 (08:24 +0100)]
maint: improve release-related process and documentation

* README-release: Fix typo. it's "maintainer-clean".
Refer to HACKING for full list of dependencies.
Use cvs add's -ko option to inhibit $Id$-style keyword expansion.
* maint.mk (web-manual): Factor out definition of $(manual_title).
(vc-dist): Set XZ_OPT=-9ev for the final "make dist".
* cfg.mk (manual_title): Define it here.
Suggestions from Eric Blake.

15 years agodist: document our release procedure
Jim Meyering [Sun, 1 Mar 2009 20:29:21 +0000 (21:29 +0100)]
dist: document our release procedure

* README-release: New file.

15 years agodist: automate the post-release web-manual update process
Jim Meyering [Fri, 27 Feb 2009 12:56:49 +0000 (13:56 +0100)]
dist: automate the post-release web-manual update process

* maint.mk (web-manual): New rule, from m4's maint.mk.
* bootstrap.conf (gnulib_modules): Add gendocs.

15 years agotests: rm/ext3-perf: relax this test
Jim Meyering [Fri, 27 Feb 2009 11:54:01 +0000 (12:54 +0100)]
tests: rm/ext3-perf: relax this test

* tests/rm/ext3-perf: If set-up takes too long, use the set-up time
as the removal time limit.  Otherwise, a parallel "make check" would
usually fail when run with RUN_VERY_EXPENSIVE_TESTS=yes.

15 years agotests: don't skip setgid-dir related tests on SELinux-enabled systems
Jim Meyering [Fri, 27 Feb 2009 08:09:18 +0000 (09:09 +0100)]
tests: don't skip setgid-dir related tests on SELinux-enabled systems

* tests/setgid-check: The change in ls (use ".", not "+") caused
this check always to report the working directory as set-gid.
Now, use stat, not ls.

15 years agotests: reflect the s/+/./ SELinux indicator change
Jim Meyering [Fri, 27 Feb 2009 08:16:45 +0000 (09:16 +0100)]
tests: reflect the s/+/./ SELinux indicator change

* tests/mkdir/perm: Now that this test is no longer always skipped,
make it work independently of ls: use stat, not ls, to get perm string.
* test-lib.sh (rwx_to_mode_): Use stat, not ls to get perm string
This test was run only when RUN_VERY_EXPENSIVE_TESTS=yes was set.

15 years agotests: when skipping a test, say why on screen, not just in the log
Jim Meyering [Fri, 27 Feb 2009 08:12:14 +0000 (09:12 +0100)]
tests: when skipping a test, say why on screen, not just in the log

* tests/test-lib.sh: Redirect also to descriptor 9.
Better one-line why-skip diagnostics.
* tests/check.mk (TESTS_ENVIRONMENT): Redirect 9 to stderr.
* tests/misc/pwd-unreadable-parent: Remove redundant "skipping..." diag.

15 years agomaint: enable many gcc warnings
Jim Meyering [Sat, 14 Feb 2009 10:29:20 +0000 (11:29 +0100)]
maint: enable many gcc warnings

* bootstrap.conf (gnulib_modules): Add manywarnings.
* configure.ac: Use gl_MANYWARN_ALL_GCC, and exclude options
I don't want or that provoke too many warnings.
(WARN_CFLAGS, WERROR_CFLAGS): Define.
(lint, GNULIB_PORTCHECK): Define.
(_FORTIFY_SOURCE): Define to 2.

15 years agomaint: avoid gcc warning about missing attributes
Jim Meyering [Sat, 14 Feb 2009 10:22:22 +0000 (11:22 +0100)]
maint: avoid gcc warning about missing attributes

* src/prog-fprintf.h (prog_fprintf): Declare with printf attribute.
* src/system.h (usage): Declare with the "noreturn" attribute.

15 years agomaint: avoid warnings about potentially-counterproductive "inline"
Jim Meyering [Sat, 14 Feb 2009 10:26:14 +0000 (11:26 +0100)]
maint: avoid warnings about potentially-counterproductive "inline"

* src/dd.c (quit): Remove "inline" attribute.
* src/test.c (advance, unary_advance): Likewise.

15 years agomaint: cp: avoid gcc warning about unused macro definitions
Jim Meyering [Sat, 14 Feb 2009 09:45:53 +0000 (10:45 +0100)]
maint: cp: avoid gcc warning about unused macro definitions

* src/cp.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE): Remove.

15 years agodist: do not emit MD5 or SHA1 checksums into announcement template
Jim Meyering [Mon, 2 Mar 2009 07:40:41 +0000 (08:40 +0100)]
dist: do not emit MD5 or SHA1 checksums into announcement template

* maint.mk (announcement): Use announce-gen's new --no-print-checksums.

15 years agomaint: detect unnecessary inclusion of signal.h
Jim Meyering [Tue, 24 Feb 2009 20:43:26 +0000 (21:43 +0100)]
maint: detect unnecessary inclusion of signal.h

* maint.mk (sc_prohibit_signal_without_use): New rule.

15 years agomaint: remove an unnecessary inclusion of <signal.h>
Jim Meyering [Tue, 24 Feb 2009 20:44:51 +0000 (21:44 +0100)]
maint: remove an unnecessary inclusion of <signal.h>

* src/operand2sig.c: Don't include <signal.h>.

15 years agotests: sort: Check skipping blanks in multibyte locales
Pádraig Brady [Fri, 27 Feb 2009 08:40:42 +0000 (08:40 +0000)]
tests: sort: Check skipping blanks in multibyte locales

* tests/misc/sort: On Fedora 8 at least, sort -k1b,1
mishandles blanks in multibyte locales, so add test.

15 years ago* HACKING: avoid trailing white space
Jim Meyering [Wed, 25 Feb 2009 14:37:58 +0000 (15:37 +0100)]
* HACKING: avoid trailing white space

15 years agocp: diagnose invalid "cp -rl dir dir" right away, once again
Jim Meyering [Fri, 27 Feb 2009 08:23:44 +0000 (09:23 +0100)]
cp: diagnose invalid "cp -rl dir dir" right away, once again

Running "mkdir dir; cp -rl dir dir" would create dir/dir/dir/...
rather than diagnosing the "copy-into-self" failure.

The easy fix would have been to revert this part of the change
[3ece0355 2008-11-09 cp: use far less memory in some cases]
that introduced the bug:

-         remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev);
+         if (!x->hard_link)
+           remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev);

However, that would have induced the failure of the new cp/link-heap
test, due to the added memory pressure of recording 10k dev/ino pairs.
And besides, I liked that improvement and wanted to keep it.

Now that it's obvious recording the just-created-directory dev/ino
needn't depend on the setting of hard_link, I realized it is necessary
to record the pair only for the first directory created for each
source command-line argument.

I made that change, then noticed the new test, cp -rl a d d, would pass
when run once, yet output the into-self diagnostic twice.  Also note
the side effect: it creates d/a and d/d.  However, running that same
command a second time, now with the modified directory, would fail.

That turned out to be due to the fact that although the first into-self
failure was detected in copy_dir, that function would continue copying
other entries regardless -- and that would make it fail (eventually)
with the unwanted recursion.

* src/copy.c (copy_internal): This function needed an indicator of
whether, for a give command line argument, it had already created its
first directory.  If so, no more need to record dev/ino pairs.  If this
is the first, then do record its pair.  Hence, the new parameter.
(copy_dir, copy): Update callers.
(copy_dir): Upon any into-self failure, break out of the loop.
* tests/cp/into-self: Test for the above.
Reported by Mikael Magnusson.

15 years agotests: stty-row-col would hang when run in the background
Jim Meyering [Thu, 26 Feb 2009 19:25:42 +0000 (20:25 +0100)]
tests: stty-row-col would hang when run in the background

* tests/misc/stty-row-col: Don't hang when run in background
at least on Solaris 10 and OpenBSD.

15 years agosort: Fix two bugs with determining the end of field
Pádraig Brady [Tue, 24 Feb 2009 08:37:18 +0000 (08:37 +0000)]
sort: Fix two bugs with determining the end of field

* src/sort.c: When no specific number of chars to skip
is specified for the end field, always skip the whole field.
Also never include leading spaces from next field.
* tests/misc/sort: Add 2 new tests for these cases.
* NEWS: Mention this bug fix.
* THANKS: Add bug reporter.
Reported by Davide Canova.

15 years agoargv-iter: avoid variadic macro
Eric Blake [Thu, 26 Feb 2009 13:54:48 +0000 (06:54 -0700)]
argv-iter: avoid variadic macro

* gl/lib/argv-iter.h (_ATTRIBUTE_NONNULL_): Don't assume C99 variadic
macros are portable yet; needed for at least IRIX/MIPSpro.
* THANKS: Update.
Reported by Stuart Shelton.

15 years agotests: Remove system specific error strings
Pádraig Brady [Thu, 26 Feb 2009 00:01:06 +0000 (00:01 +0000)]
tests: Remove system specific error strings

* tests/dd/skip-seek-past-file: Just check for
the non system specific part of the error strings.
This was causing an erroneous failure on NetBSD 1.6 at least.

15 years agotests: using printf with \e for ESC isn't portable
Jim Meyering [Wed, 25 Feb 2009 18:51:04 +0000 (19:51 +0100)]
tests: using printf with \e for ESC isn't portable

* tests/ls/color-clear-to-eol: Use \33, not \e for ascii ESC.
This test failed when using the built-in printf of /bin/sh from
NetBSD 1.6.

15 years agoEnsure comment for translators is included in po file
Pádraig Brady [Tue, 24 Feb 2009 09:47:00 +0000 (09:47 +0000)]
Ensure comment for translators is included in po file

Issue reported by Göran Uddeborg.

* src/system.h: Move the translator comment adjacent
to the translated string.
* THANKS: Update Göran's email address.

15 years agotruncate: fix typo in man page
Tobias Stoeckmann [Sun, 22 Feb 2009 15:30:48 +0000 (16:30 +0100)]
truncate: fix typo in man page

* man/truncate.x: Fix spelling.
* THANKS: Update.

15 years agodoc: describe dd's status=noxref option
Andrew Church [Sun, 22 Feb 2009 09:25:01 +0000 (10:25 +0100)]
doc: describe dd's status=noxref option

* doc/coreutils.texi (dd invocation): Describe status=noxref.

15 years agotests: reenable temporarily-disabled tests using e.g., trap '' TTOU
Jim Meyering [Sun, 22 Feb 2009 00:42:43 +0000 (01:42 +0100)]
tests: reenable temporarily-disabled tests using e.g., trap '' TTOU

Revert "tests: skip newly-modified tests unconditionally..."
This reverts commit 773a88d33f68e50a2919c8a8310c646a7e5fabc2.
* tests/misc/stty: Don't skip.
* tests/misc/stty-invalid: Likewise.
* tests/mv/i-3: Likewise.

15 years agoupdate James Youngman's email address
James Youngman [Sun, 22 Feb 2009 00:41:13 +0000 (00:41 +0000)]
update James Youngman's email address

* THANKS: Update James Youngman's email address

15 years agopost-release administrivia
Jim Meyering [Sat, 21 Feb 2009 21:49:24 +0000 (22:49 +0100)]
post-release administrivia

* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.

15 years agoversion 7.1 v7.1
Jim Meyering [Sat, 21 Feb 2009 21:35:33 +0000 (22:35 +0100)]
version 7.1

* NEWS: Record release date.

15 years ago* README: Mention that c99-to-c89.diff is no longer maintained.
Jim Meyering [Sat, 21 Feb 2009 20:31:34 +0000 (21:31 +0100)]
* README: Mention that c99-to-c89.diff is no longer maintained.

15 years agotests: skip new install-C test if working directory is set-gid
Jim Meyering [Sat, 21 Feb 2009 18:48:30 +0000 (19:48 +0100)]
tests: skip new install-C test if working directory is set-gid

* tests/install/install-C: Use setgid-check.

15 years agotests: skip newly-modified tests unconditionally, just to be safe
Jim Meyering [Sat, 21 Feb 2009 14:56:26 +0000 (15:56 +0100)]
tests: skip newly-modified tests unconditionally, just to be safe

* tests/misc/stty-invalid: Skip.
* tests/misc/stty: Likewise.
* tests/mv/i-3: Likewise.

15 years agotests: don't let SIGTTOU/TTIN hang a backgrounded "make check"
Jim Meyering [Sat, 21 Feb 2009 10:30:41 +0000 (11:30 +0100)]
tests: don't let SIGTTOU/TTIN hang a backgrounded "make check"

Running "make check &" would hang due to SIGTTOU and SIGTTIN signals.
* tests/misc/stty: Ignore SIGTTOU.
* tests/misc/stty-invalid: Likewise.
* tests/mv/i-3: Ignore SIGTTIN.

15 years agodoc: ls: clarify description of -s
Jim Meyering [Fri, 20 Feb 2009 18:31:31 +0000 (19:31 +0100)]
doc: ls: clarify description of -s

* src/ls.c (usage): Make the description of -s mention "allocated size",
so that it's less likely to be confused with an apparent byte-count.
Suggested by Vito Caputo.

15 years agodoc: dd: document that the default block size is 512 bytes
Jim Meyering [Thu, 19 Feb 2009 11:35:58 +0000 (12:35 +0100)]
doc: dd: document that the default block size is 512 bytes

* src/dd.c (usage): Document the default block size.
* doc/coreutils.texi (dd invocation): Document that the default
block size (bs, ibs, obs) is 512 bytes.
Reported by Petr Uzel.

15 years agomaint: changing NEWS' copyright date must not invalidate checksum
Jim Meyering [Wed, 18 Feb 2009 15:09:45 +0000 (16:09 +0100)]
maint: changing NEWS' copyright date must not invalidate checksum

* maint.mk (NEWS_hash): Don't let the Copyright date line contribute
to the checksum.
* cfg.mk (old_NEWS_hash): Update to reflect the new policy.

15 years agodoc: explain how to recover from changes committed to master
Jim Meyering [Wed, 18 Feb 2009 13:50:04 +0000 (14:50 +0100)]
doc: explain how to recover from changes committed to master

* HACKING: A beginner's commit-to-master is so common,
and causes enough confusion, that we describe how to recover.

15 years agomaint: add copyright notices
Jim Meyering [Wed, 18 Feb 2009 13:34:23 +0000 (14:34 +0100)]
maint: add copyright notices

* HACKING: Add copyright notice.
* tests/test-lib.sh: Likewise.

15 years agocp: -a now preserves SELinux context, with reduced diagnostics
Ondřej Vašík [Tue, 17 Feb 2009 14:53:39 +0000 (15:53 +0100)]
cp: -a now preserves SELinux context, with reduced diagnostics

* copy.c (copy_reg): Reduce SELinux context diagnostics for 'cp -a'.
(copy_internal): Likewise
* copy.h (cp_options): Add boolean reduce_diagnostics.
* cp.c (usage): Say that --archive (-a) behaves like -dR --preserve=all.
(cp_option_init): Initialize added reduce_diagnostics.
(main): Add reduce_diagnostics for the -a option, and preserve SELinux
context, if possible.
* mv.c (cp_options_init): Initialize new cp_options booleans.
* install.c (cp_option_init): Likewise.
* NEWS: Mention those behaviour changes.
* doc/coreutils.texi: Document --preserve=context, document that
diagnostics are not shown for failures of non-mandatory attributes
(just SELinux at the moment).
* tests/cp/cp-a-selinux: Check not only failures, but succesful use
of preserving SELinux context in cp.

15 years agoadd missing copyright dates
Eric Blake [Wed, 18 Feb 2009 13:07:30 +0000 (06:07 -0700)]
add missing copyright dates

* NEWS: Add 2009 to copyright.
* README: Likewise.
* README-hacking: Likewise.
* TODO: Likewise.
* doc/Makefile.am: Likewise.
* m4/prereq.m4: Likewise.
* src/nl.c: Likewise.
* src/seq.c: Likewise.
* tests/cp/cp-i: Likewise.
* tests/install/install-C: Likewise.
* tests/install/install-C-root: Likewise.
* tests/install/install-C-selinux: Likewise.
* tests/misc/seq: Likewise.
* tests/mv/mv-n: Likewise.

15 years agoinstall: compare files in binary mode
Eric Blake [Tue, 17 Feb 2009 14:58:39 +0000 (07:58 -0700)]
install: compare files in binary mode

* src/install.c (need_copy): Use O_BINARY when it matters.

15 years agoinstall: add --compare (-C) option to install file only when necessary
Kamil Dudka [Tue, 17 Feb 2009 12:16:54 +0000 (13:16 +0100)]
install: add --compare (-C) option to install file only when necessary

* src/install.c (have_same_content): New function to compare files
content.
(extra_mode): New function checking for non-permission bits in mode.
(need_copy): New function to check if copy is necessary.
(main): Handle new option --compare (-C).
(copy_file): Skip file copying if not necessary.
(usage): Show new option --compare (-C) in --help.
* tests/install/install-C: Basic tests for install --compare (-C).
* tests/install/install-C-root: Tests requiring root privileges.
* tests/install/install-C-selinux: Tests requiring SELinux.
* tests/Makefile.am: Add new tests for install --compare (-C).
* doc/coreutils.texi: Document new install option --compare (-C).
* NEWS: Mention the change.

15 years agonl: correct long-option name for -v in usage
Ondřej Vašík [Tue, 17 Feb 2009 12:29:33 +0000 (13:29 +0100)]
nl: correct long-option name for -v in usage

* nl.c (usage): Use --starting-line-number, not --first-page for -v

15 years agodoc: id: make --help and .man more descriptive
Jim Meyering [Sat, 14 Feb 2009 08:09:17 +0000 (09:09 +0100)]
doc: id: make --help and .man more descriptive

* src/id.c (usage): Improve description, based on a suggestion
from Brian M. Carlson in http://bugs.debian.org/514675
* man/id.x: Use a better one-liner, based on the one at top of id.c.

15 years agoseq: Fix equal width calculation when '.' added to last number
Pádraig Brady [Sat, 14 Feb 2009 17:20:37 +0000 (17:20 +0000)]
seq: Fix equal width calculation when '.' added to last number

Issue reported by Samuel Hapák.
<http://lists.gnu.org/archive/html/bug-coreutils/2009-02/msg00139.html>

* src/seq.c: Account for '.' added to "last" number.
* tests/misc/seq: Add corresponding test.
* NEWS: Mention the fix.

15 years agodu,chgrp,chmod,chown: use FTS_DEFER_STAT
Jim Meyering [Wed, 11 Feb 2009 11:26:14 +0000 (12:26 +0100)]
du,chgrp,chmod,chown: use FTS_DEFER_STAT

* src/du.c (main): Use FTS_DEFER_STAT, for better locality of inode
reference.  Important when traversing file systems with fake inodes.
* src/chgrp.c (main): Likewise.
* src/chmod.c (main): Likewise.
* src/chown.c (main): Likewise.
The only remaining fts client, chcon, doesn't need this, since it goes
further and uses FTS_NOSTAT, which suppresses all non- directory
stat calls.

15 years agomaint: mention how to run a single test in HACKING docs
Pádraig Brady [Thu, 12 Feb 2009 13:51:03 +0000 (13:51 +0000)]
maint: mention how to run a single test in HACKING docs

* HACKING: Give an example of how to run a test in isolation.
* README: Fix/simplify example for running a single test.
* README-hacking: Reference the HACKING file.

15 years agoln: add details to --help text
Eric Blake [Thu, 12 Feb 2009 04:09:09 +0000 (21:09 -0700)]
ln: add details to --help text

* src/ln.c (usage): Mention more about symlink properties.
* doc/coreutils.texi (ln invocation): Likewise.
* THANKS: Update.
Reported by Vitali Lovich.

Signed-off-by: Eric Blake <ebb9@byu.net>
15 years agols: clean up after wrapped+colored file names with clear-to-EOL
Jim Meyering [Wed, 31 Dec 2008 18:17:31 +0000 (19:17 +0100)]
ls: clean up after wrapped+colored file names with clear-to-EOL

This change addresses a relatively unusual case: ls --color, with
a highlighted name being printed initially in the last row of a
terminal emulator (possibly followed by other lines of output) such
that it is wrapped onto the following line, as the terminal emulator
scrolls the output.  That would cause the entire following line to
be highlighted, even if the name happened to use only one position.
The least-invasive patch would have made colorized output larger for
all uses.  The approach taken below is more invasive, but limits the
increase in overhead to only those lines that are expected to wrap.
* src/ls.c (enum indicator_no): Add C_CLR_TO_EOL.
(indicator_name): Add "cl".
(color_indicator): Add default escape codes for "cl".
(print_long_format): Propagate width to print_name_with_quoting.
(print_name_with_quoting): Print new C_CLR_TO_EOL string if needed.
Return the width of what we're printing.
(print_file_name_and_frills): Propagate width.
(print_type_indicator): Return bool (aka width).
(print_many_per_line): Pass column position to print_* function.
(print_current_files): Likewise.
(print_horizontal): Likewise.
(print_with_commas): Likewise.
* src/dircolors.c (slack_codes): Add "CLRTOEOL".
(ls_codes): Add "cl".
* tests/ls/color-clear-to-eol: New file.  Test for this fix.
* tests/Makefile.am (TESTS): Add ls/color-clear-to-eol.
* THANKS: Update.
Reported by Alexander V. Lukyanov.  See thread for details:
http://thread.gmane.org/gmane.linux.kernel/740021/focus=14824
Thanks to Jan Engelhardt for helping me reproduce the problem.

Demonstrate with this in an 80-column xterm:
  seq 200 # to start in the "bottom" row
  touch zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.foo
  env LS_COLORS='*.foo=0;31;42' ls -og --color=always

Before the fix, you'd see something like this:
(where the file name is printed in red on a green background,
and each "=" denotes a space on a green background)
...
  -rw-r--r--  1       0 Feb  5 11:31 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\
  zzzzzzzzzzzzzz.foo===================================================

After the patch, the trailing green spaces are gone:

  -rw-r--r--  1       0 Feb  5 11:31 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\
  zzzzzzzzzzzzzz.foo

15 years ago* tests/test-lib.sh: Use skip_test_... in place of echo...;exit 77.
Jim Meyering [Tue, 10 Feb 2009 13:30:06 +0000 (14:30 +0100)]
* tests/test-lib.sh: Use skip_test_... in place of echo...;exit 77.

15 years agotests: avoid skipping stty-* tests
Nix [Tue, 10 Feb 2009 08:04:23 +0000 (08:04 +0000)]
tests: avoid skipping stty-* tests

* tests/test-lib.sh (require_controlling_input_terminal_):
Check stdout, not stdin.

15 years agotouch: deprecate --file option: equivalent to --reference (-r)
Jim Meyering [Mon, 9 Feb 2009 10:44:17 +0000 (11:44 +0100)]
touch: deprecate --file option: equivalent to --reference (-r)

* src/touch.c: Mark long-undocumented --file for removal in 2010.
(main): Warn upon use of --file.

15 years agotests: fix dd skip=greater_max_file_size test on Solaris 10
Pádraig Brady [Fri, 6 Feb 2009 02:01:43 +0000 (02:01 +0000)]
tests: fix dd skip=greater_max_file_size test on Solaris 10

* tests/dd/skip-seek-past-file: I had previously commented that
on some systems lseek(> max file size) may succeed, but left
the possibility of failure in that case, so that I could determine
specific systems to put in the comments for both failure modes.

15 years agoavoid spurious parentheses/arith-op-related warnings from newer gcc
Jim Meyering [Thu, 5 Feb 2009 13:53:10 +0000 (14:53 +0100)]
avoid spurious parentheses/arith-op-related warnings from newer gcc

* src/copy.c (set_owner): Use && rather than &.
* src/stty.c (main): Likewise.
* src/wc.c (wc): Likewise.

15 years agomaint: tighten atoi/atof-prohibiting regexp, clean up .x-sc- file
Jim Meyering [Mon, 2 Feb 2009 08:37:08 +0000 (09:37 +0100)]
maint: tighten atoi/atof-prohibiting regexp, clean up .x-sc- file

* maint.mk (sc_prohibit_atoi_atof): Require "(" after token.
* .x-sc_prohibit_atoi_atof: Remove names that no longer contain a match.

15 years agodoc: preserve --help line breaks in 'REPORTING BUGS' man page section
Jim Meyering [Sun, 1 Feb 2009 19:29:14 +0000 (20:29 +0100)]
doc: preserve --help line breaks in 'REPORTING BUGS' man page section

* man/help2man: Insert .br between adjacent lines.

15 years ago* src/system.h (emit_bug_reporting_address): Remove periods.
Jim Meyering [Sun, 1 Feb 2009 19:23:06 +0000 (20:23 +0100)]
* src/system.h (emit_bug_reporting_address): Remove periods.

15 years agoupdate copyright dates from recent changes
Jim Meyering [Thu, 20 Nov 2008 10:28:31 +0000 (10:28 +0000)]
update copyright dates from recent changes

* src/dd.c: Add 2009 to list of copyright years.
* tests/dd/seek-skip-past-file: Likewise.
* tests/dd/seek-skip-past-dev: Likewise.
* m4/xattr.m4: Likewise.
* src/copy.h: Likewise.

15 years ago* maint.mk (sc_redundant_const): Use $(_prohibit_regexp).
Jim Meyering [Sun, 1 Feb 2009 19:19:03 +0000 (20:19 +0100)]
* maint.mk (sc_redundant_const): Use $(_prohibit_regexp).

15 years agodate doc: warn at -d about LC_TIME
jidanni@jidanni.org [Thu, 29 Jan 2009 15:04:46 +0000 (23:04 +0800)]
date doc: warn at -d about LC_TIME

We also warn here about LC_TIME, so the user will know even if he
doesn't look in the @xref{Date input formats}.

15 years agodocument sort --ignore-case --unique interaction
jidanni@jidanni.org [Thu, 29 Jan 2009 15:03:49 +0000 (23:03 +0800)]
document sort --ignore-case --unique interaction

15 years agomaint: detect useless inclusion of c-ctype.h
Jim Meyering [Sat, 31 Jan 2009 08:39:12 +0000 (09:39 +0100)]
maint: detect useless inclusion of c-ctype.h

* maint.mk (sc_prohibit_c_ctype_without_use): New rule.

15 years agomaint: teach "make syntax-check" to print each check name as it's run
Jim Meyering [Thu, 29 Jan 2009 09:46:39 +0000 (10:46 +0100)]
maint: teach "make syntax-check" to print each check name as it's run

* maint.mk (%.m): New rules to print each syntax-checking rule name,
just before running its commands.
($(syntax-check-rules)): Depend on it.

15 years agomaint: silence some syntax-check rules
Jim Meyering [Thu, 29 Jan 2009 09:44:25 +0000 (10:44 +0100)]
maint: silence some syntax-check rules

* cfg.mk (sc_strftime_check): Silence the rule.
(sc_tight_scope): Likewise.
* src/Makefile.am (check-AUTHORS): Likewise.