Pádraig Brady [Thu, 14 Feb 2013 15:52:18 +0000 (15:52 +0000)]
version 8.21
* NEWS: Record release date.
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.
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.
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.
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.
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.
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
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
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.
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.
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.
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.
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.
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".
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.
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.
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.
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
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.
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.
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>
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
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
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
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.
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
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.
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.
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.
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.
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>
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
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".
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().
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.
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.
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.
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.
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.
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.
Jim Meyering [Tue, 1 Jan 2013 02:54:41 +0000 (03:54 +0100)]
build: update gnulib submodule to latest
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.
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.
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.
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.
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.
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.
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.
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.
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.
Pádraig Brady [Sat, 15 Dec 2012 03:15:38 +0000 (03:15 +0000)]
doc: clarify when dd iflag=fullblock is useful
* doc/coreutils.texi (dd invocation): Explain that iflag=fullblock
ensures that count= will count blocks rather than reads, and
reference that in both the count= and iflag=fullblock descriptions.
Suggested by John Reiser.
Pádraig Brady [Tue, 18 Dec 2012 13:06:15 +0000 (13:06 +0000)]
tests: avoid a race in timeout-group.sh
* tests/misc/timeout-group.sh: The kernel might possibly delay
signal propagation to timeout.cmd long enough, that it exits
normally without running the signal handler (as sleep will
be in the same process group and so get the signal too).
So avoid this by explicitly checking that the signal handler
is called, which should always happen under normal circumstances.
Reported by Stefano Lattarini on linux-2.6.30-2-686 and bash-4.2.36.
Pádraig Brady [Wed, 19 Dec 2012 09:13:21 +0000 (09:13 +0000)]
build: avoid --enable-gcc-warnings on GCC <= 4.5
* configure.ac: Only enable warnings automatically when
on GCC >= 4.6 (and when building from a git checkout)
as that was the first GCC version to support fine-grained
control of warnings, allowing them to be adjusted around
certain code sections. gnulib relies on this for certain
warnings, so avoid auto enabling this option lest we trigger
build failures on now over two year old compilers.
Reported by Zartaj Majeed with GCC 4.5.3 on cygwin.
Zartaj Majeed [Tue, 18 Dec 2012 09:50:50 +0000 (09:50 +0000)]
build: fix cygwin build issues
* doc/local.mk (doc/constants.texi): Ensure the doc directory
is present which is needed when doing a non source dir build,
when the doc/constants.texi target is built before other doc targets.
* src/local.mk: Add $(EXEEXT) to the make-prime-list calls.
Pádraig Brady [Sat, 15 Dec 2012 03:23:06 +0000 (03:23 +0000)]
maint: consistently use @dots{} in coreutils.texi
* doc/coreutils.texi: s/\.\.\./@dots{}/ except in code and examples.
Pádraig Brady [Wed, 12 Dec 2012 19:54:12 +0000 (19:54 +0000)]
readlink: support multiple command line arguments
This allows efficient processing of multiple files,
while also increasing compatibility with BSD's readlink(1).
We also add the -z, --zero option to delimit output items
with the NUL character which disambiguates output in the
presence of '\n' characters.
* src/readlink.c (usage): Add the --zero description,
and also adjust the description of --no-newline accordingly.
(main): Handle the -z option and iterate over multiple arguments.
Also as in commit v8.15-24-g9d46b25 we use fputs() and putchar()
rather than printf() for performance reasons.
* doc/coreutils.texi (readlink invocation): Document the
new --zero option, adjust the --no-newline description, and
tweak the general info to indicate multiple files are supported.
* tests/readlink/multi.sh: A new test for the new functionality.
* tests/local.mk: Reference the new test.
* man/readlink.x: Adjust the summary and also reference realpath.
* NEWS: Mention the improvement.
* THANKS.in: Suggested by Aaron Davies.
Assaf Gordon [Fri, 14 Dec 2012 18:27:26 +0000 (13:27 -0500)]
maint: update gitignore entries
* .gitignore: ignore GCC coverage data files.
Assaf Gordon [Fri, 14 Dec 2012 07:47:17 +0000 (08:47 +0100)]
doc: mention "git stash" in HACKING
* HACKING: In the paragraph about switching branches, mention
"git stash" as a way to continue while preserving uncommitted
changes.
Bernhard Voelker [Fri, 14 Dec 2012 23:13:55 +0000 (00:13 +0100)]
tail,stat: improve support for the ceph file system
Teach tail -f that it must use polling on ceph file systems, and
let stat -f --format=%T report the file system type name, "ceph".
Website: http://ceph.com/
* src/stat.c (human_fstype): Add a case: ceph, 0x00C36400, remote.
* NEWS (Improvements): Mention it.
* THANKS.in: Update.
Reported by Konrad Wróblewski in http://bugs.gnu.org/13172.
Bernhard Voelker [Fri, 14 Dec 2012 09:45:21 +0000 (10:45 +0100)]
maint: fix typos found by misspellings
* doc/coreutils.texi (df invocation): s/occurence/occurrence/.
* tests/df/skip-rootfs.sh: s/supressed/suppressed/
Jim Meyering [Sat, 8 Dec 2012 20:04:14 +0000 (12:04 -0800)]
tests: add test case and note that last week's cut change is a bug fix
* tests/misc/cut-huge-to-eol-range.sh: New test, showing that
the change in v8.20-51-g7d03466 is a bug fix after all.
* tests/local.mk (all_tests): Add it.
* NEWS (Bug fixes): Mention it.
Bernhard Voelker [Sat, 8 Dec 2012 18:09:19 +0000 (19:09 +0100)]
cp: fix --no-preserve=mode to not exit 1
cp --no-preserve=mode exited 1 unconditionally. Furthermore,
the tests which would have detected this error - namely
link-preserve.sh and reserve-mode.sh - failed to test
cp's exit code.
* src/copy.c (copy_reg): In the case x->explicit_no_preserve_mode,
do only set return_val to false iff the previous set_acl ()
failed.
* tests/cp/link-preserve.sh: Check cp's exit code.
* tests/cp/link-symlink.sh: Likewise.
* tests/cp/preserve-mode.sh: Likewise.
* NEWS: Mention the fix.
Bug introduced in commit v8.19-145-g24ebca6.
Reported by Florian Pritz in http://bugs.gnu.org/13119.
Ondrej Oprala [Fri, 7 Dec 2012 20:10:40 +0000 (21:10 +0100)]
df: do not print duplicate entries and rootfs by default
* src/df.c (struct devlist): Add new struct for storing already-
examined device numbers.
(devlist_head): Add new store of the above type.
(show_rootfs): Add new global boolean to not skip rootfs.
(dev_examined): Add new function to check if the device has
already been traversed.
(get_dev): Filter out rootfs unless "-t rootfs" or the -a
option is specified. Filter out duplicate entries by calling
the above new dev_examined unless the -a option is specified.
(main): Set the show_rootfs variable appropriately when the -t
option is specified for rootfs. Free device list (guarded by
IF_LINT).
* tests/df/skip-duplicates.sh: Add test to exercise the skipping
of duplicate entries.
* tests/df/skip-rootfs.sh: Add test to exercise the skipping
of the rootfs pseudo file system.
* tests/local.mk: Add the above new tests.
* NEWS (Changes in behavior): Mention the changes.
* doc/coreutils.texi (df invocation): Document df's behavior about
skipping rootfs and duplicate entries.
Co-authored-by: Bernhard Voelker.
Cojocaru Alexandru [Thu, 6 Dec 2012 02:03:41 +0000 (03:03 +0100)]
cut: avoid a redundant heap allocation
* src/cut.c (set_fields): Don't allocate memory for
`printable_field' if there are no finite ranges.
This is achieved by keeping max_range_endpoint as 0 when
there are no finite ranges. max_range_endpoint is then
used throughout the code to guard against allocation of,
and access to the bit array.
The extra allocation was introduced via commit v8.10-3-g2e636af.
Pádraig Brady [Thu, 6 Dec 2012 16:51:41 +0000 (16:51 +0000)]
maint: fix a referenced coreutils version in a test comment
* tests/misc/cut.pl: This particular bug existed up to v8.10.
Bernhard Voelker [Thu, 6 Dec 2012 09:11:42 +0000 (10:11 +0100)]
tests: fix regex to match "-" in ipcent field in df/total-verify.sh
The regular expression failed to match for file systems that
do not provide inode statistics, e.g. VFAT or CIFS (depending
on the underlying peer file system).
* tests/df/total-verify.sh: Fix the regular expression to match
a dash in the ipcent field again.
Reported by Assaf Gordon in http://bugs.gnu.org/13099.
Bug introduced in commit v8.20-18-gdae8d22.
Assaf Gordon [Thu, 6 Dec 2012 09:58:10 +0000 (09:58 +0000)]
maint: adjust HACKING instructions to run a single test
* HACKING: Adjust as per the recent changes introduced
when switching to non recursive make.
Pádraig Brady [Wed, 5 Dec 2012 13:51:01 +0000 (13:51 +0000)]
tests: cut.pl: adjust for changed diagnostic
* tests/misc/cut.pl: Since we now output the more
complete error message irrespective of running
in a multi-byte locale or not, adjust the test accordingly.
Cojocaru Alexandru [Wed, 5 Dec 2012 13:13:51 +0000 (13:13 +0000)]
cut: improve error reporting
* src/cut.c (main): Treat a NUL delimiter (-d '') consistently
with non NUL delimiters, and disallow such a delimiter option,
unless a field is also specified.
(set_fields): Provide a more accurate error message when
a given list is invalid.
* tests/misc/cut.pl: Add a test case.
Pádraig Brady [Thu, 6 Dec 2012 09:29:34 +0000 (09:29 +0000)]
maint: adjust instructions to run a single test
* README: Adjust as per the recent changes introduced
when switching to non recursive make.
Bernhard Voelker [Wed, 5 Dec 2012 10:47:18 +0000 (11:47 +0100)]
maint: remove now auto-added entry from THANKS.in
The syntax-check sc_THANKS_in_duplicates complained about
that excess entry.
* THANKS.in (Colin Watson): Remove entry, now that it will be
automatically included in the generated THANKS file.
Pádraig Brady [Fri, 30 Nov 2012 15:08:31 +0000 (15:08 +0000)]
maint: remove a redundant odd sized alloc from factor.c
* src/factor.c (mp_factor_init): Init the pointers with NULL,
which xrealloc (or realloc) handles fine.
Colin Watson [Thu, 29 Nov 2012 19:37:30 +0000 (19:37 +0000)]
factor: fix infinite loop on 32 bit powerpc
Both Debian and Ubuntu builds of coreutils 8.20 hang while running the
test suite on powerpc, which is reproducible using 'factor 122'.
This turns out to be somewhat related to http://bugs.gnu.org/12754,
but not quite the same. uintmax_t is 64 bits, but the cntlzw
instruction takes 32-bit operands, and the cntlzd option is only
available on 64-bit hardware.
* src/longlong.h: Add an _LP64 check around the PPC64 code,
so that this falls back to the C implementations.
* NEWS: Mention the fix.
Jim Meyering [Sat, 24 Nov 2012 19:36:15 +0000 (11:36 -0800)]
cut: do not print extraneous delimiters in some unusual cases
When printing output delimiters, and when a to-EOL range subsumes
at least one other range, cut would mistakenly print delimiters for
the subsumed range. This bug was probably introduced via commit
v5.2.1-639-g847e066.
* src/cut.c (set_fields): Ignore any range that is subsumed by a
to-EOL range. Also, move two declarations down.
* tests/misc/cut.pl: Add tests to exercise this.
* NEWS (Bug fixes): Mention it.
Reported by Marcel Böhme in http://bugs.gnu.org/12966
Jim Meyering [Sat, 24 Nov 2012 07:09:10 +0000 (23:09 -0800)]
cut: treat -b2-,3- like -b2-, not like -b3-
* src/cut.c (set_fields): When two right-open-ended ranges are
specified, don't blindly let the latter one take precedence over
the former. Instead, use the union of the ranges.
* tests/misc/cut.pl: Add tests to exercise this.
* NEWS (Bug fixes): Mention it.
Reported by Marcel Böhme in http://bugs.gnu.org/12966
Thanks to Berhard Voelker for catching log and NEWS typos.
Bernhard Voelker [Sat, 24 Nov 2012 15:04:44 +0000 (16:04 +0100)]
doc: cp: clarify behavior of the --preserve=xattr option
* doc/coreutils.texi (cp invocation): Enhance documentation
of the --preserve=xattr option regarding the preservation
of ACLs, SELinux contexts and capabilities: the user may
notice this only when not specifying --preserve=mode
and --preserve=context, too, i.e., otherwise, these attributes
are preserved anyway.
Pádraig Brady [Fri, 26 Oct 2012 14:46:04 +0000 (15:46 +0100)]
doc: update info cross reference to bash
* doc/coreutils.texi (tee invocation): Reference
the bash manual rather than bashref, as the latter
is more likely to work on newer systems.
Pádraig Brady [Mon, 29 Oct 2012 00:46:04 +0000 (00:46 +0000)]
tests: use sub-second timeouts to speed up a timeout test
* tests/misc/timeout.sh: Take advantage of recent support for
sub-second timeouts to decrease runtime from about 6s to 2s.
Pádraig Brady [Thu, 22 Nov 2012 14:25:46 +0000 (14:25 +0000)]
doc: clarify that renice is needed to adjust niceness
* doc/coreutils.texi (nice invocation): Ensure there is no
ambiguity in the summary in relation to nice being able
to adjust the niceness of an existing process.
Reference the renice command.
* man/nice.x: Reference renice (1)
Pádraig Brady [Thu, 22 Nov 2012 10:36:31 +0000 (10:36 +0000)]
tests: accept EEXIST from rm -d
* tests/rm/d-2.sh: EEXIST is a valid error on some systems.
Reported by Michael Felt on AIX 6.1
Pádraig Brady [Thu, 22 Nov 2012 10:07:25 +0000 (10:07 +0000)]
tests: don't rely on sed -i being available
* tests/df/df-output.sh: sed --in-place is not generally available.
Also add a couple of simplifications from Bernhard Voelker.
Removing all spaces, rather than just leading spaces, suffices.
Searching for ' --output' in unadjusted df --help, suffices.
Pádraig Brady [Fri, 23 Nov 2012 03:06:07 +0000 (03:06 +0000)]
seq: ensure correct output width for scientific notation input
* src/seq.c (scan_arg): Calculate the width more accurately
for numbers specified using scientific notation.
* tests/misc/seq.pl: Add tests for cases that were mishandled.
* NEWS: Mention the fix.
* THANKS.in: Reported by Marcel Böhme.
Fixes http://bugs.gnu.org/12959
Bernhard Voelker [Thu, 22 Nov 2012 14:40:54 +0000 (15:40 +0100)]
df: reorder default field list of --output option
As the inodes information is usually not so much of interest,
and some file systems including btrfs do not even provide it,
reading of the full df --output is easier when the block
statistic fields come just left of the last field, the mount
point.
* src/df.c (all_args_string): Move the inodes fields before
the block fields.
(usage): Likewise.
* tests/df/df-output.sh: Likewise.
* doc/coreutils.texi (df invocation): Likewise. Additionally,
explicitly mention the default order of the --output option.
Paul Eggert [Wed, 21 Nov 2012 02:10:21 +0000 (18:10 -0800)]
install: fix security race
* NEWS: Document this.
Paul Eggert [Tue, 20 Nov 2012 21:15:34 +0000 (13:15 -0800)]
install: fix security race
* src/copy.c (copy_internal): Use DST_MODE_BITS, not SRC_MODE.
See Bernhard R. Link in <http://bugs.gnu.org/12947> and in
<http://bugs.debian.org/598018>.
Bernhard Voelker [Tue, 20 Nov 2012 10:06:46 +0000 (11:06 +0100)]
nl: remove deprecated --page-increment option
The above option has been deprecated since coreutils-7.5
by commit v7.4-129-g718b279.
* src/nl.c (PAGE_INCREMENT_OPTION_DEPRECATED): Remove enum.
(longopts): Remove "page-increment" entry.
(main): Remove PAGE_INCREMENT_OPTION_DEPRECATED case.
* NEWS (Changes in behavior): Mention the change.
Reported by Marcel Böhme in <http://bugs.gnu.org/12940>.
Bernhard Voelker [Sun, 11 Nov 2012 11:07:47 +0000 (12:07 +0100)]
doc: remove already implemented items from TODO
* TODO (renice): The renice program is part of util-linux for
years now. Remove entry.
(dd): The option status=none has been implemented in commit
v8.19-143-g7331ab5. Remove entry.
Bernhard Voelker [Sun, 18 Nov 2012 21:20:16 +0000 (22:20 +0100)]
cut: do not accept the invalid range 0-
The command "echo 12345 | cut -b 0-" prints an empty line while
it should fail with "fields and positions are numbered from 1".
* src/cut.c (set_fields): Add a diagnostic for the invalid open
range which starts with Zero, i.e., the range 0-.
* tests/misc/cut.pl: Add tests to ensure the range 0- fails for
fields (-f) and for positions (-b, -c).
* NEWS: Mention the fix.
Reported by Marcel Böhme in <http://bugs.gnu.org/12903>.
Daniel Schepler [Sun, 18 Nov 2012 18:04:54 +0000 (10:04 -0800)]
build: fix compilation failure on x32
* src/factor.c [HAVE_ATTRIBUTE_MODE]: Fix typo in #if test:
s/HAVE_LONG_LONG/HAVE_LONG_LONG_INT/. Otherwise, factor.c would
elicit assembler errors on x32: it was incorrectly defining DItype
to long instead of long long. Patch and report in
http://bugs.debian.org/693337; Mike Stone notified upstream.
Jim Meyering [Sun, 18 Nov 2012 17:51:48 +0000 (09:51 -0800)]
maint: reenable accidentally-disabled cppi-check syntax-check rule
* cfg.mk (exclude_file_name_regexp--sc_preprocessor_indentation): Fix
typo that disabled the sc_preprocessor_indentation syntax-check rule
by exempting all files. s/__ll/_ll/ The typo was introduced in
commit v8.19-157-g759ebcb.
Jim Meyering [Sun, 18 Nov 2012 17:45:14 +0000 (09:45 -0800)]
maint: correct indentation of W_TYPE_SIZE-defining cpp directives
* src/factor.c: Indent cpp directives to reflect their nesting.
Jim Meyering [Sun, 18 Nov 2012 17:16:17 +0000 (09:16 -0800)]
maint: avoid i686-specific syntax-check failure
* cfg.mk (_gl_TS_unmarked_extern_vars): Define.
Paul Eggert [Sat, 17 Nov 2012 16:23:47 +0000 (08:23 -0800)]
doc: explain why dd is called "dd"
* doc/coreutils.texi (dd invocation): Mention JCL.
Paul Eggert [Sat, 17 Nov 2012 00:51:50 +0000 (16:51 -0800)]
factor: tidy up primes.h again
See Stefano Lattarini in <http://bugs.gnu.org/12899>.
* src/local.mk (BUILT_SOURCES): Put $(top_srcdir)/src/primes.h here
(MAINTAINERCLEANFILES): ... instead of here.
Paul Eggert [Tue, 13 Nov 2012 15:43:08 +0000 (07:43 -0800)]
factor: cleanup for primes.h
* .gitignore: Add src/primes.h back, since it's no longer
in the repository.
Jim Meyering [Tue, 13 Nov 2012 06:03:01 +0000 (07:03 +0100)]
maint: avoid unnecessary #include to fix syntax-check failure
* src/factor.c: Remove unneeded #inclusion of"verify.h".
It's already included via system.h.
Paul Eggert [Tue, 13 Nov 2012 05:10:17 +0000 (21:10 -0800)]
factor: improve primes.h change
This follows suggestions by Jim Meyering in
<http://bugs.gnu.org/12841#34>.
* src/make-prime-list.c (print_wide_uint): Change "nested" argument
to "nesting", and use it to avoid outputting lines that are too long.
* src/primes.h: Remove from git. This can be generated by a
maintainer. It's nicer to do so on a host with at least 128-bit
arithmetic.
Paul Eggert [Mon, 12 Nov 2012 16:32:04 +0000 (08:32 -0800)]
factor: maintainer builds primes.h, not builder
With this change, the maintainer builds primes.h and it is part of
the tarball. primes.h's contents are not architecture-specific.
* .gitignore: Remove /src/primes.h.
* src/factor.c: Include verify.h.
(W): New constant. Verify that uintmax_t lacks holes
and that W is no wider than the integers used to generate primes.h.
* src/local.mk (EXTRA_DIST): Add src/primes.h.
(BUILT_SOURCES, CLEANFILES): Remove src/primes.h.
($(top_srcdir)/src/primes.h): Rename from src/primes.h.
Do not depend on src/make-prime-list. Instead, use sub-make to
build, so that we build primes.h only if it does not exist.
* src/make-prime-list.c: Include <limits.h>, for ULONG_MAX.
(wide_uint): Define to uintmax_t or unsigned __int128 if not #defined.
(struct prime, binvert, process_prime): Use it instead of uintmax_t.
(print_wide_uint): New function. This generates the proper pinv
value regardless of the width of uintmax_t on the target, so long
as the width doesn't exceed that of the width of wide_uint on the
maintainer host that generated src/primes.h.
(output_primes): Use it. Output WIDE_UINT_BITS, too. Let the
target compute its own lim, since its uintmax_t may be narrower
than ours.
(SZ): Remove.
* src/primes.h: New file, generated with 128-bit integers and usable
on any host where uintmax_t's width is no greater than 128 bits.
Paul Eggert [Mon, 12 Nov 2012 16:16:30 +0000 (08:16 -0800)]
factor: port to systems with rpl_malloc
* src/make-prime-list.c (malloc): Undef. This fixes a problem on
AIX 8.20 reported by Michael Felt in <http://bugs.gnu.org/12841>.
Bernhard Voelker [Fri, 9 Nov 2012 14:09:05 +0000 (15:09 +0100)]
tests: fix factor's tests to use coreutil's own sha1sum
The test used the shasum utility which seems to belong to the
perl package. On SLES-10.4, perl doesn't include this yet:
+ seq 0
10000000
+ factor
+ shasum -c --status exp
./tests/factor/t00.sh: line 30: shasum: command not found
+ Exit 1
It is better to use our own stuff anyway.
* tests/factor/run.sh: s/shasum/sha1sum/. Additionally, add
sha1sum to the print_ver_ call.