platform/upstream/coreutils.git
14 years agosort: adjust the leading blanks --debug warning
Pádraig Brady [Sat, 22 May 2010 13:19:50 +0000 (14:19 +0100)]
sort: adjust the leading blanks --debug warning

* src/sort.c (key_warnings): Always warn about significant leading
blanks when character offsets are specified, unless they key is
possibly a line offset, i.e. of the form -k1.x,1.y.  Also suppress
this warning if the user could be sorting right aligned indexes.

14 years agomaint: make copyright comment consistent with all others
Jim Meyering [Sun, 23 May 2010 16:10:28 +0000 (18:10 +0200)]
maint: make copyright comment consistent with all others

* tests/misc/mktemp: Change punctuation to make copyright
paragraph consistent with all of the others.

14 years agotests: fix cp-a-selinux to skip cleanly upon mkfs failure
Jim Meyering [Fri, 21 May 2010 12:55:36 +0000 (14:55 +0200)]
tests: fix cp-a-selinux to skip cleanly upon mkfs failure

* tests/cp/cp-a-selinux: Initialize skip, to avoid a syntax error
in subsequent "test".
Remove redirect-to-/dev/null, now that output is always to a log file.

14 years agodu: recognize -d N as equivalent to --max-depth=N
Jon Ringuette [Tue, 18 May 2010 06:26:11 +0000 (08:26 +0200)]
du: recognize -d N as equivalent to --max-depth=N

* NEWS (New features): Mention it.
* src/du.c (DEBUG_OPT): Remove.  Use long-named ---debug instead.
Commented out.
(MAX_DEPTH_OPTION): Remove.  Use 'd' instead.
(main): Insert literal "d:"; remove DEBUG_OPT.
* doc/coreutils.texi (du invocation): Add -d to indices.
* tests/du/max-depth: Exercise -d, too.

14 years agotests: exercise du's --max-depth option
Jim Meyering [Tue, 18 May 2010 06:39:40 +0000 (08:39 +0200)]
tests: exercise du's --max-depth option

* tests/Makefile.am (TESTS): Add du/max-depth.
* tests/du/max-depth: New file.

14 years agotests: fix sort-debug-keys when fr_FR.utf8 not available
Pádraig Brady [Tue, 18 May 2010 22:42:36 +0000 (23:42 +0100)]
tests: fix sort-debug-keys when fr_FR.utf8 not available

* tests/misc/sort-debug-keys: Correctly check for the absence
of the French UTF8 locale.

14 years agomaint: fix the fs-magic-compare rule
Jim Meyering [Mon, 17 May 2010 14:10:24 +0000 (16:10 +0200)]
maint: fix the fs-magic-compare rule

* src/Makefile.am (fs-def): Sort definitions.
This is required by fs-magic-compare's use of join.

14 years agotests: update init.sh from gnulib
Jim Meyering [Mon, 17 May 2010 07:12:22 +0000 (09:12 +0200)]
tests: update init.sh from gnulib

* tests/init.sh: Update from gnulib.

14 years agobuild: avoid a new -Wformat-induced warning
Jim Meyering [Mon, 17 May 2010 07:09:28 +0000 (09:09 +0200)]
build: avoid a new -Wformat-induced warning

* src/sort.c (mark_key): Add a cast-to-int of a printf field width,
to placate -Wformat.

14 years agodoc: fix sort info about version sort skipping blanks
Pádraig Brady [Sun, 16 May 2010 00:14:51 +0000 (01:14 +0100)]
doc: fix sort info about version sort skipping blanks

* doc/coreutils.text (sort invocation): leading blanks are
significant for 'V'.

14 years agosort: --debug: output data independent warnings and info
Pádraig Brady [Tue, 11 May 2010 17:46:21 +0000 (18:46 +0100)]
sort: --debug: output data independent warnings and info

* src/sort.c (usage): Mention --debug can output warnings to stderr.
Also split the translatable string to aid translation.
(default_key_compare): A new function refactored from main(),
and now also called from the new key_warnings() function.
(key_to_opts): A new function refactored from incompatible_options(),
and now also called from the new key_warnings() function.
(key_numeric): A new function refactored to test if key is numeric.
(key_warnings): A new function to output warnings to stderr,
about questionable use of various options.  Currently it warns
about zero length keys and ineffective global options.
(incompatible_options): Refactor out key_to_opts()
(main): Use key_init() to initialize gkey.  Refactor out
default_key_compare().  Call key_warnings() in debug mode.
* doc/coreutils.texi (sort invocation): Mention that warnings
are output by --debug.
* tests/misc/sort-debug-warn: A new test for debug warnings.
* tests/Makefile.am: Reference the new test.
* NEWS: Mention the new feature

14 years agotests: fix sort-debug-keys when fr_FR.utf8 not available
Pádraig Brady [Wed, 12 May 2010 13:47:30 +0000 (14:47 +0100)]
tests: fix sort-debug-keys when fr_FR.utf8 not available

* tests/misc/sort-debug-keys: Don't verify (or even run)
the fr_FR tests when that locale is not available on the system.

14 years agosort: add a --debug option to highlight key extents
Pádraig Brady [Tue, 23 Feb 2010 08:43:04 +0000 (08:43 +0000)]
sort: add a --debug option to highlight key extents

