]> git.ipfire.org Git - thirdparty/coreutils.git/log
thirdparty/coreutils.git
12 years agomaint: avoid a valgrind memory leak warning from uptime
Anton Ovchinnikov [Sun, 7 Jul 2013 09:29:27 +0000 (10:29 +0100)] 
maint: avoid a valgrind memory leak warning from uptime

* src/uptime.c (uptime): Free utmp_buf returned from read_utmp,
to avoid a "definitely lost" warning from valgrind.

12 years agobuild: update gnulib submodule to latest
Paul Eggert [Sun, 7 Jul 2013 00:15:22 +0000 (17:15 -0700)] 
build: update gnulib submodule to latest

12 years agotests: fix "shuf unreadable" test to work when run as root
Pádraig Brady [Fri, 5 Jul 2013 01:43:22 +0000 (02:43 +0100)] 
tests: fix "shuf unreadable" test to work when run as root

* tests/misc/shuf.sh: Restrict the test to the significant
case where we can't in fact read the "unreadable" file.

12 years agostat: ensure --context emits an "unrecognized option" diagnostic
Pádraig Brady [Tue, 2 Jul 2013 10:46:51 +0000 (11:46 +0100)] 
stat: ensure --context emits an "unrecognized option" diagnostic

* src/stat.c (long_options): Remove the "context" option as it's
no longer referenced since commit v8.5-65-g13f3237

12 years agomkdir,mkfifo,mknod: give scontext-related variable a better scope
Bernhard Voelker [Tue, 2 Jul 2013 09:53:57 +0000 (11:53 +0200)] 
mkdir,mkfifo,mknod: give scontext-related variable a better scope

* src/mkdir.c (main): Move the variable ret and issuing the error
message into the body of the scontext-related if-block.
* src/mkfifo.c (main): Likewise.
* src/mknod.c (main): Likewise.

12 years agomaint: refactor SMACK interface to a separate module
Pádraig Brady [Tue, 2 Jul 2013 02:42:20 +0000 (03:42 +0100)] 
maint: refactor SMACK interface to a separate module

Consolidate all smack routines and checks in a module.
We replace and wrap the most commonly used smack routines,
which allows removing ifdefs throughout the code.

* gl/lib/smack.h: A new header containing the implementation
of the wrapped and replacement routines.  Note the is_smack_enabled()
routine should be optimized out at compile time when compiled
on a system without libsmack.
* gl/modules/smack: Describe the new module and move the
configure time code here from ...
* m4/jm-macros.m4: ... here.
* bootstrap.conf: Reference the new module.
* src/id.c: Use the routines without ifdefs where possible.
* src/ls.c: Likewise.
* src/mkdir.c: Likewise.
* src/mkfifo.c: Likewise.
* src/mknod.c: Likewise.

12 years agoid: don't show SMACK errors unless -Z is specified
Pádraig Brady [Tue, 2 Jul 2013 01:40:35 +0000 (02:40 +0100)] 
id: don't show SMACK errors unless -Z is specified

* src/id.c (main): Be consistent with the SELinux case,
and only show errors in getting the security context
when -Z is specified.

12 years agomkdir,mkfifo,mknod: with -Z, create SMACK security context
Jarkko Sakkinen [Wed, 26 Jun 2013 08:48:27 +0000 (11:48 +0300)] 
mkdir,mkfifo,mknod: with -Z, create SMACK security context

Enable creation of SMACK security context with -Z command-line switch
if SMACK is enabled.

* mkdir.c (main): Set process security context to given SMACK label.
* mkfifo.c (main): Likewise.
* mknod.c (main): Likewise.
* src/local.mk: link mk{dir, fifo, nod} with libsmack.
* NEWS: Mention the new feature.

12 years agodoc: fix details on the interaction of df with device nodes
D. Hugh Redelmeier [Thu, 27 Jun 2013 11:32:45 +0000 (12:32 +0100)] 
doc: fix details on the interaction of df with device nodes

* man/df.x: Don't say that a dev node is always on the root file system.
* doc/coreutils.texi (df invocation): Likewise.  Also state that the
device node to mounted file system interpretation is only done when
passed absolute paths to device nodes.

12 years agols: with -Z, show SMACK security context
Jarkko Sakkinen [Mon, 24 Jun 2013 11:24:55 +0000 (14:24 +0300)] 
ls: with -Z, show SMACK security context

Enable showing of file SMACK security with '-Z' command-line switch
if SMACK is enabled.  Showing SMACK context of a file does not strictly
require SMACK to be enabled but this required to make choice whether to
show SELinux or SMACK security context.

* src/ls.c (getfilecon_cache): Retrieve SMACK context if available.
(gobble_file): Handle SMACK context similarly to SELinux context.
* src/local.mk: Link lsl with libsmack.
* NEWS: Mention the new feature.
* .mailmap: Merge the Author's 2 email addresses.

12 years agostdbuf: make it mandatory to specify a buffering option
Pádraig Brady [Sat, 22 Jun 2013 02:37:51 +0000 (03:37 +0100)] 
stdbuf: make it mandatory to specify a buffering option

This is consistent with the documented interface and
avoids any ambiguity in a user thinking that stdbuf without options
might reset to a "standard" buffering setup.

* src/stdbuf.c (set_libstdbuf_options): Indicate with the return value
whether any env variables were actually set.
(main): Fail unless some env variables were set.
* tests/misc/stdbuf.sh: Ensure this constraint is enforced.
* NEWS: Mention the small change in behavior.

12 years agodoc: clarify that truncate --size represents bytes by default
Pádraig Brady [Sat, 22 Jun 2013 02:09:01 +0000 (03:09 +0100)] 
doc: clarify that truncate --size represents bytes by default

* src/truncate.c (usage): Mention that --size is in bytes which
is by far the most common usage.
* doc/coreutils.texi (truncate invocation): Likewise. Also cross
reference the --io-blocks option.
Reported in http://bugs.gnu.org/14686

12 years agoid: adjust/restrict smack support to newer versions of libsmack
Jarkko Sakkinen [Thu, 20 Jun 2013 18:21:37 +0000 (21:21 +0300)] 
id: adjust/restrict smack support to newer versions of libsmack

There was slight change to libsmack such that positive values are
reserved for returning length of the label for smack_new_label_from_*
functions.

* m4/jm-macros.m4: Set HAVE_SMACK when both smack_new_label_from_self()
and recently added smack_new_label_from_path() are present.
The latter's presence indicates the newer API of the former.
* src/id.c (main): Check that smack_new_label_from_self() < 0,
and not just non-zero.

12 years agotests: use appropriate precision when printing float limits
Pádraig Brady [Tue, 18 Jun 2013 14:47:35 +0000 (15:47 +0100)] 
tests: use appropriate precision when printing float limits

* src/getlimits.c (print_float): Adjust to use the ftoastr module,
which uses the appropriate precision so that no info is lost.
* cfg.mk (sc_prohibit_continued_string_alpha_in_column_1): Exclude od.c
fixes http://bugs.gnu.org/14650

