platform/upstream/coreutils.git
15 years agomaint: improve update-copyright rule
Joel E. Denny [Wed, 29 Jul 2009 09:05:54 +0000 (11:05 +0200)]
maint: improve update-copyright rule

* Makefile.am (update-copyright): Relax the selection rule
to match any file containing the word "Copyright".
Correct the exclusion rule so that it also excludes ChangeLog
and COPYING files that are not in the top level directory.

15 years agomaint: update-copyright: fix just-introduced bug
Jim Meyering [Wed, 29 Jul 2009 08:56:10 +0000 (10:56 +0200)]
maint: update-copyright: fix just-introduced bug

* build-aux/update-copyright: ... and revert-for-now the
change that made this script invoke localtime only once.

15 years agomaint: make update-copyright handle more cases
Jim Meyering [Wed, 29 Jul 2009 08:25:24 +0000 (10:25 +0200)]
maint: make update-copyright handle more cases

* build-aux/update-copyright: Handle cases in which the final
year number and copyright holder are on separate lines.
Prompted by a report from Joel E. Denny.
Also, do not invoke localtime for each line we process.

15 years agodoc: fix the generated HTML index
Pádraig Brady [Mon, 27 Jul 2009 01:24:03 +0000 (02:24 +0100)]
doc: fix the generated HTML index

* doc/coreutils.texi: Move the "SELinux context" section
down below the "System context" nodes so that the HTML
index is generated correctly. Also some extraneous and missing
'.' characters were corrected in the index.
Reported by Benno Schulenberg.

15 years agotail: use the inotify backend also with --pid=PID
Giuseppe Scrivano [Sun, 26 Jul 2009 11:22:57 +0000 (13:22 +0200)]
tail: use the inotify backend also with --pid=PID

* src/tail.c (tail_forever_inotify): When a PID is specified, use
select to block for no more than sleep_interval seconds at a time,
and check for process death upon timeout.
(main): Adapt to new tail_forever_inotify interface.

15 years agotests: new test for bug in ls -1U dir arg ...
Jim Meyering [Sat, 25 Jul 2009 09:06:22 +0000 (11:06 +0200)]
tests: new test for bug in ls -1U dir arg ...

* tests/misc/ls-misc (multi-arg-U1): New test.

15 years agols -1U dir arg ... now works again
Kamil Dudka [Mon, 27 Jul 2009 09:37:47 +0000 (11:37 +0200)]
ls -1U dir arg ... now works again

* src/ls.c (print_dir): Emit "$dir_name:\n" *before* accumulating (and
possibly printing) directory entry names.
The bug was introduced in coreutils-7.0 via commit
8d974b00, 2008-07-30, "ls -U1 now uses constant memory".
Reported by Julian Bradfield.
* NEWS (Bug fixes): Mention it.

15 years agotr: improve --help's description of --complement (-c)
Heikki Orsila [Sun, 26 Jul 2009 16:33:13 +0000 (19:33 +0300)]
tr: improve --help's description of --complement (-c)

15 years agodoc: add a sort by line length example
Pádraig Brady [Fri, 24 Jul 2009 23:46:12 +0000 (00:46 +0100)]
doc: add a sort by line length example

* doc/coreutils.texi (sort invocation): Add an example showing how
to sort data not directly supported by the sort command.

15 years agodoc: mention realpath in the readlink info
Pádraig Brady [Fri, 24 Jul 2009 17:17:24 +0000 (18:17 +0100)]
doc: mention realpath in the readlink info

* doc/coreutils.texi (readlink invocation): Add realpath to the index,
and also mention it in the readlink description so people
searching for that functionality can easily make the connection.

15 years agobuild: use a fixed-name temporary in man/Makefile.am
Jim Meyering [Sat, 25 Jul 2009 21:16:41 +0000 (23:16 +0200)]
build: use a fixed-name temporary in man/Makefile.am

* man/Makefile.am (check-x-vs-1): Using a fixed-name temporary file
is better than one ending in -$$, because many -$$-suffixed files
may accumulate over time.

15 years agodoc: improve readlink description here, too
Kamil Dudka [Fri, 24 Jul 2009 08:25:23 +0000 (10:25 +0200)]
doc: improve readlink description here, too

* doc/coreutils.texi (readlink invocation): Update menus.
Add @cindex entries.

15 years agoreadlink: improve one-line summary: prints canonical file names, too
Jim Meyering [Fri, 24 Jul 2009 07:33:23 +0000 (09:33 +0200)]
readlink: improve one-line summary: prints canonical file names, too

* src/readlink.c (usage): Adjust one-line summary.
* man/readlink.x: Likewise.
Suggested by Kamil Dudka.

15 years agobuild: update from gnulib
Jim Meyering [Sun, 19 Jul 2009 20:39:06 +0000 (22:39 +0200)]
build: update from gnulib