* src/sort (usage): Add description for --debug.
(write_bytes): Pass a line structure so it can subsequently
be passed to compare to highlight the keys when in debug mode.
Also transform TAB and NUL characters written to stdout so
that the highlighting in debug mode aligns correctly.
(human_numcompare): Pass an "endptr" so we can record the extent
of the number matched.
(general_numcompare): Likewise.
(find_unit_order): Likewise.
(getmonth): Likewise.
(numcompare): Likewise.  Note we reuse find_unit_order() for this,
which is a good enough approximation, and means we don't need to
change the strnumcmp() interface.
(check_mixed_SI_IEC): Return whether iec_present, so that can be
used to set the "endptr" in find_unit_order.  Also make the key
parameter optional, which will be the case from numcompare().
(count_tabs): A new function to determine how much to adjust
the mbswidth() values by (TABs don't have a width).
(mark_key): A new function to output the key highlighting to stdout.
(debug_key): A new function to determine the offset and width
of the key highlighting.
(key_compare): Pass the show_debug parameter so the key highlighting
is only displayed when explicitly called.  For each key type, set
the length (lena) and whether leading blanks are auto skipped (skipb)
which are then used by debug_key() to highlight the portion of the
key used in the comparison.
(compare): Pass the show_debug parameter so the key highlighting
is only displayed when explicitly called.  Call debug_key() to
highlight the last resort comparison.
(check): Output highlighting for disorder line to stdout.
(main): Process the --debug option and make it mutually exlusive
with the -o option as I don't see it useful there, even potentially
harmful if someone left a --debug in by mistake when updating a file.
Also restricting debug output to stdout, simplifies the logic
for dealing with temporary files.
* doc/coreutils.texi (sort invocation): Describe the --debug option,
and reference it from the --key description.
* tests/misc/sort-debug-keys: A new test for highlighting keys.
* tests/Makefile.am: Reference the new test.
* NEWS: Mention the new feature.

14 years agobuild: record the gettext-0.18 requirement also in configure.ac
Jim Meyering [Tue, 11 May 2010 08:31:21 +0000 (10:31 +0200)]
build: record the gettext-0.18 requirement also in configure.ac

* configure.ac: Require gettext-0.18 here, too.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Tue, 11 May 2010 07:50:29 +0000 (09:50 +0200)]
build: update gnulib submodule to latest

* tests/init.sh: Update from gnulib, to fix typo.

14 years agobuild: record that when building from git, gettext-0.18 is required
Jim Meyering [Mon, 10 May 2010 10:39:37 +0000 (12:39 +0200)]
build: record that when building from git, gettext-0.18 is required

* bootstrap.conf (buildreq): Require gettext-0.18.

14 years agotests: avoid a new syntax-check failure
Jim Meyering [Mon, 10 May 2010 09:47:00 +0000 (11:47 +0200)]
tests: avoid a new syntax-check failure

* .x-sc_prohibit_fail_0: Exempt tests/init.sh.

14 years agotests: provide a definition of gl_trap_ in cfg.mk
Jim Meyering [Mon, 10 May 2010 09:06:37 +0000 (11:06 +0200)]
tests: provide a definition of gl_trap_ in cfg.mk

* cfg.mk (gl_trap_): Define here, now that it's gone from maint.mk.
* gnulib: Update to latest.

14 years agotests: begin using init.sh
Jim Meyering [Mon, 10 May 2010 09:29:27 +0000 (11:29 +0200)]
tests: begin using init.sh

* tests/init.sh: New file.
* tests/Makefile.am (EXTRA_DIST): Add it here.

14 years agotests: update help-version
Jim Meyering [Sun, 9 May 2010 19:22:21 +0000 (21:22 +0200)]
tests: update help-version

* tests/misc/help-version: Use init.sh, rather than test-lib.sh.
Add idutils' setup.

14 years agotests: move sc_prohibit_always-defined_macros to gnulib's maint.mk
Jim Meyering [Sun, 9 May 2010 16:52:36 +0000 (18:52 +0200)]
tests: move sc_prohibit_always-defined_macros to gnulib's maint.mk

* cfg.mk (sc_prohibit_always-defined_macros): Remove it from here.
* gnulib: Update to latest, for a maint.mk that includes that rule.

14 years agotests: rename a syntax-check
Jim Meyering [Sun, 9 May 2010 16:47:34 +0000 (18:47 +0200)]
tests: rename a syntax-check

* cfg.mk (sc_prohibit_always-defined_macros): Rename from
sc_always_defined_macros.
* .x-sc_prohibit_always-defined_macros: New file, renamed from...
* .x-sc_always_defined_macros: ...removed.
* Makefile.am (syntax_check_exceptions): Rename here, too.

14 years agotests: loosen/tighten the always_defined_macros check
Jim Meyering [Sun, 9 May 2010 16:29:22 +0000 (18:29 +0200)]
tests: loosen/tighten the always_defined_macros check

* cfg.mk (.re-defmac): Generate better regexps: allow white space
before the '#', and append a word-boundary requirement.
Without the latter, #define NULL_DEV ... would evoke a false-positive.

14 years agotests: improve the always_defined_macros check
Jim Meyering [Sun, 9 May 2010 10:08:21 +0000 (12:08 +0200)]
tests: improve the always_defined_macros check