12 years agomaint: update gitignore entries
Pádraig Brady [Thu, 13 Jun 2013 10:27:29 +0000 (11:27 +0100)] 
maint: update gitignore entries

* .gitignore: Exclude the generated doc/manual directory,
and also the src/fs-latest-magic.h file referenced in README-release.

12 years agodoc: clarify the description of du --separate-dirs
Pádraig Brady [Wed, 12 Jun 2013 10:40:25 +0000 (11:40 +0100)] 
doc: clarify the description of du --separate-dirs

* src/du.c (usage): Clarify that --separate-dirs doesn't exclude
all directories.
* doc/coreutils.texi (du invocation): Avoid implying that -S
excludes the size of any non directory entries for a directory.
Also don't mention st_size as it's dependent on --apparent-size.
Reported by C de-Avillez in <https://launchpad.net/bugs/1187044>

12 years agodoc: mention prior stat change
Eric Blake [Wed, 5 Jun 2013 18:46:17 +0000 (12:46 -0600)] 
doc: mention prior stat change

For a file of size 1234 bytes, commit ca9aa759 had the side effect
of changing 'stat -c "%'s" file' from outputting "?s" to the nicer
"1,234", depending on locale.  This is worth mentioning in the NEWS.

Resolves part of http://bugs.gnu.org/14556.

* NEWS: Mention 8.7 improvement in stat.
* cfg.mk (old_NEWS_hash): Adjust accordingly.

12 years agobuild: update gnulib submodule; also bootstrap to latest
Bernhard Voelker [Wed, 5 Jun 2013 09:41:19 +0000 (11:41 +0200)] 
build: update gnulib submodule; also bootstrap to latest

Notes tests/init.sh is still in sync with gnulib.

* bootstrap: Update to latest.
* gnulib: Update avoiding gnulib-test failures.

12 years agotests: avoid a race in tail --retry testing
Pádraig Brady [Mon, 3 Jun 2013 00:29:17 +0000 (01:29 +0100)] 
tests: avoid a race in tail --retry testing

Prompted by the continuous integration build failure at:
http://hydra.nixos.org/build/5221053

* tests/tail-2/retry.sh: Ensure the 'out' file is truncated,
as it's used to arbitrate the run order of commands.
Relying on the truncation in the background tail command
is racy because the truncation can occur after the fork
of the background shell and thus wait4lines would not wait
for output to occur in 'out', which would mean that the
'missing' file could be populated by the time tail(1)
gets to process it.

12 years agodoc: mention 'UTC' in date --utc help
Andreas Mohr [Sun, 2 Jun 2013 23:37:11 +0000 (00:37 +0100)] 
doc: mention 'UTC' in date --utc help

src/date.c (usage): Make -u apparent in searches for UTC.

12 years agood: -wN, N>64K, avoid misbehavior on systems with 32-bit size_t
Jim Meyering [Sun, 2 Jun 2013 02:20:06 +0000 (19:20 -0700)] 
od: -wN, N>64K, avoid misbehavior on systems with 32-bit size_t

* src/od.c (PRINT_FIELDS): Declare "i" to be of type uintmax_t, so that
the numerator in the expression for "next_pad" does not overflow.
(print_named_ascii): Likewise.
(print_ascii): Likewise.
Bug introduced via commit v6.12-42-g20c0b87.
* tests/misc/od.pl: Exercise each of the three affected code paths.
* NEWS (Bug fixes): Mention it.
Reported by Rich Burridge.

12 years agotests: head-c: avoid spurious failure with a 32-bit size_t
Jim Meyering [Tue, 28 May 2013 00:01:14 +0000 (17:01 -0700)] 
tests: head-c: avoid spurious failure with a 32-bit size_t

* tests/misc/head-c.sh: Don't try to elide 1 exabytes, since on
32-bit systems, that number is not representable as a size_t.
This command would fail on 32-bit systems, where SIZE_MAX < 1E:
  head --bytes=-E < /dev/null
Instead of "E", use $SSIZE_MAX.
For discussion, see http://bugs.gnu.org/13530

12 years agotests: avoid spurious failure when SIZE_MAX is 2^32-1
Jim Meyering [Mon, 27 May 2013 01:56:50 +0000 (18:56 -0700)] 
tests: avoid spurious failure when SIZE_MAX is 2^32-1

* tests/split/line-bytes.sh: Since we've limited virtual memory to
20MB, choose a smaller size, 1GiB (which is <= SIZE_MAX) rather than
1EiB, which is larger than SIZE_MAX on 32-bit systems.
I confirmed that this test still fails when the split.c-modifying
part of v8.21-58-gfec363c is backed out.

12 years agotests: fix an ls test not to fail when user or group name contains SP
Jim Meyering [Sat, 25 May 2013 03:11:37 +0000 (20:11 -0700)] 
tests: fix an ls test not to fail when user or group name contains SP

* tests/ls/block-size.sh (size_etc): The sed expression through which
we filtered the output of "ls -l ..." assumed that the user and group
name components of each line would not contain spaces.  Avoid the
problem by using -og instead of -l, thus not printing either of those
fields.  Adjust the sed expression accordingly.

12 years agotests: numfmt: use the printf program, not the shell builtin
Stefano Lattarini [Sun, 26 May 2013 22:06:00 +0000 (00:06 +0200)] 
tests: numfmt: use the printf program, not the shell builtin

* tests/misc/numfmt.pl: Avoid a spurious failure when
/bin/sh is dash (as can happen on Debian systems).

12 years agostat: tune for large-LDAP case
Paul Eggert [Fri, 24 May 2013 17:21:26 +0000 (10:21 -0700)] 
stat: tune for large-LDAP case

* src/stat.c (print_stat): Omit unnecessary calls to setpwent, setgrent.
Problem reported by Fridolín Pokorný in <http://bugs.gnu.org/14462>.

12 years agosplit: with --line-bytes only allocate memory as needed
Pádraig Brady [Sat, 20 Apr 2013 07:46:43 +0000 (08:46 +0100)] 
split: with --line-bytes only allocate memory as needed

* src/split.c (line_bytes_split): Rewrite to only buffer
when necessary.  I.E. only increase the buffer when we've
already lines output in a split and we encounter a line
larger than the input buffer size, in which case a hold
buffer will be increased in increments of the input buffer size.
(lines_rr): Use the more abstract xalloc_die() just like
we did in line_bytes_split(), rather than explicitly
printing the "memory exhausted" message and exiting.
* tests/split/line-bytes.sh: Add a new test for this
function which previously had no test coverage.
* tests/local.mk: Reference the new test.
* NEWS: Mention the improvement.
Fixes http://bugs.gnu.org/13537

12 years agomaint: port --enable-gcc-warnings to clang
Paul Eggert [Sun, 19 May 2013 00:49:32 +0000 (17:49 -0700)] 
maint: port --enable-gcc-warnings to clang

