]> git.ipfire.org Git - thirdparty/coreutils.git/log
thirdparty/coreutils.git
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.

12 years agonumfmt: a new command to format numbers
Assaf Gordon [Thu, 6 Dec 2012 22:30:23 +0000 (22:30 +0000)] 
numfmt: a new command to format numbers

* AUTHORS: Add my name.
* NEWS: Mention the new program.
* README: Reference the new program.
* src/numfmt.c: New file.
* src/.gitignore: Ignore the new binary.
* build-aux/gen-lists-of-programs.sh: Update.
* scripts/git-hooks/commit-msg: Allow numfmt: commit prefix.
* po/POTFILES.in: Add new c file.
* tests/misc/numfmt.pl: A new test file giving >93% coverage.
* tests/local.mk: Reference the new test.
* man/.gitignore: Ignore the new man page.
* man/local.mk: Reference the new man page.
* man/numfmt.x: A new template.
* doc/coreutils.texi: Document the new command.

12 years agocut: fix a segfault with disjoint open ended ranges
Pádraig Brady [Mon, 4 Feb 2013 11:39:20 +0000 (11:39 +0000)] 
cut: fix a segfault with disjoint open ended ranges

Fixes the issue introduced in unreleased commit v8.20-60-gec48bea.

* src/cut.c (set_fields): Don't access the bit array if
we've an open ended range that's outside any finite range.
* tests/misc/cut.pl: Add tests for this case.
Reported by Marcel Böhme in http://bugs.gnu.org/13627

12 years agodoc: say how to tac char-by-char
Paul Eggert [Fri, 1 Feb 2013 21:32:48 +0000 (13:32 -0800)] 
doc: say how to tac char-by-char

This fixes Bug#12115, reported by Reuben Thomas.
* doc/coreutils.texi (tac invocation): Document how to reverse a
file character by character.  Break out MS-DOS into a separate
section, like 'cat' does.

12 years agodf: do not treat rootfs specially
Bernhard Voelker [Mon, 28 Jan 2013 13:56:44 +0000 (14:56 +0100)] 
df: do not treat rootfs specially

Like any other pseudo file system, df should show rootfs only
when the -a option is specified, i.e. specifying -trootfs alone
is not sufficient.  As the rootfs entry is now elided by the
general deduplication in filter_mount_list (commit v8.20-103-gbb116d3),
all other references to rootfs can be removed again.

* src/df.c (show_rootfs): Remove global variable.
(ROOTFS): Remove constant.
(filter_mount_list): Remove case to handle rootfs specially.
(main): In the case for handling the -t option, remove setting
of the show_rootfs variable.
* tests/df/skip-rootfs.sh: Adapt the test case "df -t rootfs":
the rootfs file system must not be printed (because no -a).
* doc/coreutils.texi (df invocation): Correct the documentation
about eliding mount entries: it is not the first occurrence of
the the device which wins, but now rather the entry with the
shortest mount point name.  Also adapt the description about
eliding pseudo file system types like rootfs.
* NEWS (Changes in behavior): Adapt entry.

12 years agodf: prefer fullpath entries when deduplicating
Ondrej Oprala [Fri, 25 Jan 2013 00:07:58 +0000 (01:07 +0100)] 
df: prefer fullpath entries when deduplicating

* src/df.c (struct devlist): Add a new element for storing
pointers to mount_entry structures.
(devlist_head, dev_examined): Remove.
(filter_mount_list): Add new function to filter out the rootfs
entry (unless -trootfs is specified), and duplicities. The
function favors entries with a '/' character in me_devname
or those with the shortest me_mountdir string, if multiple
entries fulfill the first condition.
Use struct devlist to build up a list of entries already known,
and finally rebuild the global mount_list.
(get_all_entries): Call the above new function unless the -a
option is specified.
(get_dev): Remove the code for skipping rootfs and duplicities.
* tests/df/skip-duplicates.sh: Add test cases.

Co-authored-by: Bernhard Voelker <mail@bernhard-voelker.de>
12 years agotimeout: ensure a blocked SIGALRM from the parent is unblocked
Stephan Krempel [Fri, 25 Jan 2013 02:48:46 +0000 (02:48 +0000)] 
timeout: ensure a blocked SIGALRM from the parent is unblocked

* src/timeout.c (unblock_signal): A new function to unblock a
specified signal, or warn if not possible.
(set_timeout): Ensure SIGALRM is unblocked before we setup the timer.
* tests/misc/timeout-blocked.pl: A new test for the issue.
* tests/local.mk: Reference the new test.
* NEWS: Mention the fix.
Fixes: http://bugs.gnu.org/13535
12 years agoseq: fix to always honor the step value
Pádraig Brady [Tue, 22 Jan 2013 11:13:16 +0000 (11:13 +0000)] 
seq: fix to always honor the step value