* gnulib: Update submodule to latest.

15 years agodoc: point to Guile's ChangeLog-writing guidelines
Jim Meyering [Tue, 14 Jul 2009 18:42:29 +0000 (20:42 +0200)]
doc: point to Guile's ChangeLog-writing guidelines

* HACKING (Commit log requirements): Point to Guile's
http://www.gnu.org/software/guile/changelogs/guile-changelogs_3.html.
Mention that a bit of prose can be welcome.

15 years agotail: adjust type of a local variable
Jim Meyering [Sat, 11 Jul 2009 07:43:25 +0000 (09:43 +0200)]
tail: adjust type of a local variable

* src/tail.c (tail_forever_inotify): Declare "len" to be of type
size_t, not ssize_t, since the former is what safe_read returns.

15 years agotests: avoid false-positive cp/link-heap failure
Jim Meyering [Thu, 9 Jul 2009 13:50:21 +0000 (15:50 +0200)]
tests: avoid false-positive cp/link-heap failure

* tests/cp/link-heap: Increase address space limit from 14000KB
to 16000KB, to avoid failure with Debian unstable's libc6-dev-2.9-19

15 years agobuild: avoid build warn/failure due to -Wstack-protector
Jim Meyering [Thu, 9 Jul 2009 13:20:15 +0000 (15:20 +0200)]
build: avoid build warn/failure due to -Wstack-protector

* configure.ac: Do not enable -Wstack-protector.
Otherwise, at least df.c would provoke a warning.

15 years agocopy.c: remove a duplicate expression
Ondřej Vašík [Wed, 8 Jul 2009 16:21:27 +0000 (17:21 +0100)]
copy.c: remove a duplicate expression

* src/copy.c (copy_attr_error): remove a redundant expression
added in commit e0cf592f, 2009-04-27, "factor out test for errno ...".

15 years agobuild: update from gnulib
Jim Meyering [Wed, 8 Jul 2009 20:37:29 +0000 (22:37 +0200)]
build: update from gnulib

* gnulib: Update submodule to latest.

15 years agotail: use size_t for counter and index variables, ...
Jim Meyering [Wed, 8 Jul 2009 17:49:46 +0000 (19:49 +0200)]
tail: use size_t for counter and index variables, ...

* src/tail.c (any_live_files): ... not "int" or even unsigned int
(tail_forever, tail_forever_inotify, main): Likewise.

15 years agotail: declare "file descriptor" variable to be "int", not size_t
Jim Meyering [Wed, 8 Jul 2009 17:51:22 +0000 (19:51 +0200)]
tail: declare "file descriptor" variable to be "int", not size_t

* src/tail.c (tail_forever_inotify): Use "int", not size_t
as the type of a file descriptor variable.

15 years agomove argv-iter module to gnulib
Jim Meyering [Sat, 4 Jul 2009 15:41:39 +0000 (17:41 +0200)]
move argv-iter module to gnulib

* gl/lib/argv-iter.c: Remove file.
* gl/lib/argv-iter.h: Remove file.
* gl/modules/argv-iter: Remove file.
* gl/modules/argv-iter-tests: Remove file.
* gl/tests/test-argv-iter.c: Remove file.
* gnulib: Update submodule, to get argv-iter

15 years agotests: refactor code to use require_proc_pid_status_
Giuseppe Scrivano [Sat, 4 Jul 2009 08:25:03 +0000 (10:25 +0200)]
tests: refactor code to use require_proc_pid_status_

* tests/tail-2/tail-n0f: Read the process status using the test-lib.sh
require_proc_pid_status_ function.

15 years agotests: use the "nobody" user's group as the default group id
Giuseppe Scrivano [Sat, 4 Jul 2009 08:14:31 +0000 (10:14 +0200)]
tests: use the "nobody" user's group as the default group id

* tests/chroot/credentials: Use the group id, not its name.
* tests/test-lib.sh (NON_ROOT_GROUP): Use the "nobody" user's group in
place of "nogroup".

15 years agobuild: update from gnulib
Jim Meyering [Fri, 3 Jul 2009 18:28:33 +0000 (20:28 +0200)]
build: update from gnulib

* gnulib: Update submodule to latest.

15 years agosort: allow SI and IEC units on separate human sort fields
Pádraig Brady [Mon, 29 Jun 2009 23:52:43 +0000 (00:52 +0100)]
sort: allow SI and IEC units on separate human sort fields

* src/sort.c: Store the si_present state per key rather than globally
* tests/misc/sort: Add a check that would have previously failed.
Also add a test to demonstrate that invalid IEC/SI mixtures are not
always noticed when they're not significant to the sort.