* configure.ac: If clang, add -Wno-format-extra-args and
-Wno-tautological-constant-out-of-range-compare.
* gl/lib/rand-isaac.c (ind):
* gl/lib/randread.c (readisaac):
* src/ls.c (dev_ino_push, dev_ino_pop):
* src/sort.c (buffer_linelim):
* src/system.h (is_nul):
* src/tail.c (tail_forever_inotify):
Rewrite to avoid casts that clang dislikes.
It's good to avoid casts anyway.
* src/expr.c (integer_overflow): Declare only if it exists.
(die): Remove; unused.
* src/ls.c (dev_ino_push): New function, replacing ...
(DEV_INO_PUSH): ... this removed macro.  All uses changed.
(decode_switches): Rewrite "str"+i to &str[i].

12 years agobuild: update gnulib submodule to latest
Paul Eggert [Sat, 18 May 2013 19:47:53 +0000 (12:47 -0700)] 
build: update gnulib submodule to latest

12 years agotests: don't assume expr was built with GMP
Paul Eggert [Sat, 18 May 2013 23:26:39 +0000 (16:26 -0700)] 
tests: don't assume expr was built with GMP

* tests/misc/cut-huge-range.sh (subtract_one): New string.
(CUT_MAX): Don't pass a too-large integer to 'expr'.

12 years agodoc: link to the list of rejected feature requests
Pádraig Brady [Sun, 12 May 2013 12:04:27 +0000 (13:04 +0100)] 
doc: link to the list of rejected feature requests

* README: Update the email address best suited to discussing
feature requests, and also link to the list of previously
discussed and rejected requests.

12 years agobuild: avoid new syntax-check failure
Jim Meyering [Sat, 11 May 2013 16:28:32 +0000 (18:28 +0200)] 
build: avoid new syntax-check failure

* po/POTFILES.in: Reflect renaming.

12 years agomaint: add FIXME comment
Paul Eggert [Sun, 12 May 2013 02:21:06 +0000 (19:21 -0700)] 
maint: add FIXME comment

12 years agomkdir: don't assume umask equals POSIX default ACL mask
Paul Eggert [Sun, 12 May 2013 02:17:10 +0000 (19:17 -0700)] 
mkdir: don't assume umask equals POSIX default ACL mask

This fixes Bug#14371, reported by Killer Bassist.
* NEWS: Document this.
* src/mkdir.c (struct mkdir_options): Remove member ancestor_mode.
New member umask_value.  All uses changed.
* src/mkdir.c (make_ancestor): Fix umask assumption.
* src/mkdir.c, src/mkfifo.c, src/mknod.c (main):
Leave umask alone.  This requires invoking lchmod after creating
the file, which introduces a race condition, but this can't be
avoided on hosts with "POSIX" default ACLs, and there's no easy
way with network file systems to tell what kind of host the
directory is on.
* tests/local.mk (all_tests): Add tests/mkdir/p-acl.sh.
* tests/mkdir/p-acl.sh: New file.

12 years agobuild: update gnulib submodule to latest
Paul Eggert [Sun, 12 May 2013 01:29:47 +0000 (18:29 -0700)] 
build: update gnulib submodule to latest

12 years agoid: with -Z, show SMACK security context
Jarkko Sakkinen [Sat, 4 May 2013 17:44:53 +0000 (20:44 +0300)] 
id: with -Z, show SMACK security context

Adds an optional dependency on libsmack.

* m4/jm-macros.m4: Look for the smack library/header.
* src/id.c (main): Output the smack context if available.
* src/local.mk: Link with libsmack if available.
* NEWS: Mention the new feature.

12 years agocut: improve performance, especially with --output-delimiter
Cojocaru Alexandru [Tue, 7 May 2013 12:47:15 +0000 (13:47 +0100)] 
cut: improve performance, especially with --output-delimiter

Use a sentinel value that's checked implicitly, rather than
a bit array, to determine if an item should be output.

Benchmark results for this change are:

$ yes abcdfeg | head -n1MB > big-file

$ for c in orig sentinel; do
    src/cut-$c 2>/dev/null
    echo -ne "\n== $c =="
    time src/cut-$c -b1,3 big-file > /dev/null
  done
== orig ==
real    0m0.049s
user    0m0.044s
sys     0m0.005s

== sentinel ==
real    0m0.035s
user    0m0.032s
sys     0m0.002s

 ## Again with --output-delimiter ##
$ for c in orig sentinel; do
    src/cut-$c 2>/dev/null
    echo -ne "\n== $c =="
    time src/cut-$c -b1,3 --output-delimiter=: big-file > /dev/null
  done
== orig ==
real    0m0.106s
user    0m0.103s
sys     0m0.002s

== sentinel ==
real    0m0.055s
user    0m0.052s
sys     0m0.003s

eol_range_start: Removed. 'n-' is no longer treated specially,
and instead SIZE_MAX is set for the 'hi' limit, and tested implicitly.
complement_rp: Used to complement 'rp' when '--complement' is specified.
ADD_RANGE_PAIR: Macro renamed to 'add_range_pair' function.
* tests/misc/cut-huge-range.sh: Adjust to the SENTINEL value.
Also remove the overlapping range test as this is no longer
dependent on large ranges and also is already handled with
the EOL-subsumed-3 test in cut.pl.

12 years agocut: fix handling of overlapping ranges
Cojocaru Alexandru [Tue, 7 May 2013 12:01:46 +0000 (13:01 +0100)] 
cut: fix handling of overlapping ranges

This issue was introduced in commit v8.21-43-g3e466ad

* src/cut.c (set_fields): Process all range pairs when merging.
* tests/misc/cut-huge-range.sh: Add a test for this edge case.
Also fix an issue where we could miss reported errors due
to truncation of the 'err' file.

12 years agodoc: correct a URL to older textutils source
Pádraig Brady [Tue, 30 Apr 2013 10:50:37 +0000 (11:50 +0100)] 
doc: correct a URL to older textutils source

* doc/coreutils.texi (Putting the tools together): Adjust the
textutils-1.22 URL, and add a URL for newer sources.

12 years agocut: reduce CPU usage for the the common case
Pádraig Brady [Sun, 28 Apr 2013 22:27:12 +0000 (23:27 +0100)] 
cut: reduce CPU usage for the the common case

Ensure appropriate functions are inlined.  This was seen to
be required with gcc 4.6.0 with -O2 on x86_64 at least.
It was reported that gcc 4.8.0 did inline these functions though.

Also reinstate the bit vector for the common case,
to further improve performance.

Benchmark results for both aspects of this change are:

$ yes abcdfeg | head -n1MB > big-file
$ for c in orig inline inline-array; do
    src/cut-$c 2>/dev/null
    echo -ne "\n== $c =="
    time src/cut-$c -b1,3 big-file > /dev/null
  done

== orig ==
real    0m0.088s
user    0m0.081s
sys     0m0.007s

== inline ==
real    0m0.070s
user    0m0.060s
sys     0m0.009s

== inline-array ==
real    0m0.049s
user    0m0.044s
sys     0m0.005s

