platform/upstream/coreutils.git
12 years agomaint: post-release administrivia
Jim Meyering [Thu, 8 Sep 2011 15:23:21 +0000 (17:23 +0200)]
maint: post-release administrivia

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

12 years agoversion 8.13 v8.13
Jim Meyering [Thu, 8 Sep 2011 15:04:42 +0000 (17:04 +0200)]
version 8.13

* NEWS: Record release date.

12 years agobuild: update gnulib submodule to latest
Jim Meyering [Thu, 8 Sep 2011 13:49:42 +0000 (15:49 +0200)]
build: update gnulib submodule to latest

12 years agostat: avoid compilation failure on AIX 7.x
Jim Meyering [Thu, 8 Sep 2011 09:52:55 +0000 (11:52 +0200)]
stat: avoid compilation failure on AIX 7.x

* src/stat.c (USE_STATVFS): Adjust definition so that it is enabled
also on AIX 7.x systems that provide statvfs64 and no statvfs.
[USE_STATVFS && ! STAT_STATVFS && STAT_STATVFS64] (STATFS): Define
to statvfs64 in that precise case.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Adjust the condition
here to match the new one in stat.c, to keep them in sync.
Reported by Bruno Haible.  For details, see
http://article.gmane.org/gmane.comp.gnu.coreutils.general/1668

12 years agotests: adjust PATH to include /sbin for mkfs-using tests
Bernhard Voelker [Wed, 7 Sep 2011 09:58:52 +0000 (11:58 +0200)]
tests: adjust PATH to include /sbin for mkfs-using tests

* tests/init.cfg (require_mkfs_PATH_): New function to test whether mkfs
is in PATH, otherwise adding /sbin to PATH.  Needed for distributions
(OpenSuSE, Solaris) in which sudo does not include /sbin in PATH.
* tests/cp/cp-a-selinux: Use require_mkfs_PATH_.
* tests/cp/cp-mv-enotsup-xattr: Likewise.
* tests/cp/sparse-fiemap: Likewise.
* tests/mkdir/writable-under-readonly: Likewise.
* tests/rm/read-only: Likewise.

12 years agotests: avoid false-positive "make check" failure when perl is missing
Jim Meyering [Wed, 7 Sep 2011 09:18:20 +0000 (11:18 +0200)]
tests: avoid false-positive "make check" failure when perl is missing

* doc/Makefile.am (sc-lower-case-var): Skip this test when $(PERL)
is not usable.  Reported by Bruno Haible.

12 years agocp: update gnulib to get support for NFSv4 ACLs
Jim Meyering [Tue, 6 Sep 2011 06:02:33 +0000 (08:02 +0200)]
cp: update gnulib to get support for NFSv4 ACLs

* NEWS (Improvements): Mention the cp-vs-NFSv4-ACL improvement we
have inherited via gnulib.  For details, see
http://article.gmane.org/gmane.comp.lib.gnulib.bugs/28100
and the following messages in that thread.
* gnulib: Update to latest, for numerous ACL-related improvements.

12 years agotests: init.sh: work also with any non-GNU diff that supports -u
Bruno Haible [Fri, 2 Sep 2011 08:51:52 +0000 (10:51 +0200)]
tests: init.sh: work also with any non-GNU diff that supports -u

* tests/init.sh: Relax check for diff -u support.
Rather than checking for GNU diff via --version, simply check
for support for -u itself.  Useful at least on OpenBSD 4.9.

12 years agotests: remove require-perl script; use function instead
Jim Meyering [Thu, 1 Sep 2011 21:59:02 +0000 (23:59 +0200)]
tests: remove require-perl script; use function instead

* tests/require-perl: Remove file.
* tests/Makefile.am (EXTRA_DIST): Remove it from this list.
* tests/init.cfg (require_perl_): New function.
* tests/misc/pwd-long: Use the new function, not the file.
* tests/ls/nameless-uid: Likewise.
* tests/misc/sum-sysv: Likewise.

12 years agotests: cut: exercise distro-added multibyte code paths
Jim Meyering [Thu, 1 Sep 2011 19:30:10 +0000 (21:30 +0200)]
tests: cut: exercise distro-added multibyte code paths

* tests/misc/cut: Repeat each test using a multibyte locale,
if the configure-time test found such a locale.
Adjust the tests so that they also accept a slightly
different diagnostic that is specific to the MB-patched cut.

12 years agodoc: describe test control variables
Pádraig Brady [Fri, 2 Sep 2011 10:33:42 +0000 (11:33 +0100)]
doc: describe test control variables

* HACKING (Add tests): Mention the variables and default values.
* README-release (Pre-release testing): Mention that setting
the SHELL variable may be required.
Suggested by Bruno Haible.

12 years agotimeout: fixup previous warning fix
Pádraig Brady [Thu, 1 Sep 2011 14:50:08 +0000 (15:50 +0100)]
timeout: fixup previous warning fix

* src/timeout.c (settimeout): Fix the previous commit
to test errno rather than the return value.

12 years agotests: split/l-chunk: avoid a portability issue
Pádraig Brady [Thu, 1 Sep 2011 14:43:25 +0000 (15:43 +0100)]
tests: split/l-chunk: avoid a portability issue

* tests/split/l-chunk: Don't use the `test "$var"`
idiom to test that var is set to something as
that's not supported by all shells.
The new style matches the usage is the rest of
the test in any case.
Reported by Bruno Haible on AIX 6.1 and 7.1

12 years agotests: pwd-long: diagnose failure earlier
Jim Meyering [Thu, 1 Sep 2011 13:11:12 +0000 (15:11 +0200)]
tests: pwd-long: diagnose failure earlier