15 years agotail: avoid an inotify portability problem in kernels prior to 2.6.21
Giuseppe Scrivano [Thu, 2 Jul 2009 21:38:46 +0000 (23:38 +0200)]
tail: avoid an inotify portability problem in kernels prior to 2.6.21

* src/tail.c (tail_forever_inotify): Handle the special case in which
an old inotify watcher returns 0.  Affects kernels in [2.6.13, 2.6.21).

15 years agotests: tail-2/wait: rename internal file name
Jim Meyering [Fri, 3 Jul 2009 15:10:27 +0000 (17:10 +0200)]
tests: tail-2/wait: rename internal file name

* tests/tail-2/wait: Rename file from not_accessible to unreadable,
since all the test cares about is readability.

15 years agotests: tail-2/wait: don't fail when run as root
Giuseppe Scrivano [Thu, 2 Jul 2009 21:40:40 +0000 (23:40 +0200)]
tests: tail-2/wait: don't fail when run as root

* tests/tail-2/wait: Ensure that the unreadable file really is not
readable before trying to run "tail -f" on it.

15 years agodoc: update the info on sort -b and -k
Pádraig Brady [Wed, 1 Jul 2009 14:07:19 +0000 (15:07 +0100)]
doc: update the info on sort -b and -k

* doc/coreutils.texi (sort invocation): Mention in the description
of -b, that the locale can also affect whether blanks are significant.
Update the list of ordering options for a --key that cause it
to not inherit any global ordering options.
Update the list of ordering options that implicitly skip whitespace.

15 years agomaint: generalize the development prerequisites docs
Pádraig Brady [Thu, 2 Jul 2009 08:51:34 +0000 (09:51 +0100)]
maint: generalize the development prerequisites docs

* README-hacking: Add a little more high level info and
merge notes on specific developer prerequisites into README-prereq
* README-prereq: Remove the Fedora 8 specific information
and generalize the information to be applicable to any system.

15 years agotail: add comments noting potential inotify-related problems
Jim Meyering [Mon, 29 Jun 2009 18:43:26 +0000 (20:43 +0200)]
tail: add comments noting potential inotify-related problems

* src/tail.c (tail_forever_inotify): Add two FIXME comments.

15 years agomaint: bootstrap: merge changes from gnulib
Jim Meyering [Sun, 28 Jun 2009 10:16:28 +0000 (12:16 +0200)]
maint: bootstrap: merge changes from gnulib

* bootstrap: Indent using spaces, not TABs.

15 years agomaint: bootstrap: sync submodule usage from gnulib
Jim Meyering [Sun, 28 Jun 2009 09:25:13 +0000 (11:25 +0200)]
maint: bootstrap: sync submodule usage from gnulib

* bootstrap: Config for git submodule use only if .gitmodules exists.

15 years agomaint: bootstrap: split a few long lines
Jim Meyering [Sun, 28 Jun 2009 09:17:50 +0000 (11:17 +0200)]
maint: bootstrap: split a few long lines

* bootstrap (found_aux_dir): Avoid lines longer than 80 columns.

15 years agomaint: don't change COPYING
Jim Meyering [Fri, 26 Jun 2009 15:06:52 +0000 (17:06 +0200)]
maint: don't change COPYING

* COPYING: Don't modify Copyright date list in imported file.
This file is one of very few exceptions in that we version-control it,
even though its primary source is another package.
Spotted by Eric Blake.

15 years agomaint: add a rule to automate the annual copyright-year-update process
Jim Meyering [Fri, 26 Jun 2009 11:33:59 +0000 (13:33 +0200)]
maint: add a rule to automate the annual copyright-year-update process

* build-aux/update-copyright: New file.
* Makefile.am (changelog_etc): Add update-copyright.
(update-copyright): New rule.

15 years agostdbuf: fix to stop -i option causing an assertion
Pádraig Brady [Sat, 27 Jun 2009 00:48:49 +0000 (01:48 +0100)]
stdbuf: fix to stop -i option causing an assertion

* src/stdbuf.c (main): Fix the array bounds check in the assert
* tests/misc/stdbuf: Add a test for all standard streams

15 years agodoc: clarify the tail inotify NEWS
Pádraig Brady [Thu, 25 Jun 2009 13:41:05 +0000 (14:41 +0100)]
doc: clarify the tail inotify NEWS

* NEWS: Say why inotify was used

15 years agomaint: update all Copyright year lists to include 2009
Jim Meyering [Tue, 23 Jun 2009 20:33:15 +0000 (22:33 +0200)]
maint: update all Copyright year lists to include 2009

15 years agomaint: remove old TODO files
Jim Meyering [Tue, 23 Jun 2009 20:30:29 +0000 (22:30 +0200)]
maint: remove old TODO files

* lib/TODO: Remove file.
* tests/join/TODO: Likewise.