* src/cut.c (set_fields): Set up the printable_field bit vector
for performance, but only when it's appropriate.  I.E. not
when either --output-delimeter or huge ranges are specified.
(next_item): Ensure it's inlined and avoid unnecessary processing.
(print_kth): Ensure it's inlined and add a branch for the fast path.
Related to http://bugs.gnu.org/13127

12 years agocut: reduce CPU overhead in determining item to output
Cojocaru Alexandru [Sun, 28 Apr 2013 02:03:45 +0000 (03:03 +0100)] 
cut: reduce CPU overhead in determining item to output

print_kth() is the central function of cut used to
determine if an item is to be output or not,
so simplify it by moving some logic outside.
Benchmark results for this change are:

$ yes abcdfeg | head -n1MB > big-file
$ for c in orig split; do
    src/cut-$c 2>/dev/null
    echo -ne "\n== $c =="
    time src/cut-$c -b1,3 big-file > /dev/null
  done

== orig ==
real    0m0.111s
user    0m0.108s
sys     0m0.002s

== split ==
real    0m0.088s
user    0m0.081s
sys     0m0.007s

* src/cut.c (print_kth): Refactor a branch to outside the function.
Related to http://bugs.gnu.org/13127

12 years agocut: make memory allocation independent of range width
Cojocaru Alexandru [Sun, 9 Dec 2012 09:43:10 +0000 (10:43 +0100)] 
cut: make memory allocation independent of range width

The current implementation of cut, uses a bit array,
an array of `struct range_pair's, and (when --output-delimiter
is specified) a hash_table.  The new implementation will use
only an array of `struct range_pair's.
The old implementation is memory inefficient because:
 1. When -b with a big num is specified, it allocates a lot of
    memory for `printable_field'.
 2. When --output-delimiter is specified, it will allocate 31 buckets.
    Even if only a few ranges are specified.

Note CPU overhead is increased to determine if an item is to be printed,
as shown by:

$ yes abcdfeg | head -n1MB > big-file
$ for c in with-bitarray without-bitarray; do
    src/cut-$c 2>/dev/null
    echo -ne "\n== $c =="
    time src/cut-$c -b1,3 big-file > /dev/null
  done

== with-bitarray ==
real    0m0.084s
user    0m0.078s
sys     0m0.006s

== without-bitarray ==
real    0m0.111s
user    0m0.108s
sys     0m0.002s

Subsequent patches will reduce this overhead.

* src/cut.c (set_fields): Set and initialize RP
instead of printable_field.
* src/cut.c (is_range_start_index): Use CURRENT_RP rather than a hash.
* tests/misc/cut.pl: Check if `eol_range_start' is set correctly.
* tests/misc/cut-huge-range.sh: Rename from cut-huge-to-eol-range.sh,
and add a test to verify large amounts of mem aren't allocated.
Fixes http://bugs.gnu.org/13127

12 years agostat,tail: improve support for snfs
Pádraig Brady [Wed, 24 Apr 2013 21:59:46 +0000 (22:59 +0100)] 
stat,tail: improve support for snfs

The StorNext distributed file system was previously known as CVFS.

* src/stat.c (human_fstype): Add new file system ID definition.
* NEWS: Mention the improvement.
Fixes http://bugs.gnu.org/14251

12 years agotests: fix usage of require_ulimit_
Pádraig Brady [Thu, 25 Apr 2013 10:03:22 +0000 (11:03 +0100)] 
tests: fix usage of require_ulimit_

* init.cfg (require_ulimit_v_): Renamed from require_ulimit_
as this only checks for ulimit -v support.  Other uses of
ulimit -t and ulimit -n in tests shouldn't cause false failures
if not supported.
* cfg.mk (sc_prohibit_test_ulimit_without_require_): A new syntax check
to ensure that require_ulimit_v_() is used iff required.
* tests/misc/head-c.sh: Add missing call to require_ulimit_v_.
* tests/rm/many-dir-entries-vs-OOM.sh: Likewise.
* tests/split/r-chunk.sh: Remove non mandatory require_ulimit_ call.
* tests/misc/sort-merge-fdlimit.sh: Likewise.
* tests/cp/link-heap.sh: Adjust to renamed require_ulimit_v_.
* tests/dd/no-allocate.sh: Likewise.
* tests/misc/csplit-heap.sh: Likewise.
* tests/misc/cut-huge-to-eol-range.sh: Likewise.
* tests/misc/printf-surprise.sh: Likewise.

12 years agoscripts: tweak URLs in autotools-install
Jim Meyering [Wed, 5 Dec 2012 19:11:59 +0000 (11:11 -0800)] 
scripts: tweak URLs in autotools-install

* scripts/autotools-install (tarballs): Use http:// URLs rather
than ftp:// ones.  The former are more likely to work, these days.
Update URLs to point to the latest versions.

12 years agotail: exit following by descriptor when no tailable file left
Bernhard Voelker [Sat, 20 Apr 2013 14:34:23 +0000 (16:34 +0200)] 
tail: exit following by descriptor when no tailable file left

As a side effect of the previous commit which fixes 'tail -f --retry'
to wait for a file to appear, tail would not exit when the last file
appears untailable and gives up on this file.
This can happen, for example, when the argument file name appears
as directory.  Tail sets the 'ignore' flag of this file to true,
but instead of exiting the program, tail would continue the loop.

* src/tail.c (any_live_files): Change the function to return true
if any of the files is still tailable or if tail should continue to
try to check again.
(tail_forever): Change the condition to break the loop in the
"no files remaining" case, because now any_live_files() will care
about it, as mentioned above.
(parse_options): When --retry is used without any follow mode,
then reset reopen_inaccessible_files to false.
* tests/tail-2/retry.sh: Add test case.

12 years agotail: let -f --retry wait for inaccessible files
Bernhard Voelker [Sat, 20 Apr 2013 14:33:06 +0000 (16:33 +0200)] 
tail: let -f --retry wait for inaccessible files

The --retry option is indeed useful for both following modes
by name and by file descriptor.  The difference is that in the
latter case, it is effective only during the initial open.

As a regression of the implementation of the inotify support,
tail -f --retry would immediately exit if the given file is
inaccessible.

* src/tail.c (usage): Change the description of the --retry option:
remove the note that this option would mainly be useful when
following by name.
(main): Change diagnosing dubios uses of --retry option:
when the --retry option is used without following, then issue
a warning that this option is ignored; when it is used together
with --follow=descriptor, then issue a warning that it is only
effective for the initial open.
Disable inotify also in the case when the initial open in tail_file()
failed (which is the actual bug fix).
* init.cfg (retry_delay_): Pass excess arguments to the test function.
* tests/tail-2/retry.sh: Add new tests.
* tests/local.mk (all_tests): Mention it.
* doc/coreutils.texi (tail invocation): Enhance the documentation
of the --retry option.  Clarify the difference in tail's behavior
regarding the --retry option when combined with the following modes
name versus descriptor.
* NEWS (Bug fixes): Mention the fix.