* src/seq.c (main): With 3 positive integer args we were
checking the end value was == "1", rather than the step value.
* tests/misc/seq.pl: Add tests for this case.
Reported by Marcel Böhme in http://bugs.gnu.org/13525

12 years agoseq: fix misaligment with -w when no precision for start value
Pádraig Brady [Wed, 9 Jan 2013 12:23:35 +0000 (12:23 +0000)] 
seq: fix misaligment with -w when no precision for start value

* src/seq.c (get_default_format): Also account for the case where '.'
is auto added to the start value, which is significant when the
number sequence narrows.
* tests/misc/seq.pl: Add two new tests for the failing cases.
* NEWS: Mention the fix.
Fixes http://bugs.gnu.org/13394

12 years agocut: fix -f to work with the -d$'\n' edge case
Pádraig Brady [Tue, 22 Jan 2013 01:34:07 +0000 (01:34 +0000)] 
cut: fix -f to work with the -d$'\n' edge case

* src/cut.c (cut_fields): Handle the edge case where '\n' is
the delimiter, which could be used for example to suppress
the last line if it doesn't contain a '\n'.
* test/misc/cut.pl: Add tests for this edge case.

12 years agocut: with -f, process each line independently
Pádraig Brady [Mon, 21 Jan 2013 15:37:37 +0000 (15:37 +0000)] 
cut: with -f, process each line independently

Previously line N+1 was inspected before line N was fully output,
which causes output ordering issues at the terminal or delays
from intermittent sources like tail -f.

* src/cut.c (cut_fields): Adjust so that we record the
previous output character so we can use that info to
determine wether to output a '\n' or not.
* tests/misc/cut.pl: Add tests to ensure existing
functionality isn't broken.
* NEWS: Mention the fix.
Fixes bug http://bugs.gnu.org/13498

12 years agobuild: update gnulib submodule to latest
Paul Eggert [Thu, 24 Jan 2013 03:58:35 +0000 (19:58 -0800)] 
build: update gnulib submodule to latest

* bootstrap.conf (gnulib_modules): Add statat.
The fstatat module was split in two, and we need both halves.

12 years agodoc: fix an example in the od man page
Pádraig Brady [Thu, 24 Jan 2013 01:38:17 +0000 (01:38 +0000)] 
doc: fix an example in the od man page

* man/od.x: s/-w 16/-w16/ as -w takes an optional
parameter and so the space is significant.

12 years agodoc: fix order of du options in usage and texinfo manual
Bernhard Voelker [Wed, 23 Jan 2013 00:26:40 +0000 (01:26 +0100)] 
doc: fix order of du options in usage and texinfo manual

* src/du.c (usage): Bring options into alphabetical order.
* doc/coreutils.texi (du invocation): Likewise.
Furthermore, use the @itemx macro for the long options
--max-depth and --threshold instead of @item.

12 years agomaint: define usage note about mandatory args centrally
Bernhard Voelker [Wed, 23 Jan 2013 00:03:38 +0000 (01:03 +0100)] 
maint: define usage note about mandatory args centrally

Each program with at least one long option which is marked as
'required_argument' and which has also a short option for that
option, should print a note about mandatory arguments.
Define that well-known note centrally and use it rather than
literal printf/fputs, and add it where it was missing.

* src/system.h (emit_mandatory_arg_note): Add new function.

* src/cp.c (usage): Use it rather than literal printf/fputs.
* src/csplit.c, src/cut.c, src/date.c, src/df.c, src/du.c:
* src/expand.c, src/fmt.c, src/fold.c, src/head.c, src/install.c:
* src/kill.c, src/ln.c, src/ls.c, src/mkdir.c, src/mkfifo.c:
* src/mknod.c, src/mv.c, src/nl.c, src/od.c, src/paste.c:
* src/pr.c, src/ptx.c, src/shred.c, src/shuf.c, src/sort.c:
* src/split.c, src/stdbuf.c, src/tac.c, src/tail.c, src/timeout.c:
* src/touch.c, src/truncate.c, src/unexpand.c, src/uniq.c:
Likewise.

* src/base64.c (usage): Add call of the above new function
because at least one long option has a required argument.
* src/basename.c, src/chcon.c, src/date.c, src/env.c:
* src/nice.c, src/runcon.c, src/seq.c, src/stat.c, src/stty.c:
Likewise.

12 years agodu: add -t SIZE, --threshold=SIZE option
Jakob Truelsen [Mon, 21 Jan 2013 05:29:12 +0000 (06:29 +0100)] 
du: add -t SIZE, --threshold=SIZE option