15 years agodoc: README-hacking tweak
Jim Meyering [Tue, 23 Jun 2009 14:54:38 +0000 (16:54 +0200)]
doc: README-hacking tweak

* README-hacking: Move the "While building..." sentence down
to where it belongs.

15 years agotests: tail-2/pid: include more info upon failure
Jim Meyering [Tue, 23 Jun 2009 14:53:43 +0000 (16:53 +0200)]
tests: tail-2/pid: include more info upon failure

* tests/tail-2/pid: Print unexpected $state upon failing.

15 years agodoc: typo fix in README-hacking
Jim Meyering [Sat, 20 Jun 2009 12:48:59 +0000 (14:48 +0200)]
doc: typo fix in README-hacking

* README-hacking: Fix a typo.
Don't make building from a git-cloned tree sound so hard.

15 years agobuild: update from gnulib (hash module updates; maint.mk tweak)
Jim Meyering [Fri, 19 Jun 2009 22:06:42 +0000 (00:06 +0200)]
build: update from gnulib (hash module updates; maint.mk tweak)

* gnulib: Update submodule to latest.

15 years agodoc: fix a typo
Jim Meyering [Wed, 17 Jun 2009 14:17:19 +0000 (16:17 +0200)]
doc: fix a typo

* doc/coreutils.texi (stdbuf invocation): Insert missing "to".

15 years agostdbuf: A new program to run a command with modified stdio buffering
Pádraig Brady [Wed, 17 Dec 2008 11:30:03 +0000 (11:30 +0000)]
stdbuf: A new program to run a command with modified stdio buffering

* AUTHORS: Register as the author.
* NEWS: Mention this change.
* README: Add stdbuf command to list.
* configure.ac: Only enable on ELF systems with GCC.
* cfg.mk (sc_system_h_headers): Use VC_LIST_EXCEPT rather than
VC_LIST, so we can add an exception, if needed.
* .x-sc_system_h_headers: New file.  Exempt libstdbuf.c.
* Makefile.am (syntax_check_exceptions): Add .x-sc_system_h_headers.
* doc/coreutils.texi (stdbuf invocation): Add stdbuf info.
* man/.gitignore: Ignore generated manpage.
* src/.gitignore: Ignore stdbuf and libstdbuf.so binaries.
* man/Makefile.am (stdbuf.1): Add dependency.
* man/stdbuf.x: New file with example usage.
* po/POTFILES.in: Reference new command and shared library sources.
* src/Makefile.am (build_if_possible__progs): Add stdbuf and libstdbuf,
(pkglib_PROGRAMS): Reference optional shared lib,
(libstdbuf_so_LDADD): Ensure we don't link with non PIC libcoreutils.a.
(libstdbuf_so_LDFLAGS): Add -shared GCC option,
(libstdbuf_so_CFLAGS): Add -fPIC GCC option.
(check-README): Exclude libstbuf.
(check-AUTHORS): ditto.
(sc_tight_scope): Exclude functions starting with __.
* src/libstdbuf.c: The LD_PRELOAD shared library to control buffering.
* src/stdbuf.c: New file to setup env variables before execing command.
* tests/Makefile.am: Reference new test file.
* tests/misc/help-version: Set expected exit codes.
* tests/misc/invalid-opt: ditto.
* tests/misc/stdbuf: Add 9 tests.

15 years agodoc: cp: describe an oddity of combining -H/-L and --preserve=links
Jim Meyering [Mon, 15 Jun 2009 07:10:50 +0000 (09:10 +0200)]
doc: cp: describe an oddity of combining -H/-L and --preserve=links

* doc/coreutils.texi (cp invocation) [-L]: Elaborate.
[--preserve=links]: Remove comments saying that we need documentation
for just this situation.  Provide more explanation and examples.
Reported by Brian M. Carlson in http://bugs.debian.org/525048.

15 years agomaint: revert last change: we're not ready for "local" in scripts, yet
Jim Meyering [Mon, 15 Jun 2009 17:37:42 +0000 (19:37 +0200)]
maint: revert last change: we're not ready for "local" in scripts, yet

Revert "use a local var: more readable"
This reverts commit c0d82452883a10911c9cbc69c84144d99b7e6b08.

15 years agouse a local var: more readable
Jim Meyering [Sun, 14 Jun 2009 12:43:16 +0000 (14:43 +0200)]
use a local var: more readable

15 years agotail: use inotify if it is available
Giuseppe Scrivano [Tue, 2 Jun 2009 06:28:23 +0000 (08:28 +0200)]
tail: use inotify if it is available

* NEWS: Document the new feature.
* m4/jm-macros.m4: Check if inotify is present.
* src/tail.c (tail_forever_inotify): New function.
(main): Use the inotify-based function, if possible.
* tests/Makefile.am: Add new tests for tail.
* tests/test-lib.sh (require_proc_pid_status_, get_process_status_):
New functions.
* tests/tail-2/pid: New file.
* tests/tail-2/wait: New file.
* tests/tail-2/tail-n0f: Refactor code into the test-lib.sh
require_proc_pid_status_ function.