Reported by Noel Morrison in:
http://lists.gnu.org/archive/html/coreutils/2013-04/msg00003.html

12 years agotests: avoid false failures with non default groups
Pádraig Brady [Fri, 12 Apr 2013 21:57:45 +0000 (22:57 +0100)] 
tests: avoid false failures with non default groups

On OS X it was seen that the group ID used for new files,
are set to a that of the directory rather than the current user.
It's not currently understood when this happens, but it was confirmed
that ACLs, extended attributes and setgid bits are _not_ involved.

* init.cfg (skip_if_nondefault_group_): A new function to detect
and avoid this situation.  Document with links to the discussions
for hopefully future clarification.
* tests/install/install-C-root.sh: Use the new function.
* tests/install/install-C-selinux.sh: Likewise.
* tests/install/install-C.sh: Likewise.

12 years agodoc: mention caveats with using install --compare
Pádraig Brady [Sat, 13 Apr 2013 21:23:01 +0000 (22:23 +0100)] 
doc: mention caveats with using install --compare

* doc/coreutils.texi (install invocation): Mention that install(1) may
not correctly determine the default user or permissions for installed
files, and so is best used with options specifying these attributes.

12 years agohead: with --bytes=-N only allocate memory as needed
Pádraig Brady [Wed, 23 Jan 2013 12:34:46 +0000 (12:34 +0000)] 
head: with --bytes=-N only allocate memory as needed

* src/head.c (elide_tail_bytes_pipe): Don't use calloc as that
bypasses memory overcommit due to the zeroing requirement.
Also realloc rather than malloc the pointer array to avoid
dependence on overcommit entirely.
* tests/misc/head-c.sh: Add a test case.
Fixes http://bugs.gnu.org/13530

12 years agodd: avoid buffer allocations unless needed
Ondrej Oprala [Tue, 22 Jan 2013 13:21:23 +0000 (14:21 +0100)] 
dd: avoid buffer allocations unless needed

* src/dd.c: Add new static global variable ibuf.
(alloc_ibuf, alloc_obuf): New functions factored from dd_copy().
(dd_copy): Call the new functions to allocate memory for
ibuf and obuf when necessary.
(skip): Likewise.
* tests/dd/no-allocate.sh: New test.
* tests/local.mk: Reference the test.

12 years agocsplit: add the --suppress-matched option
Assaf Gordon [Wed, 6 Mar 2013 20:53:16 +0000 (15:53 -0500)] 
csplit: add the --suppress-matched option

With --suppress-matched, the lines that match the pattern will not be
printed in the output files.  I.E. the first line from the second
and subsequent splits will be suppressed.

* src/csplit.c: process_regexp(),process_line_count(): Don't output the
matched lines.  Since csplit includes "up to but not including" matched
lines in each split, the first line (in the next group) is the matched
line - so just skip it.
main(): Handle new option.
usage(): Mention new option.
* doc/coreutils.texi (csplit invocation): Mention new option, examples.
* tests/misc/csplit-suppress-matched.pl: New test script.
* tests/local.mk: Reference the new test.
* NEWS: Mention new feature.

12 years agobuild: fix man page build failure with some permissions setups
Enrico Scholz [Sat, 6 Apr 2013 12:23:59 +0000 (14:23 +0200)] 
build: fix man page build failure with some permissions setups

Use the more portable 'chmod a-w', instead of the 'chmod -w' form.
The latter is not always supported.  Also its operation is
dependent on umask controlling the permissions bits for new files,
which is not the case in the presence of POSIX default ACLs for e.g.
In that case, chmod may print a warning like the following, and
exit with failure status:

chmod: man/hostid.1-t: new permissions are r--rw-r--, not r--r--r--

* man/local.mk: s/-w/a-w/

12 years agotests: avoid shared lib tests on unsupported platforms
Pádraig Brady [Wed, 27 Mar 2013 12:51:43 +0000 (12:51 +0000)] 
tests: avoid shared lib tests on unsupported platforms

* init.cfg (require_gcc_shared_): A new function to check
that we can build shared libraries in the particular manner
we use in our tests.
* tests/cp/nfs-removal-race.sh: Use require_gcc_shared_.
Then fail rather than skip, if the actual shared lib build fails.
* tests/df/no-mtab-status.sh: Likewise.
* tests/df/skip-duplicates.sh: Likewise.
* tests/ls/getxattr-speedup.sh: Likewise.
Reported in http://bugs.gnu.org/14024

12 years agotail: exit without reading input if would never output
Pádraig Brady [Tue, 26 Mar 2013 00:36:01 +0000 (00:36 +0000)] 
tail: exit without reading input if would never output

* src/tail.c (main): If -n0 or -c0 were specified without -f,
then no data would ever be output, so exit without reading input.
* tests/tail-2/tail-n0f.sh: Augment the related test with this case.

12 years agoshuf: exit without reading if would never output
Pádraig Brady [Wed, 27 Mar 2013 11:06:00 +0000 (11:06 +0000)] 
shuf: exit without reading if would never output

* src/shuf.c (main): If -n0 specified then no data would ever be output,
so exit without reading input.
* tests/misc/shuf.sh: Augment the related test with this case.

12 years agodoc: add details on ln --relative symlink resolution
Pádraig Brady [Wed, 3 Apr 2013 17:33:43 +0000 (18:33 +0100)] 
doc: add details on ln --relative symlink resolution

* doc/coreutils.texi (ln invocation): Describe how symlinks are
resolved with --relative, and give an example showing the greater
control available through realpath(1).
* tests/ln/relative.sh: Add a test to demonstrate full symlink
resolution, in a case where it might not be wanted.

12 years agoln: --relative: fix updating of existing symlinks
Rémy Lefevre [Tue, 2 Apr 2013 01:48:28 +0000 (02:48 +0100)] 
ln: --relative: fix updating of existing symlinks

Don't dereference an existing symlink being replaced.
I.E. generate the symlink relative to the symlink's containing dir,
rather than to some arbitrary place it points to.

* src/ln.c (convert_abs_rel): Don't consider the final component
of the symlink name when canonicalizing, as we want to avoid
dereferencing the final component.
* tests/ln/relative.sh: Add a test case.
* NEWS: Mention the fix.
Resolves http://bugs.gnu.org/14116

12 years agoshuf: use reservoir-sampling for large or unknown sized inputs
Assaf Gordon [Wed, 6 Mar 2013 23:25:49 +0000 (18:25 -0500)] 
shuf: use reservoir-sampling for large or unknown sized inputs

Reservoir sampling optimizes selecting K random lines from large or
unknown-sized input: http://en.wikipedia.org/wiki/Reservoir_sampling
Note this also avoids reading any input when -n0 is specified.