* src/du.c (opt_threshold): Add variable to hold the value of
the --threshold option specified by the user.
(long_options): Add a required_argument entry for the new
--threshold option.
(usage): Add --threshold option.
(process_file): Elide printing the entry if its size does not
meet the value specified by the --threshold option.
(main): In the argument parsing loop, add a case for the new
-t option. Convert the given argument by permitting the
well-known suffixes for megabyte, gigabytes, etc.
Handle the special case "-0": give an error as this value is
not permitted.
* doc/coreutils.texi (du invocation): Add documentation for the
above new option.
* tests/du/threshold.sh: Add new test to exercise the new option.
* tests/local.mk (all_tests): Mention the above test.

Co-authored-by: Bernhard Voelker <mail@bernhard-voelker.de>
12 years agotests: remove test case du/slink
Bernhard Voelker [Sun, 20 Jan 2013 22:47:32 +0000 (23:47 +0100)] 
tests: remove test case du/slink

This test tried to ensure that not all symlinks (across all
file system types) have Zero size and refers to a change
in system.h from 2002-08-31 (commit SH-UTILS-2_0_15-55-g62808a7).
The test used to do this by working on symlinks to long file
names.  This assumption is dependant on the underlying file
system, and in some environments like XEN does not even work
on file systems known to work otherwise.

The test for dereferencing and no-dereferencing symlinks is
already covered by other tests (du/deref.sh, du/deref-args.sh,
and du/no-deref.sh).  Therefore, remove it.

* tests/du/slink.sh: Remove file.
* tests/local.mk (all_tests): Remove the above test.

Discussed in:
http://lists.gnu.org/archive/html/coreutils/2013-01/msg00053.html

12 years agomaint: fix alphabetical order in .gitignore
Bernhard Voelker [Fri, 11 Jan 2013 08:14:22 +0000 (09:14 +0100)] 
maint: fix alphabetical order in .gitignore

Since commit v8.20-67-g0f525b6, .gitignore sometimes
showed up as changed because the entries "*.gcda" and
"*.gcno" had not been in alphabetical order.

* .gitignore: Exchange the entries "*.gcda" and "*.gcno".

12 years agouptime: gettextize an overlooked string, and normalize another
Benno Schulenberg [Sat, 17 Nov 2012 10:49:21 +0000 (11:49 +0100)] 
uptime: gettextize an overlooked string, and normalize another

* src/uptime.c: Add calls to gettext() and select_plural().

12 years agodoc: make a --help text fragment identical to three others
Benno Schulenberg [Fri, 4 Jan 2013 21:07:49 +0000 (22:07 +0100)] 
doc: make a --help text fragment identical to three others

* src/ln.c (usage): Move a newline to the next text fragment, so
the preceding fragment about backup methods becomes the same as
the ones for cp, mv, and install.  A bit easier for translators.

12 years agofactor: apply a more general fix to enable correct assembly
Pádraig Brady [Fri, 4 Jan 2013 18:07:01 +0000 (18:07 +0000)] 
factor: apply a more general fix to enable correct assembly