15 years agodiag: say "failed to...", rather than "cannot..." in a few diagnostics
Jim Meyering [Sat, 13 Jun 2009 14:36:48 +0000 (16:36 +0200)]
diag: say "failed to...", rather than "cannot..." in a few diagnostics

* src/chroot.c (main): ...it's more precise.
* src/nohup.c (main): Likewise.
* src/setuidgid.c (main): Likewise.
* src/timeout.c (main): Likewise.

15 years agosort: Ignore fields where end position is before the start position
Cliff Miller [Thu, 11 Jun 2009 17:30:32 +0000 (18:30 +0100)]
sort: Ignore fields where end position is before the start position

* NEWS: Mention the fix
* THANKS: Add Cliff Miller
* src/sort.c (keycompare): Ensure lima >= texta
* tests/misc/sort: Add 3 corresponding tests

Signed-off-by: Pádraig Brady <P@draigBrady.com>
15 years agotests: ls --color, permissions override hardlink coloring
Pádraig Brady [Thu, 11 Jun 2009 10:34:21 +0000 (11:34 +0100)]
tests: ls --color, permissions override hardlink coloring

* tests/ls/multihardlink: Add a test case to demonstrate
and test this non obvious behavior.

15 years agols --color: do not colorize files with multiple hard links by default
Kamil Dudka [Wed, 10 Jun 2009 17:44:43 +0000 (19:44 +0200)]
ls --color: do not colorize files with multiple hard links by default

* src/ls.c: Rename hl->mh, do not colorize files with multiple
hard links by default.
* src/dircolors.c: Rename HARDLINK -> MULTIHARDLINK, hl -> mh.
* src/dircolors.hin: Do not colorize files with multiple hard links by
default.
* tests/Makefile.am: Rename the test case accordingly.
* tests/ls/multihardlink: Additionally test ls' default behavior
and factor out some duplication.
* NEWS: Mention the change in behavior.

15 years agomaint: Add a syntax-check to ensure all .x-sc_ files are distributed
Pádraig Brady [Mon, 8 Jun 2009 07:42:00 +0000 (08:42 +0100)]
maint: Add a syntax-check to ensure all .x-sc_ files are distributed

* Makefile.am: Add a couple of missing entries to
syntax_check_exceptions for distribution.
* cfg.mk: Add a rule to ensure the syntax_check_exceptions list
stays in sync with the .x-sc_* files in the repository.

15 years agobuild: update from gnulib
Jim Meyering [Sun, 7 Jun 2009 10:54:18 +0000 (12:54 +0200)]
build: update from gnulib

* gnulib: Update submodule to latest.

15 years agosort: die immediately upon heap allocation failure
Jim Meyering [Sun, 7 Jun 2009 11:55:43 +0000 (13:55 +0200)]
sort: die immediately upon heap allocation failure

* src/sort.c (register_proc): Handle hash_insert failure.

15 years agodircolors: add screen-256color-bce to TERM list
Mike Frysinger [Thu, 7 May 2009 19:29:23 +0000 (15:29 -0400)]
dircolors: add screen-256color-bce to TERM list

* src/dircolors.hin: Add screen-256color-bce.

15 years agodoc: HACKING: minor adjustments, additions
Jim Meyering [Wed, 3 Jun 2009 16:28:34 +0000 (18:28 +0200)]
doc: HACKING: minor adjustments, additions

* HACKING (Amending...): Remove spurious "-e" used with commit --amend.
(log message policy): Mention the 72-column limit.
"build:" and "maint:" are common prefixes, these days.

15 years agodoc: adjust wording in README-prereq
Jim Meyering [Tue, 2 Jun 2009 20:31:16 +0000 (22:31 +0200)]
doc: adjust wording in README-prereq

15 years agodircolors: recognize .xz, .txz, .tbz and .tlz suffixes
Jim Meyering [Tue, 2 Jun 2009 19:48:38 +0000 (21:48 +0200)]
dircolors: recognize .xz, .txz, .tbz and .tlz suffixes

* src/dircolors.hin: Add .xz, .txz, .tbz and .tlz.

15 years agodoc: use newer URL for XZ utils
Jim Meyering [Tue, 2 Jun 2009 19:44:11 +0000 (21:44 +0200)]
doc: use newer URL for XZ utils

* README-hacking: Use <http://tukaani.org/xz/>
* README-prereq: Mention xz, not lzma.

15 years agodoc: adjust README-prereq instructions
Matěj Cepl [Wed, 3 Jun 2009 00:02:01 +0000 (01:02 +0100)]
doc: adjust README-prereq instructions