* src/shuf.c (main): Use reservoir-sampling when the number of output
lines is known, and the input size is large or unknown.
(input_size): A new function to get the input size for regular files.
(read_input_reservoir_sampling): New function to read lines from input,
keeping only K lines in memory, replacing lines with decreasing prob.
(write_permuted_output_reservoir): New function to output reservoir.
* tests/misc/shuf-reservoir.sh: An expensive_ test using valgrind to
exercise the reservoir-sampling code.
* tests/local.mk: Reference new test.
* NEWS: Mention the improvement.

12 years agostat,tail: improve support for efivarfs, exofs, f2fs and ubifs
Pádraig Brady [Fri, 22 Mar 2013 12:15:04 +0000 (12:15 +0000)] 
stat,tail: improve support for efivarfs, exofs, f2fs and ubifs

* src/stat.c (human_fstype): Add new file system ID definitions.
* NEWS: Mention the improvement.
Fixes http://bugs.gnu.org/14020

12 years agomaint: improve make src/fs-magic-compare
Pádraig Brady [Fri, 22 Mar 2013 11:10:40 +0000 (11:10 +0000)] 
maint: improve make src/fs-magic-compare

* README-release: fix the `make` command, and mention how
to get the latest results without requring running a
system with the latest kernel.
* src/local.mk (src/fs-latest-magic.h): A new target to
document how/where to place the latest magic header.
(src/fs-kernel-magic): Adjust to include separately
downloaded header if available.
(src/fs-magic): Undefine MANPAGER as it may impact the
ability to pipe the output of man(1).
(fs-magic-compare): Don't echo the commands run as they're
distracting from the output which needs to be examined.

12 years agobuild: fix issues when building with GMP
Pádraig Brady [Fri, 22 Mar 2013 13:58:55 +0000 (13:58 +0000)] 
build: fix issues when building with GMP

* m4/gmp.m4 (cu_GMP): Add an extra check that gmp.h is available
which is required on one Mac OS X 10.5.8 system at least,
where the lib was available but the header wasn't.
Also enable our GMP code on systems where GMP is not in a separate lib.

12 years agodoc: clarify the printable characters output by od
Pádraig Brady [Fri, 22 Mar 2013 15:33:57 +0000 (15:33 +0000)] 
doc: clarify the printable characters output by od

* src/od.c (usage): Mention any printable character is output,
Not just ASCII.
* doc/coreutils.texi (od invocation): Further clarify that only
single byte characters are output (due to the alignment requirement).
Also mention the fact that 3 digit octal sequences are output
for non printable characters without a corresponding C escape.
Reported in http://bugs.gnu.org/13947

12 years agodoc: clarify stat the meaning of --format="%t %T"
Pádraig Brady [Tue, 12 Mar 2013 13:43:08 +0000 (13:43 +0000)] 
doc: clarify stat the meaning of --format="%t %T"

* src/stat.c (usage): Mention that the values are only
defined for character and block special files.
* doc/coreutils.texi (stat invocation): Likewise.
Also mention st_rdev.
Reported in http://bugs.gnu.org/13927

12 years agodoc: mention `numfmt` as an alternative to `sort -h`
Pádraig Brady [Mon, 4 Mar 2013 00:55:57 +0000 (00:55 +0000)] 
doc: mention `numfmt` as an alternative to `sort -h`

* doc/coreutils.texi (sort invocation): Mention that numfmt
can achieve the same results with a possibly more accurate sort.

12 years agodoc: remove a redundant numfmt heading from texinfo
Pádraig Brady [Mon, 4 Mar 2013 00:50:51 +0000 (00:50 +0000)] 
doc: remove a redundant numfmt heading from texinfo

* doc/coreutils.texi (detailmenu): Remove the redundant numfmt heading.

12 years agomaint: ensure proper backslash quoting in texinfo macros
Pádraig Brady [Mon, 4 Mar 2013 00:17:50 +0000 (00:17 +0000)] 
maint: ensure proper backslash quoting in texinfo macros

* doc/coreutils.texi (ambiguousGroupNote): Ensure '\' is escaped
appropriately within the macro.  This was verified to generate
a single '\' in both "info" and "pdf" outputs.

12 years agobuild: fix factor build failure on aarch64
Torbjörn Granlund [Mon, 4 Mar 2013 17:57:33 +0000 (17:57 +0000)] 
build: fix factor build failure on aarch64

* src/longlong.h (__aarch64__): Make add_ssaaaa and sub_ddmmss work.
* NEWS: Mention the build fix.
Reported at https://bugzilla.redhat.com/917735

12 years agotests: don't skip all uniq tests when locale is missing
Assaf Gordon [Thu, 28 Feb 2013 23:34:49 +0000 (23:34 +0000)] 
tests: don't skip all uniq tests when locale is missing

* tests/misc/uniq.pl: Previously, if LOCALE_FR was not defined, all
tests would be skipped. Modified to skip only the relevant test.

12 years agouniq: add the --group option
Assaf Gordon [Wed, 20 Feb 2013 18:31:22 +0000 (13:31 -0500)] 
uniq: add the --group option

* src/uniq.c (usage): Summarize the new option,
and adjust the --all-repeated option to be more consistent.
(check_file): Merge the --group functionality into
the core loop for the default uniq operation since
it's very similar and can output lines immediately upon reading.
(main): Handle the new --group option and make it
mutually exclusive with other selection options.
* tests/misc/uniq.pl: Add tests.
* NEWS: Mention the new feature.
* doc/coreutils.texi (uniq invocation): Describe --group.

12 years agodoc: move some info from all --help messages, online
Pádraig Brady [Thu, 28 Feb 2013 02:07:28 +0000 (02:07 +0000)] 
doc: move some info from all --help messages, online

* src/system.h (emit_ancillary_info): Link to the bug report email
addresses and general help URLs online rather than specifying directly.
This give us greater scope to present better info like describing
the difference between bug-coreutils@gnu.org and coreutils@gnu.org etc.
* tests/misc/help-version.sh: Remove the check for bug-coreutils@gnu.org
* tests/local.mk: Remove the no longer needed PACKAGE_BUGREPORT.

12 years agotests: add '--ignore-case' tests for uniq
Assaf Gordon [Tue, 12 Feb 2013 15:30:25 +0000 (10:30 -0500)] 
tests: add '--ignore-case' tests for uniq

* tests/misc/uniq.pl: add tests for --ignore-case.

12 years agodircolors: add a new entry to colorize 'arc' files
Javier López [Thu, 28 Feb 2013 03:30:52 +0000 (03:30 +0000)] 
dircolors: add a new entry to colorize 'arc' files

* src/dircolors.hin: Add an entry for arc.  Suggested in:
https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/1088131

12 years agojoin: Add the -z, --zero-terminated option
Assaf Gordon [Thu, 14 Feb 2013 20:29:08 +0000 (15:29 -0500)] 
join: Add the -z, --zero-terminated option

* NEWS: Mention join's new option: --zero-terminated (-z).
* src/join.c: Add new option, --zero-terminated (-z), to make
join use the NUL byte as separator/delimiter rather than newline.
(get_line): Use readlinebuffer_delim in place of readlinebuffer.
(main): Handle the new option.
(usage): Describe new option the same way sort does.
* doc/coreutils.texi (join invocation): Describe the new option.
* tests/misc/join.pl: add tests for -z option.