Without this change, we'd get use-of-uninit value warnings
and harder-to-diagnose failure down the road.
* tests/misc/pwd-long (normalize_to_cwd_relative): Diagnose stat
failure.  This failed on AIX 6.1 and 7.1.  Reported by Bruno Haible.

12 years agotests: printf-surprise: avoid false-positive failure
Jim Meyering [Thu, 1 Sep 2011 12:45:51 +0000 (14:45 +0200)]
tests: printf-surprise: avoid false-positive failure

* tests/misc/printf-surprise: Also accept a strerror-style string
after the usual 'printf: write error:' diagnostic prefix.
Otherwise, this test would fail on HP-UX 11.
Reported by Bruno Haible.

12 years agotests: improve message in 'require_membership_in_two_groups_' function
Bernhard Voelker [Thu, 1 Sep 2011 09:11:06 +0000 (11:11 +0200)]
tests: improve message in 'require_membership_in_two_groups_' function

* tests/init.cfg (require_membership_in_two_groups_): Add quotes
around the suggested groups for the COREUTILS_GROUPS variable.

12 years agotests: misc/printf: accommodate alternate behavior
Jim Meyering [Thu, 1 Sep 2011 10:14:11 +0000 (12:14 +0200)]
tests: misc/printf: accommodate alternate behavior

* tests/misc/printf: Avoid false positive failure on MacOS X 10.5
due to a slightly differing diagnostic.  Reported by Bruno Haible.

12 years agotests: invoke via "env printf", rather than using an absolute name
Jim Meyering [Thu, 1 Sep 2011 10:09:32 +0000 (12:09 +0200)]
tests: invoke via "env printf", rather than using an absolute name

* tests/misc/printf: This results in more concise diagnostics.

12 years agotimeout: suppress a redundant warning on some systems
Pádraig Brady [Thu, 1 Sep 2011 14:30:18 +0000 (15:30 +0100)]
timeout: suppress a redundant warning on some systems

* src/timeout.c (settimeout): Don't warn about ENOSYS
which is returned on OpenBSD 4.9 at least.
Reported by Bruno Haible

12 years agostdbuf: fix helper lib identification on some platforms
Pádraig Brady [Thu, 1 Sep 2011 14:23:17 +0000 (15:23 +0100)]
stdbuf: fix helper lib identification on some platforms

* src/stdbuf.c (main): Pass the path of `stdbuf` rather than
the command it's running to the search function.  This is
significant on platforms without /proc/self/exe
Reported by Bruno Haible

12 years agobuild: avoid the use of strsignal() in split
Pádraig Brady [Thu, 1 Sep 2011 14:07:51 +0000 (15:07 +0100)]
build: avoid the use of strsignal() in split

... which is not available on some platforms,
and the replacement currently requires linking
with threading libraries.
* src/split.c (closeout): Remove the call to strsignal()
which is largely redundant anyway as sig2str()
is already used to map number to name in the error.
Reported by Bruno Haible on AIX 6.1 and 7.1

12 years agodate: support parsing of ISO-8601-with-"T" dates
Jim Meyering [Tue, 30 Aug 2011 21:02:28 +0000 (23:02 +0200)]
date: support parsing of ISO-8601-with-"T" dates

Thanks to an improvement in gnulib's parse-datetime module,
commands like this now succeed (output manually indented):
    $ ./date -u -d 2004-02-29T16:21:42.33+07:00 +%FT%T.%N%z
   2004-02-29T09:21:42.330000000+0000
* tests/misc/date: Add a test to exercise the new-in-gnulib
parsing of ISO8601-with-"T" dates.
* NEWS (New features): Mention it.
* gnulib: Update, to pull in this parse-datetime improvement.

12 years agobuild: heap.c: make possible gnulib candidate c89 compatible
Pádraig Brady [Tue, 30 Aug 2011 14:09:23 +0000 (15:09 +0100)]
build: heap.c: make possible gnulib candidate c89 compatible

* gl/lib/heap.c: Move declaration to the top of scope.
Reported by Rob McMahon and Wolfgang Steinwender
in relation to "Sun WorkShop 6 update 2 C 5.3 Patch 111679-12
2003/05/18" and "GCC 2.95.3" respectively.

12 years agotimeout: revert signal propagation enhancement
Pádraig Brady [Thu, 25 Aug 2011 10:25:30 +0000 (11:25 +0100)]
timeout: revert signal propagation enhancement

This effectively reverts the unreleased commit 5a647a05

* src/timeout.c (main): Don't propagate signals from the monitored
process, as on Linux /proc/sys/kernel/core_pattern could still
handle them and cause false reports against `timeout`

12 years agomaint: rename a test
Jim Meyering [Wed, 24 Aug 2011 08:40:51 +0000 (10:40 +0200)]
maint: rename a test

Lesson: do not include details like "4 million" in a file name.
* tests/rm/many-dir-entries-vs-OOM: Renamed from ...
* tests/rm/4-million-entry-dir: ...this.
* tests/Makefile.am (TESTS): Reflect renaming.

12 years agotests: adjust the new, very expensive rm test to be less expensive
Jim Meyering [Wed, 24 Aug 2011 08:36:25 +0000 (10:36 +0200)]
tests: adjust the new, very expensive rm test to be less expensive

* tests/rm/4-million-entry-dir: Create only 200,000 files, rather
than 4 million.  The latter was overkill, and was too likely to
fail due to inode exhaustion.  Not everyone is using btrfs yet.
Now that this test doesn't take so long, label it as merely
"expensive", rather than "very expensive".  Thanks to
Bernhard Voelker for pointing out the risk of inode exhaustion.

12 years agopr: fix so that LAST_PAGE is honored with -T
Pádraig Brady [Tue, 23 Aug 2011 23:09:30 +0000 (00:09 +0100)]
pr: fix so that LAST_PAGE is honored with -T