* cfg.mk (sc_always_defined_macros): Adjust its helpers not to depend
on the existence of ./lib.  Instead, extract symbols directly from
gnulib/lib/*.in.h files.

14 years agodoc: factor hard-coded project-specific bits from README-release, ...
Jim Meyering [Mon, 3 May 2010 20:00:30 +0000 (22:00 +0200)]
doc: factor hard-coded project-specific bits from README-release, ...

using the new --mail-headers option to gnulib's announce-gen, and
the updated maint.mk rules to connect the pieces.
* README-release: Remove hard-coded To:, Cc: etc. parts, now
that they're emitted automatically into the announcement template.
* cfg.mk (announcement_Cc_): Override the default.
* gnulib: Update to latest, to get newer announce-gen and maint.mk.

14 years agodoc: update release procedure
Jim Meyering [Mon, 3 May 2010 18:37:13 +0000 (20:37 +0200)]
doc: update release procedure

* README-release: Rearrange slightly: post the announcement to
Savannah first, so you can include a link to that post in the email.

14 years agomaint: factor trap-related code out of two syntax-check rules
Jim Meyering [Mon, 3 May 2010 13:35:56 +0000 (15:35 +0200)]
maint: factor trap-related code out of two syntax-check rules

* cfg.mk (gl_trap_): Define, using a loop and eval'd trap,
rather than repeated "trap" uses.  Also handle "13", SIGPIPE.
(sc_always_defined_macros): Use it.
(sc_system_h_headers): Likewise.

14 years agomaint: extend the always_defined_macros syntax-check
Jim Meyering [Mon, 3 May 2010 10:05:14 +0000 (12:05 +0200)]
maint: extend the always_defined_macros syntax-check

* cfg.mk (gl_generated_headers_): Define.
(headers_with_interesting_macro_defs): Remove headers covered
by the above.
(.re-defmac): Extract symbol names from many more files.
(sc_always_defined_macros): Use VC_LIST_EXCEPT, not VC_LIST, so
that we can use the usual exception mechanism.
Test for $(gnulib_dir), not system.h.
* .x-sc_always_defined_macros: New file.  Exempt src/seq.c.
* Makefile.am (syntax_check_exceptions): Add it here.

14 years agomaint: remove now-redundant definitions provided by signal.h
Jim Meyering [Mon, 3 May 2010 08:50:23 +0000 (10:50 +0200)]
maint: remove now-redundant definitions provided by signal.h

* src/dd.c (SA_NODEFER, SA_RESETHAND): Remove definitions,
now that gnulib guarantees they are defined in <signal.h>.
* src/ls.c (SA_RESTART): Likewise.

14 years agomaint: remove now-redundant definitions provided by sys/wait.h
Jim Meyering [Mon, 3 May 2010 08:45:47 +0000 (10:45 +0200)]
maint: remove now-redundant definitions provided by sys/wait.h

* src/timeout.c (WIFSIGNALED, WTERMSIG): Remove definitions,
now that gnulib guarantees they are defined in <sys/wait.h>.
* src/operand2sig.c: Likewise.
* src/kill.c: Likewise.

14 years agosort: use long doubles only when effective
Paul Eggert [Fri, 30 Apr 2010 22:23:38 +0000 (23:23 +0100)]
sort: use long doubles only when effective

* src/sort.c (general_numcompare): Don't use long double if strtold
is not available, as it may introduce needless overhead.

14 years agobuild: update gnulib submodule to latest; bootstrap, too
Jim Meyering [Fri, 30 Apr 2010 16:27:19 +0000 (18:27 +0200)]
build: update gnulib submodule to latest; bootstrap, too

14 years agosort: use long doubles for general numeric mode
Pádraig Brady [Wed, 28 Apr 2010 22:54:33 +0000 (23:54 +0100)]
sort: use long doubles for general numeric mode

* src/sort.c (general_numcompare): Use long doubles unconditionally,
and strtold when available, to convert numbers with greater range and
precision.  Performance was seen to be on par with standard doubles.
* doc/coreutils.texi (sort invocation): Amend the -g description to
mention long double rather than double, and strtold rather than strtod.
* src/getlimits.c (main): Output floating point limits for use in tests.
* tests/misc/sort-float: A new test to ensure sort is using long
doubles when possible, and that locale specific floats are handled.
* tests/Makefile.am: Reference the new test.
* tests/test-lib.sh (getlimits_): Normalize indenting.
* NEWS: Mention the new behaviour.
Reported by Nelson Beebe.

14 years agobuild: remove now-duplicate use of AC_SYS_LARGEFILE
Jim Meyering [Thu, 29 Apr 2010 10:03:41 +0000 (12:03 +0200)]
build: remove now-duplicate use of AC_SYS_LARGEFILE

* m4/jm-macros.m4 (gl_CHECK_ALL_TYPES): Don't require AC_SYS_LARGEFILE,
now that gnulib does it.

14 years agobuild: remove now-useless configure-time header checks
Jim Meyering [Thu, 29 Apr 2010 09:32:37 +0000 (11:32 +0200)]
build: remove now-useless configure-time header checks

* m4/jm-macros.m4 (gl_CHECK_ALL_HEADERS): Don't test for headers
that gnulib now provides: sys/ioctl.h, sys/time.h, sys/wait.h.

14 years agodoc: tweak factor-describing wording
Jim Meyering [Sun, 25 Apr 2010 08:35:51 +0000 (10:35 +0200)]
doc: tweak factor-describing wording

* doc/coreutils.texi (factor invocation): Don't say that "factoring
large prime numbers is hard".  A pedant might ding you, since it's
trivial to factor a number that is known to be prime.  Instead, say
that "factoring large numbers... is hard".  Reported by Andreas Eder.

14 years agomaint: remove now-unnecessary #if HAVE_header_H tests.
Jim Meyering [Sat, 24 Apr 2010 15:38:13 +0000 (17:38 +0200)]
maint: remove now-unnecessary #if HAVE_header_H tests.

* .x-sc_prohibit_always_true_header_tests: New file.
* Makefile.am (syntax_check_exceptions): Add it.
* src/cat.c: Remove #if HAVE_SYS_IOCTL_H test.
* src/copy.c: Likewise.
* src/ls.c: Likewise.
* src/stty.c: Likewise.
* src/install.c: Remove #if HAVE_SYS_WAIT_H test.
* src/kill.c: Likewise.
* src/operand2sig.c: Likewise.
* src/timeout.c: Likewise.
* src/pathchk.c: Remove #if HAVE_WCHAR_H test.
* src/stat.c: Remove #if HAVE_NETINET_IN_H test.

14 years agobuild: enable gnulib modules for more replacement headers
Jim Meyering [Sat, 24 Apr 2010 15:16:56 +0000 (17:16 +0200)]
build: enable gnulib modules for more replacement headers

* bootstrap.conf (gnulib_modules): Add the following:
netinet_in, sys_ioctl, sys_wait, so that we can eliminate
the #if HAVE_<header>_H tests guarding their header inclusions.

14 years agotests: clean up also upon SIGQUIT
Jim Meyering [Sat, 24 Apr 2010 13:50:41 +0000 (15:50 +0200)]
tests: clean up also upon SIGQUIT

* tests/test-lib.sh: Also trap on SIGQUIT.
Spotted by Dmitry V. Levin.

14 years agopost-release administrivia
Jim Meyering [Fri, 23 Apr 2010 16:36:32 +0000 (18:36 +0200)]
post-release administrivia

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

14 years agoversion 8.5 v8.5
Jim Meyering [Fri, 23 Apr 2010 15:18:16 +0000 (17:18 +0200)]
version 8.5

* NEWS: Record release date.

14 years agotests: fix exit status of signal handlers in shell scripts
Dmitry V. Levin [Sat, 30 Jan 2010 16:02:36 +0000 (16:02 +0000)]
tests: fix exit status of signal handlers in shell scripts

The value of `$?' on entrance to signal handlers in shell scripts
cannot be relied upon, so set the exit code explicitly.

* cfg.mk (sc_always_defined_macros, sc_system_h_headers): Set
the exit code in signal handler explicitly to 128 + SIG<SIGNAL>.
* src/Makefile.am (sc_tight_scope): Likewise.
* tests/test-lib.sh: Likewise.

14 years agobase64: always treat input in binary mode
Eric Blake [Wed, 21 Apr 2010 14:17:59 +0000 (08:17 -0600)]
base64: always treat input in binary mode

Necessary for cygwin.  Technically, this patch is not correct,
in that it clobbers O_APPEND, but it is no different than any
other use of xfreopen to force binary mode, so all such uses
should be fixed at once in a later patch.

* src/base64.c (main): Open input in binary mode.
* THANKS: Update.
Reported by Yutaka Amanai.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Wed, 21 Apr 2010 18:05:52 +0000 (20:05 +0200)]
build: update gnulib submodule to latest

14 years agodocs: document transformation of obsolete sort syntax
Eric Blake [Tue, 20 Apr 2010 22:26:27 +0000 (16:26 -0600)]
docs: document transformation of obsolete sort syntax

* doc/coreutils.texi (sort invocation): Mention the conversion.

14 years agomaint: update a couple of NEWS items for the pending release
Pádraig Brady [Wed, 21 Apr 2010 06:50:39 +0000 (07:50 +0100)]
maint: update a couple of NEWS items for the pending release

* NEWS: Mention that cp and mv from the previous release did
not support preserving extended attributes (fixed in e489fd04).
Improve the grammar for the "cp capabilities" item.

14 years agosort: fix parsing of end field in obsolescent key formats
Pádraig Brady [Tue, 20 Apr 2010 15:25:55 +0000 (16:25 +0100)]
sort: fix parsing of end field in obsolescent key formats

This regression was introduced in commit 224a69b5, 2009-02-24,
"sort: Fix two bugs with determining the end of field".
The specific regression being that we include 1 field too many when
an end field is specified using obsolescent key syntax (+POS -POS).

* src/sort.c (struct keyfield): Clarify the description of the eword
member, as suggested by Alan Curry.
(main): When processing obsolescent format key specifications,
normalize eword to a zero based count when no specific end char is given
for an end field. This matches what's done when keys are specified with -k.
* tests/misc/sort: Add a few more tests for the obsolescent key formats,
with test 07i being the particular failure addressed by this change.
* THANKS: Add Alan Curry who precisely identified the issue.
* NEWS: Mention the fix.
Reported by Santiago Rodríguez

14 years agocp: preserve "capabilities" when also preserving file ownership
Pádraig Brady [Fri, 16 Apr 2010 07:39:11 +0000 (08:39 +0100)]
cp: preserve "capabilities" when also preserving file ownership

* src/copy.c (copy_reg): Copy xattrs _after_ setting file ownership
so that capabilities are not cleared when setting ownership.
* tests/cp/capability: A new root test.
* tests/Makefile.am (root_tests): Reference the new test.
* NEWS: Mention the fix.

14 years ago* HACKING (Add tests): Change example name, "newtest" to "new-test".
Jim Meyering [Fri, 16 Apr 2010 06:42:47 +0000 (08:42 +0200)]
* HACKING (Add tests): Change example name, "newtest" to "new-test".

Not that anyone would confuse with something newt-related, but just
because it is more readable that way.

doc: tweak HACKING

14 years agodoc: tweak HACKING
Jim Meyering [Fri, 16 Apr 2010 06:21:32 +0000 (08:21 +0200)]
doc: tweak HACKING

* HACKING (Curly braces): Tweak a sentence.  Filter a few
paragraphs through "fmt".

14 years agomaint: fix build on platforms that replace strsignal
Pádraig Brady [Thu, 15 Apr 2010 16:34:57 +0000 (17:34 +0100)]
maint: fix build on platforms that replace strsignal

* src/Makefile.am (kill_LDADD): Add $(LIBTHREAD) so that
we link with the appropriate libraries to provide Thread Local Storage
on platforms that replace strsignal (like AIX for example).

Tested-by: Daniel Richard G. <danielg@teragram.com>
14 years agotests: avoid spurious failure of ls/color-norm test
Pádraig Brady [Wed, 14 Apr 2010 14:32:27 +0000 (15:32 +0100)]
tests: avoid spurious failure of ls/color-norm test

* tests/ls/color-norm: Use the "time" output by `ls -l`
to check normal style.  Previously we used the size from `ls -s`,
but the size of "empty" files can vary depending on whether
SELinux is enabled for example.

14 years agodoc: document our code formatting policy regarding curly braces
Jim Meyering [Thu, 15 Apr 2010 08:17:47 +0000 (10:17 +0200)]
doc: document our code formatting policy regarding curly braces

* HACKING (Curly braces: use judiciously): New section.

14 years agotests: avoid spurious failure of root-only ls/capability test
Jim Meyering [Wed, 14 Apr 2010 13:48:31 +0000 (15:48 +0200)]
tests: avoid spurious failure of root-only ls/capability test

* tests/ls/capability: Adjust this test not to expect the no-op escape
sequence that was removed from all other tests by 2010-01-30 commit
5d43617e, "ls --color: don't emit a final no-op escape sequence".

14 years agocp: treat selinux warnings consistently
Pádraig Brady [Tue, 13 Apr 2010 11:49:05 +0000 (12:49 +0100)]
cp: treat selinux warnings consistently

* src/copy.c (copy_reg): Suppress SELinux ENOTSUP warnings consistently
between the destination being present or not.  Previously we did
not suppress ENOTSUP messages when the destination was present.
(copy_internal): Use the same ENOTSUP supression method as
copy_reg() even though the issue was not seen in this case.
* tests/cp/cp-a-selinux: Add a test case for the issue and
group the other test cases in the file more coherently.
* tests/cp/cp-mv-enotsup-xattr: Do the same check for xattr
warnings, even though they did not have the issue.

14 years agodoc: clarify when cp and mv output xattr warnings
Pádraig Brady [Mon, 12 Apr 2010 07:46:37 +0000 (08:46 +0100)]
doc: clarify when cp and mv output xattr warnings

The 2010-03-26 commit, 4c38625e, "doc: fix info on cp --preserve..."
was not entirely correct as cp --preserve=all does produce some
xattr warnings.

* src/copy.h: Update and clarify the comments for reduce_diagnostics
and require_preserve_{xattr,context}.
* doc/coreutils.texi (cp invocation): Update the -a and
--preserve=xattr,context options to say when and which
xattr warnings are output.
(mv invocation): Mention that some warnings are output
when preserving xattrs.

14 years agodoc: mention that "capabilities" are preserved by cp/mv
Pádraig Brady [Sat, 10 Apr 2010 00:05:39 +0000 (01:05 +0100)]
doc: mention that "capabilities" are preserved by cp/mv

* doc/coreutils.texi (cp invocation): Mention that
"capabilities" are preserved when implemented using
extended attributes.
(mv invocation): Mention ACLs etc. are maintained
due to xattrs being copied.

14 years agobuild: tell ./bootstrap to check for xz up-front
Jie Liu [Sun, 11 Apr 2010 14:40:52 +0000 (22:40 +0800)]
build: tell ./bootstrap to check for xz up-front

* bootstrap.conf (buildreq): Add xz to the list.

14 years agotests: more syntax-checks
Jim Meyering [Sat, 10 Apr 2010 20:43:01 +0000 (22:43 +0200)]
tests: more syntax-checks

* gnulib: update to latest
* cfg.mk (sc_prohibit_empty_lines_at_EOF): Remove, now that it's
in gnulib's maint.mk.
(_hv_file): Override the default.

14 years agomaint: new syntax-check rule: prohibit empty lines at EOF
Jim Meyering [Sat, 10 Apr 2010 12:19:11 +0000 (14:19 +0200)]
maint: new syntax-check rule: prohibit empty lines at EOF

* cfg.mk (detect_empty_lines_at_EOF_): Define.
(sc_prohibit_empty_lines_at_EOF): New rule.
* .x-sc_prohibit_empty_lines_at_EOF: New file.  Exempt pr test inputs.
* Makefile.am (syntax_check_exceptions): Add it.
Pádraig Brady suggested to parse the output of tail -n1.

14 years agodircolors: add rxvt-256color and rxvt-unicode256
Mike Frysinger [Fri, 9 Apr 2010 06:16:36 +0000 (02:16 -0400)]
dircolors: add rxvt-256color and rxvt-unicode256

* src/dircolors.hin: Add them.

14 years agomaint: ftruncate is always available, even without gnulib
Jim Meyering [Fri, 9 Apr 2010 08:49:38 +0000 (10:49 +0200)]
maint: ftruncate is always available, even without gnulib

Now that even MinGW provides ftruncate, we know that all
reasonable portability targets provide this function.
Remove the workaround code.  We nearly removed the gnulib
module three years ago:
  http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/9203
and it is now officially "obsolete".
* bootstrap.conf (gnulib_modules): Remove ftruncate.
* src/copy.c (copy_reg): Remove use of HAVE_FTRUNCATE and its
no-longer-used workaround code.
* src/truncate.c: Remove a comment about handling missing ftruncate.

14 years agodoc: make wc --help say how it defines a 'word'
James Youngman [Thu, 8 Apr 2010 09:58:52 +0000 (10:58 +0100)]
doc: make wc --help say how it defines a 'word'

* src/wc.c (usage): Add wc's definition of "word".

14 years agodoc: adjust a header in announcement email template
Jim Meyering [Thu, 8 Apr 2010 06:45:23 +0000 (08:45 +0200)]
doc: adjust a header in announcement email template

* README-release: Use Mail-Followup-To: rather than Reply-To:.
The former works more reliably, at least with Gnus.

14 years agotests: add a PATH-sanity-check to help-version
Jim Meyering [Wed, 7 Apr 2010 09:47:28 +0000 (11:47 +0200)]
tests: add a PATH-sanity-check to help-version

* tests/misc/help-version: Sync from gzip's version.
* tests/check.mk (TESTS_ENVIRONMENT): Export VERSION, as required
for new help-version test.

14 years agomaint: fix a masked syntax-check violation
Jim Meyering [Tue, 6 Apr 2010 14:01:32 +0000 (16:01 +0200)]
maint: fix a masked syntax-check violation

* m4/jm-macros.m4 (ARGMATCH_DIE): Use usage(EXIT_FAILURE), not usage(1).
* .x-sc_prohibit_magic_number_exit: Remove *.m4 exemption that was
masking the above.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Mon, 5 Apr 2010 18:14:15 +0000 (20:14 +0200)]
build: update gnulib submodule to latest

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Sun, 4 Apr 2010 09:01:31 +0000 (11:01 +0200)]
build: update gnulib submodule to latest

14 years agotail: include sys/vfs.h (if possible) when sys/statfs.h is absent
Marc Kleine-Budde [Sun, 4 Apr 2010 07:15:07 +0000 (09:15 +0200)]
tail: include sys/vfs.h (if possible) when sys/statfs.h is absent

* src/tail.c [HAVE_INOTIFY && !HAVE_SYS_STATFS_H]: Include <sys/vfs.h>.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Fri, 2 Apr 2010 18:30:48 +0000 (20:30 +0200)]
build: update gnulib submodule to latest

* cfg.mk: Update to use new _sc_search_regexp interface.  Run this:
perl -pi -e 's/\b_prohibit_regexp\b/_sc_search_regexp/;'
  -e 's/\bmsg=/halt=/; s/\bre=/prohibit=/;' cfg.mk
and then adjust backslashes so they still line up.

14 years agodoc: synchronize parts of README-release from grep's version
Jim Meyering [Wed, 31 Mar 2010 06:58:40 +0000 (08:58 +0200)]
doc: synchronize parts of README-release from grep's version

* README-release (FIXME): Add Reply-To, use coreutils@gnu.org
for announcements.  Update savannah-verbatim-announcement procedure.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Mon, 29 Mar 2010 06:07:35 +0000 (08:07 +0200)]
build: update gnulib submodule to latest

14 years agotests: disable new texinfo-acronym syntax-check from gnulib
Jim Meyering [Mon, 29 Mar 2010 06:28:25 +0000 (08:28 +0200)]
tests: disable new texinfo-acronym syntax-check from gnulib

* cfg.mk (local-checks-to-skip): Add new sc_texinfo_acronym, to skip it.

14 years agobuild: update after change in gnulib's lib-ignore module
Bruno Haible [Mon, 29 Mar 2010 06:25:02 +0000 (08:25 +0200)]
build: update after change in gnulib's lib-ignore module

* src/Makefile.am (AM_LDFLAGS): Define.  Use gnulib's new
$(IGNORE_UNUSED_LIBRARIES_CFLAGS).

14 years agotests: avoid spurious sc_prohibit_test_minus_ao syntax-check failures
Jim Meyering [Mon, 29 Mar 2010 06:21:43 +0000 (08:21 +0200)]
tests: avoid spurious sc_prohibit_test_minus_ao syntax-check failures

* tests/misc/ls-time: Change comments and diagnostics.
* tests/misc/xattr: Likewise.

14 years agotests: fix typos in envvar-check script
Jim Meyering [Fri, 26 Mar 2010 15:46:23 +0000 (16:46 +0100)]
tests: fix typos in envvar-check script

* tests/envvar-check: Fix variable name typos.
Probably harmless, since no selected shell would fail to unset.

14 years agonice,chroot: use more standard option parsing
Pádraig Brady [Fri, 26 Mar 2010 07:42:01 +0000 (07:42 +0000)]
nice,chroot: use more standard option parsing

Related to the 2010-03-25 commit, 88d4b346,
"timeout: use more standard option parsing".
* src/nice.c (main): Don't use parse_long_options()
which is a helper for commands that don't have any
long options specific to them.
* src/chroot.c (main): Likewise.
* tests/misc/nice-fail: Remove a case that now
passes due to us accepting multiple instances of the
--help and --version options.
* tests/misc/chroot-fail: Likewise.

14 years agotimeout: use more standard option parsing
Kim Hansen [Thu, 25 Mar 2010 17:43:10 +0000 (17:43 +0000)]
timeout: use more standard option parsing

* src/timeout.c (main): Don't use parse_long_options()
which is a helper for commands that don't have any
long options specific to them.
* tests/misc/timeout-parameters: Remove a case that now
passes due to us accepting multiple instances of the
--help and --version options.
* THANKS: Add the author.

Signed-off-by: Pádraig Brady <P@draigBrady.com>
14 years agodoc: fix info on cp --preserve=all, which does _not_ give xattr warnings
Pádraig Brady [Fri, 26 Mar 2010 11:19:16 +0000 (11:19 +0000)]
doc: fix info on cp --preserve=all, which does _not_ give xattr warnings

The info docs have been inaccurate since 2009-04-17, commit 941bd482,
"mv: ignore xattr-preservation failure when not supported by filesystem"
* doc/coreutils.texi (cp invocation): Say that cp --preserve=all
does _not_ output errors when failing to copy xattrs.

14 years agocfg.mk: remove comments with sed rather than cpp -fpreprocessed
Jim Meyering [Sat, 20 Mar 2010 20:05:24 +0000 (21:05 +0100)]
cfg.mk: remove comments with sed rather than cpp -fpreprocessed

* cfg.mk (_sed_remove_comments): Define, starting with gettext's
moopp sed code, but factoring it to be more understandable.
(sc_space_before_open_paren): Adapt.
Prompted by Bruno Haible's suggestion to use gettext's moopp code.

14 years agocfg.mk: fix copy-paste-o in a diagnostic
Jim Meyering [Sat, 20 Mar 2010 12:45:56 +0000 (13:45 +0100)]
cfg.mk: fix copy-paste-o in a diagnostic

* cfg.mk (sc_space_before_open_paren): Mention cpp -fpreprocessed,
not cppi, when cpp -fpreprocessed doesn't work.
Spotted by Eric Blake.

14 years agomaint: enforce one small aspect of formatting style: space-before-"("
Jim Meyering [Sat, 20 Mar 2010 11:14:46 +0000 (12:14 +0100)]
maint: enforce one small aspect of formatting style: space-before-"("

* cfg.mk (sc_space_before_open_paren): New rule.

14 years agomaint: code formatting nit
Jim Meyering [Sat, 20 Mar 2010 11:11:50 +0000 (12:11 +0100)]
maint: code formatting nit

* src/system.h (ST_NBLOCKS): Add space before paren.

14 years agomaint: mbsalign: fix an edge case where we truncate too much
Pádraig Brady [Fri, 19 Mar 2010 21:40:05 +0000 (21:40 +0000)]
maint: mbsalign: fix an edge case where we truncate too much

* gl/lib/mbsalign.c (mbsalign): Ensure the temporary destination buffer
is big enough, as it may need to be bigger than the source buffer
in the presence of single byte non printable chars.
* gl/tests/test-mbsalign.c (main): Add a test to trigger the issue.

14 years agomaint: update the mbsalign module
Pádraig Brady [Mon, 15 Mar 2010 14:04:31 +0000 (14:04 +0000)]
maint: update the mbsalign module

* gl/lib/mbsalign.c (mbsalign):  Support the MBA_UNIBYTE_FALLBACK
flag which reverts to unibyte mode if one can't allocate memory
or if there are invalid multibyte characters present.
Note memory is no longer dynamically allocated in unibyte mode so
one can assume that mbsalign() will not return an error if this
flag is present.  Don't calculate twice, the number of spaces,
when centering.  Suppress a signed/unsigned comparison warning.
(ambsalign): A new wrapper function to dynamically allocate
the minimum memory required to hold the aligned string.
* gl/lib/mbsalign.h: Add the MBA_UNIBYTE_FALLBACK flag and
also document others that may be implemented in future.
(ambsalign): A prototype for the new wrapper.
* gl/tests/test-mbsalign.c (main): New test program.
* gl/modules/mbsalign-tests: A new index to reference the tests.
* .x-sc_program_name: Exclude test-mbsalign.c from this check.

14 years agotests: change help-version to per-program functions
Paolo Bonzini [Fri, 19 Mar 2010 11:27:45 +0000 (12:27 +0100)]
tests: change help-version to per-program functions

* help-version: Change each *_args variable to a *_setup function.

14 years agodoc: tweak README-prereq again
Jim Meyering [Fri, 19 Mar 2010 10:34:15 +0000 (11:34 +0100)]
doc: tweak README-prereq again

* README-prereq: Change one more: s/coreutils/This package/

14 years agodoc: make README-prereq more generic
Jim Meyering [Fri, 19 Mar 2010 09:11:24 +0000 (10:11 +0100)]
doc: make README-prereq more generic

* README-prereq: Adjust wording and reduce number of mentions of
"coreutils", so it's easier to reuse in another package: grep.

14 years agorm: tweak wording about loss of data warning
Eric Blake [Wed, 17 Mar 2010 15:31:44 +0000 (09:31 -0600)]
rm: tweak wording about loss of data warning

* src/rm.c (usage): Update wording to make two points more
apparent: undelete is not trivial, and partial recovery should be
a consideration factor in deciding whether rm is secure enough.
Initially suggested by Reuben Thomas.

14 years agorevert "maint: mark makefile "dist-hook" target as PHONY"
Ralf Wildenhues [Thu, 18 Mar 2010 20:07:41 +0000 (21:07 +0100)]
revert "maint: mark makefile "dist-hook" target as PHONY"

* src/Makefile.am (dist-hook): Do not mark this target
as PHONY, explicitly.  Automake does it for us.

14 years agodoc: improve ls --help's description of --escape (-b)
Eric Blake [Thu, 18 Mar 2010 15:19:08 +0000 (16:19 +0100)]
doc: improve ls --help's description of --escape (-b)

* src/ls.c (usage): Be more precise about how --escape (-b) works:
say "C-style escapes", not "octal escapes".  Reported by Jacky Fong.

14 years agomaint: mark makefile "dist-hook" target as PHONY
Jim Meyering [Thu, 18 Mar 2010 07:32:26 +0000 (08:32 +0100)]
maint: mark makefile "dist-hook" target as PHONY

* src/Makefile.am (dist-hook): Mark target as PHONY.

14 years agomaint: add a space before open-paren, where lacking
Jim Meyering [Wed, 17 Mar 2010 17:27:52 +0000 (18:27 +0100)]
maint: add a space before open-paren, where lacking

* src/copy.c (copy_reg): Likewise.
* src/cut.c (main): Likewise.
* src/dd.c (main): Likewise.
* src/getlimits.c (print_int): Likewise.
* src/join.c (join): Likewise.
* src/pwd.c (logical_getcwd): Likewise.
* src/sort.c (specify_nmerge, mergefps, avoid_trashing_input): Likewise.
(merge): Likewise.
* src/uptime.c (usage): Likewise.

14 years agotimeout: add the --kill-after option
Pádraig Brady [Mon, 15 Mar 2010 23:03:30 +0000 (23:03 +0000)]
timeout: add the --kill-after option

Based on a report from Kim Hansen who wanted to
send a KILL signal to the monitored command
when `timeout` itself received a termination signal.
Rather than changing such a signal into a KILL,
we provide the more general mechanism of sending
the KILL after the specified grace period.

* src/timeout.c (cleanup): If a non zero kill delay
is specified, (re)set the alarm to that delay, after
which a KILL signal will be sent to the process group.
(usage): Mention the new option.  Separate the description
of DURATION since it's now specified in 2 places.
Clarify that the duration is an integer.
(parse_duration): A new function refactored from main(),
since this logic is now called for two parameters.
(main): Parse the -k option.
* doc/coreutils.texi (timeout invocation): Describe the
new --kill-after option and use @display rather than
@table to show the duration suffixes.  Clarify that
a duration of 0 disables the associated timeout.
* tests/misc/timeout-parameters: Check invalid --kill-after.
* tests/misc/timeout: Check a valid --kill-after works.
* NEWS: Mention the new feature.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Sat, 13 Mar 2010 12:53:58 +0000 (13:53 +0100)]
build: update gnulib submodule to latest

The latest from gnulib once again passes all tests.

14 years agorevert to previous working version of gnulib
Jim Meyering [Sat, 13 Mar 2010 09:30:33 +0000 (10:30 +0100)]
revert to previous working version of gnulib

This reverts commit 0c31cdc2d13a1e47106ce708ca9c94df8d21f764.

14 years agodoc: use mktemp, not tempfile, in a shred usage example
Thien-Thi Nguyen [Sat, 13 Mar 2010 04:34:15 +0000 (05:34 +0100)]
doc: use mktemp, not tempfile, in a shred usage example

* doc/coreutils.texi (shred invocation):
Use mktemp(1) instead of Debian-specific tempfile(1).

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Wed, 10 Mar 2010 10:06:21 +0000 (11:06 +0100)]
build: update gnulib submodule to latest

14 years agomaint: drop *.lzma suport
Eric Blake [Thu, 11 Mar 2010 18:55:45 +0000 (11:55 -0700)]
maint: drop *.lzma suport

* .gitignore: Remove *.lzma lines.

14 years agomaint: ignore *.xz files
Eric Blake [Wed, 10 Mar 2010 23:13:04 +0000 (16:13 -0700)]
maint: ignore *.xz files

* .gitignore: Ignore *.xz created by 'make dist', now that we
no longer produce *.lzma.