12 years agodircolors: add new entries to colorized archive formats
Ondřej Vašík [Wed, 20 Feb 2013 13:52:43 +0000 (14:52 +0100)] 
dircolors: add new entries to colorized archive formats

* src/dircolors.hin:  Add .cab, .alz, .lzo, .lrz, .t7z, .tzo, .lha
to colorized archives.
Suggested by Ville Skyttä in https://bugzilla.redhat.com/868510

12 years agoinstall: cleanup properly if the strip program failed for any reason
Ondrej Oprala [Fri, 22 Feb 2013 12:48:57 +0000 (13:48 +0100)] 
install: cleanup properly if the strip program failed for any reason

* src/install.c (strip): Indicate failure with a return code instead
of terminating the program.
(install_file_in_file): Handle strip's return code and unlink the
created file if necessary.
* tests/install/strip-program.sh: Add a test to cover the changes.
* NEWS (Bug fixes): Mention the fix.
Reported by John Reiser in http://bugzilla.redhat.com/632444.

12 years agocopy: ensure the correct root ID is checked on all platforms
Joachim Schmitz [Tue, 19 Feb 2013 11:36:57 +0000 (11:36 +0000)] 
copy: ensure the correct root ID is checked on all platforms

* src/copy.c (copy_reg): Check ROOT_UID rather than 0,
which is significant on HP-NonStop.

12 years agomaint: cleanup up various uses of __attribute__
Pádraig Brady [Tue, 19 Feb 2013 10:58:51 +0000 (10:58 +0000)] 
maint: cleanup up various uses of __attribute__

* src/cfg.mk (sc_prohibit-gl-attributes): Disallow the __attribute()
form without trailing underscores as that is not elided where required.
Also ensure we use gnulib macros rather than defining our own.
* src/system.h: Remove gnulib provided macros.
* src/chown-core.c: Likewise.
* src/chroot.c: Likewise.
* src/copy.c: Likewise.
* src/csplit.c: Likewise.
* src/dd.c: Likewise.
* src/expr.c: Likewise.
* src/extent-scan.c: Likewise.
* src/factor.c: Likewise.
* src/ls.c: Likewise.
* src/od.c: Likewise.
* src/paste.c: Likewise.
* src/ptx.c: Likewise.
* src/sort.c: Likewise.
* src/stat.c: Likewise.
* src/stty.c: Likewise.
* src/system.h: Likewise.
* src/tac.c: Likewise.
* src/test.c: Likewise.
* src/tsort.c: Likewise.

12 years agobuild: fix numfmt build error on compilers without __attribute
Joachim Schmitz [Tue, 19 Feb 2013 11:09:44 +0000 (11:09 +0000)] 
build: fix numfmt build error on compilers without __attribute

* src/numfmt.c (): Use the more standard _GL_ATTRIBUTE_PURE
which is elided where required.
Reported in http://bugs.gnu.org/10305

12 years agotests: avoid false failures on file systems with smaller NAME_MAX
Pádraig Brady [Tue, 19 Feb 2013 12:06:18 +0000 (12:06 +0000)] 
tests: avoid false failures on file systems with smaller NAME_MAX

* tests/du/long-from-unreadable.sh: This test requires a NAME_MAX
of at least 200, so skip the test otherwise.
* tests/rm/deep-2.sh: Likewise.
Reported by C de-Avillez with ecryptfs where NAME_MAX = 143.

12 years agomaint: choose editor in the commit-msg git hook the same way git does
Stefano Lattarini [Fri, 15 Feb 2013 13:39:40 +0000 (14:39 +0100)] 
maint: choose editor in the commit-msg git hook the same way git does

Git honours the GIT_EDITOR environment variable, the "core.editor" Git
configuration variable, and the EDITOR environment variable (in that
order, and defaulting to "vi" if none of them is set) to decide which
editor should be invoked for the user when he has to or want to edit
his commit message.

However, our commit-msg hook, when invoking an editor on behalf of the
user to allow him to fix a non-policy-complaint commit message, only
honoured the EDITOR environment variable.  To avoid potential annoying
inconsistencies, we should really use the same logic used by Git in the
selection of the editor.  Luckily, we don't have to duplicate this
logic (that would be brittle in the long term), as we can rely on the
"git var" command, designed exactly to be used in situations like this.

* scripts/git-hooks ($editor): Adjust definition.

12 years agomaint: don't reset PATH in the commit-msg git hook
Stefano Lattarini [Fri, 15 Feb 2013 13:39:39 +0000 (14:39 +0100)] 
maint: don't reset PATH in the commit-msg git hook

I have a custom 'editor' script in ~/bin, and a system-provided
'editor' program in /usr/bin (on Debian, this is a link set up the
"debian alternatives" subsystem).  My '$EDITOR' and '$GIT_EDITOR'
variables are set simply to 'editor' (no absolute path), which I
expect should point to my 'editor' script, since ~/bin precedes
/usr/bin in my PATH definition.  But the 'commit-msg' hook used in
coreutils unconditionally resets its PATH to '/bin:/usr/bin', which
causes it to call the "wrong" editor (the one in /usr/bin, not the
one in ~/bin) when it makes me update a botched commit message.

* scripts/git-hooks: Don't reset $ENV{PATH} to '/bin:/usr/bin',
which was only done to avoid failure when enabling Perl's taint
checking.

12 years agomaint: prevent trailing period at first line of a commit message
Bernhard Voelker [Wed, 13 Feb 2013 23:28:06 +0000 (00:28 +0100)] 
maint: prevent trailing period at first line of a commit message

* scripts/git-hooks/commit-msg (bad_first_line): Return an error
message if the first line of a commit message ends with a period.

12 years agomaint: post-release administrivia
Pádraig Brady [Thu, 14 Feb 2013 16:23:45 +0000 (16:23 +0000)] 
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.21 v8.21
Pádraig Brady [Thu, 14 Feb 2013 15:52:18 +0000 (15:52 +0000)] 
version 8.21

* NEWS: Record release date.

12 years agotests: avoid non portable sed use of \t
Pádraig Brady [Thu, 14 Feb 2013 04:27:34 +0000 (04:27 +0000)] 
tests: avoid non portable sed use of \t

* tests/du/threshold.sh: use `cut` rather than
sed to avoid using the non portable \t which
fails on sed on openbsd 5 at least.
Also remove a redundant call to `tr` and avoid
explicit setting of LANG=C which is done globally.

12 years agobuild: avoid link failure in devmsg() on older linkers
Pádraig Brady [Thu, 14 Feb 2013 02:32:22 +0000 (02:32 +0000)] 
build: avoid link failure in devmsg() on older linkers

On linkers that don't remove unused functions,
there will be a reference to a missing dev_debug symbol
in the devmsg() function.  So for now ...

* src/system.h: ... move devmsg() from here ...
* src/numfmt.c: ... to here, and document future cleanup.
* src/factor.c: Likewise.