* README-prereq: Mention new requirement on automake-1.11,
with its new location and updated dependency on autoconf-2.62.
Remove the reference to coreutils-7.0 so that this file
implicitly refers to the latest or release version of coreutils.
Fix and clarify the instructions for updating the $PATH.

Signed-off-by: Pádraig Brady <P@draigBrady.com>
15 years agodoc: HACKING: mention the GNU Coding Standards
Jim Meyering [Tue, 2 Jun 2009 05:52:02 +0000 (07:52 +0200)]
doc: HACKING: mention the GNU Coding Standards

* HACKING (Add documentation): Add a link to the GCS.

15 years agobuild: no longer list gnulib's "memchr" module as obsolete
Jim Meyering [Sun, 31 May 2009 13:18:16 +0000 (15:18 +0200)]
build: no longer list gnulib's "memchr" module as obsolete

* bootstrap.conf (obsolete_gnulib_modules): Remove memchr from
the list, now that it fixes a problem in some modern C libraries.
(gnulib_modules): Add it here.

15 years agobuild: make generated man/*.1 files read-only
Jim Meyering [Sun, 31 May 2009 07:52:51 +0000 (09:52 +0200)]
build: make generated man/*.1 files read-only

This should help people notice that they are generated.
Note: each file already has a comment to that effect from help2man.
* man/Makefile.am (.x.1): Make generated files read-only.
Also, don't redirect directly to the target, $@.

15 years agobuild (man/): use automake's new $(AM_V_GEN) variable
Jim Meyering [Fri, 24 Apr 2009 20:23:50 +0000 (22:23 +0200)]
build (man/): use automake's new $(AM_V_GEN) variable

* man/Makefile.am (.x.1, check-x-vs-1, check-programs-vs-x):
Mark with $(AM_V_GEN), so that automake-1.11 prints
"GEN $@" by default (stick with "GEN" in spite of the latter two
rules not officially generating anything -- they're just tests).

15 years agochroot: make --groups= work without --userspec=; be more robust
Jim Meyering [Fri, 29 May 2009 06:44:56 +0000 (08:44 +0200)]
chroot: make --groups= work without --userspec=;  be more robust

* src/chroot.c (set_additional_groups): Add comments.
Given an empty or all-comma group list, diagnose it and return nonzero.
When more than one group is invalid, diagnose all of them,
not just the first.
(main): Honor --groups= also when --userspec= is not specified.
Now that set_additional_groups consistently diagnoses its failures,
don't diagnose it separately here.
* tests/chroot/credentials: Do not invoke with an empty group list.

15 years agochroot: don't set bogus user-ID or group-ID for --u=U: or --u=:G
Jim Meyering [Wed, 27 May 2009 21:06:15 +0000 (23:06 +0200)]
chroot: don't set bogus user-ID or group-ID for --u=U: or --u=:G

* src/chroot.c (main): Initialize both "uid" and "gid".  To -1.
This also allows one to set the user-ID or primary group-ID to 0,
in case it's not that already.
* tests/chroot/credentials: Test for the above.

15 years agochroot: set-*-ID failure must provoke nonzero exit before execvp
Jim Meyering [Wed, 27 May 2009 20:06:04 +0000 (22:06 +0200)]
chroot: set-*-ID failure must provoke nonzero exit before execvp

* src/chroot.c (main): Exit upon set-group-ID or set-user-ID failure.

15 years agotests: use "nobody" as the default group name in chroot test
Jim Meyering [Thu, 28 May 2009 20:36:05 +0000 (22:36 +0200)]
tests: use "nobody" as the default group name in chroot test

* tests/test-lib.sh (NON_ROOT_GROUP): Use "nobody", not "nogroup".

15 years agobuild: make distcheck rules use --enable-gcc-warnings
Jim Meyering [Tue, 2 Jun 2009 14:33:49 +0000 (16:33 +0200)]
build: make distcheck rules use --enable-gcc-warnings

* dist-check.mk (warn_cflags): Remove definition, now that it's
been subsumed by --enable-gcc-warnings.
(my-distcheck): Use configure with --enable-gcc-warnings and remove
use of $(warn_cflags).

15 years agohead, tail: make --help less ambiguous
Eric Blake [Wed, 20 May 2009 12:32:10 +0000 (06:32 -0600)]
head, tail: make --help less ambiguous

* src/head.c (usage): Use -n K, not -n N, to avoid confusion.
* src/tail.c (usage): Likewise.
* doc/coreutils.texi (head invocation, tail invocation):
Likewise.
Reported by Christophe Lyon.

15 years agosort: new --human-numeric-sort option to sort KiB MB etc.
Michael Speer [Mon, 27 Apr 2009 13:51:29 +0000 (14:51 +0100)]
sort: new --human-numeric-sort option to sort KiB MB etc.

* NEWS: Document the new option
* doc/coreutils.texi (sort invocation): ditto
* src/sort.c (main): handle the new --human-numeric-sort option (-h).
(human_numcompare): A new function to compare SI and IEC suffixes
before falling back to the standard --numeric comparison.
(find_unit_order): A new helper function to find the order
of magnitude of a number string as determined by its suffix.
(check_mixed_SI_IEC): A new helper function to exit with error
if both SI and IEC suffixes are presented.
* tests/misc/sort: Add 8 tests to test the new functionality.
* THANKS: Update

15 years agochroot: accept new options --userspec=U:G and --groups=G1,G2,G3
Giuseppe Scrivano [Fri, 1 May 2009 21:50:11 +0000 (23:50 +0200)]
chroot: accept new options --userspec=U:G and --groups=G1,G2,G3

* NEWS: Note chroot's new options.
* doc/coreutils.texi: Document them.
* src/chroot.c (main): Add support for --userspec and --groups.
* tests/Makefile.am (root-tests): Add chroot/credentials.
* tests/chroot/credentials: New file.
* tests/test-lib.sh: Define NON_ROOT_GROUP to a default value.

15 years agodoc: clarify the operation of the comm -123 parameters
Pádraig Brady [Fri, 15 May 2009 16:28:51 +0000 (17:28 +0100)]
doc: clarify the operation of the comm -123 parameters

* src/comm.c (usage): give more information on the -123 parameters,
with examples to show that they can be combined.
Addresses <http://savannah.gnu.org/bugs/?24974>.
* doc/coreutils.texi (comm invocation): Mention that the
column separators are suppressed along with the column.
Suggestion from Dan Jacobson.
* man/comm.x: Reference other commands that match adjacent lines.
* man/join.x: ditto.
* man/uniq.x: ditto.

15 years agobuild: require automake-1.11
Jim Meyering [Mon, 18 May 2009 05:06:34 +0000 (07:06 +0200)]
build: require automake-1.11

* bootstrap.conf (buildreq): Require automake-1.11, not 1.10b,
for our use of AM_SILENT_RULES.
* configure.ac (AM_INIT_AUTOMAKE): Likewise.

15 years agomaint: HACKING: mention a few more useful git commands
Jim Meyering [Sun, 17 May 2009 15:49:24 +0000 (17:49 +0200)]
maint: HACKING: mention a few more useful git commands

* HACKING (Miscellaneous useful git commands): Add a few.

15 years agobuild: avoid new "make distcheck" failure with gcc 4.5.0 20090517
Jim Meyering [Sun, 17 May 2009 13:22:11 +0000 (15:22 +0200)]
build: avoid new "make distcheck" failure with gcc 4.5.0 20090517

* dist-check.mk (warn_cflags): Add -Wno-enum-compare.

15 years agobuild: avoid new warnings from gcc 4.5.0 20090517
Jim Meyering [Sun, 17 May 2009 11:47:39 +0000 (13:47 +0200)]
build: avoid new warnings from gcc 4.5.0 20090517

* configure.ac: Add an explicit -Wno-logical-op,
now that not listing -Wlogical-op is insufficient.

15 years agomaint: use ARRAY_CARDINALITY more
Jim Meyering [Sun, 17 May 2009 11:02:25 +0000 (13:02 +0200)]
maint: use ARRAY_CARDINALITY more

* src/sort.c (main): Use ARRAY_CARDINALITY, rather than open-coding it.
* src/factor.c (WHEEL_END): Likewise.
* src/csplit.c (main): Likewise.
* src/od.c: Likewise,
* src/ls.c (main): Likewise.
(N_ENTRIES): Remove definition.  Use ARRAY_CARDINALITY instead.
* src/dircolors.c: Likewise.
(array_len): Remove definition.

15 years agobuild: tr: avoid a warning due to newer gcc's -Wenum-compare
Jim Meyering [Sun, 17 May 2009 10:47:24 +0000 (12:47 +0200)]
build: tr: avoid a warning due to newer gcc's -Wenum-compare

* src/tr.c (N_CHAR_CLASSES): Remove anonymous enum definition.
(look_up_char_class): Use ARRAY_CARDINALITY, rather than N_CHAR_CLASSES.

15 years agomaint: define ARRAY_CARDINALITY in system.h
Jim Meyering [Sun, 17 May 2009 11:01:37 +0000 (13:01 +0200)]
maint: define ARRAY_CARDINALITY in system.h

* src/system.h (ARRAY_CARDINALITY): Define if not already defined.

15 years agobuild: turn off -Wlong-long
Jim Meyering [Sun, 17 May 2009 09:43:21 +0000 (11:43 +0200)]
build: turn off -Wlong-long

* configure.ac: With --enable-gcc-warnings, -Wlong-long would
cause compilation failure due to inclusion of lib/gethrxtime.h.
Initialize "nw".

15 years agomaint: cfg.mk: remove now-unnecessary gnulib_dir definition
Jim Meyering [Fri, 15 May 2009 13:04:52 +0000 (15:04 +0200)]
maint: cfg.mk: remove now-unnecessary gnulib_dir definition

* cfg.mk (gnulib_dir): Remove definition, now that gnulib's
maint.mk provides the default we want.
* gnulib: Update submodule to latest.

15 years agotests: fix date-next-dow failure on older systems
Pádraig Brady [Fri, 15 May 2009 06:50:35 +0000 (07:50 +0100)]
tests: fix date-next-dow failure on older systems

* tests/misc/date-next-dow: In the strftime call use %Y-%m-%d
rather than the newer %F equivalent which is not available
on Solaris 8 for example.

15 years agobuild: update from gnulib, for rename.m4 fix, improved tests, etc.
Jim Meyering [Thu, 14 May 2009 07:55:44 +0000 (09:55 +0200)]
build: update from gnulib, for rename.m4 fix, improved tests, etc.

* gnulib: Update submodule to latest.

15 years agomaint: README-release: minor improvements
Jim Meyering [Thu, 14 May 2009 07:54:22 +0000 (09:54 +0200)]
maint: README-release: minor improvements

* README-release: Mention gnu_ftp_host-{alpha,...} settings in cfg.mk.
Now that XZ_OPT is set via maint.mk, don't mention it here.

15 years agotruncate: fix bug in use of isspace
Eric Blake [Thu, 7 May 2009 20:27:37 +0000 (14:27 -0600)]
truncate: fix bug in use of isspace

* src/truncate.c (main): Pass unsigned characters to isspace.
* NEWS: Mention this.

15 years agopost-release administrivia
Jim Meyering [Thu, 7 May 2009 13:52:50 +0000 (15:52 +0200)]
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.4 v7.4
Jim Meyering [Thu, 7 May 2009 13:35:19 +0000 (15:35 +0200)]
version 7.4

* NEWS (Build-related): Mention make check fixes.

15 years agoadmin: update NEWS
Jim Meyering [Thu, 7 May 2009 13:17:53 +0000 (15:17 +0200)]
admin: update NEWS

* NEWS (Bug fixes): Mention the date-related fixes.
(Portability): Mention the ACL-related fixes on *BSD.

15 years agodoc: note the use of LC_COLLATE in comm, join and uniq
Pádraig Brady [Tue, 5 May 2009 11:00:15 +0000 (12:00 +0100)]
doc: note the use of LC_COLLATE in comm, join and uniq

* doc/coreutils.texi (uniq invocation): Simplify the
text to remove the inconsequential mentioning of order,
while implying that LC_COLLATE can alter equality comparisons.
* src/comm.c (usage): Mention LC_COLLATE is significant.
* src/join.c (usage): Ditto.
* src/uniq.c (usage): Ditto. Also improve the summary.
Suggestion from Andries Brouwer

15 years agotests: rm/one-file-system: umount more reliably
Jim Meyering [Tue, 5 May 2009 05:54:47 +0000 (07:54 +0200)]
tests: rm/one-file-system: umount more reliably

* tests/rm/one-file-system: Run umount via trap, so it runs
also upon irregular termination.

15 years agotests: fix typo in check-AUTHORS rule
Andreas Schwab [Tue, 5 May 2009 05:13:46 +0000 (07:13 +0200)]
tests: fix typo in check-AUTHORS rule

* src/Makefile.am (check-AUTHORS): Set locale.

15 years agobuild: use a gnulib SHA1 that is not private
Jim Meyering [Mon, 4 May 2009 05:47:56 +0000 (07:47 +0200)]
build: use a gnulib SHA1 that is not private

* gnulib: Update submodule to latest *public*.

15 years agobuild: update from gnulib, for ACL-related fixes
Jim Meyering [Mon, 4 May 2009 05:10:12 +0000 (07:10 +0200)]
build: update from gnulib, for ACL-related fixes

* gnulib: Update submodule to latest.

15 years agomv, rm: adapt to new and improved gnulib interfaces
David Bartley [Wed, 29 Apr 2009 07:48:15 +0000 (03:48 -0400)]
mv, rm: adapt to new and improved gnulib interfaces

Use gnulib's new priv-set module and updated write-any-file.
With them, the remove-called can_write_any_file function no
longer tries to drop the unlink-directory privilege, so now
each caller of remove must do that separately, calling
priv_set_remove_linkdir.
* bootstrap.conf (gnulib_modules): Add priv-set.
* src/rm.c: Include "priv-set.h".
(main): Call priv_set_remove_linkdir.
* src/mv.c (main): Likewise.
* gnulib: Update submodule to latest.