Ever since the LAST_PAGE functionality was added
in commit ed0923a1, 1996-12-05,
"Apply big patch (patch-20) from Roland Huebner"
it was ignored when -t or -T were specified or
when -l <= 10.

* src/pr.c (print_page): Increment the current page here.
(print_header): Don't increment the current page here.
* tests/pr/pr-tests: Add a test case.
* NEWS: Mention the fix

Reported at http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9347

12 years agodoc: correct typo in yesterday's NEWS entry: 30GB -> 30MB
Erik Auerswald [Sat, 20 Aug 2011 06:12:31 +0000 (08:12 +0200)]
doc: correct typo in yesterday's NEWS entry: 30GB -> 30MB

* NEWS: s/30GB/30MB/

12 years agorm, du, chmod, chown, chgrp: use much less memory for large directories
Jim Meyering [Fri, 19 Aug 2011 15:51:45 +0000 (17:51 +0200)]
rm, du, chmod, chown, chgrp: use much less memory for large directories

For details, see the gnulib commit,
http://git.sv.gnu.org/cgit/gnulib.git/commit/?id=47cb657e
* tests/rm/4-million-entry-dir: New test.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
* gnulib: Update to latest to get the required fts fixes.

12 years agomaint: remove empty statement after jump label
Bernhard Voelker [Mon, 25 Jul 2011 16:39:28 +0000 (18:39 +0200)]
maint: remove empty statement after jump label

* src/head.c (elide_tail_bytes_pipe): Remove the empty statement, ";"
after a jump label; it is needed only when a declaration follows.
* src/kill.c (main): Likewise.
* src/od.c (main): Likewise.
* src/paste.c (collapse_escapes): Likewise.
* src/printf.c (print_formatted): Likewise.

12 years agopathchk: port to hosts where mbstate_t is replaced
Paul Eggert [Fri, 12 Aug 2011 08:14:45 +0000 (01:14 -0700)]
pathchk: port to hosts where mbstate_t is replaced

This problem was discovered when trying to build git coreutils on
Solaris 8 sparcv9 with Sun C 5.8: the 3rd argument to mbrlen was
of type int * (a pointer to the gnulib replacement mbstate_t) but
the system mbrlen wants the system mbstate_t *.
* bootstrap.conf (gnulib_modules): Add mbrlen.
* src/pathchk.c (mbrlen, mbstate_t) [!(HAVE_MBRLEN && HAVE_MBSTATE_T)]:
Remove macros, which are wrong now that gnulib supplies
replacements for mbstate_t and mbrlen.

12 years agobootstrap: use latest gnulib bootstrap, gettext
Paul Eggert [Thu, 11 Aug 2011 18:42:03 +0000 (11:42 -0700)]
bootstrap: use latest gnulib bootstrap, gettext

* bootstrap: Sync from gnulib.  This removes an obsolescent
gettext.m4 patch, along with some other changes that do not
seem to affect coreutils.
* bootstrap.conf (gnulib_modules): Use gettext, not gettext-h.
Current gnulib gettext seems to work without needing special hacking.
* configure.ac (AM_GNU_GETTEXT_VERSION): Now 0.18.1, not 0.17.
* gnulib: Update to latest.

12 years agomaint: use gnulib's new largefile modulue
Jim Meyering [Tue, 9 Aug 2011 08:28:31 +0000 (10:28 +0200)]
maint: use gnulib's new largefile modulue

* bootstrap.conf (gnulib_modules): Add largefile.
This is useful to Mac OS X 10.5 users if/when configure
is generated using autoconf prior to v2.68-80-gdb2f2e0.
* gnulib: Update to latest.

12 years agotests: avoid lack-of-support du test failure on HP-UX 11.31
Jim Meyering [Sun, 7 Aug 2011 20:09:42 +0000 (22:09 +0200)]
tests: avoid lack-of-support du test failure on HP-UX 11.31

* tests/du/inaccessible-cwd: Skip this test on systems like HP-UX 11.31
that lack both the *at functions and the /proc/self/fd-based support
we might have used to emulate them.  Reported by Bruno Haible in
http://debbugs.gnu.org/8846

12 years agojoin: with --check-order print offending file name, line number and data
Jim Meyering [Thu, 4 Aug 2011 17:31:50 +0000 (19:31 +0200)]
join: with --check-order print offending file name, line number and data