12 years agonumfmt: fix strtol() return code handling
Assaf Gordon [Tue, 12 Feb 2013 20:28:22 +0000 (15:28 -0500)] 
numfmt: fix strtol() return code handling

src/numfmt.c (parse_format_string): On some systems, strtol() returns
EINVAL if no conversion was performed.  So only handle ERANGE here,
and handle other format errors directly.

12 years agomaint: avoid running check-root tests in gnulib
Bernhard Voelker [Mon, 11 Feb 2013 09:48:31 +0000 (09:48 +0000)] 
maint: avoid running check-root tests in gnulib

* tests/local.mk (check-root): Restrict to SUBDIRS=. as traversing
into gnulib-tests induces a false failure.

12 years agodoc: improve the numfmt man page format
Pádraig Brady [Mon, 11 Feb 2013 09:27:22 +0000 (09:27 +0000)] 
doc: improve the numfmt man page format

* src/numfmt.c (usage): Keep a single space between the "K = 1000",
so that it's not displayed on a separate line.  Also place ','
between each unit entry to improve readability.

12 years agodoc: standardize helptext of numfmt and slice into single options
Benno Schulenberg [Sun, 10 Feb 2013 22:00:48 +0000 (23:00 +0100)] 
doc: standardize helptext of numfmt and slice into single options

* src/numfmt.c (usage): Correct synopsis and make command description
clearer.  Start option descriptions with lowercase letter; use
semicolon instead of period where needed; indent continuation lines;
gettextize single options for ease of translation and maintenance;
sort options alphabetically.
* doc/coreutils.texi (numfmt invocation): Sort numfmt options
alphabetically.  Enforce double-blank-after-period style.

This addresses http://bugs.gnu.org/13681.
Improved-by: Bernhard Voelker
12 years agomaint: consolidate developer debug messages
Pádraig Brady [Sun, 10 Feb 2013 12:47:23 +0000 (12:47 +0000)] 
maint: consolidate developer debug messages

Both factor and numfmt recently introduced debug messages
for developers, enabled by --verbose and ---devdebug respectively.
There were a few issues though:
 1. They used different mechanisms to enable these messages.
 2. factor used --verbose which might be needed for something else
 3. They used different methods to output the messages,
    and numfmt used error() which added an unwanted newline
 4. numfmt marked all these messages for translation and factor
    marked a couple.  We really don't need these translated.
So we fix the above issues here while renaming the enabling
option for both commands to ---debug (still undocumented).

* src/factor.c (verbose): Rename to dev_debug and change from int to
bool as it's just a toggle flag.
(long_options): Rename --verbose to ---debug.
* src/system.h (devmsg): A new inline function to output a message
if enabled by a global dev_debug variable in the compilation unit.
* src/numfmt.c: Use devmsg() rather than error().
Also remove the translation tags from these messages.
Also change debug flag to bool from int.
* tests/misc/numfmt.pl: Adjust for the ---devdebug to ---debug change.
* cfg.mk (sc_marked_devdiagnostics): Add a syntax check to ensure
translations are not added to devmsg calls.

Reported by Göran Uddeborg in http://bugs.gnu.org/13665

12 years agotests: tail-2/inotify-rotate: fix a false failure on NFS
Pádraig Brady [Sat, 9 Feb 2013 04:39:40 +0000 (04:39 +0000)] 
tests: tail-2/inotify-rotate: fix a false failure on NFS

* tests/tail-2/inotify-rotate.sh: Avoid a subshell with bash,
which in turn causes the `kill` to be ineffective to the tail
processes (as the SIGTERM is sent to the subshell which doesn't
propagate the signal on to its children).  On NFS the test
cleanup will then fail as there will be .nfs files maintained
in the directory for the files still opened by the tail processes.
Reported by Bernhard Voelker.

12 years agotests: skip numfmt grouping tests on some systems
Pádraig Brady [Fri, 8 Feb 2013 16:05:25 +0000 (16:05 +0000)] 
tests: skip numfmt grouping tests on some systems

* tests/misc/numfmt.pl: When the system locale grouping doesn't
match our expected format for grouping 1234 in the fr_FR locale,
reset the locale to 'C' so as to skip all locale tests.

12 years agotests: avoid actual/expected mismatch due to changed diagnostic
Jim Meyering [Thu, 7 Feb 2013 17:43:41 +0000 (09:43 -0800)] 
tests: avoid actual/expected mismatch due to changed diagnostic

* tests/cp/fail-perm.sh: Adjust expected diagnostic to match
just-changed cp diagnostic.
* tests/ln/hard-to-sym.sh: Likewise.
* .mailmap: Also map my new address.

12 years agobuild: update gnulib submodule; also bootstrap to latest
Pádraig Brady [Thu, 7 Feb 2013 16:47:45 +0000 (16:47 +0000)] 
build: update gnulib submodule; also bootstrap to latest

Notes tests/init.sh is still in sync with gnulib

* bootstrap: update to latest
* gnulib: update avoiding secure_getenv and subsequent patches
as these are reported to fail on FreeBSD at least.

12 years agomaint: improve error messages upon failed read, write, access, close
Benno Schulenberg [Fri, 4 Jan 2013 21:45:34 +0000 (22:45 +0100)] 
maint: improve error messages upon failed read, write, access, close

Note we use "failed to {access,close}" for those single operations,
and "error {read,writ}ing" for those partial operation failures.

* src/copy.c: Improve error messages for failing read, write and close.
* src/cp.c: Improve error messages for failing access.
* src/dd.c: Improve error messages for failing read, write and open.
* src/head.c: Improve error message for failing close.
* src/install.c: Improve error messages for failing access.
* src/ln.c: Likewise.
* src/mv.c: Likewise.
* src/touch.c: Improve error message for failing close.
* src/truncate.c: Likewise.

12 years agodoc: fix a numfmt help section typo
Assaf Gordon [Tue, 5 Feb 2013 16:04:41 +0000 (11:04 -0500)] 
doc: fix a numfmt help section typo

* src/numfmt.c (usage): Change erroneous "G" to "M".

12 years agostty: add support for DTR/DSR hardware control flow
Ondřej Vašík [Tue, 5 Feb 2013 14:00:47 +0000 (15:00 +0100)] 
stty: add support for DTR/DSR hardware control flow

Originally requested in Red Hat bugzilla #445213.

* src/stty.c (mode_info): Add support for DTR/DSR hardware flow control,
if available.
* doc/coreutils.texi: Document it.
* tests/misc/stty.sh: Add it to the list of serial options to avoid.
* NEWS: Mention the improvement.

12 years agonumfmt: correct a printf format
Pádraig Brady [Tue, 5 Feb 2013 15:37:47 +0000 (15:37 +0000)] 
numfmt: correct a printf format

Prompted by the continuous integration build failure at:
http://hydra.nixos.org/build/4010493

* src/numfmt.c (parse_format_string): Correct both sign and size of
a printf format, which only gives a warning on 32 bit builds.