In addition to the previous 64 bit guards we've placed in longlong.h
there are additional _LP64 guards required for mips with -mcpu >= 3,
to avoid a build failure (http://bugs.gnu.org/13353) and on sparc
with -mcpu >= v9 in 32 bit mode where for example,
`factor 2123123123123123123123` would go into an infinite loop.

Since factor.c currently operates on uintmax_t, we restrict the use
of the assembly in longlong.h to when 'long' has the same width, to
provide a more general guard for this code.

* src/factor.c: Restrict the use of longlong.h assembly code,
to when the width of intmax_t == long.
* src/longlong.h: Remove the previous _LP64 guards to avoid
divergence from GMP's longlong.h
* NEWS: Adjust the info on build and runtime fixes.

12 years agodoc: sync parse-datetime from gnulib
Paul Eggert [Sun, 6 Jan 2013 15:36:54 +0000 (07:36 -0800)] 
doc: sync parse-datetime from gnulib

* doc/coreutils.texi (Top): Sync from gnulib parse-datetime.texi menu.

12 years agodoc: avoid @sc in texinfo; it is unnecessary
Karl Berry [Sun, 6 Jan 2013 12:32:22 +0000 (12:32 +0000)] 
doc: avoid @sc in texinfo; it is unnecessary

* doc/coreutils.texi: avoid @sc and use explicit capitals.
* doc/local.mk (sc-use-small-caps-NUL): Remove, as no longer applicable.

12 years agodoc: remove stale pr news in the manual
Karl Berry [Fri, 4 Jan 2013 18:17:55 +0000 (18:17 +0000)] 
doc: remove stale pr news in the manual

* coreutils.texi (pr invocation): remove list of ancient news
items; the main documentation already covers what is needed.

12 years agomaint: update all copyright year number ranges
Jim Meyering [Tue, 1 Jan 2013 02:54:51 +0000 (03:54 +0100)] 
maint: update all copyright year number ranges

Run "make update-copyright", but then also run this,
  perl -pi -e 's/2\d\d\d-//' tests/sample-test
to make that one script use the single most recent year number.

12 years agobuild: update gnulib submodule to latest
Jim Meyering [Tue, 1 Jan 2013 02:54:41 +0000 (03:54 +0100)] 
build: update gnulib submodule to latest

12 years agomaint: adjust NEWS entry wording
Jim Meyering [Sat, 29 Dec 2012 14:30:48 +0000 (15:30 +0100)] 
maint: adjust NEWS entry wording

* NEWS: Adjust wording in a few entries.

12 years agodoc: improve od --help and man page
Pádraig Brady [Thu, 27 Dec 2012 04:14:14 +0000 (04:14 +0000)] 
doc: improve od --help and man page

* src/od.c: Redorder the information output by --help
to ease interpretation and so that appropriate sections
are generated by help2man.
* doc/coreutils.texi (od invocation): Fix an incorrect
reference to @var{n}, which should be @var{bytes}.
* man/od.x: Add an "Examples" section, and move the
default od format to there, and add a commonly required
format to generate hexdumps.
Reported by Akim Demaille in http://bugs.gnu.org/13280.

12 years agofactor: disable x86_64 assembly code for x32 builds
Mike Frysinger [Fri, 7 Dec 2012 20:44:18 +0000 (15:44 -0500)] 
factor: disable x86_64 assembly code for x32 builds

The current x86_64 asm code does not work for x32 (__ILP32__) ABIs,
so disable it.  Note simply deleting the q suffix is not enough.

* src/longlong.h: Restrict x86_64 assembly to _LP64 targets,
which is consistent with other checks in longlong.h and
avoids this code on x32.
* NEWS: Mention the build fix.

12 years agotests: avoid false positive valgrind failures
Pádraig Brady [Thu, 20 Dec 2012 00:09:15 +0000 (00:09 +0000)] 
tests: avoid false positive valgrind failures

* init.cfg (require_valgrind_): Check the `true` program,
which will check more valgrind failure cases as now
detailed in the function comments.

12 years agodd: fix a printf format mismatch in an error message
Pádraig Brady [Wed, 19 Dec 2012 23:58:10 +0000 (23:58 +0000)] 
dd: fix a printf format mismatch in an error message

* src/dd.c (dd_copy): To print an off_t portably we need
to use PRIdMAX and cast to intmax_t, otherwise there
could be a mismatch between say a 32 bit off_t
and uintmax_t.  This was flagged by -Wformat on
a 64 bit host when compiling with CFLAGS=-m32.

12 years agoseq: fix newline output when -s specified
Pádraig Brady [Wed, 19 Dec 2012 19:27:10 +0000 (19:27 +0000)] 
seq: fix newline output when -s specified

This regression was introduced in commit v8.19-132-g3786fb6.

* src/seq.c (seq_fast): Don't use puts() to output the first number,
and instead insert it into the buffer as for other numbers.
Also output the terminator unconditionally.
* tests/misc/seq.pl: Add some basic tests for the -s option.
* NEWS: Mention the fix.
* THANKS.in: Reported by Philipp Gortan.

12 years agotests: add tests for basename's --zero option
Bernhard Voelker [Thu, 20 Dec 2012 15:38:56 +0000 (16:38 +0100)] 
tests: add tests for basename's --zero option

The -z option has been introduced in commit v8.15-60-ga3eb71a,
i.e. in coreutils-8.16.  Time to add some tests for it.

* tests/misc/basename.pl: Add tests exercising the -z option.
In the foreach loop to append a newline to the end of each
expected 'OUT' string, skip the -z tests.

12 years agodoc: tweak 'lcov' in HACKING
Assaf Gordon [Thu, 20 Dec 2012 10:42:22 +0000 (11:42 +0100)] 
doc: tweak 'lcov' in HACKING

* HACKING: In the paragraph about creating coverage statistics,
use the correct -b (--base-directory) parameter.

12 years agomaint: rewrap a long line noticed by make syntax-check
Pádraig Brady [Wed, 19 Dec 2012 11:44:28 +0000 (11:44 +0000)] 
maint: rewrap a long line noticed by make syntax-check

* configure.ac: Wrap the recently introduced long line.