* src/join (g_names): New global (was main's "names").
(main): Update all uses of "names".
(line_no[2]): New globals.
(get_line): Increment after reading each line.
(check_order): Print the standard "file name:line_no: " prefix
as well as the offending line when reporting disorder.
Here is a sample old/new comparison:
  -join: file 1 is not in sorted order
  +join: in:4: is not sorted: contents-of-line-4
* tests/misc/join: Change the two affected tests to expect
the new diagnostic.
Add new tests for more coverage: mismatch in file 2,
two diagnostics, zero-length out-of-order line.
* NEWS (Improvements): Mention it.
Suggested by David Gast in http://debbugs.gnu.org/9236

12 years agomaint: use xcalloc rather than xmalloc+memset (no semantic change)
Jim Meyering [Thu, 4 Aug 2011 16:46:16 +0000 (18:46 +0200)]
maint: use xcalloc rather than xmalloc+memset (no semantic change)

* src/join.c (init_linep): Use xcalloc, not xmalloc+memset.

12 years agomaint: add copyright notice to init.cfg
Jim Meyering [Mon, 8 Aug 2011 07:26:18 +0000 (09:26 +0200)]
maint: add copyright notice to init.cfg

* tests/init.cfg: Add copyright.  Suggested by Stefano Lattarini.

12 years agomaint: prevent accidental future use of the old shell function name
Jim Meyering [Mon, 8 Aug 2011 06:54:52 +0000 (08:54 +0200)]
maint: prevent accidental future use of the old shell function name

This is especially important for an error-handling shell function
like this that is actually called only rarely.
* cfg.mk (sc_prohibit_framework_failure): New rule, to prevent
use of the old name.

12 years agotests: complete the renaming framework_failure -> framework_failure_
Stefano Lattarini [Thu, 4 Aug 2011 18:52:31 +0000 (20:52 +0200)]
tests: complete the renaming framework_failure -> framework_failure_

These changes were mostly mechanical, made by running the
following command:

  git grep -lw framework_failure | grep -v ChangeLog \
    | xargs perl -pi -e 's/\b(framework_failure)\b/${1}_/'

and then editing init.cfg and `tests/cp/cp-a-selinux' by hand.

* tests/init.cfg (framework_failure): Remove, `framework_failure_'
from init.sh should be used instead in the tests.
Remove now-obsolete "FIXME" comment.
(is_local_dir_, require_strace_, require_membership_in_two_groups_,
require_sparse_support_, skip_if_mcstransd_is_running_,
mkfifo_or_skip_) Use `framework_failure_', not `framework_failure'.
* Many test scripts: Likewise.

12 years agomktemp: stir in enough entropy (Bug#6683)
Paul Eggert [Mon, 8 Aug 2011 07:29:46 +0000 (00:29 -0700)]
mktemp: stir in enough entropy (Bug#6683)

* gl/lib/tempname.c.diff (gen_tempname_len):
Use x_suffix_len bytes' worth of entropy, not 8 bytes.

12 years agotests: remove obsolete 'error_' shell function
Stefano Lattarini [Thu, 4 Aug 2011 08:48:38 +0000 (10:48 +0200)]
tests: remove obsolete 'error_' shell function

* tests/init.cfg (framework_failure, getlimits_): Use 'fatal_'
instead of 'error_'.
(error_): Delete, it's not used anymore (and one is anyway
advised to use 'fatal_' instead).
Update heading comments.
* tests/shell-or-perl (error_): Renamed ...
(fatal_): ... to this, for consistency.  Also, add a useful
comment.

12 years agodoc: mention the new mirroring behavior of cp -au
Pádraig Brady [Sun, 31 Jul 2011 08:36:41 +0000 (09:36 +0100)]
doc: mention the new mirroring behavior of cp -au

* NEWS: Mention the change in behavior.
* doc/coreutils.texi (cp invocation): Likewise.

12 years agomaint: accommodate old-NEWS update
Jim Meyering [Sun, 31 Jul 2011 09:23:58 +0000 (11:23 +0200)]
maint: accommodate old-NEWS update

* cfg.mk (old_NEWS_hash): Update, to accommodate 6.12 addition.
Without this change, "make syntax-check" would fail.

12 years ago* NEWS: Say that 6.12 preserved ns-resolution timestamps.
Paul Eggert [Sun, 31 Jul 2011 07:21:00 +0000 (00:21 -0700)]
* NEWS: Say that 6.12 preserved ns-resolution timestamps.

12 years agobuild: require gnulib's fclose module
Jim Meyering [Wed, 27 Jul 2011 19:48:59 +0000 (21:48 +0200)]
build: require gnulib's fclose module

* bootstrap.conf (gnulib_modules): Explicitly use the fclose module.
This is required, now that gnulib's close module no longer depends
on fclose.  Without this module, we would be exposed to fclose bugs
affecting at least glibc 2.13 and FreeBSD.
Reported by Bernhard Voelker.  Suggested by Eric Blake.

12 years agobuild: update gnulib, for "make syntax-check" fix
Jim Meyering [Wed, 27 Jul 2011 20:19:11 +0000 (22:19 +0200)]
build: update gnulib, for "make syntax-check" fix

Without the recent maint.mk fix, "make syntax-check"
would fail like this:

    src/dd.c:# define SA_RESETHAND 0
    src/ls.c:# define SA_RESTART 0
    src/timeout.c:# define SA_RESTART 0
    maint.mk: define the above via some gnulib .h file
    make: *** [sc_prohibit_always-defined_macros] Error 1

12 years agodoc: add a vim indentation example
Ivan Sichmann Freitas [Tue, 19 Jul 2011 02:43:19 +0000 (23:43 -0300)]
doc: add a vim indentation example

HACKING: add a vim example showing how to configure it to follow GNU
indentation in coreutils source files.

12 years agomaint: copy: refactor hard link creation
Pádraig Brady [Wed, 27 Jul 2011 12:22:39 +0000 (13:22 +0100)]
maint: copy: refactor hard link creation

* src/copy.c (create_hard_link): A new function refactored
from existing code.
(copy_internal): Call the new function from all 3 locations
that create hard links.
* tests/cp/same-file: Amend to match the adjusted diagnostic.

12 years agotests: cp/preserve-link: test all relevant paths
Pádraig Brady [Wed, 27 Jul 2011 08:32:39 +0000 (09:32 +0100)]
tests: cp/preserve-link: test all relevant paths

* tests/cp/preserve-link: Add test cases for when a missing
link in the destination tree is encountered first and second.
Also add cases for old and new separate files in the destination
tree, both to make the clobbering behavior explicit, and to
test any changes in this area in future.

12 years agodoc: mention cp's dir-permissions fix
Jim Meyering [Tue, 26 Jul 2011 07:24:31 +0000 (09:24 +0200)]
doc: mention cp's dir-permissions fix

* NEWS (Bug fixes): Mention yesterday's dir-permissions fix.

12 years agomaint: use consistent style in C and test scripts
Jim Meyering [Tue, 26 Jul 2011 07:01:44 +0000 (09:01 +0200)]
maint: use consistent style in C and test scripts

* src/copy.c (copy_internal): Adjust formatting style to conform with
guidelines in HACKING: put braces around two one-line "else" blocks.
* tests/cp/existing-perm-dir: Use $(...), not `...`, and
stat rather than ls+cut to get the mode string.
mode=$(stat --p=%A dst/dir)

12 years agocp: don't mishandle existing dir dest permissions (Bug#9170)
Paul Eggert [Mon, 25 Jul 2011 20:36:16 +0000 (13:36 -0700)]
cp: don't mishandle existing dir dest permissions (Bug#9170)

* src/copy.c (copy_internal): If we don't create the directory,
then we cannot have omitted permissions.  Problem and trivial
fix reported by Eric Lammerts.
* tests/Makefile.am (TESTS): Add cp/existing-perm-dir.
* tests/cp/existing-perm-dir: New file.

12 years agocp -up: preserve all hard links
Jim Meyering [Mon, 25 Jul 2011 09:31:01 +0000 (11:31 +0200)]
cp -up: preserve all hard links

* src/copy.c (copy_internal): With --update (-u), this function would
return early once it found that the destination is not older than the
source, *without* recording the source-dev/ino--to--dest_name mapping.
That mapping is required in order to preserve src hard links in the
destination tree, so when using cp with --update and --preserve=links
(perhaps via -p or -a), cp could fail to preserve one hard link
per inode when at least one of the hard-linked names already exists
in the destination tree.
Reported by Odd Harry Mannsverk in http://debbugs.gnu.org/8419.
* tests/cp/preserve-link: New file.  Exercise the flaw/fix.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.

12 years agotimeout: support sub-second timeouts
Pádraig Brady [Mon, 18 Jul 2011 09:49:17 +0000 (10:49 +0100)]
timeout: support sub-second timeouts

* src/timeout.c (settimeout): A new function to convert
from a floating point duration and call alarm() or
timer_settime() if that's available.
(parse_duration): Return a double rather than unsigned int.
(usage): Mention floating point is supported.
(main): Pass the double to settimeout() rather than
calling alarm() directly with the parsed int.
(cleanup): Likewise.
* doc/coreutils.texi (timeout invocation): Say floating point timeouts
now supported, and mention the caveat with resolution.
* bootstrap.conf: Include the timer-time gnulib module.
* tests/misc/timeout-parameters: Add a test with nanoseconds.
* NEWS: Mention the improvement.

12 years agobuild: update gnulib to fix a build warning/error in a test program
Jim Meyering [Mon, 25 Jul 2011 06:26:06 +0000 (08:26 +0200)]
build: update gnulib to fix a build warning/error in a test program

12 years agodf: support partitions larger than 4 TiB on MacOS >= 10.5 & AIX >=5.2
Jim Meyering [Sun, 24 Jul 2011 20:52:34 +0000 (22:52 +0200)]
df: support partitions larger than 4 TiB on MacOS >= 10.5 & AIX >=5.2

This change derives from improvements to gnulib's fsusage module.
* NEWS (Improvements): df now supports disk partitions larger than
4 TiB on MacOS X 10.5 or newer and on AIX 5.2 or newer.
Alphabetize entries.
* gnulib: Update to latest.

12 years agodd, shred: use fdatasync only if declared
Paul Eggert [Fri, 22 Jul 2011 20:40:03 +0000 (13:40 -0700)]
dd, shred: use fdatasync only if declared

* m4/jm-macros.m4 (coreutils_MACROS): Use fdatasync only if declared.
MacOS X 10.7 has an fdatasync that is not declared, and is rumored to
be ineffective.  (Bug#9141)

12 years agodircolors: add screen.Eterm terminal type
Mike Frysinger [Wed, 20 Jul 2011 03:59:34 +0000 (23:59 -0400)]
dircolors: add screen.Eterm terminal type

* src/dircolors.hin: Add screen.Eterm.
Reported by Kfir Lavi

12 years agomaint: remove a redundant call to gl_CLOCK_TIME
Pádraig Brady [Wed, 20 Jul 2011 10:36:36 +0000 (11:36 +0100)]
maint: remove a redundant call to gl_CLOCK_TIME

* m4/jm-macros.m4: Remove gl_CLOCK_TIME as it's already
done by the gettime gnulib module.

12 years agounexpand: fix misalignment when spaces span a tabstop
Pádraig Brady [Tue, 19 Jul 2011 08:06:37 +0000 (09:06 +0100)]
unexpand: fix misalignment when spaces span a tabstop

The following dropped the space from the first field
  printf "1234567  \t1\n" | unexpand -a
Note POSIX says that spaces should not precede tabs.
Also a single trailing space should not be converted
if the next field starts with non blank characters.
So we enforce those rules too, with this change.

* src/unexpand.c (unexpand): Implement as per POSIX rules.
* tests/misc/unexpand: Add tests, and adjust existing
tests as per POSIX rules.
* NEWS: Mention the fix.
Reported by Hallvard B Furuseth

12 years ago* NEWS: Mention fix for Bug#9098.
Paul Eggert [Sun, 17 Jul 2011 19:51:56 +0000 (12:51 -0700)]
* NEWS: Mention fix for Bug#9098.

12 years agotimeout: add regression test (Bug#9098)
Paul Eggert [Sun, 17 Jul 2011 19:47:22 +0000 (12:47 -0700)]
timeout: add regression test (Bug#9098)

* tests/misc/timeout: Check that 'timeout' is not confused when
starting off with a child.

12 years agotimeout: treat seconds counts like 'sleep' does
Paul Eggert [Sat, 16 Jul 2011 19:07:46 +0000 (12:07 -0700)]
timeout: treat seconds counts like 'sleep' does

Treat fractions as a request to round up to the next representable
value, and treat out-of-range values as maximal ones.  This is
consistent with how "sleep" works.  And this way, "timeout
999999999999999999d FOO" and "timeout 4.5 foo" are more likely to
do what the user wants.
* src/timeout.c: Include c-strtod.h and xstrtod.h, not xstrtol.h.
(apply_time_suffix): Change it to the way sleep.c's time_suffix
does things.  Maybe this function (identical in both programs,
other than its name) should be moved to a library?
(parse_duration): Return a maximal value on overflow.  Return
unsigned int, not unsigned long.  Allow fractions, which round
up to the next integer value.
* tests/misc/timeout-parameters: Adjust tests to match new behavior.
Add a very large number.

12 years agoFix capiTalization in comments.
Paul Eggert [Sat, 16 Jul 2011 13:03:47 +0000 (06:03 -0700)]
Fix capiTalization in comments.

12 years ago* src/timeout.c (main): Use waitpid, not wait (Bug#9098).
Paul Eggert [Sat, 16 Jul 2011 12:57:19 +0000 (05:57 -0700)]
* src/timeout.c (main): Use waitpid, not wait (Bug#9098).

Reported by Andreas Schwab.

* src/timeout.c (SA_RESTART): Define to 0 if not defined.

12 years agotimeout: port to NonStop (Bug#9077)
Paul Eggert [Sat, 16 Jul 2011 00:48:38 +0000 (17:48 -0700)]
timeout: port to NonStop (Bug#9077)

* src/timeout.c (SA_RESTART): Define to 0 if not defined.
(main): Don't assume signal handling uses SA_RESTART.

12 years agols: port to NonStop (Bug#9076)
Paul Eggert [Sat, 16 Jul 2011 00:39:28 +0000 (17:39 -0700)]
ls: port to NonStop (Bug#9076)

* src/ls.c (SA_RESTART): Define to 0 if not defined.

12 years agodd: port to NonStop (Bug#9076)
Paul Eggert [Sat, 16 Jul 2011 00:38:32 +0000 (17:38 -0700)]
dd: port to NonStop (Bug#9076)

* src/dd.c (SA_RESETHAND): Define to 0 if not defined.

13 years agocsplit: don't prematurely terminate cleanup (Bug#9076)
Paul Eggert [Fri, 15 Jul 2011 23:03:41 +0000 (16:03 -0700)]
csplit: don't prematurely terminate cleanup (Bug#9076)

* src/csplit.c (interrupt_handler): Reset signal to SIG_DFL
after deleting the files, so that a second interrupt won't
prematurely terminate cleanup.
(main): Don't use SA_NODEFER | SA_RESETHAND, as that might
allow premature termination of cleanup.  Also, this ports better
to platforms like NonStop, which don't ahve SA_RESETHAND.

13 years ago* src/dd.c: Remove obsolete comments re POSIX.
Paul Eggert [Fri, 15 Jul 2011 22:56:13 +0000 (15:56 -0700)]
* src/dd.c: Remove obsolete comments re POSIX.

13 years agobuild: avoid a st_blksize compile failure on some systems
Pádraig Brady [Fri, 15 Jul 2011 15:18:18 +0000 (16:18 +0100)]
build: avoid a st_blksize compile failure on some systems

* src/stat.c (print_stat): Use ST_BLKSIZE() rather than
accessing st_blksize directly, which is not present on
NonStop at least.  Reported by Joachim Schmitz.

13 years agobuild: avoid a fiemap compile failure on some systems
Pádraig Brady [Fri, 15 Jul 2011 08:51:35 +0000 (09:51 +0100)]
build: avoid a fiemap compile failure on some systems

* src/fiemap.h (struct fiemap): Adjust the previous change
to the fiemap_extents array, which would also require changes
to the sizeof calculations in extent_scan_read().
Instead, only declare the fiemap_extents zero length array
on linux, which is the only platform that references this member.
This avoids a compilation failure on systems that don't support
this non standard construct.  We don't use the equivalent C99
flexible array construct so as to have maximum portability.
* src/extent-scan.c: Cleanup. Remove a redundant #ifndef.

13 years ago* src/fiemap.h (struct fiemap.fm_extents): Change size to 1.
Paul Eggert [Fri, 15 Jul 2011 05:06:46 +0000 (22:06 -0700)]
* src/fiemap.h (struct fiemap.fm_extents): Change size to 1.

This is for portability to non-GCC C89 and C99 compilers.
Original problem, on NonStop, reported by Joachim Schmitz in
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9077>.

13 years agomaint: fix warning 'possible use of "=" where "==" was intended'
Bernhard Voelker [Thu, 14 Jul 2011 10:56:23 +0000 (11:56 +0100)]
maint: fix warning 'possible use of "=" where "==" was intended'

* src/mktemp.c: maint: avoid warning by using the comma operator
rather than an always-true conditional (as suggested by Eric Blake).
Reported by Joachim Schmitz in http://debbugs.gnu.org/9064.

13 years agodoc: describe the file permissions set by mktemp
Benoît Knecht [Wed, 13 Jul 2011 11:57:59 +0000 (13:57 +0200)]
doc: describe the file permissions set by mktemp

* src/mktemp.c (usage): As above, for --help.
Reported by Jordi Pujol in http://bugs.debian.org/551093.
Wording improvments from Eric Blake.

13 years agodoc: note the order in which wc counts are printed
Benoît Knecht [Mon, 11 Jul 2011 21:10:33 +0000 (23:10 +0200)]
doc: note the order in which wc counts are printed

This information has already been added to the Texinfo manual, but was
missing from the --help output.

* src/wc.c (usage): As above, for --help.
Reported by Vincent Lefevre in http://bugs.debian.org/395430.

13 years agobuild: update gnulib submodule to latest
Jim Meyering [Tue, 12 Jul 2011 13:40:53 +0000 (15:40 +0200)]
build: update gnulib submodule to latest

13 years agobuild: list makeinfo 4.13 as a build-from-git requirement
Eric Blake [Tue, 12 Jul 2011 10:05:47 +0000 (12:05 +0200)]
build: list makeinfo 4.13 as a build-from-git requirement

* bootstrap.conf (buildreq): List 4.13 as minimum makeinfo version.
Prompted by Joachim Schmitz's report in http://debbugs.gnu.org/9050.

13 years agodircolors: highlight .webm multimedia files
Benoît Knecht [Sun, 10 Jul 2011 22:38:34 +0000 (00:38 +0200)]
dircolors: highlight .webm multimedia files

* src/dircolors.hin: Add .webm multimedia files.
Suggested by Josh Triplett in http://bugs.debian.org/582403.

13 years agomaint: add syntax-check rule to prohibit "."-terminated "SEE ALSO"
Jim Meyering [Fri, 8 Jul 2011 15:10:17 +0000 (17:10 +0200)]
maint: add syntax-check rule to prohibit "."-terminated "SEE ALSO"

* cfg.mk (sc_prohibit_man_see_also_period): Prohibit a period at
the end of the first line after a "SEE ALSO" marker in man/*.x.
With this, we shouldn't have to make any more changes like those
in today's commit, f2dabd68.

13 years agodoc: list all new file system types recognized by stat -f
Pádraig Brady [Fri, 8 Jul 2011 14:53:09 +0000 (15:53 +0100)]
doc: list all new file system types recognized by stat -f

NEWS (Improvements): Mention the MQUEUE and PSTOREFS
file systems, recognized as of commit 171e1b98.

13 years agodoc: don't terminate SEE ALSO sections with a period
Benoît Knecht [Fri, 8 Jul 2011 12:52:41 +0000 (14:52 +0200)]
doc: don't terminate SEE ALSO sections with a period

man-pages(7) explicitly says about SEE ALSO sections: "Do not terminate
this with a period." This is also in line with all the other man pages
in coreutils.

* man/cat.x: Remove period at the end of the SEE ALSO section.
* man/tac.x: Likewise.

13 years agotimeout: handle signals more transparently
Pádraig Brady [Fri, 8 Jul 2011 13:49:05 +0000 (14:49 +0100)]
timeout: handle signals more transparently

* m4/jm-macros.m4: Define HAVE_SETRLIMIT.
* src/timeout.c: If the child exited with a signal,
raise that signal to the timeout process itself,
so that callers may also see the signal status.
Use setrlimit to disable core dumps for the timeout
process, which would be generated by some signals.

13 years agotimeout: support cascaded timeouts
Pádraig Brady [Fri, 8 Jul 2011 12:31:05 +0000 (13:31 +0100)]
timeout: support cascaded timeouts

* src/timeout.c (cleanup): Send signals directly to the child
in case it has started its own process group (like a cascaded
timeout command would for example).
* test/misc/timeout-group: Add a test case.
* NEWS: Mention the fix.

13 years agotimeout: add --foreground to support interactive commands
Pádraig Brady [Wed, 6 Jul 2011 22:17:10 +0000 (23:17 +0100)]
timeout: add --foreground to support interactive commands

Or more accurately, commands not started from the shell prompt,
that are interactive, or need to receive Ctrl-C etc. from the terminal.

* doc/coreutils.texi (timeout invocation): Document --foreground.
* src/timeout.c (main): Set the foreground flag and don't create
a separate group.
(cleanup): Only send a signal directly to the monitored command
when the foreground flag is set.
(usage): Describe --foreground.
* tests/misc/timeout-group: Add a new test.
* tests/Makefile.am: Reference new test.
NEWS: Mention the new option.

Reported by Shay Shimony
Analysis by Alan Curry
Fix suggested by Paul Eggert

13 years agodoc: note that cp -l creates _hard_ links
Benoît Knecht [Fri, 8 Jul 2011 08:17:20 +0000 (10:17 +0200)]
doc: note that cp -l creates _hard_ links

This fact was already noted in the Texinfo manual, but not in the
output of --help.
* src/cp.c (usage): As above, for --help.
Reported by Jari Aalto in http://bugs.debian.org/294327.

13 years agotests: exercise md5sum's new --strict option
Jim Meyering [Thu, 7 Jul 2011 10:12:40 +0000 (12:12 +0200)]
tests: exercise md5sum's new --strict option

* tests/misc/md5sum: Exercise new --strict option.

13 years agomd5sum, sha1sum, etc: accept new option: --strict
Patrick Schoenfeld [Thu, 7 Jul 2011 06:57:39 +0000 (08:57 +0200)]
md5sum, sha1sum, etc: accept new option: --strict

Use this new option with --check when the input is expected to
consist solely of checksum lines.  With only --check, an invalid
line evokes a warning, but the program can still exit successfully.
With --strict, any invalid line makes the program exit non-zero.

* src/md5sum.c (strict, STRICT_OPTION): Declare/define.
(long_options): Add "strict".
(usage): Describe --strict.
(digest_check): Count improperly_formatted lines, too, and use
that number and the global "strict" to determine the return value.
(main): Handle STRICT_OPTION.
Reject --strict without --check.
* doc/coreutils.texi: Describe it.
* NEWS (New features): Mention it.

13 years agodoc: note date's %k, %l are space-padded and equivalent to %_H and %_I
Benoît Knecht [Thu, 7 Jul 2011 08:55:47 +0000 (10:55 +0200)]
doc: note date's %k, %l are space-padded and equivalent to %_H and %_I

* src/date.c (usage): As above, for --help.
* doc/coreutils.texi (Time conversion specifiers): Likewise.
Reported by Britton Leo Kerin in http://bugs.debian.org/115833.

13 years agostat: recognize GPFS as a file system type
Jim Meyering [Tue, 5 Jul 2011 20:49:56 +0000 (22:49 +0200)]
stat: recognize GPFS as a file system type

* src/stat.c (human_fstype) [S_MAGIC_GPFS]: Add a case,
to handle GPFS_SUPER_MAGIC/0x47504653.  Prompted by this discussion:
http://thread.gmane.org/gmane.comp.sysutils.autoconf.general/14007
* NEWS (Improvements): Mention it.

13 years agomaint: use "const" and "pure" function attributes where possible
Jim Meyering [Sun, 24 Apr 2011 17:06:39 +0000 (19:06 +0200)]
maint: use "const" and "pure" function attributes where possible

* configure.ac (WARN_CFLAGS): Add -Wsuggest-attribute=const,
-Wsuggest-attribute=pure and -Wsuggest-attribute=noreturn.
(GNULIB_WARN_CFLAGS): But do not add them here... yet.
* src/chown-core.h (chopt_free, uid_to_name): Add function attribute(s).
* src/copy.c (is_ancestor, valid_options): Likewise.
* src/copy.h (chown_failure_ok): Likewise.
* src/dd.c (operand_matches, operand_is): Likewise.
* src/df.c (selected_fstype, excluded_fstype): Likewise.
* src/expr.c (null looks_like_integer): Likewise.
* src/md5sum.c (hex_digits): Likewise.
* src/od.c (get_lcm): Likewise.
* src/pathchk.c (component_start, component_len): Likewise.
* src/pinky.c (count_ampersands): Likewise.
* src/pr.c (cols_ready_to_print): Likewise.
* src/ptx.c (search_table): Likewise.
* src/sort.c (find_unit_order): Likewise.
* src/stty.c (mode_type_flag, string_to_baud, baud_to_value): Likewise.
* src/system.h (gcd, lcm): Likewise.
* src/tr.c (is_char_class_member, look_up_char_class): Likewise.
(star_digits_closebracket): Likewise.
* src/uniq.c (find_field): Likewise.
* src/wc.c (compute_number_width): Likewise.
* lib/xfts.h (cycle_warning_required): Likewise.
* gl/lib/randint.h (randint_get_source): Likewise.
* gl/lib/randperm.c (ceil_lg): Likewise.
* gl/lib/randperm.h (randperm_bound): Likewise.
* lib/strnumcmp.h (strintcmp): Likewise.

13 years agobuffer_lcm: declare with _GL_ATTRIBUTE_CONST
Jim Meyering [Sat, 4 Jun 2011 08:41:08 +0000 (10:41 +0200)]
buffer_lcm: declare with _GL_ATTRIBUTE_CONST

* lib/buffer-lcm.h (buffer_lcm): Use _GL_ATTRIBUTE_CONST.
* lib/buffer-lcm.c: Include <config.h>.

13 years agodoc: detail the effect of disabling input buffering with stdbuf
Pádraig Brady [Fri, 1 Jul 2011 08:42:17 +0000 (09:42 +0100)]
doc: detail the effect of disabling input buffering with stdbuf

* docs/coreutils.texi (stdbuf invocation): Expand on the different
reasons for disabling buffering on input and output.

13 years agodoc: mention the restrictions for stdbuf more prominently
Bruno Haible [Thu, 30 Jun 2011 17:02:36 +0000 (18:02 +0100)]
doc: mention the restrictions for stdbuf more prominently

* doc/coreutils.texi (stdbuf invocation): List the contraints
on the command being controlled, up front.

13 years agodoc: improve ls --help grammar
Jim Meyering [Sat, 25 Jun 2011 12:54:45 +0000 (14:54 +0200)]
doc: improve ls --help grammar

* src/ls.c (usage): Improve grammar.
Reported by Peng Yu.

13 years agodoc: clarify an improvement from coreutils-7.0
Jim Meyering [Sat, 25 Jun 2011 05:57:59 +0000 (07:57 +0200)]
doc: clarify an improvement from coreutils-7.0

* NEWS (7.0 Improvements): Mention the command: "ls -1U".
* cfg.mk (old_NEWS_hash): Update.

13 years agomaint: don't use gnulib's pathmax module; define PATH_MAX if needed
Jim Meyering [Fri, 24 Jun 2011 07:12:59 +0000 (09:12 +0200)]
maint: don't use gnulib's pathmax module; define PATH_MAX if needed

* bootstrap.conf (gnulib_modules): Remove pathmax.
* src/system.h: Don't include "pathmax.h".
(PATH_MAX) [!PATH_MAX]: Define to 8192.  Defining it to a constant
is preferable to using a definition from pathmax.h that might expand
to pathconf ("/", _PC_PATH_MAX). Prompted by discussion leading to:
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/27183/focus=27269

13 years agobuild: bootstrap: remove obsolete gettext-related file exclusions
Jim Meyering [Wed, 22 Jun 2011 15:34:08 +0000 (17:34 +0200)]
build: bootstrap: remove obsolete gettext-related file exclusions

* bootstrap.conf: Don't bother to exclude gettext/intl-related
.m4 files.  That exclusion is no longer necessary.

13 years agostat: recognize MQUEUE and PSTOREFS file systems
Pádraig Brady [Fri, 24 Jun 2011 07:22:06 +0000 (08:22 +0100)]
stat: recognize MQUEUE and PSTOREFS file systems

* src/stat.c (human_fstype): Add magic numbers for
PSTOREFS and MQUEUE.

13 years agotests: stat-free-color: do not count stat calls before main
Bernhard Voelker [Tue, 21 Jun 2011 14:26:50 +0000 (16:26 +0200)]
tests: stat-free-color: do not count stat calls before main

* tests/ls/stat-free-color: The system may perform additional stat
calls upon loading (seen on OpenSuSE-11.4).  Count only the number
of stat calls compared to --help.
This also reduces back to "1" the number of expected calls,
effectively reverting part of 2011-06-01 commit, ccf2d9a4.