2012-05-10 Jim Meyering version 8.17 * NEWS: Record release date. tests: misc/tty-eof: increase timeout to avoid unwarranted failure * tests/misc/tty-eof: Increase timeout from 1s to 10s, to avoid unwarranted failure under heavy load. * tests/Makefile.am (TESTS): Move misc/tty-eof "up" to nearer the beginning of the list (from near the middle) so that it is started earlier in parallel test runs. Otherwise, it would frequently be among the last two tests to complete. stat,tail: recognize new FS types: bdevfs, inodefs, qnx6 * src/stat.c (human_fstype) [__linux__]: Add 'case's for these local file system types: bdevfs (0x62646576), inodefs (0x42494E4D), qnx6 (0x68191122). Now that the kernel has a name for S_MAGIC_BINFMTFS, use theirs in place of our S_MAGIC_BINFMT_MISC. * NEWS (New features): Mention it. scripts: encourage use of shorter "bugs.gnu.org" in bug URLs * scripts/git-hooks/commit-msg: Also ding debbugs.gnu.org URLs. 2012-05-10 Paul Eggert maint: handle file sizes more reliably Problem reported by Samuel Thibault in . * NEWS: Document this. * src/dd.c (skip): Handle skipping past EOF on shared or typed memory objects the same way as with regular files. (dd_copy): It's OK to truncate shared memory objects. * src/du.c (duinfo_add): Check for overflow. (print_only_size): Report overflow. (process_file): Ignore negative file sizes in the --apparent-size case. * src/od.c (skip): Fix comment about st_size. * src/split.c (main): * src/truncate.c (do_ftruncate, main): On files where st_size is not portable, fall back on using lseek with SEEK_END to determine the size. Although strictly speaking POSIX says the behavior is implementation-defined, in practice if lseek returns a nonnegative value it's a reasonable one to use for the file size. * src/system.h (usable_st_size): Symlinks have reliable st_size too. * tests/misc/truncate-dir-fail: Don't assume that getting the size of a dir is not allowed, as it's now allowed on many platforms, e.g., GNU/Linux. stat: don't report negative file size as huge positive number * src/stat.c (print_stat): Use out_int, not out_uint for stat.st_size. * NEWS (Bug fixes): Mention it. 2012-05-08 Jim Meyering split: avoid apparent infloop when splitting /dev/zero w/-n on the Hurd * src/split.c (main): Use stat.st_size only for regular files. Samuel Thibault reported in http://bugs.gnu.org/11424 that the /dev/zero-splitting tests would appear to infloop on GNU/Hurd, because /dev/zero's st_size is LONG_MAX. It was only a problem when using the --number (-n) option. * NEWS (Bug fixes): Mention it. This bug was introduced with the --number option, via commit v8.7-25-gbe10739 build: update gnulib submodule to latest; also bootstrap and init.sh * bootstrap: Update from gnulib. * tests/init.sh: Likewise. 2012-05-08 Pádraig Brady doc: clarify dd conv=sparse usage with devices * doc/coreutils.texi (dd invocation): Clarify that NUL blocks are not copied for devices either, and give examples of where it might be useful. 2012-05-08 Jim Meyering maint: new function: usable_st_size 2012-05-08 Kevin Lyda maint: fix common spelling errors These were identified using: https://github.com/lyda/misspell-check executed like: git ls-files | misspellings -f - * src/cat.c: Correct a spelling error. * src/comm.c: Likewise. * src/expr.c: Likewise. * src/pr.c: Likewise. * src/tac.c: Likewise. * src/test.c: Likewise. * src/ChangeLog-2005: Likewise. * src/ChangeLog-2007: Likewise. * src/NEWS: Likewise. * src/doc/coreutils.texi: Likewise. * src/lib/ChangeLog-2007: Likewise. * src/man/help2man: Likewise. * src/old/fileutils/ChangeLog-1997: Likewise. * src/old/fileutils/NEWS: Likewise. * src/old/sh-utils/ChangeLog.0: Likewise. * src/old/textutils/ChangeLog: Likewise. * src/tests/misc/comm: Likewise. * src/tests/misc/uniq: Likewise. * src/tests/mv/dir2dir: Likewise. * src/cfg.mk (old_NEWS_hash): update with `make update-NEWS-hash` 2012-05-07 Jim Meyering tests: avoid LD_PRELOAD lookup error for dlsym * tests/cp/nfs-removal-race: Link with -ldl. cp: handle a race condition more sensibly * src/copy.c (copy_reg): In a narrow race (stat sees dest, yet open-without-O_CREAT fails with ENOENT), retry the open with O_CREAT. * tests/cp/nfs-removal-race: New file. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it. Reported by Philipp Thomas and Neil F. Brown in http://bugs.gnu.org/11100 doc: NEWS: note when the id/groups bug was introduced * NEWS (Bug fixes): Note the first affected release. The id bug was introduced by commit v8.0-112-g719a95a. 2012-05-04 Jim Meyering build: update gnulib submodule to latest maint: rely on gnulib's new sys_resource module * bootstrap.conf (gnulib_modules): Add sys_resource. * src/sort.c: Remove #if HAVE_SYS_RESOURCE_H guard around inclusion of and move the inclusion "up" into the alphabetized list of its peers. This also avoids a failure of the sc_prohibit_always_true_header_tests syntax-check rule. * m4/jm-macros.m4 (gl_CHECK_ALL_HEADERS): Remove sys/resource.h. 2012-05-02 Pádraig Brady cp,mv,install: provide POSIX_FADV_SEQUENTIAL hint to input This was inadvertently omitted from v8.5-104-g47076e3, and gives the same 5% speedup when copying from an SSD. * src/copy.c (copy_internal): Apply the FADVISE_SEQUENTIAL hint. 2012-05-02 Jim Meyering maint: prohibit an operator at end of line Many coding standards, including GNU's, advocate that when splitting a line near a binary operator, one should put the operator at the beginning of the continued line, rather than at the end of the preceding one. This is for readability: such operators are relatively important to readability, and they are more apparent at the beginning of a line than at the varying-column end of line, * cfg.mk (sc_prohibit_operator_at_end_of_line): New rule. Exempt test.c and head.c. maint: adjust comments to avoid FP match on binary-operator-at-EOL * src/ls.c (print_long_format): Reformat comment to avoid "==" at end of line. Also, "sortkey" is not a word: s/sortkey/sort key/. * src/ioblksize.h: Likewise, for "|" from a shell snippet. * src/runcon.c: Likewise, for "|" in grammar-like usage. maint: with split lines, don't leave an operator at end of line * src/copy.c (copy_reg): Split an expression before a binary operator, not after it. * src/cut.c (set_fields): Likewise. * src/id.c (main): Likewise. * src/install.c (setdefaultfilecon): Likewise. * src/join.c (ignore_case): Likewise. * src/pr.c (cols_ready_to_print, init_parameters, print_page): Likewise. * src/stty.c (set_window_size): Likewise. * src/wc.c (SUPPORT_OLD_MBRTOWC): Likewise. * src/who.c (scan_entries): Likewise. * src/test.c (binary_operator): Join a split line. * src/extent-scan.c (extent_scan_read): Move an ">" from end of line to beginning of the following. Likewise for two other expressions. 2012-04-30 Pádraig Brady cat,cp,mv,install,split: Set the minimum IO block size used to 64KiB * NEWS: Mention the change in behavior. * src/ioblksize.h: Add updated test results and increase value from 32KiB to 64KiB. 2012-04-27 Jim Meyering id: -Zn/-Zr: avoid an invalid diagnostic * src/id.c (main): Using -Z with -r or -n would fail with "id: cannot print only names or real IDs in default format", in spite of that "-Z", which specifies a non-default format. Now, it succeeds and ignores the -n or -r option. The error was that the test for default_format was not updated when I added the new --context (-Z) option in commit v6.9-33-g5320d0f. id: don't call getcon unnecessarily * src/id.c (main): Invocations like "id" and "id -G" would call getcon to determine the current security context even though that result would not be used. Similarly, when POSIXLY_CORRECT is set. Rearrange conditionals and hoist the POSIXLY_CORRECT test so that we call getcon only when necessary. maint: id: minor factorization * src/id.c (main): Factor out uses of "argc - optind". Move option-consistency checks to precede the potential getcon call. 2012-04-27 Jim Meyering id,groups: with no user name, print only real and/or effective IDs, ... i.e., don't use the getpw* functions. Before this change, running groups or id with no user name argument would include a group name or ID from /etc/passwd. Thus, under unusual circumstances (default group is changed, but has not taken effect for a given session), those programs could print a name or ID that is neither real nor effective. To demonstrate, run this: echo 'for i in 1 2; do id -G; sleep 1.5; done' \ |su -s /bin/sh ftp - & sleep 1; perl -pi -e 's/^(ftp:x:\d+):(\d+)/$1:9876/' /etc/passwd Those id -G commands printed the following: 50 50 9876 With this change, they print this: 50 50 Similarly, running those programs set-GID could make them print one ID too many. * src/group-list.c (print_group_list): When username is NULL, pass egid, not getpwuid(ruid)->pw_gid), to xgetgroups, per the API requirements of xgetgroups callee, mgetgroups. When not using the password database, don't call getpwuid. * NEWS (Bug fixes): Mention it. * tests/misc/id-setgid: New file. * tests/Makefile.am (TESTS): Add it. (root_tests): It's a root-only test, so add it here, too. Originally reported by Brynnen Owen as http://bugs.gnu.org/7320. Raised again by Marc Mengel in http://bugzilla.redhat.com/816708. 2012-04-23 Stefano Lattarini maint: sync up required autoconf version in bootstrap.conf * bootstrap.conf ($buildreq): Require autoconf 2.64, not 2.62. This is consistent with what is required by AC_PREREQ in configure.ac. 2012-04-19 Jim Meyering doc: fix a grammar nit * doc/coreutils.texi (split invocation): s/are/is/ in "P or Q are". 2012-04-19 Bernhard Voelker tests: factor out expensive "pairs" code of misc/stty * tests/Makefile.am (TESTS): Add misc/stty-pairs. * tests/init.cfg (stty_reversible_init_): New function. (stty_reversible_query_): New function. * tests/misc/stty: Factor out expensive "pairs" code into new test. Use new stty_reversible_* functions instead of evaluating static REV_* variables. * tests/misc/stty-pairs: Add new test. Code added from misc/stty. Mark this as an expensive test. Skip 'parenb' and 'cread' options, as these tests are known to fail. Like in misc/stty, also use the new stty_reversible_* functions. tests: add iutf8 option to misc/stty * tests/misc/stty: Add iutf8 to the list of REV_* options. That option has been implemented in commit v5.2.1-193-g733e79e. 2012-04-19 Jim Meyering maint: tac: use memcpy, not strcpy * src/tac.c (main): Use memcpy, not strcpy, since we know the length. maint: ls: use stpncpy/stpcpy, not strncpy/strcpy * src/ls.c (gobble_file): Move a decl "down". (make_link_name): Do not hard-code '/'. Use IS_ABSOLUTE_FILE_NAME and dir_len instead. Use stpcpy/stpncpy in place of strncpy/strcpy. maint: modernize/clean-up a small function in ls.c * src/ls.c (make_link_name): Adjust comment style to refer to VARIABLE names, not 'variable'. Move each of two declarations "down" to first use. Compare pointer to NULL, not to 0. Don't reuse local, "linkbuf" for a different purpose. doc: tweak README-hacking * README-hacking: Don't say "...on your hard drive". That is unnecessary, and now, borderline anachronistic. 2012-04-17 Jim Meyering doc: use @xref{... only at start of a sentence * doc/coreutils.texi: Correct many misuses of @xref. 2012-04-16 Jim Meyering maint: replace a use of strcpy in chmod.c with memcpy * src/chmod.c (main): Use memcpy rather than strcpy, since we already have the length handy. 2012-04-14 Karl Berry doc: remove a little direntry redundancy * doc/coreutils.texi (Basics direntry): Remove 3rd "Common options." 2012-04-12 Bruce Korb fmt: accept new --goal=WIDTH (-g) option Accept -g for BSD/Plan9 compatibility. * NEWS (New features): Mention it. * tests/fmt/goal-option: New test. * tests/fmt/long-line: Rename from tests/fmt-long-line. * tests/fmt/base: Rename from tests/misc/fmt. * doc/coreutils.texi: Document it. * src/fmt.c (main): Accept the new option (check_for_goals): new function to implement the operands Based on BSD's and Plan-9's fmt programs. 2012-04-12 Pádraig Brady cp: change --attributes-only to not truncate existing files * src/copy.c (copy_reg): Don't truncate an existing file, to support copying attributes between existing files. The original use case only considered creating new files, and it would be a very unusual use case to be relying on the truncating behavior. * doc/coreutils.texi (cp invocation): Mention the non truncating behavior. * tests/cp/attr-existing: A new test to ensure O_TRUNC skipped. * tests/Makefile.am: Reference the new test. * NEWS: Mention the change in behavior. 2012-04-04 Andreas Schwab tests: avoid unnecessary subshells in misc/stty * tests/misc/stty: Don't waste a subshell to perform this: eval rev=\$REV_$opt. Fix rev1,rev2 assignments similarly. 2012-04-04 Jim Meyering build: update gnulib submodule to latest tests: correct reversed args to "compare" * tests/misc/sort-discrim: Correct reversed args to "compare". This nit was masked by a bug in maint.mk that effectively disabled many of the syntax-check rules. tests: new syntax-check rule to prohibit use of `...` in tests/ * cfg.mk (sc_prohibit_test_backticks): New rule. Exempt 3 files. tests: remove nearly all remaining backticks * tests/rm/isatty: Remove now-unneeded "# `" line. * tests/misc/ls-time: Likewise. * tests/misc/date-sec: Remove stray "`" in comment. * tests/du/long-sloop: Likewise. * tests/mv/part-symlink: Replace multi-line `...` by $(...). * tests/mv/sticky-to-xpart: Likewise. * tests/rm/fail-2eperm: Likewise. * tests/ls/nameless-uid: Likewise. * tests/cp/perm: Likewise. * tests/cp/preserve-gid: Likewise. * tests/cp/same-file: Likewise. tests: use perl's qx!...! rather than `...` * tests/misc/expr: As above. * tests/misc/ls-misc: Likewise. * tests/misc/pwd-long: Likewise. * tests/misc/uniq: Likewise. 2012-04-04 Jim Meyering tests: convert nearly all `...` expressions to $(...) Exempt init.sh because it runs before we're assured to have a shell that groks $(...). Exempt *.mk because "$" would have to be doubled, and besides, any `...` expression in a .mk file is almost certainly evaluated before init.sh is run. Finally, also exempt the perl-based tests, because perl's `...` cannot be converted to $(...). Do that by running this command: git grep -l '`.*`' tests \ | grep -Ev 'init\.sh|\.mk$' | xargs grep -Lw perl \ | xargs perl -pi -e 's/`(.*?)`/\$($1)/g' One minor fix-up change was required after that, due to how quoting differs: diff --git a/tests/chmod/equals b/tests/chmod/equals - expected_perms=$(eval 'echo \$expected_'$dest) + expected_perms=$(eval 'echo $expected_'$dest) Another was to make these required quoting adjustments: diff --git a/tests/misc/stty b/tests/misc/stty ... - rev=$(eval echo "\\\$REV_$opt") + rev=$(eval echo "\$REV_$opt") ... - rev1=$(eval echo "\\\$REV_$opt1") - rev2=$(eval echo "\\\$REV_$opt2") + rev1=$(eval echo "\$REV_$opt1") + rev2=$(eval echo "\$REV_$opt2") Also, transform two files that were needlessly excluded above: (both use perl, but are mostly bourne shell) perl -pi -e 's/`(.*?)`/\$($1)/g' \ tests/du/long-from-unreadable tests/init.cfg 2012-04-03 Jim Meyering tests: convert one `...` expression manually * tests/ls/stat-vs-dirent: Manually convert `(...)` to $(...), to avoid automatically producing an invalid result. tests: fix quoting bug in misc/nohup * tests/misc/nohup: Fix invalid quoting. doc: identify/refer to source of each fixed bug in log and in NEWS * HACKING (Commit log requirements): Describe our policy: when you fix a bug, put the "git describe" string of the bug-introducing commit in your commit log and put the "fixed-in-release version number" in the NEWS blurb. tests: avoid spurious misc/expr failure on AIX 6.1 * tests/misc/expr: Avoid spurious failure on AIX 6.1 due to differing regexp diagnostic. Reported by Michael Felt. 2012-03-28 Paul Eggert chmod: undo previous change It's not portable; see . * src/chmod.c, NEWS: Undo previous change. chmod: fix symlink race condition * NEWS: Document this. * src/chmod.c (process_file): Don't follow symlink if we think the file is not a symlink. 2012-03-26 Jim Meyering tests: remove temporary skip for sort-stale-thread-mem failure * tests/misc/sort-stale-thread-mem: Invoke framework_failure_, now, hoping that valgrind is fixed (or we add exclusions) before the next release. maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.16 * NEWS: Record release date. tests: work around F17-valgrind sort-stale-thread-mem failure * tests/misc/sort-stale-thread-mem: Skip upon known failure. doc: use $(...), not `...` in documentation and comments * doc/coreutils.texi (dircolors invocation, Examples of expr): (shred invocation, seq invocation): Use $(...), not `...`. * src/mv.c (do_move): Likewise, in a comment. 2012-03-23 Jim Meyering tests: skip ls/stat-free-color on XFS, rather than always failing * tests/init.cfg (require_dirent_d_type_): Manually skip when "." is an xfs file system. tests: skip part of dd/sparse on some file systems * tests/dd/sparse: The last two parts of this test would fail due to the underlying file system at least on Solaris 10 with NFS. That file system would report that a 3MiB file was occupying <= 1KiB of space for nearly 50 seconds after creation. Improved-by: Bernhard Voelker 2012-03-22 Pádraig Brady maint: avoid a doc syntax check failure Prompted by the continuous integration build failure at: http://hydra.nixos.org/build/2315847 * doc/coreutils.texi (ln invocation): s/path/file name/ 2012-03-22 Harald Hoyer ln: add the --relative option With the "--relative --symbolic" options, ln computes the relative symbolic link for the user. So, ln works just as cp, but creates relative symbolic links instead of copying the file. I miss this feature since the beginning of using ln. $ tree ./ / `-- usr |-- bin `-- lib `-- foo `-- foo 4 directories, 1 file $ ln -s -v --relative usr/lib/foo/foo usr/bin/foo ‘usr/bin/foo’ -> ‘../lib/foo/foo’ $ tree ./ / `-- usr |-- bin | `-- foo -> ../lib/foo/foo `-- lib `-- foo `-- foo 4 directories, 2 files $ ln -s -v --relative usr/bin/foo usr/lib/foo/link-to-foo ‘usr/lib/foo/link-to-foo’ -> ‘foo’ $ tree ./ / `-- usr |-- bin | `-- foo -> ../lib/foo/foo `-- lib `-- foo |-- link-to-foo -> foo `-- foo 4 directories, 3 files * src/Makefile.am: Reference the relpath module. * src/ln.c (usage): Mention the new option. (do_link): Call the relative conversion if specified. (convert_abs_rel): Perform the relative conversion using the relpath module. * tests/ln/relative: Add a new test. * tests/Makefile.am: Reference the new test. * doc/coreutils.texi: Document the new feature. * NEWS: Mention the new feature. 2012-03-22 Pádraig Brady maint: refactor relpath() from `realpath` for use by `ln` * src/relpath.c: Refactored from realpath.c and adjusted to support returning the relative path rather than just printing to stdout. * src/relpath.h: Export the relpath function. * src/Makefile.am: Reference the refactored relpath module. * po/POTFILES.in: Likewise. * src/realpath.c: Adjust to the refactored relpath module. 2012-03-22 Pádraig Brady maint: ensure PATH_MAX is set correctly This reverts part of commit v8.12-103-g54cbe6e. * src/system.h: Include gnulib's pathmax.h to honor system specific limits, and then we set PATH_MAX only if needed. Note pathmax.h no longer uses pathconf ("/", _PC_PATH_MAX). Note I didn't reinstate the comments about limits.h inclusion order, because pathmax.h includes limits.h anyway. 2012-03-21 Jim Meyering build: add numerous gnulib modules, mostly for improved portability * bootstrap.conf (gnulib_modules): Add numerous modules for improved portability. Reported by Eric Blake in http://thread.gmane.org/gmane.comp.gnu.coreutils.general/2426/focus=2489 * po/POTFILES.in: Add new files. build: update gnulib submodule to latest maint: use more modern fseeko, rather than fseek * src/tac.c (temp_stream): Use fseeko, not fseek, on principle: use the more modern interface. In general it is better to avoid fseek due to its ABI-imposed 4GiB limit on the "offset", here its use was fine because the offset was always 0. Using fseeko also has the advantage of not triggering a GNULIB_POSIXCHECK warning. Reported by Eric Blake in http://thread.gmane.org/gmane.comp.gnu.coreutils.general/2426/focus=2489 2012-03-20 Eric Blake build: speed up configure for releases Since most users won't be building with GNULIB_POSIXCHECK defined in CFLAGS, and since we can make ./configure 10% (several seconds!) faster by omitting the framework for a posix check, this patch makes it so that the framework is omitted by default, while still giving instructions for maintainers to re-enable it. It's been a while since we've used GNULIB_POSIXCHECK; see this email: https://lists.gnu.org/archive/html/coreutils/2012-03/msg00126.html Some of those failures are because we are intentionally avoiding specific gnulib modules (that is, we have chosen not to use things like fprintf-posix), but until we work with gnulib to avoid particular warnings, wiring up an automatic GNULIB_POSIXCHECK to happen during 'make my-distcheck' is not feasible. * configure.ac (gl_ASSERT_NO_GNULIB_POSIXCHECK): Conditionally define, according to whether $GNULIB_POSIXCHECK is in environment. 2012-03-20 Jim Meyering tests: avoid spurious misc/factor failure on OpenBSD 5.1 * tests/misc/factor: Map OpenBSD 5.1's "unknown option" to our expected "invalid option". Reported by Bruno Haible. maint: remove now-superfluous coreutils-path-check rule * dist-check.mk (coreutils-path-check): Now that we set PATH in TESTS_ENVIRONMENT, it seems like overkill to make "distcheck" rerun all tests just to check this. (my-distcheck): Remove sole use. 2012-03-20 Eric Blake doc: clarify current realpath --relative-base behavior For compatibility with MacOS relpath(1), as seen here: http://opensource.apple.com/source/bootstrap_cmds/\ bootstrap_cmds-79/relpath.tproj/relpath.c we implemented 'realpath --relative-base=dir1 --relative-to=dir2 file' in the same way as 'relpath -d dir1 dir2 file'. This can result in --relative-base rendering --relative-to as a no-op if dir1 is a child of dir2. Document this. * doc/coreutils.texi (realpath invocation): Mention restriction. 2012-03-20 Pádraig Brady tests: avoid spurious dd/sparse failure * tests/dd/sparse: Allow for greater variation in sparse-block counts. Reported by Nelson H. F. Beebe and Bruno Haible. 2012-03-17 Pádraig Brady tests: fix sort-discrim to work without GMP * tests/misc/sort-discrim: The expr limit is intmax_t without GMP. 2012-03-16 Pádraig Brady tests: avoid an ls-time false positive on Solaris 10 * tests/misc/ls-time: Force a ctime update as updating the atime doesn't update ctime on tmpfs on Solaris 10. 2012-03-15 Eric Blake realpath: optimize --relative-base usage There is no need to recompute for every path being visited whether the base is a prefix of the relative location. * src/realpath.c (relpath): Hoist base check... (main): ...here. Based on a suggestion by Pádraig Brady. 2012-03-15 Eric Blake realpath: let --relative-to default to --relative-base Most of the time, if someone wants to filter which paths are relative while leaving all others absolute, they also want to to the filtering based on the same --relative-to directory. Make this easier to specify. * src/realpath.c (main): Convert error to default. * doc/coreutils.texi (realpath invocation): Document this. * tests/misc/realpath: Adjust test to match. * NEWS: Document it. 2012-03-15 Eric Blake tests: cover more realpath scenarios 'realpath --relative-base --relative-to' is identical to --relative-base=--relative-to, so the test wasn't covering what it claimed. Expose recent fixes for handling of // on systems where // is distinct, and for --relative-base=/. Add test that exposes our design decision that --relative-base that is not a prefix of --relative-to is a no-op (if we later change behavior, we will also have to change that part of the test). * tests/misc/realpath: Fix typo. Add some tests. 2012-03-15 Eric Blake realpath: fix problems with root handling When --relative-base is /, all other paths should be treated as relative (except for // where it matters). Also, on platforms like Cygwin where / and // are distinct, realpath was incorrectly collapsing // into /. http://debbugs.gnu.org/10472. * src/realpath.c (path_prefix, path_common_prefix): Treat / and // as having no common match. (relpath): Allow for no match even without --relative-base. * NEWS: Document this. 2012-03-14 Eric Blake test: expose recent gnulib canonicalize bug https://lists.gnu.org/archive/html/bug-gnulib/2012-02/msg00038.html detailed a couple of bugs in gnulib's canonicalize that were visible through coreutils' readlink, but only on systems where // is distinct from /. This particular test assumes the POSIX fix which requires canonicalization of a symlink containing just slashes to behave as if slashes separating the symlink from the rest of the name are elided (see http://austingroupbugs.net/view.php?id=541), as that is the only useful (and current) behavior on Cygwin. That is, ln -s / root ls root/dev must list the contents of /dev, not //dev. * tests/misc/readlink-root: New test. * tests/Makefile.am (TESTS): Run it. 2012-03-14 Paul Eggert Drew Kutilek James Wendt tests: new discriminator-based test for sort -n and -h * tests/Makefile.am (TESTS): Add misc/sort-discrim. * tests/misc/sort-discrim: New file, which tests a discriminator-based implementation of 'sort'. Coreutils doesn't use this implementation yet, but the test is useful anyway. 2012-03-10 Jérémy Compostella dirname: support more than one argument * src/dirname.c (main): Handle new -z option and manage more than one argument. * doc/coreutils.texi (dirname invocation): Mention it. * NEWS (New features): Mention it. * tests/misc/dirname: Add a two arguments test. split: support an arbitrary number of split files by default * src/split.c (next_file_name): If `suffix_auto' is true and the first suffix character is 'z', generate a new file file name adding `z' to the prefix and increasing the suffix length by one. (set_suffix_length): Disable auto suffix width in various cases. * tests/split/suffix-auto-length: Test it. * doc/coreutils.texi (split invocation): Mention it. * NEWS (Improvements): Likewise. 2012-03-09 Jérémy Compostella doc: add missing documentation for basename -z doc/coreutils.texi (basename invocation): Add -z option documentation. 2012-03-09 Bernhard Voelker maint: fix a version number typo in NEWS * NEWS: s/8.14/8.15/ 2012-03-09 Paul Eggert chmod: add notations +40, 00440, etc. * NEWS: Document this. * doc/perm.texi (Operator Numeric Modes): New section. (Numeric Modes, Directory Setuid and Setgid): Document new behavior. * src/chmod.c (usage): Document new behavior. (main): Support new options -0, -1, etc. * tests/chmod/setgid: Test these new features. build: update gnulib submodule to latest 2012-03-08 Jim Meyering du: fix -x: don't ignore non-directory arguments Surprise! "du -x non-DIR" would print nothing. Note that the problem arises only when processing a non-directory specified on the command line. Not surprisingly, "du -x" still works as expected for any directory argument. When performing its same-file-system check, du may skip an entry only if it is at fts_level 1 or greater. Command-line arguments are at fts_level == 0 (FTS_ROOTLEVEL). * src/du.c (process_file): Don't use the top-level FTS->fts_dev when testing for --one-file-system (-x). It happens to be valid for directories, but it is always 0 for a non-directory. * tests/du/one-file-system: Add tests for this. * NEWS (Bug fixes): Mention it. Reported by Daniel Stavrovski in http://bugs.gnu.org/10967. Introduced by commit v8.14-95-gcfe1040. 2012-03-07 Jim Meyering maint: use an optimal-for-coreutils xz compression setting * cfg.mk: Set XZ_OPT = -8e (determined empirically). This sacrifices 8 KiB of compressed tarball size for a 32-MiB decrease in the memory required during decompression. I.e., using -9e would shave off only 8 KiB from the tar.xz file, yet would force every decompression process to use 32 MiB more memory. 2012-03-07 Jérémy Compostella basename: support more than one argument * src/basename.c (perform_basename): New function refactored from main() that performs the basename work on a STRING, optionally removes a trailing SUFFIX and outputs the result. (main): Handle new options. * doc/coreutils.texi (basename invocation): Mention new options. * test/misc/basename: Add new options test cases. * NEWS (New features): Mention it. 2012-03-07 Pádraig Brady maint: refactor copy to use is_nul() * src/dd.c: Move is_nul() from here to ... * src/system.h: ... here * src/copy.c (sparse_copy): Adjust to use the refactored is_nul() 2012-03-02 Pádraig Brady tests: work around a block alignment issue in dd/sparse Prompted by the continuous integration build failure at: http://hydra.nixos.org/build/2188210 (which uses XFS). * tests/dd/sparse (alloc_equal): Add a block allocation comparison function that accounts for variations due to alignment. 2012-02-29 Rodrigo Campos doc: timeout: document the exit status when run with "-s KILL" * src/timeout.c (usage): Document the exit status for this case, in --help and thus in the man page. Word so that it covers both the -s9 and -k options. * doc/coreutils.texi (timeout invocation): Document the exit status for this case. 2012-02-29 Bernhard Voelker tests: compile and link shared object with $CC to make LD_PRELOAD work * tests/ls/getxattr-speedup: Compile and link in one step with $CC. If the shared object file is created by ld (binutils), then the destructor print_call_count() may not run (seen on OpenSuSE 12.1). See http://lists.opensuse.org/opensuse/2012-02/msg01342.html Thanks to Cristian Rodríguez. 2012-02-29 Roman Rybalko dd: add support for the conv=sparse option Notes: Small seeks are not coalesced to larger ones, like is done in cache_round() for example. conv= is used rather then oflag= for FreeBSD compatibility. * src/dd.c (final_op_was_seek): A new global boolean to flag whether the final "write" was converted to a seek. (usage): Describe the new conf=sparse option. (iwrite): Convert a write of a NUL block to a seek if requested. (do_copy): Initialize the output buffer to have a sentinel, to allow for efficient testing for NUL output blocks. If the last block in the file was converted to a seek, then convert back to a write so the size is updated. * NEWS: Mention the new feature. * tests/dd/sparse: A new test for the feature. * tests/Makefile.am: Reference the new test. 2012-02-27 Jérémy Compostella doc: fix a wrong option reference in split invocation * doc/coreutils.texi (split invocation): replace `-r' reference with `-nr/n'. 2012-02-26 Jim Meyering tests: fix help-version on cygwin, where $EXEEXT is nonempty * tests/misc/help-version: Remove the $EXEEXT suffix from each program name before comparing with a literal. 2012-02-26 Bernhard Voelker tests: remove unnecessary use of -lc * tests/ls/getxattr-speedup: Remove unneeded use of -lc. 2012-02-25 Paul Eggert sort: default to physmem/8, not physmem/16 * src/sort.c (default_sort_size): Don't divide advice by 2. Just divide the hard limits by 2. This matches the comments. Reported by Rogier Wolff in http://bugs.gnu.org/10877 2012-02-24 Jim Meyering doc: clarify a comment in system.h * src/system.h (STRNCMP_LIT): Clarify comment. Suggested by Bruno Haible. 2012-02-20 Jérémy Compostella split: add the --additional-suffix option Add the --additional-suffix option, to append an additional static suffix to output file names. * src/split.c (next_file_name): Append suffix to output file names. (main): Handle new --additional-suffix option. * NEWS (New features): Mention it. * doc/coreutils.texi (split invocation): Mention it. * tests/split/additional-suffix: New file. Test --additional-suffix. * tests/Makefile.am (TESTS): Add it. Requested by Peng Yu, in bug 6554 2012-02-20 Pádraig Brady ls: adjust errnos indicating device non support for xattrs * src/ls.c (errno_unsupported): Remove EBUSY, as this caters for the case where ACLs can't be accessed because the _file_ is locked. http://lists.gnu.org/archive/html/bug-coreutils/2005-06/msg00191.html Also ENOENT is not safe to include as you get that if the _file_ is removed between the stat() and subsequent querying of xattrs. 2012-02-19 Jérémy Compostella tests: ls/getxattr-speedup: include for older headers Modern provides ssize_t, but the one from Debian's libc6-dev 2.11.2-10 apparently does not. * tests/ls/getxattr-speedup: Also include . 2012-02-18 Jérémy Compostella doc: fix file names in split --filter=command example * doc/coreutils.texi (split invocation): Output file names should be prefixed with `big-' not `big-x'. 2012-02-18 Jim Meyering tests: test for ls speed-up * tests/ls/getxattr-speedup: New test. * tests/Makefile.am (TESTS): Add it. Improved-by: Bernhard Voelker ls: cache ACL- and CAP-querying syscall failures Like the optimization to avoid always-failing getfilecon calls, this change avoids always-failing queries for whether a file has a nontrivial ACL and for whether a file has certain "capabilities". When such a query fails for one file (indicating no support), we know it will always fail that way for the affected device. With this change, we have thus eliminated nearly all failing-unsupported getxattr syscalls. * src/ls.c (has_capability) [!HAVE_CAP]: Set errno to ENOTSUP. (errno_unsupported): Expand the list of E* errno values to match that of lib/acl-internal.h's ACL_NOT_WELL_SUPPORTED macro. (file_has_acl_cache, has_capability_cache): New functions. (gobble_file): Use them in place of non-caching ones. * NEWS (Improvements): Mention it. Suggested by Sven Breuner in http://thread.gmane.org/gmane.comp.gnu.coreutils.general/2187 While eliminating most getfilecon calls saved about 33%, eliminating these other calls can save almost all of the remaining ~67% cost, on some remote file systems. ls: optimize for when getfilecon would often fail (~33% perf. gain) On systems or file systems without SELinux support, all getfilecon and lgetfilecon calls would fail due to lack of support. We can non- invasively cache such failure (on most recently accessed device) and avoid the vast majority of the failing underlying getxattr syscalls. * src/ls.c (errno_unsupported): New function. (selinux_challenged_device): New file-scoped global. (getfilecon_cache, lgetfilecon_cache): New error-caching wrapper functions. (gobble_file): Use the caching wrappers, for when many *getfilecon calls would fail with ENOTSUP or EOPNOTSUPP. Suggested by Sven Breuner in http://thread.gmane.org/gmane.comp.gnu.coreutils.general/2187 Improved-by: Pádraig Brady. 2012-02-18 Jérémy Compostella split: support optional start value for --numeric-suffixes Allow changing the --numeric-suffixes start number from the default of 0. * src/split.c (next_file_name): Initialize the suffix index and the output filename according to start value. (main): Check that the suffix length is large enough for the numerical suffix start value. * doc/coreutils.texi (split invocation): Mention it. * NEWS (New features): Mention it. * tests/split/numeric: New file. Test --numeric-suffixes[=FROM]. * tests/Makefile.am (TESTS): Reference the new test. 2012-02-17 Pádraig Brady doc: fix a typo about seek_bytes in NEWS * NEWS: s/count_bytes/seek_bytes/2 2012-02-16 Bernhard Voelker doc: improve 'rm -f' description * doc/coreutils.texi (rm invocation): Mention that the -f option also silences the message for missing operands, which is useful in scripts e.g., for "rm -f $file_list" when $file_list is empty. * src/rm.c (usage): Likewise. Reported by Jérémy Magrin in http://bugs.gnu.org/10819 2012-02-13 Pádraig Brady dd: fix issues in the count_bytes and seek_bytes flags change These edge cases were missed in the previous commit 140eca15c. * src/dd.c (main): Include the bytes slop when truncating without further I/O. Don't invalidate the whole file cache in the case where 0 < count < ibs. * tests/dd/bytes: Change to using the independent truncate command to generate the file for comparison. Remove a redundant test case and replace with one testing the truncation only logic. 2012-02-12 Jérémy Compostella dd: add count_bytes, skip_bytes and seek_bytes flags dd now accepts the count_bytes and skip_bytes input flag and the seek_bytes output flag, to more easily allow processing portions of a file. * src/dd.c (scanargs): Compute skip_records and skip_bytes when 'skip_bytes' iflag is used. Compute max_records and max_bytes when 'count_bytes' iflag is used. Compute seek_records and seek_bytes when 'seek_bytes' oflag is used. (skip_via_lseek): Use new 'bytes' parameter and handle potential 'records' equals to zero. Update the bytes parameter when called with 'fdesc' equal to STDOUT_FILENO. Update the header comments. (dd_copy): Skip accordingly to skip_records AND skip_bytes. Count accordingly to max_records AND max_bytes. Seek on output accordingly to seek_records AND seek_bytes. * NEWS (New features): Mention it. * doc/coreutils.texi (dd invocation): Detail new flags and behaviors. * tests/dd/bytes: New file. Tests for these new flags. * tests/Makefile.am (TESTS): Add it. 2012-02-12 Jim Meyering build: correct @@-,length values in last hunk of regcomp.c.diff * gl/lib/regcomp.c.diff: Correct invalid hunk lengths (s/1/7/g) in the last hunk's @@-line. build: update gnulib, bootstrap, gl/lib/regcomp.c.diff * gnulib: Update submodule to latest. * bootstrap: Update from gnulib. * gl/lib/regcomp.c.diff: Adapt to gnulib changes. mv: "mv A B" would sometimes succeed, yet A would remain, ... But only when both A and B were hard links to the same symlink. * src/copy.c (same_file_ok): Handle another special case: the one in which we are moving a symlink onto a hard link to itself. In this case, we must explicitly tell the caller to unlink the source file. Otherwise, at least the linux-3.x kernel rename function would do nothing, as mandated by POSIX 2008. * tests/mv/symlink-onto-hardlink-to-self: New test. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it. Reported by Bernhard Voelker in http://bugs.gnu.org/10686 2012-02-06 Jérémy Compostella maint: add braces as requested by HACKING coding standard * src/dd.c (dd_copy): Braces were missing for this do/while statement. 2012-01-31 Pádraig Brady doc: clarify --help output for some optional arguments * src/pr.c (usage): Fix the -S description to indicate that the argument is optional for the short option. * doc/coreutils.texi (pr invocation): Likewise. * src/od.c (usage): Fix the -S description to indicate that the argument is required for the short option. Clarify -w takes an argument and that it is optional. 2012-01-30 Jim Meyering maint: sort: remove the last uses of "'%s'" in diagnostics * src/sort.c (key_warnings): Use quote (quote_n, since there are two) rather than literal single quotes ('%s') in diagnostic. mv: allow moving symlink onto same-inode dest with >= 2 hard links Normally, mv detects a few subtle cases in which proceeding with a same-file rename would, with very high probability, cause data loss. Here, we have found a corner case in which one of these same-inode tests makes mv refuse to perform a useful operation. Permit that corner case. * src/copy.c (same_file_ok): Detect/exempt this case. * tests/mv/symlink-onto-hardlink: New test. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it. Initially reported by: Matt McCutchen in http://bugs.gnu.org/6960. Raised again by Anders Kaseorg due to http://bugs.debian.org/654596. Improved-by: Paul Eggert. build: update gnulib, for syntax-check vs canonicalize fix 2012-01-27 Jim Meyering maint: use single copyright year range Run "make update-copyright". maint: make copyright statements more consistent; update gnulib * cfg.mk (update-copyright-env): Add UPDATE_COPYRIGHT_FORCE=1 to rejoin some split lines, and UPDATE_COPYRIGHT_USE_INTERVALS=2 to make update-copyright use only one year range. * gnulib: Update to latest, for newer update-copyright script. maint: fix copyright in old fileutils ChangeLog * old/fileutils/ChangeLog-1997: Insert omitted "Free Software" in the name of the copyright holder. Compress year range. 2012-01-26 Pádraig Brady maint: remove some redundant automake _SOURCES * src/Makefile.am: Remove auto generated entries. maint: cleanup an extraneous version output in a test * test/misc/stdbuf: Fixup the minor copy & paste issue introduced in commit ff7f0ff8 2012-01-25 Pádraig Brady realpath: avoid the use of printf This was seen to give an 11% performance improvement. * src/realpath.c (relpath): Avoid using printf. (process_path): Likewise. 2012-01-25 Pádraig Brady maint: use the standard require_perl_ function * tests/cp/sparse-fiemap: Don't use a separate check. realpath: remove extraneous '/' for --relative-to edge cases * src/realpath.c (path_common_prefix): Be consistent and always include a leading '/' in the count returned. (relpath): Account for the change in path_common_prefix() and avoid outputting extra '/' chars in relative paths that span the root dir. * tests/misc/realpath: Add the two reported cases. Reported by Mike Frysinger 2012-01-23 Jim Meyering build: update gnulib to latest, for test warning fixes See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/29810 for details. tests: remove crufty test=test_name code from old tests Before init.sh and similar, we would set test=test_name, and then construct temporary file names using $test. Now that each init.sh-using test is in its own directory, that practice is unwelcome. Remove bad examples. * tests/rm/f-1: Per above. * tests/rm/i-1: Likewise. * tests/rm/interactive-always: Likewise. * tests/rm/interactive-once: Likewise. * tests/rm/ir-1: Likewise. * tests/rm/r-1: Likewise. 2012-01-23 Paul Eggert maint: quote 'like this' or "like this", not `like this' * doc/coreutils.texi (Formatting the file names): coreutils now quotes 'like this'. * man/help2man: * src/timeout.c (usage): Quote 'like this' in diagnostics. * HACKING, Makefile.am, NEWS, README, README-hacking, TODO, cfg.mk: * doc/Makefile.am, doc/coreutils.texi, m4/jm-macros.m4: * man/Makefile.am, man/help2man, src/Makefile.am, src/copy.h: * src/extract-magic, src/ls.c, src/pinky.c, src/pr.c, src/sort.c: * src/split.c, src/timeout.c, src/who.c, tests/dd/skip-seek-past-file: * tests/pr/pr-tests: Quote 'like this' in commentary. * cfg.mk (old_NEWS_hash): Update due to changed old NEWS. 2012-01-20 Pádraig Brady stat: clarify the description of the %o stat format * src/stat.c (usage): Indicate this is a transfer size suggestion, rather than some persistent block size. * doc/coreutils.texi (stat invocation): Likewise. 2012-01-14 Jim Meyering doc: tweak an @uref so its alt reference text renders in info * doc/coreutils.texi (Opening the software toolbox): Remove commas from @uref argument, so the alternate text renders properly in info. Reported by Reuben Thomas. 2012-01-11 Pádraig Brady maint: fix minor whitespace issues The previous commit introduced a couple of spacing issues, luckily one of which caused a test to fail. * src/stat.c (default_format): Add a space so times are aligned. * src/tr.c (string2_extentd): Remove an extraneous space. 2012-01-11 Jim Meyering maint: adjust formatting of certain continued strings Add a rule to ding any source file that has a continued string with a word in the first column of the following line. Those tend to trigger malfunction in tools that try to map an arbitrary line number to an enclosing function name. Of course, very many strings do precisely this, *when they are part of the usage function*. So we exempt the body of each usage function. * src/dircolors.c (main): Separate a long, continued string into two separately-quoted parts. * src/od.c (decode_one_format): Likewise. (decode_one_format, main): Move a space from end of preceding line to the beginning of the continued line. * src/tr.c (unquote, string2_extend, validate): Likewise. * src/seq.c (main): Split in two and use string concatenation. * src/stat.c (default_format): Use a mix of techniques. * cfg.mk (sc_prohibit_continued_string_alpha_in_column_1): New rule. Exempt three files in src: system.h, od.c, printf.c. 2012-01-09 Jim Meyering maint: straggler *.[ch] files: convert more `...' to '...' The preceding commands ignored .[ch] files in lib/ and gl/. This is what I should have been doing from the start: git grep -l '`.*'\' $(g ls-files |grep '\.[ch]$') \ | xargs perl -pi -e 's/`(.+?'\'')/'\''$1/' 2012-01-09 Jim Meyering maint: src/*.[ch]: convert more `...' to '...' Run this (twice): git grep -E -l '`.+'\' src/*.[ch] \ |xargs perl -pi -e 's/`(.+?'\'')/'\''$1/' maint: src/*.c: change remaining quotes (without embedded spaces) Run this (twice): git grep -E -l '`[^ ]+'\' src/*.c \ |xargs perl -pi -e 's/`([^ ]+'\'')/'\''$1/' maint: convert `...' to '...' in --help output All affected lines end with \ or \n\, so run this command until it produces no new changes (4 times): git grep -E -l '`[^ ]+'\''.*\\' src \ |xargs perl -pi -e 's/`([^ ]+'\''.*\\)/'\''$1/' maint: adjust quoting: emit '...', not `...' in diagnostics * src/csplit.c (parse_repeat_count, extract_regexp): As above. * src/date.c (main): Likewise. * src/ls.c (decode_switches): Likewise. * src/od.c (decode_one_format, main): Likewise. * src/pathchk.c (no_leading_hyphen): Likewise. * src/pr.c (main, getoptarg): Likewise. * src/rm.c (diagnose_leading_hyphen): Likewise. * src/sort.c (key_warnings, incompatible_options, main): Likewise. * src/stat.c (print_esc_char): Print '\x', not `\x' in diagnostic. * src/test.c (main): Likewise. * src/touch.c (main): Likewise. * src/tr.c (build_spec_list, validate, append_range): Likewise. * tests/misc/mktemp: This is an unusual case, since the affected string contains only the ` of an `...' string. So we change the long ` to a lone '. * tests/pr/pr-tests: Manual quote adapting fix-up. * tests/ln/hard-to-sym: Likewise. * tests/split/suffix-length: Likewise. * tests/mv/part-fail: Likewise. * tests/misc/chcon: Likewise. * tests/misc/stat-printf: Likewise. 2012-01-09 Jim Meyering tests: more automated quote adjustment Relax initial regexp to match more instances, but add a filter to avoid some invalid conversions. Run this: git grep -l "\`[^']*'" tests | xargs perl -pi -e '$q=q"'\''";' \ -e '$q="$q\\$q$q"; /(= ?\`|\`expr|\`echo|\Q$q\E)/ and next;' \ -e ' s/\`([^'\''"]*?'\'')/'\''$1/g' The last disjunct in the above (...) filter is to exempt any line that contains this string: '\'' With quoting like that, converting a ` to ' is likely to cause trouble, so we'll handle those manually. Here are three examples where the exemption is required: *': `link-to-dir/'\'': hard link not allowed for directory'*) ;; printf 'creating file `%s'\''\n' $f 'mv: inter-device move failed: `%s'\'' to `%s'\'';'\ 2012-01-09 Jim Meyering tests: change `...' to '...' on lines not matching /[=\$]/ Exempt lines with '$' or '=', since those are prone to improper conversion. Run this: git grep -l "\`[^']*'" tests \ |xargs perl -pi -e '/[=\$]/ and next;s/\`([^'\''"]*?'\'')/'\''$1/g' tests: adjust \`...' quoting to '...' to adapt to latest gnulib Run this: git grep -l "\\\\\`[^']*'" tests \ |xargs perl -pi -e 's/\\\`(.*?'\'')/'\''$1/g build: update gnulib submodule to latest (quoting change) This pulls in changes to the quote and quotearg modules that render quoted strings in diagnostics. `Old' vs 'new'. maint: prep for global quoting changes: handle irregular cases manually * src/chroot.c (usage): Change ``...'' to '...', and describe the default more accurately (also adding quotes): s,/bin/sh,'/bin/sh -i', * src/join.c (usage): Change ` ...'' ' to "...''". * src/fmt.c (isopen): Change `' to '` in list of bytes, so that a subsequent change can safely perform the `...' to '...' conversion. * src/truncate.c (main): Tweak quoting in comments to use '...', not `...`, for consistency with the rest of comments in coreutils. 2012-01-07 Jim Meyering maint: update quoting of "Try `prog --help'" to "Try 'prog --help'" Automatically adjust both the source (now in only one place) and all tests that expect the resulting output via this: git grep -l 'Try.*--help' src/system.h tests \ | xargs perl -pi -e 's/Try \\?`(\S+ --help)/Try '\''$1/' 2012-01-07 Jim Meyering maint: use new emit_try_help in place of equivalent fprintf Run this command: perl -0777 -pi -e \ 's/fprintf \(stderr, _\("Try `%s --help.*\n.*;/emit_try_help ();/m'\ src/*.c maint: factor out all `Try --help'-emitting statements * src/system.h (emit_try_help): New function. 2012-01-06 Jim Meyering maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.15 * NEWS: Record release date. scripts: allow one-line summary to start with "[Vv]ersion \d" * scripts/git-hooks/commit-msg: Do not reject the commit log message generated by our automated release-and-tag process. (bad_first_line): New function, extracted from... (check_msg): ... here. Use it. build: update gnulib submodule to latest tests: adjust quoting in expected output to match new gnulib policy * tests/misc/xstrtol: Use '...' to match new quoting in most places. However, leave `9x' to match the sole comparison against output from the quote function, which still uses `...'. * tests/misc/sort-merge: Likewise, though here I had to leave `...'-quoted output to match output from four tests. * tests/pr/pr-tests: Convert a single `...' to '...'. * gnulib: Update submodule to latest. maint: adjust ChangeLog to reflect earlier df request * build-aux/git-log-fix: Credit early reporter. * THANKS.in: Add a name. 2012-01-05 Pádraig Brady tests: avoid stty icanon issues on some platforms * tests/misc/stty: Exclude 'icanon' for the list to check, as it's problematic on ppc*|sparc* platforms. tests: avoid ulimit issue on bash 3.2 on OS X * tests/misc/sort-continue: Perform the glob before the ulimit, as it was seen to make the glob fail on bash 3.2 on Mac OS X 10.6.8 at least. 2012-01-05 Pádraig Brady tests: avoid a false positive due to overflow on Linux/HPPA * tests/misc/timeout-parameters: Verify that the timer doesn't fire immediately in the problematic range, and avoid overflow checks in that case. * man/timeout.x: Mention the possible bug. Reported by Bruno Haible 2012-01-05 Jim Meyering tests: adjust setfacl usage to accommodate Solaris 10 * cfg.mk (sc_prohibit_short_facl_mode_spec): New rule. * tests/cp/acl: Extend setfacl mode spec to have length 3. * tests/ls/slink-acl: Likewise. * tests/mv/acl: Likewise. Report and analysis by Bruno Haible. 2012-01-05 Bruno Haible Jim Meyering split: avoid failure due to leftover 'errno' value * src/split.c (lines_chunk_split): Fix logic bug that led to unwarranted failure of "split -n l/2 /dev/zero" on NetBSD 5.1. The same would happen when splitting a growing file, where open/lseek-end gives one size, but by the time we read, there is more data available. (bytes_chunk_extract): Likewise. * NEWS (Bug fixes): Mention this. * tests/split/l-chunk: The latter case was not exercised. Add code to do that. Bug introduced with the chunk-selecting feature in v8.7-25-gbe10739. 2012-01-05 Jim Meyering doc: README: recommend GNU make to run tests on IRIX 6.5 and Solaris 9 * README: Document vendor "make check" failure on those two systems. Reported by Bruno Haible. 2012-01-04 Jim Meyering maint: ignore *.trs files, lib/getopt.h and build-aux/test-driver * .gitignore: Also ignore automake's new .trs files and its build-aux/test-driver, as well as lib/getopt.h. 2012-01-03 Jim Meyering doc: adjust NEWS * NEWS (New programs): Move this small section to the top. (df): Reword entry, from Pádraig Brady. 2012-01-03 Jim Meyering df: work around long-named /dev/disk/by-uuid/... symlinks On systems with recent kernel/tools, a symlink from /etc/mtab to /proc/mounts, and a by-UUID mount (i.e., soon, nearly everyone), you will see something like the following when running "df -hT": (this has been truncated to fit in a width-limited ChangeLog file) Filesystem Type Siz... rootfs rootfs 11G udev devtmpfs 3.8G tmpfs tmpfs 774M /dev/disk/by-uuid/828fc648-9f30-43d8-a0b1-f7096a2edb66 ext4 11G tmpfs tmpfs 1.6G /dev/sda2 ext3 494M /dev/sda5 ext4 12G /dev/sda6 ext4 9.9G Contrast that with what we're used to seeing (modulo the two entries mounted on "/", which is a separate problem): Filesystem Type Size Used Avail Use% Mounted on rootfs rootfs 11G 1.9G 8.0G 19% / udev devtmpfs 3.8G 0 3.8G 0% /dev tmpfs tmpfs 774M 376K 774M 1% /run /dev/sda3 ext4 11G 1.9G 8.0G 19% / tmpfs tmpfs 1.6G 8.0K 1.6G 1% /run/shm /dev/sda2 ext3 494M 78M 392M 17% /boot /dev/sda5 ext4 12G 7.6G 3.7G 68% /usr /dev/sda6 ext4 9.9G 6.6G 2.8G 71% /var When that long /dev/disk/by-uuid/... name is merely a symlink to a much shorter (and often more useful) device name like "/dev/sda3", and when it's part of a listing of all file systems, I would much prefer to see only the latter. Similarly, when using an encrypted root file system, you would see a name like /dev/mapper/luks-828fc648-9f30-43d8-a0b1-f7196a2edb66 pointing to say, /dev/dm-0, I prefer the shorter name. I.e., if I explicitly run "df -hT /dev/disk/by-uuid/828fc648-9f30-43d8-a0b1-f7096a2edb66", then, it's fine -- and expected -- to print to the long name. It was explicitly given. However, with no non-option argument, df should print the shorter name. Note that performing this translation at a lower level (via a change to gnulib's mountlist.c) would make it impossible to distinguish those two cases. * src/df.c: Include "canonicalize.h". (get_dev): Add a parameter, telling when we're in process-all- mount-points mode; update all callers. When true, resolve UUID-suffixed symlinks. * NEWS (Changes in behavior): Mention it. Reported by Nao Nishijima in http://bugzilla.redhat.com/766461 and by Dan Jacobson in http://bugs.gnu.org/10363 2012-01-03 Jim Meyering tests: adjust realpath test to avoid "make distcheck" failure * tests/misc/realpath: Quote lhs of test ... = ..., so that when $PWD contains a space (like it does via "make distcheck"), the test does not fail 2012-01-03 Pádraig Brady realpath: a new program to print the resolved path This program is compatible with other realpath(1) implementations, and also incorporates relpath like support, through the --relative options. The relpath support was suggested by Peng Yu, who also provided an initial implemenation of that functionality. * AUTHORS: Add my name. * NEWS: Mention the new command. * README: Likewise. * doc/coreutils.texi (realpath invocation): Add realpath info. * man/Makefile.am (realpath.1): Add dependency. * man/realpath.x: New template. * man/.gitignore: Ignore generated man page. * po/POTFILES.in: Add src/realpath.c. * src/.gitignore: Exclude realpath. * src/Makefile.am (EXTRA_PROGRAMS): Add realpath. * src/realpath.c: New file. * scripts/git-hooks/commit-msg: Add realpath to the list of prefixes. * tests/Makefile.am (TESTS): Add misc/realpath. * tests/misc/realpath: New file. 2012-01-03 Pádraig Brady build: update gnulib for canonicalize_filename_mode improvements This is required for the new realpath command. 2012-01-02 Jim Meyering build: tail: avoid type/format mismatch warning from gcc Without this change, gcc's -Werror=format would complain that the '%lx' format requires 'long unsigned int', not 'int'. * src/tail.c (fremote): Use a temporary variable. 2012-01-01 Jim Meyering tests: also print chmod's --version * tests/rm/many-dir-entries-vs-OOM: This test also exercises chmod. maint: update all copyright year number ranges Run "make update-copyright". tests: change copyright year from 2011 to 2012 in sample-test This file is special. We don't want to use a range, but merely the current year number. * tests/sample-test: s/2011/2012/ 2011-12-31 Jim Meyering tests: fix a missing-dependency problem * tests/check.mk (.built-programs): Depend on src/Makefile.am, so that when we add a program, this file is updated, and the new program is tested via misc/help-version. Spotted by Pádraig Brady. 2011-12-30 Jim Meyering build: avoid spurious test.c warning with -Wsuggest-attribute=pure * src/test.c: Add pragma to suppress gcc-4.6.2's warning that "advance" might be candidate for attribute 'pure'. 2011-12-28 Jim Meyering tail: avoid theoretically undefined behavior * src/tail.c (start_lines): Do not form potentially-invalid address. Use safe_read's return value as a pointer offset only after ensuring that it is not SAFE_READ_ERROR (size_t)(-1). Spotted by coverity. Also, move declaration of "p" to be closer to first use. tests: also unset _STDBUF_E, _STDBUF_I and _STDBUF_O * tests/envvar-check (vars): Add these to the list of envvars we ignore: _STDBUF_E, _STDBUF_I, _STDBUF_O, used by libstdbuf. 2011-12-26 Pádraig Brady doc: homologize ch{con,grp,mod,own} option descriptions * src/chgrp.c (usage): Group associated options together, to aid users. Also minimize the differences between individual messages across these four commands, to aid translators. * src/chmod.c: Likewise. * src/chown.c: Likewise. * src/chcon.c (usage): Likewise. Document the --dereference option. Suggested by Paul Eggert and Jari Aalto 2011-12-26 Jim Meyering stat,tail: recognize new FS type: pipefs * src/stat.c (human_fstype) [S_MAGIC_PIPEFS]: New case. * NEWS (Bug fixes): Mention this. 2011-12-24 Jim Meyering doc: stat: clarify that %t and %T expand to the file system type * src/stat.c (usage): Mention "file system type", not just "type" for %t and %T. Do not capitalize the first letter of each description. 2011-12-23 Jim Meyering tail: with -f, use polling when a file is on an FS of unknown type Before, we would use inotify in that case, which would work as long as updates were taking place locally, but not at all when remote. Move hard-coded list of known remote FS types into a more maintainable table in stat.c, alongside the list of FS names and magic numbers. Generate a new is_local_fs_type function. * src/Makefile.am (fs-is-local.h): New rule, generated file. * src/extract-magic: Revamp to parse local/remote keyword after each magic number in src/stat.c's case statements. Accept new --local option. * src/.gitignore: Ignore the generated fs-is-local.h. * src/tail.c [HAVE_INOTIFY]: Include fs-is-local.h. (fremote) [HAVE_INOTIFY]: Use the new function in place of the switch stmt with hard-coded list of FS types. Emit a warning when processing a file on a file system of unknown type. * NEWS (Changes in behavior): Mention it. Suggested by Sven Breuner. 2011-12-22 Jim Meyering doc: update README-release with process to check for new FS magic * README-release: Run the Makefile rule that checks for new file system magic numbers. tail,stat: add support for FhGFS * src/stat.c (human_fstype): Add a case: fhgfs, 0x19830326. * src/tail.c (fremote): Add S_MAGIC_FHGFS. * NEWS (Bug fixes): Update the entry for GPFS to mention FhGFS, too. Reported by Sven Breuner. 2011-12-20 Jim Meyering doc: improve factor example * doc/coreutils.texi (factor invocation): Adjust example to use $(...) consistently, not a mix of `...` and $(...). Separate the computation of the product and the actual factorization, so the timing of the latter doesn't include the cost of the former. 2011-12-17 Jim Meyering build: remove now-useless code from bootstrap.conf * bootstrap.conf (bootstrap_epilogue): Remove now-unnecessary, snippet that edited gnulib-tests/gnulib.mk. This snippet was rendered unnecessary by commit v8.14-73-g5bf2c0e. build: merge in bootstrap changes from gnulib * bootstrap: Pull in the combination of gnulib's "bootstrap: detect tools required by gnulib-tool" patch and the related fix. 2011-12-15 Paul Eggert du: -x should not count files in other file systems This fixes Bug#10293, which I guess was introduced in commit 95c948b06a dated 2003-10-02. * NEWS: Document fix. * src/du.c (process_file): Don't count files in different file systems if -x is given. * tests/du/one-file-system: Test for this bug. 2011-12-13 Paul Eggert doc: document 'touch' and timestamps better * doc/coreutils.texi (touch invocation): Explain file timestamps better. Problem reported by Nelson H.F. Beebe (Bug#7999). 2011-12-12 Jim Meyering ls: give a more useful diagnostic for a bogus --time-style arg * src/ls.c (decode_switches): Replace our use of XARGMATCH with open-coded version so that we can give a better diagnostic. * tests/ls/time-style-diag: New file. * tests/Makefile.am (TESTS): Add it. Reported by Dan Jacobson in http://bugs.gnu.org/10253 with suggestions from Eric Blake and Paul Eggert. 2011-12-09 Jim Meyering maint: remove a misleading comment from shred.c * src/shred.c: Remove obsolete TODO comment. The first two and the last item were done, adding --recursive (-r) is neither necessary nor appropriate, and I don't want to add --interactive. I don't see a need for the others. Prompted by comments from Amr Ali. 2011-12-08 Jim Meyering Eric Blake ls: be responsive to interrupts when color-listing large directories Starting with commit adc30a83, when using --color, ls inhibited interrupts to avoid corrupting the state of an output terminal. However, for very large directories, that inhibition rendered ls uninterruptible for too long, including a potentially long period even before any output is generated. * src/ls.c: Two phases of processing are time-consuming enough that they can provoke this: the readdir loop and the printing loop. The printing was supposed to be covered by a call to process_signals in (print_name_with_quoting): ... but that call was mistakenly guarded by a condition that might be false for many or even all files being processed. Call process_signals unconditionally. (print_dir): Also call process_signals in the readdir loop. * NEWS (Bug fixes): Mention it. Reported by Arkadiusz Miśkiewicz in http://bugs.gnu.org/10243 2011-12-05 Paul Eggert ln: clarify usage of -L, -n, -T * src/ln.c (usage): Use clearer wording to describe the -L, -n, and -T options (Bug#9896). maint: don't assume GNU make \# syntax (fix previous) * src/Makefile.am (fs_normalize_perl_subst, fs-magic, fs-kernel-magic): Undo previous patch; it missed a \#. (fs_normalize_perl_subst): Use \043 rather than \#. \043 is portable to all ASCIIish platforms, whereas \# is portable only to platforms that are compatible with GNU make (and are incompatible with POSIX make). Porting this to EBCDIC is left as an exercise for the reader.... 2011-12-05 Jim Meyering maint: sort, stat: remove unused parameters * src/sort.c (struct thread_args) [is_lo_child]: Remove member. (sortlines): Remove unused parameter, "is_lo_child". Update callers. * src/stat.c (out_epoch_sec): Mark unused parameter. (do_statfs, do_stat): Remove unused parameter, "terse". Update callers. 2011-12-05 Paul Eggert maint: don't assume GNU make \# syntax * src/Makefile.am (fs_normalize_perl_subst): Don't make unportable assumption about \# in the right hand side of a macro definition. This works with GNU make, but not with POSIX make. Problem reported by Basavaraj B (Bug#10220). (fs-magic, fs-kernel-magic): Do the #-substitution here instead. 2011-12-04 Jim Meyering od,test: address warnings from gcc's -Wjump-misses-init * src/test.c (unary_operator): gcc reported that initializations in two case statements were skipped. Enclose in braces. * src/od.c (decode_one_format): Likewise. maint: remove redundant usage declarations (-Wredundant-decls) * src/csplit.c (usage): Remove declaration. * src/ls.c (usage): Likewise. * src/pr.c (usage): Likewise. 2011-12-03 Jim Meyering maint: add missing ":" after "License" in local gnulib module files This avoids spurious diagnostics when running our "bootstrap" script. * gl/modules/heap: Append colon after "License". * gl/modules/randint: Likewise. * gl/modules/randperm: Likewise. * gl/modules/randread: Likewise. Reported by Stefano Lattarini. Diagnosed by Bruno Haible. 2011-12-01 Eric Blake doc: fix list of GNU extension date formats I didn't check how long these were documented as GNU extensions, nor when they were added by POSIX; but since they are all part of POSIX 2008, we no longer need call them out as extensions. The next version of POSIX will standardize %s: http://austingroupbugs.net/view.php?id=169 but as that is not out yet, I didn't change %s. * doc/coreutils.texi (Time conversion specifiers): %R and %z are now POSIX. (Date conversion specifiers): Likewise for %F, %g, %G. 2011-12-01 Bernhard Voelker tests: adjust PATH to generally include /sbin and /usr/sbin Commit 5eeaca94 added /sbin to the PATH for tests using mkfs. For other tests, e.g. tests/cp-fiemap-perf using filefrag, we need /usr/sbin also. Add both directories generally for the tests, "since many of us always augment our PATH with all of the sbin paths all of the time anyway" (Bob in http://lists.gnu.org/archive/html/coreutils/2011-11/msg00107.html). The previous commit is hereby obsolete. * tests/init.cfg (sanitize_path_): Add /sbin and /usr/sbin to PATH unless already included. Needed for tests using admin tools like mkfs and filefrag on systems where the user's environment does not have these directories in the PATH. * tests/init.cfg (require_mkfs_PATH_): Remove obsolete function. * tests/cp/cp-a-selinux: Remove require_mkfs_PATH_ call. * tests/cp/cp-mv-enotsup-xattr: Likewise. * tests/cp/sparse-fiemap: Likewise. * tests/mkdir/writable-under-readonly: Likewise. * tests/rm/read-only: Likewise. 2011-11-30 Eric Blake build: simplify warnings based on last gnulib update We no longer need to exclude this warning. * configure.ac (WARN_CFLAGS): Gnulib dropped -Wunsuffixed-float-constants, as non-portable. 2011-11-30 Eric Blake build: update gnulib for syntax-check improvement Commit 5b3e538 proved useful enough to migrate to gnulib after enhancing it to be more generic, which in turn pointed out that commit a2c811db missed an offender. * gnulib: Update to latest. * cfg.mk (sc_prohibit_reversed_compare_failure): Delete, now that gnulib provides it. * tests/ls/dangle: Fix last offender. 2011-11-29 Jim Meyering build: update gnulib to fix build failure with --enable-gcc-warnings 2011-11-28 Jim Meyering build: enable -Wsuggest-attribute=pure|const in lib/,... but not in gnulib-tests/. * configure.ac (GNULIB_WARN_CFLAGS): Do not exclude -Wsuggest-attribute=pure|const, thus enabling these two warning options in lib/, since gnulib now toes the line. Continue to disable them in gnulib-tests/, since some programs there trigger these suggestions and are not worth fixing. build: update gnulib for const+pure attributes 2011-11-27 Jim Meyering tests: add a syntax check for last week's global change Last week I made a global change, commit a2c811db, `tests: use "compare exp out", not "compare out exp"', but forgot to add a corresponding syntax check rule. Without that, it is far too easy to add a new test or to merge in an old one that would be non-conforming. Obviously this is only a heuristic, since it relies on the expected-output file to have a name that starts with "exp". * cfg.mk (sc_prohibit_reversed_compare_failure): Prohibit use of compare with reversed arguments. maint: update comment gcc-4.6.2 still botches -Wsuggest-attribute=pure * configure.ac: Update the comment on which gcc versions still must not use -Wsuggest-attribute=pure option: still required on post- Fedora 16 rawhide's 4.6.2 20111027. 2011-11-24 Jim Meyering maint: bootstrap: run autopoint and libtoolize *before* gnulib-tool * bootstrap (AUTOPOINT, AUTORECONF): Factor out definitions. Run autopoint and libtoolize *before* gnulib-tool. After it, run an abbreviated autoreconf, rather than a loop around all tools. * bootstrap.conf (gnulib_tool_option_extras): Add both --symlink and --makefile-name=gnulib.mk. Remove stray use of $bt. * lib/Makefile.am: Initialize all of the following so that generated code in gnulib.mk may use += to append to those variables: AM_CFLAGS, AM_CPPFLAGS, BUILT_SOURCES, CLEANFILES, EXTRA_DIST, MAINTAINERCLEANFILES, MOSTLYCLEANDIRS, MOSTLYCLEANFILES, SUFFIXES, noinst_LIBRARIES. maint: bootstrap: remove some now-unneeded code This bootstrap script arose back when gnulib-tool was young. Since then, it has seen improvements that render much of this script unnecessary. In particular, it can now make symlinks to the files it uses. Also, I no longer see as much value in marking files as read-only via comments. * bootstrap (slirp, bt_mark_as_generated): Remove. maint: use gnulib's gettext-h, not the gettext module * bootstrap.conf (gnulib_modules): Use gnulib's gettext-h, not the gettext module. Not only is gettext-h far smaller (it has far fewer dependencies than the gnulib module), but it does not suffer from the problem with the gettext module whereby it adds a -I.../intl option to compilation flags. That can provoke warnings, since we don't have such a directory. We used to work around that via a hack in bootstrap, but that was ugly and inefficient. maint: append many lib/ and m4/ names to .gitignore build: update gnulib submodule to latest for fixed stdalign test 2011-11-23 Jim Meyering scripts: commit-msg: tweak 72-column test to avoid a false-positive * scripts/git-hooks/commit-msg: Don't warn about a line that is longer than 72 if it is a comment. Git-generated comments would occasionally trigger this. build: update gnulib and tests/init.sh * gnulib: Update. * tests/init.sh: Update from gnulib. build: --enable-gcc-warnings: disable some new warnings * configure.ac: Disable some new warning options pulled in via an update to gnulib's manywarnings module: -Wformat-nonliteral, -Wunsuffixed-float-constants, -Wdouble-promotion. 2011-11-22 Jim Meyering tests: use "compare exp out", not "compare out exp" Likewise, when an empty file is expected, use "compare /dev/null out", not "compare out /dev/null". I.e., specify the expected/desired contents via the first file name. Prompted by a suggestion from Bruno Haible in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020/focus=29154 Run these commands: git grep -l -E 'compare [^ ]+ exp' \ |xargs perl -pi -e 's/(compare) (\S+) (exp\S*)/$1 $3 $2/' git grep -l -E 'compare [^ ]+ /dev/null' \ |xargs perl -pi -e 's/(compare) (\S+) (\/dev\/null)/$1 $3 $2/' * tests/chgrp/no-x: As above. * tests/chmod/no-x: Likewise. * tests/chmod/silent: Likewise. * tests/chmod/thru-dangling: Likewise. * tests/chown/basic: Likewise. * tests/chown/deref: Likewise. * tests/chown/preserve-root: Likewise. * tests/cp/abuse: Likewise. * tests/cp/backup-is-src: Likewise. * tests/cp/cp-a-selinux: Likewise. * tests/cp/cp-mv-enotsup-xattr: Likewise. * tests/cp/fail-perm: Likewise. * tests/cp/into-self: Likewise. * tests/cp/proc-zero-len: Likewise. * tests/cp/src-base-dot: Likewise. * tests/cp/thru-dangling: Likewise. * tests/dd/reblock: Likewise. * tests/dd/unblock-sync: Likewise. * tests/du/2g: Likewise. * tests/du/8gb: Likewise. * tests/du/basic: Likewise. * tests/du/bigtime: Likewise. * tests/du/deref-args: Likewise. * tests/du/exclude: Likewise. * tests/du/files0-from-dir: Likewise. * tests/du/hard-link: Likewise. * tests/du/inacc-dest: Likewise. * tests/du/inacc-dir: Likewise. * tests/du/long-sloop: Likewise. * tests/du/max-depth: Likewise. * tests/du/move-dir-while-traversing: Likewise. * tests/du/no-deref: Likewise. * tests/du/no-x: Likewise. * tests/du/one-file-system: Likewise. * tests/du/slash: Likewise. * tests/du/trailing-slash: Likewise. * tests/install/strip-program: Likewise. * tests/ln/hard-backup: Likewise. * tests/ls/block-size: Likewise. * tests/ls/color-clear-to-eol: Likewise. * tests/ls/color-dtype-dir: Likewise. * tests/ls/color-norm: Likewise. * tests/ls/dangle: Likewise. * tests/ls/dired: Likewise. * tests/ls/file-type: Likewise. * tests/ls/follow-slink: Likewise. * tests/ls/infloop: Likewise. * tests/ls/m-option: Likewise. * tests/ls/no-arg: Likewise. * tests/ls/recursive: Likewise. * tests/ls/rt-1: Likewise. * tests/ls/stat-dtype: Likewise. * tests/ls/stat-failed: Likewise. * tests/ls/stat-free-symlinks: Likewise. * tests/ls/x-option: Likewise. * tests/misc/arch: Likewise. * tests/misc/cat-buf: Likewise. * tests/misc/cat-proc: Likewise. * tests/misc/chcon: Likewise. * tests/misc/csplit: Likewise. * tests/misc/df-P: Likewise. * tests/misc/fmt-long-line: Likewise. * tests/misc/groups-dash: Likewise. * tests/misc/groups-version: Likewise. * tests/misc/head-pos: Likewise. * tests/misc/nl: Likewise. * tests/misc/od-N: Likewise. * tests/misc/od-multiple-t: Likewise. * tests/misc/od-x8: Likewise. * tests/misc/printf: Likewise. * tests/misc/printf-hex: Likewise. * tests/misc/pwd-option: Likewise. * tests/misc/readlink-fp-loop: Likewise. * tests/misc/runcon-no-reorder: Likewise. * tests/misc/seq-long-double: Likewise. * tests/misc/sort-NaN-infloop: Likewise. * tests/misc/sort-benchmark-random: Likewise. * tests/misc/sort-debug-keys: Likewise. * tests/misc/sort-float: Likewise. * tests/misc/sort-merge-fdlimit: Likewise. * tests/misc/sort-unique-segv: Likewise. * tests/misc/stat-hyphen: Likewise. * tests/misc/stat-slash: Likewise. * tests/misc/stdbuf: Likewise. * tests/misc/sum-sysv: Likewise. * tests/misc/tac-2-nonseekable: Likewise. * tests/misc/tac-continue: Likewise. * tests/misc/tr-case-class: Likewise. * tests/misc/truncate-fail-diag: Likewise. * tests/misc/wc-files0: Likewise. * tests/mkdir/selinux: Likewise. * tests/mv/backup-dir: Likewise. * tests/mv/backup-is-src: Likewise. * tests/mv/diag: Likewise. * tests/mv/dir2dir: Likewise. * tests/mv/dup-source: Likewise. * tests/mv/force: Likewise. * tests/mv/hard-verbose: Likewise. * tests/mv/i-link-no: Likewise. * tests/mv/into-self: Likewise. * tests/mv/into-self-2: Likewise. * tests/mv/into-self-3: Likewise. * tests/mv/mv-special-1: Likewise. * tests/mv/part-fail: Likewise. * tests/mv/perm-1: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/mv/trailing-slash: Likewise. * tests/rm/rm1: Likewise. * tests/rm/rm2: Likewise. * tests/rm/cycle: Likewise. * tests/rm/dir-no-w: Likewise. * tests/rm/dir-nonrecur: Likewise. * tests/rm/fail-2eperm: Likewise. * tests/rm/fail-eacces: Likewise. * tests/rm/i-never: Likewise. * tests/rm/inaccessible: Likewise. * tests/rm/interactive-always: Likewise. * tests/rm/interactive-once: Likewise. * tests/rm/isatty: Likewise. * tests/rm/one-file-system: Likewise. * tests/rm/rm3: Likewise. * tests/rm/rm5: Likewise. * tests/rm/unread2: Likewise. * tests/rm/v-slash: Likewise. * tests/sample-test: Likewise. * tests/split/b-chunk: Likewise. * tests/split/fail: Likewise. * tests/split/l-chunk: Likewise. * tests/split/lines: Likewise. * tests/split/r-chunk: Likewise. * tests/split/suffix-length: Likewise. * tests/tail-2/big-4gb: Likewise. * tests/tail-2/follow-name: Likewise. * tests/tail-2/follow-stdin: Likewise. * tests/tail-2/pipe-f: Likewise. * tests/tail-2/pipe-f2: Likewise. * tests/tail-2/start-middle: Likewise. * tests/touch/60-seconds: Likewise. * tests/touch/fail-diag: Likewise. * tests/touch/not-owner: Likewise. * tests/touch/relative: Likewise. 2011-11-22 Jim Meyering tests: use compare, not "diff", in a few stray tests * tests/install/basic-1: Use compare, not diff. * tests/mkdir/p-v: Likewise. * tests/mv/part-fail: Likewise. * tests/rm/rm1: Likewise. * tests/rm/rm2: Likewise. * tests/touch/not-owner: Likewise. 2011-11-20 Jim Meyering maint: revert "build: update gnulib submodule to latest" Don't update to latest from gnulib just yet. This reverts commit 173f4d9bd628fb771eaeca3d2fef97dcd71fedb8. In particular, manywarnings is too aggressive. build: update gnulib submodule to latest maint: make generated THANKS file read-only * Makefile.am (THANKS): Make generated file read-only. doc: clarify ln's --help output * src/ln.c (usage): Use TARGET, not "source" in description. Reported by Michael J Daniel in http://bugs.gnu.org/9896. 2011-11-20 Paul Eggert port to GNU hosts, where getuid and friends can fail * src/groups.c (main): * src/install.c (need_copy): * src/su.c (log_su): * src/test.c (unary_operator): * src/whoami.c (main): Don't assume that getuid and friends always succeed. This fixes the same problem that we recently fixed with 'id'. 2011-11-20 Jim Meyering maint: avoid gitlog-to-changelog diagnostic about unused entries * build-aux/git-log-fix: Comment out two unused entries. Each of those two entries does indicate an error in a commit log, but precedes the cut-off date, so has an actual VC'd ChangeLog entry. I.e., gitlog-to-changelog generates ChangeLog entries since 2008-02, and these two predate that. * ChangeLog-2008: Make the indicated correction. 2011-11-20 Erik Auerswald ln: fix position of --backup values description * src/ln.c (usage): A paragraph describing interactions of -s with -L and -P somehow snuck in between the description of the --backup option and the values used to control it. Fix this by moving the value description up. 2011-11-18 Jim Meyering scripts: rewrite git commit-msg hook in Perl * scripts/git-hooks/commit-msg: Rewrite in perl. This is still a work in progress in that it hard-codes coreutils- specific program names and policies that should be easy to selectively enable or disable without modifying the script. 2011-11-16 Eric Blake sort: clarify wording on -k syntax * src/sort.c (usage): Use KEYDEF instead of POS, and call out the specific OPTS that can occur in KEYDEF. Based on a report by Lars Noodén, http://bugs.gnu.org/10019 2011-11-15 Paul Eggert id: fix bug when euid != ruid * src/id.c (main): Report an error if no args are given and getuid fails, because print_full_info needs ruid. Redo code so that getuid and friends are invoked only when needed; this makes the code easier to follow, and is how I found the above bug. 2011-11-15 Ruediger Meier ls: another reword of generic size note * src/system.h (emit_size_note): Use "unit" rather than "suffix", and move multiplication to example instead of in suffix list. See additional discussion in Bug#9939. 2011-11-15 Eric Blake id: tweak comment * src/id.c (main): Replace confusing use of "etc.". 2011-11-15 Paul Eggert id: handle (uid_t) -1 more portably * src/id.c (GETID_MAY_FAIL): Remove. (main): Check for nonzero errno, rather than having a compile-time GETID_MAY_FAIL guess. Suggested by Roland McGrath in . Also, the old code was incorrect if uid_t was narrower than int. (print_full_info): Remove unnecessary cast to -1. id: undo previous commit, which was done by mistake * src/id.c (GETID_MAY_FAIL, main, print_full_info): Undo previous change. 2011-11-15 Paul Eggert doc: update for ISO/IEC 80000-13 * doc/coreutils.texi (Block size): IEC 60027-2 has been superseded by ISO/IEC 80000-13, so prefer the newer standard but also mention the old. The new standard specifies Zi and Yi, so they are no longer GNU extensions. Fix stale URL to BIPM. 2011-11-14 Paul Eggert id: handle (uid_t) -1 more portably * src/id.c (GETID_MAY_FAIL): Remove. (main): Check for negative return values, not for -1. The old code was incorrect if uid_t was narrower than int, regardless of whether we were on a GNU or a POSIX platform. The new code is simpler and doesn't need GETID_MAY_FAIL. (print_full_info): Remove unnecessary cast to -1. 2011-11-14 Ludovic Courtès id: fail when getuid, getgid, etc. fail, e.g., on GNU/Hurd POSIX-conforming getuid, geteuid, etc. functions cannot fail, but on GNU/Hurd systems and some others, they may. * src/id.c (main) [__GNU__]: Detect and diagnose any such failure. * tests/id/gnu-zero-uids: New file. * tests/Makefile.am (TESTS): Add it to the list. * tests/init.cfg (require_gnu_): New function. 2011-11-13 Nix tests: avoid rare fp failure in du/move-dir-while-traversing * tests/du/move-dir-while-traversing: Boost the mkdir iteration count yet again. 2011-11-13 Jim Meyering maint: adjust git hook to allow "copy: ..." on line 1 of commit message * scripts/git-hooks/commit-msg: Add "copy" to the list of valid command-name-like summary line prefixes. maint: id, groups: use conforming diagnostics * src/groups.c (main): Don't capitalize the first word of diagnostic. * src/id.c (main): Likewise. Reported by Ludovic Courtès. maint: avoid new syntax-check failure due to indentation with TABs * cfg.mk (tbi_2): Exempt pre-applypatch, since it too is from git. 2011-11-12 Jim Meyering maint: install customized git hooks to keep commit logs consistent * bootstrap.conf (buildreq): Copy (with backup) coreutils-supplied git hooks into .git/hooks, to help keep commit logs normalized. maint: add rule to ensure that our commit hook copies are up to date * Makefile.am (check-git-hook-script-sync): New rule -- not used anywhere, because it depends on having very recent git. * scripts/git-hooks/pre-applypatch: New file. maint: sync pre-commit script with git's * scripts/git-hooks/pre-commit (allownonascii): Remove double quotes around $(...) construct, to make this file identical to git's sample hook script. build: update gnulib for fstatat cross-compile improvement maint: adjust the URL that will appear in the generated announcement * cfg.mk (url_dir_list): Use this http://ftp.gnu.org/gnu/$(PACKAGE) for the first link listed in the generated announcement. announce-gen now provides the faster mirror link automatically. ls: plug a per-argument leak Using ls -l on an SELinux-enabled system would leak one SELinux context string per non-empty-directory command-line argument. * src/ls.c (free_ent): New function, factored out of... (clear_files): ...here. Use it. (extract_dirs_from_files): Call free_ent (f), rather than simply free (f->name). The latter failed to free the possibly-malloc'd linkname and scontext members, and thus could leak one of those strings per command-line argument. * THANKS.in: Update. * NEWS (Bug fixes): Mention it. Reported by Juraj Marko in http://bugzilla.redhat.com/751974. 2011-11-12 Paul Eggert * tests/misc/sort-continue: Port to Fedora 15. Redirect with the shell command, not in a separate 'exec'. Without this patch, Fedora 15 x86-64 /bin/sh (i.e., Bash 4.2.10) complained about running out of file descriptors in the shell. * tests/ls/block-size: Make it executable. * src/system.h (emit_size_note): Reword for clarity. See discussion in Bug#9939. ls: -k no longer affects -l's file sizes This fixes an incompatibility with POSIX 2008 and with BSD. Problem reported by Abdallah Clark (Bug#9939) via Alan Curry (Bug#10016). * NEWS: Document this. * doc/coreutils.texi (General output formatting): Document the new -k behavior, and --kibibytes. * src/ls.c (file_human_output_opts): New static var. (long_options, usage): Add --kibibytes. (decode_switches, gobble_file, print_long_format): Implement the new -k behavior. * tests/ls/block-size: New file. * tests/Makefile.am (TESTS): Add it. 2011-11-08 Eric Blake doc: fix typo in sort description * doc/coreutils.texi (sort invocation): Fix typo. 2011-11-05 Jim Meyering build: update gnulib for more openat changes 2011-11-04 Jim Meyering build: do use fstatat and unlinkat modules, now that they're separate * bootstrap.conf (gnulib_modules): Add fstatat and unlinkat. build: update gnulib to pull in openat module separation changes No semantic change. 2011-11-03 Pádraig Brady tests: avoid signal issues in timeout-group These issues were seen on an OpenSuse 10.3 system (kernel 2.6.22.5 x86_64, glibc 2.6.1-18, bash updated to 4.2), and also on a 64 bit SLES system with a 2.6.16 kernel. Both systems had 2 CPUs. There were two issues seen. 1. Occasionally the timeout.cmd shell script would block SIGINT until the sleep command exited. 2. Much less frequently the signal handler in the timeout command itself was ignored, causing SIGALRM to kill the process. * tests/misc/timeout-group: Detect the above two cases, and skip rather than fail. Note only issue 2. causes a failure unless skipped, but we skip for case 1. also, for diagnostic purposes. 2011-11-03 Pádraig Brady tests: fix a race in timeout-group This could cause a false failure, or even an infinite loop in rare circumstances. * tests/misc/timeout-group: Increase the timeouts passed to the timeout command, so that they're effectively not used. Instead the command termination is triggered by the kill commands when everything is in the correct state. Reported by Bernhard Voelker. 2011-11-02 Jim Meyering build: adapt to gnulib's recent openat/fchmodat separation * gnulib: Update to latest, pulling in the openat/fchmodat separation. * bootstrap.conf (gnulib_modules): Add fchmodat, now that gnulib has moved it into its own module. maint: fix git-log typos when generating ChangeLog * gnulib: Update to latest, for new gitlog-to-changelog. * Makefile.am (gen-ChangeLog): Use its new --amend=F option. * build-aux/git-log-fix: New file, with ChangeLog fixes. stat: avoid compilation failure with gnulib's new alignof * src/stat.c: Include , not "alignof.h" for alignof use. scripts: reject references to long-form bug URLs * scripts/git-hooks/commit-msg: Require the normalized/shortened form of bugzilla.redhat.com and bugs.gnu.org bug URLs. 2011-11-01 Pádraig Brady doc: date: mention that the hardware clock might not be set * doc/coreutils.texi (Setting the time): Reorganize slightly and mention that the hardware clock might need to be explicitly updated by the user as is the case on Fedora 16 currently. See http://bugzilla.redhat.com/749516 2011-11-01 Jim Meyering build: adapt to gnulib's recent openat/fchownat separation * bootstrap.conf (gnulib_modules): Add fchownat, now that gnulib has moved it into its own module. * gnulib: Update to latest. 2011-10-30 Jim Meyering build: update gnulib for GNUmakefile fix maint: avoid new "make syntax-check" failure due to stdalign definition * gl/modules/randread (Depends-on): Add stdalign. * gl/lib/randread.c: Include , so we can ... [!_STRING_ARCH_unaligned]: remove definition of stdalign. tests: update gnulib to latest to avoid FP DST-related test failure Otherwise, "make check" would fail after e.g., a CEST-to-CST daylight savings transition. See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28825 tests: doc: fix stale comment in new rm/many-dir-entries-vs-OOM 2011-10-29 Jim Meyering tests: don't make tail's pipe-f2 test take the full 10 seconds * tests/tail-2/pipe-f2: Don't always wait 10 seconds. Before, this test would always wait 10 seconds. Now, it stops early when it detects that tail -f has written output. BTW, the race condition that prompted changing the timeout from 1 second to 10 was that tail -f could be killed by the timeout before producing any output. 2011-10-27 Jim Meyering date: reinstate the --iso-8601 (-I) option We deprecated and undocumented the --iso-8601 (-I) option mostly because date could not parse that particular format. Now that it can, it's time to restore the documentation. * src/date.c (usage): Document it. * doc/coreutils.texi (Options for date): Reinstate documentation. Reported by Hubert Depesz Lubaczewski in http://bugs.gnu.org/7444. build: avoid bootstrap failure when using patch-2.5.8 * gl/modules/tempname.diff: Regenerate to correct bogus offsets and adjust for 1-line offset. Eric Blake reported that this patch failed to apply when using patch-2.5.8. Note that it applies fine using patch-2.6.1. 2011-10-25 Jim Meyering build: do not remove definition of ENODATA, after all * src/system.h (ENODATA): Restore definition. gnulib defines it only on native Windows systems, so removing our definition would have provoked build failure on systems that use it, like FreeBSD. Reported by Bruno Haible in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28739/focus=28795 * gnulib: Update to latest, to get new ENODATA-exempting maint.mk rule. 2011-10-24 Eric Blake doc: NEWS: correct "bug introduced in ..." version number * NEWS: s/7.0/8.0/ 2011-10-24 Jim Meyering rm: update gnulib to get an fts fix for Cygwin+NWFS/NcFsd file systems * NEWS (Bug fixes): Mention it. As far as we know, this fix affects only Cygwin with NWFS or NcFsd file systems. See these: http://git.sv.gnu.org/cgit/gnulib.git/commit/?id=71f13422f3e634 http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28739 http://cygwin.com/ml/cygwin/2011-10/msg00365.html * src/system.h (ENODATA): Remove fall-back definition, now that gnulib provides one. Caught by the sc_prohibit_always-defined_macros syntax-check rule. Also remove now-irrelevant "Don't use bcopy..." comment. 2011-10-23 Jim Meyering maint: add git hook scripts We find it worthwhile to use consistent commit summary prefixes. To that end, the commit-msg script requires that all commits I make start with "$P: " (where $P is one of ~100 programs in coreutils) or one of a few other words, like gnulib tests maint doc build. It allows more than one word, so e.g., "cat tail head: " would also be accepted. Pádraig Brady wrote the initial version, with its 72-column and blank-if-present second line checks. The pre-commit script is the same as the git-supplied sample script, modulo a bug fix and the "exec 1>&2" redirection. * scripts/git-hooks/commit-msg: New file. * scripts/git-hooks/pre-commit: New file. * scripts/git-hooks/applypatch-msg: New file. Verbatim from .sample. * cfg.mk: Exempt two of the new scripts from the no-leading-TABs check, since they're nearly verbatim from git, and we want to stay in sync. Exempt the commit-msg script from the no-"fail=0" check. 2011-10-21 Martial Bornet tail: with -f, use nanosleep (not inotify) on a GPFS file system Because tail's fremote function did not designate GPFS as a remote file system type, tail -f would mistakenly attempt to use inotify, which cannot work with a remote file system. * src/tail.c (fremote): List GPFS as a remote file system type. * NEWS (Bug fixes): Mention it. Reported in http://bugs.debian.org/646022. 2011-10-20 Mike Frysinger build: include man-pages for non-default progs At the moment, things like man/arch.1 are not included in the tarball. This makes perl a requirement if you want to build/install the arch helper. * man/Makefile.am (EXTRA_DIST): Add $(NO_INSTALL_PROGS_DEFAULT:%=%.1). 2011-10-19 Jim Meyering maint: tac: prefer "failed to" diagnostic over "cannot" * src/tac.c: Change wording in diagnostic: "failed to open" seems clearer than "cannot open". tac: do not let failed allocation cause immediate exit * src/tac.c (temp_stream): Don't exit immediately upon failed heap allocation, here. That would inhibit processing of any additional command-line arguments. tac: use only one temporary file, with multiple nonseekable inputs * src/tac.c (temp_stream): New function, factored out of... (copy_to_temp): ...here. (tac_nonseekable): Don't free or fclose, now that we reuse the file. Suggested by Ambrose Feinstein. * THANKS.in: Update. 2011-10-18 Paul Eggert maint: make tac.c slightly cleaner * src/tac.c (copy_to_temp): Now that the template string tacXXXXXX is used in only one place, don't bother using a separate variable. Also, using three unconditional assignments seems slightly clearer. 2011-10-17 Jim Meyering tac: don't leak a file descriptor for each non-seekable input * src/tac.c (tac_nonseekable): Call fclose and free tmp_file after each successful call to copy_to_temp. tac: don't misbehave with multiple non-seekable inputs * src/tac.c (copy_to_temp): Do not reuse the template buffer. Instead, scribble only on a freshly-xstrdup'd copy each time. Free that buffer both here, upon failure, and ... (tac_nonseekable): ...free the buffer in caller, upon success. * tests/misc/tac-2-nonseekable: New file. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it. Reported by Ambrose Feinstein in http://debbugs.gnu.org/9762. maint: tac: remove sole use of sprintf in favor of filenamecat * src/tac.c: Include filenamecat.h. (copy_to_temp): Use filenamecat rather than xmalloc and sprintf. Move some declarations "down" to point of initialization. 2011-10-17 Pádraig Brady maint: speed up make check (vc_exe_in_TESTS) * tests/check.mk (vc_exe_in_TESTS): The main change is to not start a sed process for each file under tests/, which was taking around 2.5s on a 2.1GHz i3-2310M. Also adjust the rule to no longer use temporary files. 2011-10-12 Jim Meyering maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.14 * NEWS: Record release date. 2011-10-12 Pádraig Brady tests: avoid a false failure on systems without inotify * tests/tail-2/follow-name: Exclude the inotify warning from the comparison. Reported by Bruno Haible. 2011-10-09 Jim Meyering build: update gnulib to latest to fix MacOS X 10.5 test link failure Details here: http://thread.gmane.org/gmane.comp.gnu.coreutils.general/1726/focus=1743 rm: do not resort to stat'ing very long names even on deficient systems This change affects only systems that have neither *at function support nor the /proc/self/fd support required to emulate those *at functions. * src/remove.c (write_protected_non_symlink): Call faccessat unconditionally. Thus we no longer need euidaccess_stat, which was the sole function used here to operate on a full relative file name. Remove full_name parameter and update caller. * lib/euidaccess-stat.h: Remove file. * lib/euidaccess-stat.c: Likewise. * m4/euidaccess-stat.m4: Likewise. * po/POTFILES.in: Remove lib/euidaccess-stat.c. * m4/prereq.m4 (gl_PREREQ): Don't require gl_EUIDACCESS_STAT. Prompted by a report from Bruno Haible that the rm/deep-2 test was failing on HP-UX 11.31. See http://thread.gmane.org/gmane.comp.gnu.coreutils.general/1748 tests: skip rather than failing when perl is not available * tests/df/total-verify: Use require_perl_, so that this test is skipped when perl is not available. * tests/rm/deep-2: Likewise, and fix wording in a comment. Reported by Bruno Haible. 2011-10-08 Jim Meyering tests: avoid tail-2/F-vs-missing failure on NFS * tests/tail-2/F-vs-missing: This test would fail about 80% of the time on linux/powerpc when run in an NFS-mounted directory. Reported by Bruno Haible in http://thread.gmane.org/gmane.comp.gnu.coreutils.general/1726/focus=1727 tests: avoid ls/slink-acl test failure on Solaris 10 * tests/ls/slink-acl: Use setfacl's "-m user::r" option rather than less-portable "-m m::r". The latter did not work with Solaris 10's version of setfacl. Reported by Bruno Haible in http://thread.gmane.org/gmane.comp.gnu.coreutils.general/1726/focus=1737 tests: avoid false-positive failures on linux/sparc64 * tests/init.cfg (require_strace_): Detect a version of strace that fails on linux/sparc64 for 64-bit executables. Report and most of the suggested fix from Bruno Haible: http://thread.gmane.org/gmane.comp.gnu.coreutils.general/1726/focus=1728 2011-10-06 Bernhard Voelker build: let bootstrap resort to wget for downloading .po files * bootstrap (download_po_files): Fallback to wget when downloading the .po files via rsync failed. This is necessary to bootstrap behind a strict firewall. 2011-10-05 Jim Meyering doc: clean up NEWS * NEWS: Mention when the sort -g infloop bug was introduced and alphabetize entries. Clarify a sentence in the pwd-improvement entry. tests: add a test to exercise today's ls-lL-vs-ACL bug * tests/ls/slink-acl: New file. * tests/Makefile.am (TESTS): Add it. * tests/init.cfg (require_setfacl_): New function. * gnulib: Update to latest, for file-has-acl changes. * NEWS (Bug fixes): Mention it. See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28538. This ":>k; setfacl -m m::r k; ln -s k s; ls -Log s" should print e.g., -rw-r-----+ 1 0 Oct 5 19:22 s With the ls from coreutils-8.13, it would print this (with "." or nothing in place of the "+"): -rw-r-----. 1 0 Oct 5 19:22 s 2011-10-03 Jim Meyering build: don't use automake's obsolete AM_C_PROTOTYPES macro * m4/jm-macros.m4 (gl_CHECK_ALL_TYPES): Remove use of AM_C_PROTOTYPES, now that automake rejects it. 2011-10-01 Jim Meyering maint: clean up m4 syntax * m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Remove unnecessary backslashes and add quotes around multi-line argument lists. 2011-10-01 Markus Duft build: use getgr*_nomembers functions on Interix Interix provides faster replacements for getgr{gid,nam,ent} where group member information is not fetched from domain controllers. This makes 'id' usable on domain controlled interix boxes. * m4/jm-macros.m4: Check for _nomembers functions. * src/system.h: Redefine function to _nomembers when available. build: accommodate missing setgroups on Interix Add a dummy, non-functional, always-successful replacement setgroups function, to keep the original code untouched and simple. * src/chroot.c (setgroups) [! HAVE_SETGROUPS]: Define. 2011-10-01 Jim Meyering build: stop distributing gzip'd releases; xz is enough * configure.ac (AM_INIT_AUTOMAKE): Add no-dist-gzip. * NEWS (Build-related): Mention that we're dropping .tar.gz. build: update gnulib submodule to latest 2011-10-01 Pádraig Brady doc: mention the recent ls -L "argetm" fix in NEWS * NEWS: Mention the bug fix 2011-10-01 Pádraig Brady ls: fix output of dangling symlinks colored as target This is related to commit b7f2b51c, 2010-01-01, "ls: fix color of broken symlinks colored as target" which didn't handle the --dereference case. The simplest way to reproduce the resultant erroneous "argetm" is as follows: $ ln -s /no-such dangle $ env LS_COLORS=ln=target ls --dereference --color ls: cannot access dangle: No such file or directory argetmdangle This is also an issue with the `tree` utility, reported here: http://bugs.debian.org/586765 * src/ls.c (print_color_indicator): Move the handling of 'ln=target' in $LS_COLORS (color_symlink_as_referent == true) to a higher scope, to handle all cases where type == C_LINK. * tests/misc/ls-misc: Add a test case for the specific issue, and 2 further test cases to verify other code paths in this area. Reported by Jason Glassey. 2011-09-30 Jim Meyering ls: avoid reading beyond end of color indicator At first this looked like a buffer overrun, since there was no test to ensure that the buffer length was 6. However, since the LS_COLORS string is NUL-terminated and since settings within it are separated by ":" there was neither the risk of reading beyond end of buffer nor risk of a false-positive match. * src/ls.c (print_color_indicator): Use color_symlink_as_referent rather than manually comparing against "target" again. * src/system.h (STRNCMP_LIT): Correct description in comment. 2011-09-28 Jim Meyering tests: update gnulib to latest, to fix test link failure 2011-09-27 Jim Meyering sort: avoid a NaN-induced infloop These commands would fail to terminate: yes -- -nan | head -156903 | sort -g > /dev/null echo nan > F; sort -m -g F F That can happen with any strtold implementation that includes uninitialized data in its return value. The problem arises in the mergefps function when bubble-sorting the two or more lines, each from one of the input streams being merged: compare(a,b) returns 64, yet compare(b,a) also returns a positive value. With a broken comparison function like that, the bubble sort never terminates. Why do the long-double bit strings corresponding to two identical "nan" strings not compare equal? Because some parts of the result are uninitialized and thus depend on the state of the stack. For more details, see http://bugs.gnu.org/9612. * src/sort.c (nan_compare): New function. (general_numcompare): Use it rather than bare memcmp. Reported by Aaron Denney in http://bugs.debian.org/642557. * NEWS (Bug fixes): Mention it. * tests/misc/sort-NaN-infloop: New file. * tests/Makefile.am (TESTS): Add it. 2011-09-24 Jim Meyering build: update gnulib submodule to latest maint: avoid new syntax-check failure Pulling in the latest gnulib triggered a new false-positive syntax-check failure. * cfg.mk (exclude_file_name_regexp--sc_prohibit_always-defined_macros): Exempt remove.c; its definitions of DT_UNKNOWN, DT_DIR and DT_LNK are harmless. 2011-09-24 Bernhard Voelker tests: mention new check-expensive/check-very-expensive in test logs * tests/init.cfg: (very_expensive_): Mention toplevel make target, check-very-expensive. (expensive_): Likewise for check-expensive. tests: introduce make targets check-expensive and check-very-expensive * Makefile.am: add shortcuts to run (very) expensive tests. Use "make check-expensive" to run tests with RUN_EXPENSIVE_TESTS=yes, use "make check-very-expensive" to run tests with both RUN_EXPENSIVE_TESTS=yes and RUN_VERY_EXPENSIVE_TESTS=yes. Non-expensive tests are included in all cases. 2011-09-22 Pádraig Brady timeout: handle implicitly created threads On some systems like glibc on GNU/kFreeBSD, a thread is implicitly created when timer_settime() is used. This breaks our scheme to ignore signals we've sent ourselves. * src/timeout.c (send_sig): Change the scheme used to ignore signals we've sent ourselves, to a more robust but perhaps limited scheme of ignoring all signals of a certain type after we've sent that signal to the job. * NEWS: Mention the change in behavior. 2011-09-19 Bruno Haible tests: init.sh: support any non-GNU diff * tests/init.sh (compare): If "diff -c" is supported but "diff -u" is not, use "diff -c". Useful on AIX 6.1, HP-UX 11.31, OSF/1 5.1, Solaris 8. 2011-09-19 Jim Meyering gnulib: update for getcwd fix on systems without openat This fixes a bug in pwd and all getcwd-using applications (for some uses: df, readlink, stat) when run from a directory whose absolute name contains more than PATH_MAX / 3 components. For more details, see http://git.sv.gnu.org/cgit/gnulib.git/commit/?id=f6fe351fc534ae1 * gnulib: Update. * NEWS (Improvements): Mention it. 2011-09-19 Reuben Thomas md5sum: clarify what is meant by binary/text flag. src/md5sum.c: Clarify that we are talking about input mode. doc/coreutils.texi: Ditto. 2011-09-19 Jim Meyering tests: cp-parents: don't let a failing chmod go unnoticed * tests/cp/cp-parents: If somehow a chmod set-up command failed, subsequent tests would fail in a harder-to-diagnose manner. 2011-09-17 Paul Eggert randread: add FIXME comment for RDRAND * gl/lib/randread.c: Add a FIXME comment suggesting how to improve performance by using the RDRAND hardware instruction. 2011-09-16 Pádraig Brady md5sum: handle BSD reversed format checksums * src/md5sum.c (split_3): Detect and handle BSD reversed format checksums. * tests/misc/md5sum-bsd: Add a new test. * tests/Makefile.am: Reference new test. * NEWS: Mention the improvement Suggested by Rimas Kudelis. 2011-09-14 Eric Blake doc: improve description of join's -a option * src/join.c (usage): Mention that -a adds to the overall output, rather than replacing the default output. * THANKS: Update. Reported by Tomas Volka. 2011-09-12 Jim Meyering build: avoid unwarranted failure w/gcc-4.6.1 and --enable-gcc-warnings * configure.ac (gl_GCC_VERSION_IFELSE): Define new macro. (WERROR_CFLAGS): With --enable-gcc-warnings, use it to add -Wsuggest-attribute=pure only with gcc 4.7 or newer. 2011-09-08 Jim Meyering doc: fix typo in test script comment * tests/d_type-check: Fix typo in comment. maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.13 * NEWS: Record release date. build: update gnulib submodule to latest stat: avoid compilation failure on AIX 7.x * src/stat.c (USE_STATVFS): Adjust definition so that it is enabled also on AIX 7.x systems that provide statvfs64 and no statvfs. [USE_STATVFS && ! STAT_STATVFS && STAT_STATVFS64] (STATFS): Define to statvfs64 in that precise case. * m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Adjust the condition here to match the new one in stat.c, to keep them in sync. Reported by Bruno Haible. For details, see http://article.gmane.org/gmane.comp.gnu.coreutils.general/1668 2011-09-07 Bernhard Voelker tests: adjust PATH to include /sbin for mkfs-using tests * tests/init.cfg (require_mkfs_PATH_): New function to test whether mkfs is in PATH, otherwise adding /sbin to PATH. Needed for distributions (OpenSuSE, Solaris) in which sudo does not include /sbin in PATH. * tests/cp/cp-a-selinux: Use require_mkfs_PATH_. * tests/cp/cp-mv-enotsup-xattr: Likewise. * tests/cp/sparse-fiemap: Likewise. * tests/mkdir/writable-under-readonly: Likewise. * tests/rm/read-only: Likewise. 2011-09-07 Jim Meyering tests: avoid false-positive "make check" failure when perl is missing * doc/Makefile.am (sc-lower-case-var): Skip this test when $(PERL) is not usable. Reported by Bruno Haible. cp: update gnulib to get support for NFSv4 ACLs * NEWS (Improvements): Mention the cp-vs-NFSv4-ACL improvement we have inherited via gnulib. For details, see http://article.gmane.org/gmane.comp.lib.gnulib.bugs/28100 and the following messages in that thread. * gnulib: Update to latest, for numerous ACL-related improvements. 2011-09-02 Bruno Haible tests: init.sh: work also with any non-GNU diff that supports -u * tests/init.sh: Relax check for diff -u support. Rather than checking for GNU diff via --version, simply check for support for -u itself. Useful at least on OpenBSD 4.9. 2011-09-02 Jim Meyering tests: remove require-perl script; use function instead * tests/require-perl: Remove file. * tests/Makefile.am (EXTRA_DIST): Remove it from this list. * tests/init.cfg (require_perl_): New function. * tests/misc/pwd-long: Use the new function, not the file. * tests/ls/nameless-uid: Likewise. * tests/misc/sum-sysv: Likewise. tests: cut: exercise distro-added multibyte code paths * tests/misc/cut: Repeat each test using a multibyte locale, if the configure-time test found such a locale. Adjust the tests so that they also accept a slightly different diagnostic that is specific to the MB-patched cut. 2011-09-02 Pádraig Brady doc: describe test control variables * HACKING (Add tests): Mention the variables and default values. * README-release (Pre-release testing): Mention that setting the SHELL variable may be required. Suggested by Bruno Haible. 2011-09-01 Pádraig Brady timeout: fixup previous warning fix * src/timeout.c (settimeout): Fix the previous commit to test errno rather than the return value. tests: split/l-chunk: avoid a portability issue * tests/split/l-chunk: Don't use the `test "$var"` idiom to test that var is set to something as that's not supported by all shells. The new style matches the usage is the rest of the test in any case. Reported by Bruno Haible on AIX 6.1 and 7.1 2011-09-01 Jim Meyering tests: pwd-long: diagnose failure earlier Without this change, we'd get use-of-uninit value warnings and harder-to-diagnose failure down the road. * tests/misc/pwd-long (normalize_to_cwd_relative): Diagnose stat failure. This failed on AIX 6.1 and 7.1. Reported by Bruno Haible. tests: printf-surprise: avoid false-positive failure * tests/misc/printf-surprise: Also accept a strerror-style string after the usual 'printf: write error:' diagnostic prefix. Otherwise, this test would fail on HP-UX 11. Reported by Bruno Haible. 2011-09-01 Bernhard Voelker tests: improve message in 'require_membership_in_two_groups_' function * tests/init.cfg (require_membership_in_two_groups_): Add quotes around the suggested groups for the COREUTILS_GROUPS variable. 2011-09-01 Jim Meyering tests: misc/printf: accommodate alternate behavior * tests/misc/printf: Avoid false positive failure on MacOS X 10.5 due to a slightly differing diagnostic. Reported by Bruno Haible. tests: invoke via "env printf", rather than using an absolute name * tests/misc/printf: This results in more concise diagnostics. 2011-09-01 Pádraig Brady timeout: suppress a redundant warning on some systems * src/timeout.c (settimeout): Don't warn about ENOSYS which is returned on OpenBSD 4.9 at least. Reported by Bruno Haible stdbuf: fix helper lib identification on some platforms * src/stdbuf.c (main): Pass the path of `stdbuf` rather than the command it's running to the search function. This is significant on platforms without /proc/self/exe Reported by Bruno Haible build: avoid the use of strsignal() in split ... which is not available on some platforms, and the replacement currently requires linking with threading libraries. * src/split.c (closeout): Remove the call to strsignal() which is largely redundant anyway as sig2str() is already used to map number to name in the error. Reported by Bruno Haible on AIX 6.1 and 7.1 2011-08-31 Jim Meyering date: support parsing of ISO-8601-with-"T" dates Thanks to an improvement in gnulib's parse-datetime module, commands like this now succeed (output manually indented): $ ./date -u -d 2004-02-29T16:21:42.33+07:00 +%FT%T.%N%z 2004-02-29T09:21:42.330000000+0000 * tests/misc/date: Add a test to exercise the new-in-gnulib parsing of ISO8601-with-"T" dates. * NEWS (New features): Mention it. * gnulib: Update, to pull in this parse-datetime improvement. 2011-08-30 Pádraig Brady build: heap.c: make possible gnulib candidate c89 compatible * gl/lib/heap.c: Move declaration to the top of scope. Reported by Rob McMahon and Wolfgang Steinwender in relation to "Sun WorkShop 6 update 2 C 5.3 Patch 111679-12 2003/05/18" and "GCC 2.95.3" respectively. 2011-08-25 Pádraig Brady timeout: revert signal propagation enhancement This effectively reverts the unreleased commit 5a647a05 * src/timeout.c (main): Don't propagate signals from the monitored process, as on Linux /proc/sys/kernel/core_pattern could still handle them and cause false reports against `timeout` 2011-08-24 Jim Meyering maint: rename a test Lesson: do not include details like "4 million" in a file name. * tests/rm/many-dir-entries-vs-OOM: Renamed from ... * tests/rm/4-million-entry-dir: ...this. * tests/Makefile.am (TESTS): Reflect renaming. tests: adjust the new, very expensive rm test to be less expensive * tests/rm/4-million-entry-dir: Create only 200,000 files, rather than 4 million. The latter was overkill, and was too likely to fail due to inode exhaustion. Not everyone is using btrfs yet. Now that this test doesn't take so long, label it as merely "expensive", rather than "very expensive". Thanks to Bernhard Voelker for pointing out the risk of inode exhaustion. 2011-08-24 Pádraig Brady pr: fix so that LAST_PAGE is honored with -T Ever since the LAST_PAGE functionality was added in commit ed0923a1, 1996-12-05, "Apply big patch (patch-20) from Roland Huebner" it was ignored when -t or -T were specified or when -l <= 10. * src/pr.c (print_page): Increment the current page here. (print_header): Don't increment the current page here. * tests/pr/pr-tests: Add a test case. * NEWS: Mention the fix Reported at http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9347 2011-08-20 Erik Auerswald doc: correct typo in yesterday's NEWS entry: 30GB -> 30MB * NEWS: s/30GB/30MB/ 2011-08-19 Jim Meyering rm, du, chmod, chown, chgrp: use much less memory for large directories For details, see the gnulib commit, http://git.sv.gnu.org/cgit/gnulib.git/commit/?id=47cb657e * tests/rm/4-million-entry-dir: New test. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it. * gnulib: Update to latest to get the required fts fixes. 2011-08-13 Bernhard Voelker maint: remove empty statement after jump label * src/head.c (elide_tail_bytes_pipe): Remove the empty statement, ";" after a jump label; it is needed only when a declaration follows. * src/kill.c (main): Likewise. * src/od.c (main): Likewise. * src/paste.c (collapse_escapes): Likewise. * src/printf.c (print_formatted): Likewise. 2011-08-12 Paul Eggert pathchk: port to hosts where mbstate_t is replaced This problem was discovered when trying to build git coreutils on Solaris 8 sparcv9 with Sun C 5.8: the 3rd argument to mbrlen was of type int * (a pointer to the gnulib replacement mbstate_t) but the system mbrlen wants the system mbstate_t *. * bootstrap.conf (gnulib_modules): Add mbrlen. * src/pathchk.c (mbrlen, mbstate_t) [!(HAVE_MBRLEN && HAVE_MBSTATE_T)]: Remove macros, which are wrong now that gnulib supplies replacements for mbstate_t and mbrlen. bootstrap: use latest gnulib bootstrap, gettext * bootstrap: Sync from gnulib. This removes an obsolescent gettext.m4 patch, along with some other changes that do not seem to affect coreutils. * bootstrap.conf (gnulib_modules): Use gettext, not gettext-h. Current gnulib gettext seems to work without needing special hacking. * configure.ac (AM_GNU_GETTEXT_VERSION): Now 0.18.1, not 0.17. * gnulib: Update to latest. 2011-08-11 Jim Meyering maint: use gnulib's new largefile modulue * bootstrap.conf (gnulib_modules): Add largefile. This is useful to Mac OS X 10.5 users if/when configure is generated using autoconf prior to v2.68-80-gdb2f2e0. * gnulib: Update to latest. 2011-08-08 Jim Meyering tests: avoid lack-of-support du test failure on HP-UX 11.31 * tests/du/inaccessible-cwd: Skip this test on systems like HP-UX 11.31 that lack both the *at functions and the /proc/self/fd-based support we might have used to emulate them. Reported by Bruno Haible in http://debbugs.gnu.org/8846 join: with --check-order print offending file name, line number and data * src/join (g_names): New global (was main's "names"). (main): Update all uses of "names". (line_no[2]): New globals. (get_line): Increment after reading each line. (check_order): Print the standard "file name:line_no: " prefix as well as the offending line when reporting disorder. Here is a sample old/new comparison: -join: file 1 is not in sorted order +join: in:4: is not sorted: contents-of-line-4 * tests/misc/join: Change the two affected tests to expect the new diagnostic. Add new tests for more coverage: mismatch in file 2, two diagnostics, zero-length out-of-order line. * NEWS (Improvements): Mention it. Suggested by David Gast in http://debbugs.gnu.org/9236 maint: use xcalloc rather than xmalloc+memset (no semantic change) * src/join.c (init_linep): Use xcalloc, not xmalloc+memset. maint: add copyright notice to init.cfg * tests/init.cfg: Add copyright. Suggested by Stefano Lattarini. maint: prevent accidental future use of the old shell function name This is especially important for an error-handling shell function like this that is actually called only rarely. * cfg.mk (sc_prohibit_framework_failure): New rule, to prevent use of the old name. 2011-08-08 Stefano Lattarini tests: complete the renaming framework_failure -> framework_failure_ These changes were mostly mechanical, made by running the following command: git grep -lw framework_failure | grep -v ChangeLog \ | xargs perl -pi -e 's/\b(framework_failure)\b/${1}_/' and then editing init.cfg and `tests/cp/cp-a-selinux' by hand. * tests/init.cfg (framework_failure): Remove, `framework_failure_' from init.sh should be used instead in the tests. Remove now-obsolete "FIXME" comment. (is_local_dir_, require_strace_, require_membership_in_two_groups_, require_sparse_support_, skip_if_mcstransd_is_running_, mkfifo_or_skip_) Use `framework_failure_', not `framework_failure'. * Many test scripts: Likewise. 2011-08-08 Paul Eggert mktemp: stir in enough entropy (Bug#6683) * gl/lib/tempname.c.diff (gen_tempname_len): Use x_suffix_len bytes' worth of entropy, not 8 bytes. 2011-08-04 Stefano Lattarini tests: remove obsolete 'error_' shell function * tests/init.cfg (framework_failure, getlimits_): Use 'fatal_' instead of 'error_'. (error_): Delete, it's not used anymore (and one is anyway advised to use 'fatal_' instead). Update heading comments. * tests/shell-or-perl (error_): Renamed ... (fatal_): ... to this, for consistency. Also, add a useful comment. 2011-07-31 Pádraig Brady doc: mention the new mirroring behavior of cp -au * NEWS: Mention the change in behavior. * doc/coreutils.texi (cp invocation): Likewise. 2011-07-31 Jim Meyering maint: accommodate old-NEWS update * cfg.mk (old_NEWS_hash): Update, to accommodate 6.12 addition. Without this change, "make syntax-check" would fail. 2011-07-31 Paul Eggert * NEWS: Say that 6.12 preserved ns-resolution timestamps. 2011-07-29 Jim Meyering build: require gnulib's fclose module * bootstrap.conf (gnulib_modules): Explicitly use the fclose module. This is required, now that gnulib's close module no longer depends on fclose. Without this module, we would be exposed to fclose bugs affecting at least glibc 2.13 and FreeBSD. Reported by Bernhard Voelker. Suggested by Eric Blake. 2011-07-29 Jim Meyering build: update gnulib, for "make syntax-check" fix Without the recent maint.mk fix, "make syntax-check" would fail like this: src/dd.c:# define SA_RESETHAND 0 src/ls.c:# define SA_RESTART 0 src/timeout.c:# define SA_RESTART 0 maint.mk: define the above via some gnulib .h file make: *** [sc_prohibit_always-defined_macros] Error 1 2011-07-27 Ivan Sichmann Freitas doc: add a vim indentation example HACKING: add a vim example showing how to configure it to follow GNU indentation in coreutils source files. 2011-07-27 Pádraig Brady maint: copy: refactor hard link creation * src/copy.c (create_hard_link): A new function refactored from existing code. (copy_internal): Call the new function from all 3 locations that create hard links. * tests/cp/same-file: Amend to match the adjusted diagnostic. tests: cp/preserve-link: test all relevant paths * tests/cp/preserve-link: Add test cases for when a missing link in the destination tree is encountered first and second. Also add cases for old and new separate files in the destination tree, both to make the clobbering behavior explicit, and to test any changes in this area in future. 2011-07-26 Jim Meyering doc: mention cp's dir-permissions fix * NEWS (Bug fixes): Mention yesterday's dir-permissions fix. maint: use consistent style in C and test scripts * src/copy.c (copy_internal): Adjust formatting style to conform with guidelines in HACKING: put braces around two one-line "else" blocks. * tests/cp/existing-perm-dir: Use $(...), not `...`, and stat rather than ls+cut to get the mode string. mode=$(stat --p=%A dst/dir) 2011-07-25 Paul Eggert cp: don't mishandle existing dir dest permissions (Bug#9170) * src/copy.c (copy_internal): If we don't create the directory, then we cannot have omitted permissions. Problem and trivial fix reported by Eric Lammerts. * tests/Makefile.am (TESTS): Add cp/existing-perm-dir. * tests/cp/existing-perm-dir: New file. 2011-07-25 Jim Meyering cp -up: preserve all hard links * src/copy.c (copy_internal): With --update (-u), this function would return early once it found that the destination is not older than the source, *without* recording the source-dev/ino--to--dest_name mapping. That mapping is required in order to preserve src hard links in the destination tree, so when using cp with --update and --preserve=links (perhaps via -p or -a), cp could fail to preserve one hard link per inode when at least one of the hard-linked names already exists in the destination tree. Reported by Odd Harry Mannsverk in http://debbugs.gnu.org/8419. * tests/cp/preserve-link: New file. Exercise the flaw/fix. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it. 2011-07-25 Pádraig Brady timeout: support sub-second timeouts * src/timeout.c (settimeout): A new function to convert from a floating point duration and call alarm() or timer_settime() if that's available. (parse_duration): Return a double rather than unsigned int. (usage): Mention floating point is supported. (main): Pass the double to settimeout() rather than calling alarm() directly with the parsed int. (cleanup): Likewise. * doc/coreutils.texi (timeout invocation): Say floating point timeouts now supported, and mention the caveat with resolution. * bootstrap.conf: Include the timer-time gnulib module. * tests/misc/timeout-parameters: Add a test with nanoseconds. * NEWS: Mention the improvement. 2011-07-25 Jim Meyering build: update gnulib to fix a build warning/error in a test program 2011-07-24 Jim Meyering df: support partitions larger than 4 TiB on MacOS >= 10.5 & AIX >=5.2 This change derives from improvements to gnulib's fsusage module. * NEWS (Improvements): df now supports disk partitions larger than 4 TiB on MacOS X 10.5 or newer and on AIX 5.2 or newer. Alphabetize entries. * gnulib: Update to latest. 2011-07-22 Paul Eggert dd, shred: use fdatasync only if declared * m4/jm-macros.m4 (coreutils_MACROS): Use fdatasync only if declared. MacOS X 10.7 has an fdatasync that is not declared, and is rumored to be ineffective. (Bug#9141) 2011-07-20 Mike Frysinger dircolors: add screen.Eterm terminal type * src/dircolors.hin: Add screen.Eterm. Reported by Kfir Lavi 2011-07-20 Pádraig Brady maint: remove a redundant call to gl_CLOCK_TIME * m4/jm-macros.m4: Remove gl_CLOCK_TIME as it's already done by the gettime gnulib module. 2011-07-20 Pádraig Brady unexpand: fix misalignment when spaces span a tabstop The following dropped the space from the first field printf "1234567 \t1\n" | unexpand -a Note POSIX says that spaces should not precede tabs. Also a single trailing space should not be converted if the next field starts with non blank characters. So we enforce those rules too, with this change. * src/unexpand.c (unexpand): Implement as per POSIX rules. * tests/misc/unexpand: Add tests, and adjust existing tests as per POSIX rules. * NEWS: Mention the fix. Reported by Hallvard B Furuseth 2011-07-17 Paul Eggert * NEWS: Mention fix for Bug#9098. timeout: add regression test (Bug#9098) * tests/misc/timeout: Check that 'timeout' is not confused when starting off with a child. 2011-07-16 Paul Eggert timeout: treat seconds counts like 'sleep' does Treat fractions as a request to round up to the next representable value, and treat out-of-range values as maximal ones. This is consistent with how "sleep" works. And this way, "timeout 999999999999999999d FOO" and "timeout 4.5 foo" are more likely to do what the user wants. * src/timeout.c: Include c-strtod.h and xstrtod.h, not xstrtol.h. (apply_time_suffix): Change it to the way sleep.c's time_suffix does things. Maybe this function (identical in both programs, other than its name) should be moved to a library? (parse_duration): Return a maximal value on overflow. Return unsigned int, not unsigned long. Allow fractions, which round up to the next integer value. * tests/misc/timeout-parameters: Adjust tests to match new behavior. Add a very large number. Fix capiTalization in comments. 2011-07-16 Paul Eggert * src/timeout.c (main): Use waitpid, not wait (Bug#9098). Reported by Andreas Schwab. * src/timeout.c (SA_RESTART): Define to 0 if not defined. 2011-07-16 Paul Eggert timeout: port to NonStop (Bug#9077) * src/timeout.c (SA_RESTART): Define to 0 if not defined. (main): Don't assume signal handling uses SA_RESTART. ls: port to NonStop (Bug#9076) * src/ls.c (SA_RESTART): Define to 0 if not defined. dd: port to NonStop (Bug#9076) * src/dd.c (SA_RESETHAND): Define to 0 if not defined. csplit: don't prematurely terminate cleanup (Bug#9076) * src/csplit.c (interrupt_handler): Reset signal to SIG_DFL after deleting the files, so that a second interrupt won't prematurely terminate cleanup. (main): Don't use SA_NODEFER | SA_RESETHAND, as that might allow premature termination of cleanup. Also, this ports better to platforms like NonStop, which don't ahve SA_RESETHAND. * src/dd.c: Remove obsolete comments re POSIX. 2011-07-15 Pádraig Brady build: avoid a st_blksize compile failure on some systems * src/stat.c (print_stat): Use ST_BLKSIZE() rather than accessing st_blksize directly, which is not present on NonStop at least. Reported by Joachim Schmitz. build: avoid a fiemap compile failure on some systems * src/fiemap.h (struct fiemap): Adjust the previous change to the fiemap_extents array, which would also require changes to the sizeof calculations in extent_scan_read(). Instead, only declare the fiemap_extents zero length array on linux, which is the only platform that references this member. This avoids a compilation failure on systems that don't support this non standard construct. We don't use the equivalent C99 flexible array construct so as to have maximum portability. * src/extent-scan.c: Cleanup. Remove a redundant #ifndef. 2011-07-15 Paul Eggert * src/fiemap.h (struct fiemap.fm_extents): Change size to 1. This is for portability to non-GCC C89 and C99 compilers. Original problem, on NonStop, reported by Joachim Schmitz in . 2011-07-14 Bernhard Voelker maint: fix warning 'possible use of "=" where "==" was intended' * src/mktemp.c: maint: avoid warning by using the comma operator rather than an always-true conditional (as suggested by Eric Blake). Reported by Joachim Schmitz in http://debbugs.gnu.org/9064. 2011-07-13 Benoît Knecht doc: describe the file permissions set by mktemp * src/mktemp.c (usage): As above, for --help. Reported by Jordi Pujol in http://bugs.debian.org/551093. Wording improvments from Eric Blake. 2011-07-13 Benoît Knecht doc: note the order in which wc counts are printed This information has already been added to the Texinfo manual, but was missing from the --help output. * src/wc.c (usage): As above, for --help. Reported by Vincent Lefevre in http://bugs.debian.org/395430. 2011-07-12 Jim Meyering build: update gnulib submodule to latest 2011-07-12 Eric Blake build: list makeinfo 4.13 as a build-from-git requirement * bootstrap.conf (buildreq): List 4.13 as minimum makeinfo version. Prompted by Joachim Schmitz's report in http://debbugs.gnu.org/9050. 2011-07-11 Benoît Knecht dircolors: highlight .webm multimedia files * src/dircolors.hin: Add .webm multimedia files. Suggested by Josh Triplett in http://bugs.debian.org/582403. 2011-07-08 Jim Meyering maint: add syntax-check rule to prohibit "."-terminated "SEE ALSO" * cfg.mk (sc_prohibit_man_see_also_period): Prohibit a period at the end of the first line after a "SEE ALSO" marker in man/*.x. With this, we shouldn't have to make any more changes like those in today's commit, f2dabd68. 2011-07-08 Pádraig Brady doc: list all new file system types recognized by stat -f NEWS (Improvements): Mention the MQUEUE and PSTOREFS file systems, recognized as of commit 171e1b98. 2011-07-08 Benoît Knecht doc: don't terminate SEE ALSO sections with a period man-pages(7) explicitly says about SEE ALSO sections: "Do not terminate this with a period." This is also in line with all the other man pages in coreutils. * man/cat.x: Remove period at the end of the SEE ALSO section. * man/tac.x: Likewise. 2011-07-08 Pádraig Brady timeout: handle signals more transparently * m4/jm-macros.m4: Define HAVE_SETRLIMIT. * src/timeout.c: If the child exited with a signal, raise that signal to the timeout process itself, so that callers may also see the signal status. Use setrlimit to disable core dumps for the timeout process, which would be generated by some signals. timeout: support cascaded timeouts * src/timeout.c (cleanup): Send signals directly to the child in case it has started its own process group (like a cascaded timeout command would for example). * test/misc/timeout-group: Add a test case. * NEWS: Mention the fix. 2011-07-08 Pádraig Brady timeout: add --foreground to support interactive commands Or more accurately, commands not started from the shell prompt, that are interactive, or need to receive Ctrl-C etc. from the terminal. * doc/coreutils.texi (timeout invocation): Document --foreground. * src/timeout.c (main): Set the foreground flag and don't create a separate group. (cleanup): Only send a signal directly to the monitored command when the foreground flag is set. (usage): Describe --foreground. * tests/misc/timeout-group: Add a new test. * tests/Makefile.am: Reference new test. NEWS: Mention the new option. Reported by Shay Shimony Analysis by Alan Curry Fix suggested by Paul Eggert 2011-07-08 Benoît Knecht doc: note that cp -l creates _hard_ links This fact was already noted in the Texinfo manual, but not in the output of --help. * src/cp.c (usage): As above, for --help. Reported by Jari Aalto in http://bugs.debian.org/294327. 2011-07-07 Jim Meyering tests: exercise md5sum's new --strict option * tests/misc/md5sum: Exercise new --strict option. 2011-07-07 Patrick Schoenfeld md5sum, sha1sum, etc: accept new option: --strict Use this new option with --check when the input is expected to consist solely of checksum lines. With only --check, an invalid line evokes a warning, but the program can still exit successfully. With --strict, any invalid line makes the program exit non-zero. * src/md5sum.c (strict, STRICT_OPTION): Declare/define. (long_options): Add "strict". (usage): Describe --strict. (digest_check): Count improperly_formatted lines, too, and use that number and the global "strict" to determine the return value. (main): Handle STRICT_OPTION. Reject --strict without --check. * doc/coreutils.texi: Describe it. * NEWS (New features): Mention it. 2011-07-07 Benoît Knecht doc: note date's %k, %l are space-padded and equivalent to %_H and %_I * src/date.c (usage): As above, for --help. * doc/coreutils.texi (Time conversion specifiers): Likewise. Reported by Britton Leo Kerin in http://bugs.debian.org/115833. 2011-07-07 Jim Meyering stat: recognize GPFS as a file system type * src/stat.c (human_fstype) [S_MAGIC_GPFS]: Add a case, to handle GPFS_SUPER_MAGIC/0x47504653. Prompted by this discussion: http://thread.gmane.org/gmane.comp.sysutils.autoconf.general/14007 * NEWS (Improvements): Mention it. 2011-07-02 Jim Meyering maint: use "const" and "pure" function attributes where possible * configure.ac (WARN_CFLAGS): Add -Wsuggest-attribute=const, -Wsuggest-attribute=pure and -Wsuggest-attribute=noreturn. (GNULIB_WARN_CFLAGS): But do not add them here... yet. * src/chown-core.h (chopt_free, uid_to_name): Add function attribute(s). * src/copy.c (is_ancestor, valid_options): Likewise. * src/copy.h (chown_failure_ok): Likewise. * src/dd.c (operand_matches, operand_is): Likewise. * src/df.c (selected_fstype, excluded_fstype): Likewise. * src/expr.c (null looks_like_integer): Likewise. * src/md5sum.c (hex_digits): Likewise. * src/od.c (get_lcm): Likewise. * src/pathchk.c (component_start, component_len): Likewise. * src/pinky.c (count_ampersands): Likewise. * src/pr.c (cols_ready_to_print): Likewise. * src/ptx.c (search_table): Likewise. * src/sort.c (find_unit_order): Likewise. * src/stty.c (mode_type_flag, string_to_baud, baud_to_value): Likewise. * src/system.h (gcd, lcm): Likewise. * src/tr.c (is_char_class_member, look_up_char_class): Likewise. (star_digits_closebracket): Likewise. * src/uniq.c (find_field): Likewise. * src/wc.c (compute_number_width): Likewise. * lib/xfts.h (cycle_warning_required): Likewise. * gl/lib/randint.h (randint_get_source): Likewise. * gl/lib/randperm.c (ceil_lg): Likewise. * gl/lib/randperm.h (randperm_bound): Likewise. * lib/strnumcmp.h (strintcmp): Likewise. buffer_lcm: declare with _GL_ATTRIBUTE_CONST * lib/buffer-lcm.h (buffer_lcm): Use _GL_ATTRIBUTE_CONST. * lib/buffer-lcm.c: Include . 2011-07-01 Pádraig Brady doc: detail the effect of disabling input buffering with stdbuf * docs/coreutils.texi (stdbuf invocation): Expand on the different reasons for disabling buffering on input and output. 2011-07-01 Bruno Haible doc: mention the restrictions for stdbuf more prominently * doc/coreutils.texi (stdbuf invocation): List the contraints on the command being controlled, up front. 2011-06-25 Jim Meyering doc: improve ls --help grammar * src/ls.c (usage): Improve grammar. Reported by Peng Yu. doc: clarify an improvement from coreutils-7.0 * NEWS (7.0 Improvements): Mention the command: "ls -1U". * cfg.mk (old_NEWS_hash): Update. maint: don't use gnulib's pathmax module; define PATH_MAX if needed * bootstrap.conf (gnulib_modules): Remove pathmax. * src/system.h: Don't include "pathmax.h". (PATH_MAX) [!PATH_MAX]: Define to 8192. Defining it to a constant is preferable to using a definition from pathmax.h that might expand to pathconf ("/", _PC_PATH_MAX). Prompted by discussion leading to: http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/27183/focus=27269 build: bootstrap: remove obsolete gettext-related file exclusions * bootstrap.conf: Don't bother to exclude gettext/intl-related .m4 files. That exclusion is no longer necessary. 2011-06-24 Pádraig Brady stat: recognize MQUEUE and PSTOREFS file systems * src/stat.c (human_fstype): Add magic numbers for PSTOREFS and MQUEUE. 2011-06-22 Bernhard Voelker tests: stat-free-color: do not count stat calls before main * tests/ls/stat-free-color: The system may perform additional stat calls upon loading (seen on OpenSuSE-11.4). Count only the number of stat calls compared to --help. This also reduces back to "1" the number of expected calls, effectively reverting part of 2011-06-01 commit, ccf2d9a4. 2011-06-21 Bernhard Voelker tests: cp/sparse-fiemap: use "head -n99" in place of "head -99" * tests/cp/sparse-fiemap: Use "head -n99" in place of "head -99". The latter is officially obsolete. 2011-06-20 Jim Meyering tests: init.sh: use "sed 1q" in place of "head -1" * tests/init.sh (warn_): Use "sed 1q" in place of "head -1". The latter is officially obsolete but more portable than "head -n1". Reported by Bernhard Voelker. maint: update THANKS.in * THANKS.in: Remove Stefano's name. 2011-06-20 Bernhard Voelker tests: improve init.sh by removing w2_ * tests/init.sh (w2_): Remove, moving contents into... (warn_): ...here. Call self from subshell when IFS must be changed. 2011-06-19 Stefano Lattarini tests: avoid extra forks in the testsuite * tests/shell-or-perl: Prefer the `read' builtin over `grep' to look at the shebang line of test scripts. Since `read' is a special builtin, it might abort the whole program upon failures, so add extra sanity checks, verifying that the test script exists and is readable, before trying to read from it. 2011-06-19 Stefano Lattarini tests: make test runner a script, not a shell function This change implements a more correct and idiomatic use of the features of the Automake-provided 'parallel-tests' harness. Moreover, this change is required in order for the testsuite to continue to work with the new testsuite harness that is planned to be introduced in Automake 1.12 (which, as of the writing date, is still under development and in alpha state). * tests/shell-or-perl: New auxiliary script. * tests/Makefile.am (EXTRA_DIST): Distribute it. * tests/check.mk (TESTS_ENVIRONMENT): Remove definition of the `shell_or_perl_' shell function, whose code has been moved in the new script above (with a few improvements and extensions). Do not use it to run the test scripts. (LOG_COMPILER): New, properly invoking `shell-or-perl'. 2011-06-19 Jim Meyering stdbuf: fix automake variable name to work with cutting edge automake * src/Makefile.am (pkglibexec_PROGRAMS): Rename from pkglib_PROGRAMS. The latter is invalid. Without this change, automake v1.11-373-g9ca6326 and newer (on master) would fail with this: `pkglibdir' is not a legitimate directory for `PROGRAMS' This changes the default installation directory of libstdbuf.so from $prefix/lib/coreutils/ to $prefix/libexec/coreutils/ * src/stdbuf.c (set_LD_PRELOAD): Search in PKGLIBEXECDIR, not PKGLIBDIR, since that's where we install libstdbuf.so. Do not search in "", the system default search path. 2011-06-19 Pádraig Brady maint: avoid a false positive syntax check * cfg.mk (sc_strftime_check): Skip the check when there is no info to compare against. Reported by Stefano Lattarini 2011-06-19 James Youngman maint: typo: insert omitted word in test comment * tests/misc/sort-spinlock-abuse: Fix typo: s/"very expensive" are/"very expensive" tests are/ 2011-06-18 Stefano Lattarini maint: fix typo in comment in configure.ac * configure.ac ($MAN): Fix typo in explanatory comment. 2011-06-18 Jim Meyering tests: sort-debug-keys: fix a bug with translated diagnostics Ensure that English diagnostics are emitted even when using French sorting rules. * tests/misc/sort-debug-keys: Unset LC_ALL and set LC_COLLATE, LC_CTYPE and LC_NUMERIC to the fr_FR.UTF-8 locale, while setting LC_MESSAGES=C. Reported by Stefano Lattarini. 2011-06-17 Pádraig Brady maint: remove duplicate names from THANKS * .mailmap: Merge email addresses * THANKS.in: Remove a duplicate name Reported by Stefano Lattarini 2011-06-17 Jim Meyering maint: use modules/tempname.diff file, not a replacement; update gnulib Using a .diff is much more maintainable. Otherwise, changes in the gnulib module description file may not be noticed and merged promptly and may even result in subtle errors. Luckily, this time, the failure to propagate gnulib's changes to modules/tempname resulted only in an obvious link failure. * gl/modules/tempname: Remove file. * gl/modules/tempname.diff: Use a .diff file instead. * gnulib: Update submodule to latest. tests: avoid sort-spinlock-abuse false positive under heavy load * tests/misc/sort-spinlock-abuse: Classify as "very expensive" to avoid unwarranted failure once and for all. tests: remove skip_test_ function; use new skip_ instead * tests/init.cfg (skip_test_): Remove function. Use skip_ in place of skip_test_ everywhere else. * cfg.mk (sc_prohibit_skip_): Remove rule. * tests/**: Use skip_, not skip_test_, everywhere. tests: make init.sh's warn_ emit to both the tty and the log file * tests/init.sh (warn_): When $stderr_fileno_ != 2, emit the diagnostic to both the tty and the log file. tests: use printf, not echo in init.sh's warn_ function * tests/init.sh (warn_): Use printf, not echo. The latter would misbehave when given strings containing a backslash or starting with e.g., -n. James Youngman suggested setting IFS. 2011-06-14 Jim Meyering tests: accommodate HP-UX and ksh-derived shells Running "make check" normally prints a diagnostic to the outermost stderr (usually a tty) to explain why a test is skipped. It did this by redirecting FD 9 to stderr (via "exec 9>&2") before invoking the shell script. Shell scripts write skip-explanation to FD 9 via init.sh's skip_ function. However, with ksh and HP-UX's /bin/sh, the effects of "exec 9>&2" are canceled upon fork-and-exec, so we would get a "Bad file number" diagnostic and no skip explanation on those systems. * tests/check.mk (TESTS_ENVIRONMENT): Redirect more portably, via "$(SHELL) 9>&2", rather than the prior "exec 9>&2; $(SHELL) ..." Actually, we use "shell_or_perl_ 9>&2", to make this effective also for the perl-based tests. * tests/init.sh (stderr_fileno_): Update the advice in comments. See http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/22488 for lots of discussion. Stefano Lattarini suggested the solution of putting "9>&2" after the command. Reported by Bruno Haible. 2011-06-13 Jim Meyering init.sh: sync from gnulib * tests/init.sh: Sync recent changes from gnulib. maint: revert previous commit Revert "init.sh: accommodate shells for which 1>&$stderr_fileno_ fails" This reverts commit 6fb9aeedd1b858a61d5cbf7f15782adf29ff733a. That change did not solve the problem. For details, see http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8846#74 init.sh: accommodate shells for which 1>&$stderr_fileno_ fails * tests/init.sh (warn_): Use eval to work around a bug in some shells, like those of Solaris 10 and HP-UX 11.11. Improved by Stefano Lattarini. doc: add NEWS items for recent gnulib fixes * NEWS (Improvements): Mention the new HP-UX 11.11 ACL support. (Build-related): Mention the cc/HP-UX 11.11 build fix. tests: avoid sort-spinlock-abuse false positive under heavy load * tests/misc/sort-spinlock-abuse: This test would frequently fail when run on a system under heavy load. Increase duration and limit. 2011-06-13 James Youngman maint: use stat-size module from gnulib * gnulib: Update to latest. * src/system.h: Definitions of ST_* macros have moved into the gnulib module stat-size (specifically, the header file stat-size.h), so remove them from here. * src/truncate.c: Include stat-size.h. * src/stat.c: Likewise. * src/shred.c: Likewise. * src/ls.c: Likewise. * src/du.c: Likewise. * src/ioblksize.h: New file. Move definition of io_blksize out of system.h so that system.h does not have to include stat-size.h. * src/cat.c: Include ioblksize.h. * src/split.c: Likewise. * src/copy.c: Include both stat-size.h and ioblksize.h. * src/Makefile.am (noinst_HEADERS): Add ioblksize.h. 2011-06-13 Pádraig Brady tests: avoid a false failure on HPUX systems * tests/dd/nocache: Relax the test, as the system may return various errors from posix_fadvise(). HPUX 11.31 returns ENOTTY for example. Reported by Bruno Haible 2011-06-11 Jim Meyering tests: inotify-rotate: avoid false positive under heavy load * tests/tail-2/inotify-rotate: Increase timeout from 10s to 40s to avoid load-induced false positive. 2011-06-09 Pádraig Brady maint: remove unneeded includes Remove unneeded includes as reported by: http://code.google.com/p/include-what-you-use/ * src/cp-hash.c: Remove unused include. * src/dd.c: Likewise. * src/du.c: Likewise. * src/head.c: Likewise. * src/kill.c: Likewise. * src/ls.c: Likewise. * src/stdbuf.c: Likewise. * src/timeout.c: Likewise. * src/truncate.c: Likewise. 2011-06-09 Pádraig Brady doc: add examples to date --help * src/date.c (usage): Add examples for TZ handling, and "seconds since epoch" parsing, neither of which was mentioned in the man page until now. * THANKS.in: Add Rick. Suggested by Rick Stanley. 2011-06-04 Jim Meyering build: require at least 2-year old autoconf-2.64 (was 2.62) * configure.ac: Require autoconf-2.64, which is nearly two years old. * src/system.h (emit_ancillary_info): Use PACKAGE_URL, now that we require autoconf-2.64. maint: remove now-spurious curly braces * src/chown-core.c (restricted_chown): Remove FIXME comment and superfluous curly braces. 2011-06-01 Jim Meyering tests: stat-free-color: accommodate stat of /selinux on rawhide * tests/ls/stat-free-color: This test recently began to fail on rawhide because dynamic library start-up code now stats "/selinux", making the total number of calls 2 rather than the prior 1. Create two more dangling symlinks, so that any erroneous stat- or lstat-calling code will get at least those three. 2011-06-01 Marek Polacek yes.c: do not use exit after error I think it would be better to exit through the error() and not to call the exit() after the error(). This way we can get rid of one function call (and curly brackets). * src/yes.c (main): Exit through the error(), remove exit() call after error(). 2011-06-01 Jim Meyering tail: fix an inconsequential bug spotted by coverity * src/tail.c (start_bytes): Increase *READ_POS (not READ_POS) by the number of bytes read. This is a real bug that happens to have no consequence in practice. First, this code is exercised only when tailing-forever a non-regular file by bytes, and with a start-relative offset, e.g., "mkfifo f; tail -f -c +3 f", but even then, the invalid READ_POS value does not influence how tail works. It is stored in the File_spec.size member, but that member is not used at all in tail_forever_inotify, and in tail_forever, it is used only when the File_spec refers to a regular file. 2011-05-31 Paul Eggert * doc/coreutils.texi (sort invocation): I/0 -> I/O (sr#107504) 2011-05-29 Jim Meyering maint: remove unnecessary gnulib .diff file * gl/modules/getloadavg.diff: Remove file. It stopped being useful back in February. * Makefile.am (EXTRA_DIST): Remove it. maint: placate -Wsign-compare when it's non-invasive * src/stdbuf.c: Declare loop index to be unsigned. 2011-05-28 Jim Meyering ls: placate gcc-4.7.0's -Wstrict-overflow * src/ls.c (enum parse_state): Define. (parse_ls_color): Use enum names in place of constants, thus avoiding the offending -1. maint: remove useless (off_t) cast of lseek arg * src/wc.c (wc): Remove unnecessary cast. * src/head.c (elide_tail_bytes_file, elide_tail_lines_file): Likewise. * src/tac.c (tac_seekable, tac_file): Likewise. tests: move tests/misc/split-* into tests/split/... * tests/split/suffix-length: Rename from tests/misc/split-a. * tests/split/b-chunk: Rename from misc/split-bchunk. * tests/split/fail: Rename from tests/misc/split-fail. * tests/split/lines: Rename from tests/misc/split-l. * tests/split/l-chunk: Rename from tests/misc/split-lchunk. * tests/split/r-chunk: Rename from tests/misc/split-rchunk. * tests/Makefile.am (TESTS): Reflect renaming. 2011-05-28 Pádraig Brady chown,chgrp: output the original ownership in -v messages * src/chown-core.c (describe_change): Output the original owner if possible. (user_group_str): Handle the case when neither owner or group are passed. * NEWS: Mention the change in behavior. 2011-05-27 Pádraig Brady chown,chgrp: output the correct ownership in -v messages * src/chown_core.c (describe_change): Accept the ownership of the original file and output that when not changing. This is significant when --from is specified as then the original and specified ownership may be different. (user_group_str): A new helper function refactored from describe_change(). (change_file_owner): Pass the original user and group strings to describe_change(). * test/chown/basic: Add a test case. * NEWS: Mention the fix. maint: fix a -Wstrict-overflow build failure with gcc 4.5 * src/ls.c (print_color_indicator): Avoid the warning by not decrementing the integer. 2011-05-26 Jim Meyering build: --enable-gcc-warnings: enable -Wstrict-overflow in src/ * configure.ac (WARN_CFLAGS): Don't turn off -Wstrict-overflow. (GNULIB_WARN_CFLAGS): Remove -Wstrict-overflow from the list of warning options used in lib/. Normally I find that -Wstrict-overflow produces too many false positives, but considering that it warns of the bug reported in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33498, I now think it is worthwhile. The lesser of two evils. Thanks to Daniel Veillard for showing me the gcc bug report. maint: accommodate gcc's -Wstrict-overflow option * src/factor.c (factor_using_pollard_rho): Change type of "i" to unsigned to avoid warning from gcc's -Wstrict-overflow. * src/expr.c: Use an unsigned intermediate. * src/dircolors.c (main): Reorder operations to avoid the risk of pointer overflow. * src/tr.c (squeeze_filter): Change NOT_A_CHAR from an anonymous "enum" to an "int", to avoid this warning: tr.c:1624:10: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] * src/pr.c (main): Make index "i" unsigned. maint: enforce cpp indentation policy * cfg.mk (sc_preprocessor_indentation): New test, from libvirt. Exempt 3 files from new cppi test. * gl/lib/randread.c: Adjust cpp indentation to comply. * src/extent-scan.c (extent_need_sync): Likewise. maint: env.c: remove unnecessary use of strchr * src/env.c (main): Remove excess (and confusing to static analyzers) use of strchr. shred: placate coverity and fix a comment * src/shred.c (incname): Add an assertion to tell static analyzers that we know this particular use of strchr never returns NULL. Finish incomplete sentence in function-describing comment. 2011-05-26 Pádraig Brady maint: split: remove --filter specific code from other paths * src/split.c (lines_chunk_split): Don't use ignore_error() which is redundant and confusing when not running with --filter. (lines_rr): Likewise. (ofile_open): Likewise. Add a comment to clarify that filters aren't restarted under file descriptor pressure. split: diagnose when --filter is used with a chunk number * src/split.c (main): Exit with a diagnostic if --filter is specified along with a specific chunk number. * test/split/filter: Ensure this combination fails. split: exit when we can no longer write to a --filter * src/split.c (bytes_split): Stop reading when we can no longer write to a child process. (lines_rr): Likewise. (lines_bytes_split): No change is made here since input is bounded by the original file size. * test/split/filter: Add test cases. split: return success even if a --filter exits src/split.c (main): Don't unblock SIGPIPE before cleanup, as then any pending signals will be sent and cause the main split process to exit with a non zero status (141). * test/split/filter: Add a test for this case. split: fix an edge case where -n l/... creates an extra file * src/split.c (lines_bytes_chunk): Handle the edge case where the file is truncated as we read. * tests/misc/split-lchunk: Cleanup; no functional change. 2011-05-26 Bernhard Voelker chmod: output the original mode in verbose mode * src/chmod.c (describe_change): Pass in the original mode, and output this in the messages. * tests/chmod/c-option: Adjust as per the new message. * THANKS.in: Remove the now auto-generated name. * NEWS: Mention the change in behavior. 2011-05-25 Jim Meyering tests: ls/stat-free-color: fix unwarranted failure on a 32-bit system * tests/ls/stat-free-color: Also check for stat64 and lstat64 syscalls. This fixes a test failure reported by Stefano Lattarini. maint: accommodate gnulib's newer tight_scope rule * cfg.mk: Include via "-include", to accommodate new tight-scope rule. (sc_check-AUTHORS): Change the name of the rule in src/Makefile.am to _sc_check-AUTHORS, so it doesn't conflict with this one when this file is included into the sub-make's context. * src/Makefile.am (_sc_check-AUTHORS): Rename from sc_check-AUTHORS. * gnulib: Update to latest. doc: make README-hacking slightly more generic * README-hacking: Remove a reference to "coreutils". touch: placate static analyzers: no NULL-deref is possible * src/touch.c (main): Avoid even the hint of possibility that we'd dereference NULL upon localtime failure. Coverity reported the potential, but it appears not to be possible, since posixtime rejects any time for which the subsequent localtime would return NULL. See http://thread.gmane.org/gmane.comp.gnu.coreutils.general/1253 2011-05-24 Pádraig Brady split: fix cases where -n l/... creates extraneous files * src/split.c (lines_chunk_split): Ensure that data is only written to stdout when k specified. Also ensure that extra files are not created when there is more data available than reported in the file size. * tests/misc/split-lchunk: Verify that split -n l/k/n doesn't generate any files, and that -n l/n always generates n files. * NEWS: Mention the fix. 2011-05-24 Stéphane Raimbault doc: add a missing space in timeout --help * src/timeout.c (usage): Add a space to be consistent with other uses of "(the default)" in the documentation. 2011-05-24 Pádraig Brady doc: improve tail -f vs. inotify description and advice * doc/coreutils.texi (tail invocation): Adjust, and add an example. 2011-05-23 Jim Meyering maint: avoid trivial syntax-check failure * doc/coreutils.texi (tail invocation): Use @var{n}, not @var{N}. 2011-05-23 Karl Berry maint: README-hacking clarifications * README-hacking: Small getting-started clarifications. 2011-05-23 Jim Meyering doc: describe how kernel inotify support affects tail -f * doc/coreutils.texi (tail invocation) [-f]: Mention how inotify kernel support makes a difference. Prompted by http://bugzilla.redhat.com/662900 2011-05-22 Jim Meyering tests: fix typo in tac-continue * tests/misc/tac-continue: Fix typo in usually-skipped test: s/mkfifo_or_skip/mkfifo_or_skip_/ (i.e., append "_"). This test is usually skipped, because I'm probably the only one to set the FULL_PARTITION_TMPDIR envvar, and recently the one I'd been using ceased to exist, so this test was skipped even for me. Good argument for making this a root-only test and creating a full partition just for this test case. doc: fix a formatting nit in od's texinfo documentation * doc/coreutils.texi (od invocation): Typesetting of "bytes" was wrong. Fix it via s/@code/@var/ so it's consistent. 2011-05-21 Ivan Sichmann Freitas maint: fix comment typos in df.c * src/df.c: s/Optain/Obtain/ 2011-05-19 Jim Meyering maint: correct typos involving misuse of "a" and "an" * NEWS: "an misleading" * src/expr.c: "a integer * src/ptx.c (find_occurs_in_text): "a end" * src/shred.c (do_wipefd): "a infinite" * src/sort.c (SUBTHREAD_LINES_HEURISTIC): "an dual-core" (compare_random): "an checksum" * cfg.mk (old_NEWS_hash): Update, since the typo was in old news. 2011-05-18 Pádraig Brady printf: fix an out-of-bounds memory access * src/printf.c (STRTOX): Don't access memory after a string containing a single quote character. * tests/misc/printf: Add tests for various combinations of single quote characters combined with a numeric format. * THANKS.in: Add bug reporter. * NEWS: Mention the fix. Reported-by: Paul Marinescu 2011-05-17 Pádraig Brady doc: mention that ls time ordering is newest first * src/ls.c (usage): Add the "newest first" info to the -t and -c options 2011-05-14 Pádraig Brady tests: refactor more tests to use mkfifo_or_skip_ * tests/cp/existing-perm-race: s/mkfifo/mkfifo_or_skip_/ * tests/cp/file-perm-race: Likewise. * tests/cp/parent-perm-race: Likewise. * tests/cp/special-f: Likewise. * tests/dd/reblock: Likewise. * tests/ls/file-type: Likewise. * tests/misc/cat-buf: Likewise. * tests/misc/mknod: Likewise. * tests/misc/printf-surprise: Likewise. * tests/misc/selinux: Likewise. * tests/misc/sort-spinlock-abuse: Likewise. * tests/misc/stdbuf: Likewise. * tests/misc/tac-continue: Likewise. * tests/init.cfg: Improve the error message when skipping. shuf: use memory more efficiently when returning a subset * gl/lib/randperm.c (randperm_new): When the number of items to return H, is much smaller than the total number of items N, use a hash to represent the sparse permutations of the set N. This is currently enabled for N > 128K and N/H > 32. * tests/misc/shuf: Ensure shuf can quickly return 2 numbers from a large range. * gl/modules/randperm: Depend on hash. * NEWS: Mention the change. 2011-05-13 Jim Meyering maint: avoid syntax-check failure due to long line * tests/du/bigtime (future_time): Split long line. maint: add new syntax-check rule to prohibit use of skip_ * cfg.mk (sc_prohibit_skip_): New rule. * tests/init.cfg (skip_test_): Add a comment. tests: use skip_test_, not skip_ skip_test_ emits its diagnostic both to FD 9 (tty), and to FD 2 (usually the log file), whereas init.sh's skip_ emits only to FD 9. Without that, the log is slightly less useful. * tests/cp/fiemap-2: Use skip_test_, not skip_. * tests/cp/fiemap-perf: Likewise. * tests/du/bigtime: Likewise. * tests/du/files0-from-dir: Likewise. * tests/du/move-dir-while-traversing: Likewise. * tests/init.sh: Likewise. * tests/misc/sort-stale-thread-mem: Likewise. * tests/misc/stat-nanoseconds: Likewise. * tests/mv/i-3: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/split/filter: Likewise. Prompted by a report from Pádraig Brady. ls: allow stat-free use of --color Even on a system with d_type support, the default use of --color makes ls stat every file in order to be able to honor settings like EXEC, STICKY, ORPHAN, SETUID, etc., because those settings require information that is not provided by dirent.d_type. However, if for a potentially large performance gain, you are willing to disable those settings, you can now make ls --color give type-related coloring and perform no stat calls at all (other than the unavoidable call-per- command-line argument). Before this change, even with all of those attributes disabled, ls --color would still stat every directory. Now, we're down to the minimum of one stat call per command-line arg. * src/ls.c (gobble_file): With --color, don't stat a non-command-line-specified directory when no directory-coloring attribute is enabled. * tests/init.cfg (require_dirent_d_type_): New function. * tests/d_type-check: New script, mostly from Pádraig Brady. * tests/Makefile.am (EXTRA_DIST): Add it. * tests/ls/stat-free-color: New test. * tests/Makefile.am (TESTS): Add it. * doc/coreutils.texi (General output formatting): Describe how to use dircolors to make ls --color refrain from calling stat on a d_type-enabled file system. Prompted by a query from Josef Bacik. 2011-05-12 Jim Meyering maint: use , not "group-member.h" gnulib's group-member module now ensures that the group_member function is declared in , just like it is glibc. * lib/euidaccess-stat.c: Remove inclusion of "group-member.h". * src/chgrp.c: Likewise. build: update gnulib submodule to latest 2011-05-11 Jim Meyering maint: remove syntax-checking sc_tight_scope rule * src/Makefile.am (sc_tight_scope): Remove rule. Now it's provided via gnulib's maint.mk. * cfg.mk (sc_tight_scope): Likewise. maint: tail: mark a global variable as static * src/tail.c [HAVE_INOTIFY] (inotify_wd_mask): Declare static. 2011-05-08 Pádraig Brady maint: remove -Wmissing-field-initializers workarounds * configure.ac: Rather than disabling -Wmissing-field-initializers, use the fact that gnulib now disables it automatically when required (on versions of GCC older than 4.7). * src/system.h: Remove the no longer needed DECLARE_ZEROED_AGGREGATE. * src/ls.c: Likewise. * src/pathchk.c: Likewise. * src/shred.c: Likewise. * src/stty.c: Likewise. * src/wc.c: Likewise. 2011-05-07 Jim Meyering tests: don't fail the split --filter=CMD test if xz is not available * tests/split/filter: Skip if xz is not installed. 2011-05-06 Jim Meyering doc: document split's new --filter=CMD option * doc/coreutils.texi (split invocation): Describe --filter=CMD. * NEWS (New feature): Mention it. tests: test split's new --filter=CMD option * tests/Makefile.am (TESTS): Add split/filter. * tests/split/filter: New file. 2011-05-06 Karl Heuer split: accept new output --filter=CMD option * src/split.c: Include , and "sig2str.h". (FILTER_OPTION): New anonymous enum member. (filter_command, filter_pid): New globals. (open_pipes, open_pipes_alloc, n_open_pipes): Likewise. (oldblocked, newblocked): Likewise. (longopts): Add "filter". (usage): Document --filter. (create): Extend to create a pipe and fork "sh -c CMD". (closeout): Adapt to close a pipe and wait for child process. (cwrite): Call closeout, not just close. (lines_chunk_split): FIXME (bytes_chunk_extract): FIXME (opid, ofile_open, lines_rr, main): FIXME (ignorable): New function, to encapsulate EPIPE test. 2011-05-06 Jim Meyering build: update gnulib submodule to latest 2011-05-06 Pádraig Brady sort: fix a contradictory --debug warning * src/sort.c (key_warn): `sort -k2,1n --debug` would output warnings about being both "zero width" and "spanning multiple fields". Suppress the latter one. * tests/misc/sort-debug-warn: Add a couple of test cases. 2011-05-05 Pádraig Brady df: fix crash in mem exhaustion edge case * src/df.c (print_table): Don't try to output NULL if ambsalign() can't allocate memory. Instead just output the unaligned text. 2011-05-03 Jim Meyering maint: remove use of gnulib's obsolete strtol module * bootstrap.conf (gnulib_modules): Remove now-obsolete "strtol". Remove use of $obsolete_gnulib_modules: unused since commit edc69f91. maint: remove unnecessary listing of update-copyright in Makefile.am * Makefile.am (changelog_etc): Don't list update-copyright here. It is automatically included via gnulib-tool-generated lib/gnulib.mk. doc: remove a name from THANKS.in that is derived from git log * THANKS.in: Remove a now-duplicate name. 2011-05-03 Jim Meyering copy: fix my typo * src/copy.c (copy_reg): Fix my typo (mis-applied patch). The patch by Jeff Liu was fine, but I mis-applied it and introduced a compilation error in commit efa479c1. 2011-05-03 Jim Meyering 2011-05-03 Jim Meyering build: avoid bootstrap failure when $GZIP is set Running "GZIP=-9 ./bootstrap" would fail right away, because the tool-version-checking code would treat the upper-cased program name as an environment variable name and if that has a value use the result as the application name. That works fine for automake, autoconf, etc. but not for gzip. * bootstrap (check_versions): Do not treat $GZIP as a program name. If defined at all, it is supposed to list gzip options. Reported by Alan Curry in http://debbugs.gnu.org/8609 2011-05-03 Jeff Liu copy: correct misuse of quote in diagnostic * src/copy.c (copy_reg): Multiple uses of quote (s) in an argument list is erroneous. Use quote_n, instead. 2011-04-30 Jim Meyering maint: adjust split.c formatting to conform * src/split.c (usage): Correct indentation. (ofile_open): Likewise. (create): "char *name", not "char* name". (struct of_info) [ofile]: Similar. (parse_chunk): Add spaces around "+". 2011-04-29 Eric Blake build: update to latest gnulib * gnulib: Update to latest. * bootstrap.conf (gnulib_modules): Add xgetgroups. 2011-04-29 Jim Meyering tests: distribute new file, CuSkip.pm Without this, most perl-based tests would fail in "make distcheck". * tests/Makefile.am (EXTRA_DIST): Add CuSkip.pm 2011-04-28 Jim Meyering tests: remove useless test: misc/pwd-unreadable-parent * tests/Makefile.am (TESTS): Remove misc/pwd-unreadable-parent. This test was misleading and useless (was always skipped). Inspired by a report from Bruno Haible: http://debbugs.gnu.org/8570 * tests/misc/pwd-unreadable-parent: Remove file. tests: write skip explanation from perl scripts also to outer stderr * tests/CuSkip.pm (skip): New file/module/function, to help the perl test scripts "skip" a test consistently, emitting a diagnostic both into the log file and into the outermost stderr stream that is more likely to be seen by a human. * tests/check.mk (TESTS_ENVIRONMENT): Add -MCuSkip. * tests/misc/date-next-dow: Use CuSkip::skip in place of warn+exit-77. * tests/misc/tty-eof: Likewise. * tests/misc/uniq: Likewise. * tests/rm/fail-eperm: Likewise. * tests/misc/md5sum-newline: Likewise. Also, s/program_name/ME/. * tests/misc/ls-misc (setuid_setup, main): Likewise. * tests/misc/pwd-long: Likewise, and add -I"$abs_srcdir" -MCuSkip to the $PERL invocation command. Inspired by a request from Bruno Haible regarding misc/tty-eof: http://debbugs.gnu.org/8570 2011-04-26 Jim Meyering post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.12 * NEWS: Record release date. maint: tweak sc_tight_scope rule * src/Makefile.am (sc_tight_scope): Remove useless quotes, change 1>&2 to >&2, and combine a few short lines. dd: work around compilation failure on AIX 5.1 and 5.2 * src/dd.c (O_NOCACHE): Undefine. This symbol is defined via AIX's , yet used as an enum name in dd.c. Reported by Gary V. Vaughan in http://debbugs.gnu.org/8555 * NEWS (Portability): Mention this. maint: move two small functions, so we can remove a fwd decl * src/dd.c (cleanup, quit): Move the definition of quit to follow the definition of process_signals, so we can remove the declaration of the latter. 2011-04-25 Jim Meyering maint: change some leading 8-space sequences to TABs in a Makefile.am src/Makefile.am (fs-magic, fs-kernel-magic): Change some leading 8-space sequences to TABs. stat: recognize V9FS and ECRYPTFS file systems * src/stat.c (human_fstype): Add magic numbers for V9FS and ECRYPTFS. tail --follow=name no longer implies --retry * src/tail.c (tail_forever_inotify): Just as without inotify, tail --follow=name now terminates when the last tailed-by-name file is unlinked or moved aside. This bug was introduced on 2009-06-15 via commit ae494d4b, "tail: use inotify if it is available". Reported by Tim Underwood in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/22286 * NEWS (Bug fixes): Mention this. * tests/tail-2/follow-name: Test for this. * tests/Makefile.am (TESTS): Add it. 2011-04-25 Jeff Liu copy: include both src and dest names in clone failure diagnostic * src/copy.c (copy_reg): Upon btrfs clone failure, print not just the destination file name, but also the source file name. That may be useful upon failure of a cross-device clone attempt. 2011-04-25 Jim Meyering tests: tail-2/pipe-f2: avoid false-positive failure Otherwise, this would fail (albeit rarely) on a "make -j24 check" run. * tests/tail-2/pipe-f2: Increase timeout from 1 second to 10, to avoid false positive failure. maint: explicitly list full-read and full-write module names * bootstrap.conf (gnulib_modules): Include full-read and full-write explicitly. Before, we'd get them via safe-read, but with newer gnulib, that is no longer enough: link failure due to undefined references to full_write. doc: tail/inotify does use --sleep-interval=S, with --pid=P * doc/coreutils.texi (tail invocation): Mention it. * src/tail.c (usage): Likewise. (tail_forever_inotify): Clarify comment. 2011-04-22 Alan Curry tests: sparse-fiemap: adjust syntax to accommodate older awk * tests/cp/sparse-fiemap: Parenthesize ternary expression used as an argument to awk's printf. Otherwise, gawk 3.0.1 and the one from debian stable's original-awk would get a syntax error. Reported by Dennis Clarke. Copyright note: tiny change 2011-04-21 Jim Meyering tests: sparse-fiemap: with root/ext3, do not create an ext4 FS * tests/cp/sparse-fiemap: When this test was run as root on an ext3 file system, (ext3 had known problems), it would trickily create and mount a loopback ext4 file system and use that instead. However, due to a bug in 2.6.39-rc1..rc3, this loopback test (when run in another loopback FS) exposed a bug with 1k-blocksize ext4 whereby non-NUL data would be read from a hole. For details, see this: http://thread.gmane.org/gmane.comp.file-systems.ext4/24495 tests: sparse-fiemap: report more detail upon failure; ignore an FP * tests/cp/sparse-fiemap: Fail right away with details, when cmp fails. When extent maps are found to differ, display them and merely warn. 2011-04-20 Jim Meyering copy: use FIEMAP (extent_copy) only for apparently-sparse files, to avoid the expense of extent_copy's unconditional use of FIEMAP_FLAG_SYNC. * src/copy.c (copy_reg): Do not attempt extent_copy on a file that appears to have no holes. * NEWS (Changes in behavior): Document this. At first I labeled this as a bug fix, but that would be inaccurate, considering there is no documentation of FIEMAP semantics, nor even consensus among kernel FS developers. Here's hoping SEEK_HOLE/SEEK_DATA support will soon make it into the linux kernel. copy: factor out a tiny sparse-testing function * src/copy.c (HAVE_STRUCT_STAT_ST_BLOCKS): Define to 0 if undefined, so we can use it in the return expression, here: (is_probably_sparse): New function, factored out of... (copy_reg): ...here. Use the new function. copy: do not treat unwritten extents specially: avoid XFS/ext4 data loss * src/copy.c (extent_copy): Do not treat "unwritten extents" specially. Otherwise, with a release-candidate 2.6.39-rc3 kernel, XFS or ext4, when using gold as your linker, and if you forget to run "make check", you could end up installing files full of zeros instead of the expected binaries. For a lot of discussion, see http://thread.gmane.org/gmane.comp.file-systems.xfs.general/37895 * tests/cp/fiemap-empty: Disable this test. copy: always use FIEMAP_FLAG_SYNC, for now * src/extent-scan.c (extent_need_sync): Always return true, to make the sole caller always use FIEMAP_FLAG_SYNC. This will doubtless have an undesirable performance impact, but we'll mitigate that shortly, by using extent_copy only on files with holes. tests: remove spurious syntax from a perl snippet * tests/cp/sparse-fiemap: Remove spurious BEGIN {...} block. 2011-04-17 Ondřej Vašík dircolors: add .ear, .war, .sar, for Java jar-like archives * src/dircolors.hin: Add .ear, .war, .sar, for Java jar-like archives Suggested by Ville Skyttä in https://bugzilla.redhat.com/616497. 2011-04-13 Jim Meyering post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.11 * NEWS: Record release date. 2011-04-13 Pádraig Brady maint: mention dd's new partial read warning in NEWS * NEWS: Mention the new feature, from commits e1788d9e and 194c1e89 tests: fix a false positive fiemap test on some file systems * tests/filefrag-extent-compare: Don't check the length of the last extent, as this was seen to vary on XFS, where it leaves trailing blocks allocated for performance reasons. * tests/cp/fiemap-empty: Though not seen as an issue in practise, try to avoid possible issues with the allocator in file systems, by requesting to allocate a power of 2. 2011-04-12 Pádraig Brady maint: correct kernel version in test comment 2011-04-12 Jim Meyering maint: remove unnecessary inclusion of * src/extent-scan.c: Don't include . It was not used. 2011-04-11 Jim Meyering build: update gnulib submodule to latest cfg.mk: remove useless semicolon and backslash * cfg.mk (sc_NEWS_two_empty_lines): Remove semicolon and backslash. doc: tweak NEWS * NEWS: Slightly obfuscate a line to avoid a false-positive doubled-word ("is-is") match. Fix a grammar error in news for 8.2. * cfg.mk (old_NEWS_hash): Resync. maint: install: remove support for --preserve_context ("_", not "-") * src/install.c: Its use has elicited a warning for two years. Use --preserve-context instead. * NEWS (changes in behavior): Mention this. maint: reorder install.c to eliminate declarations of static functions * src/install.c: Remove static function declarations. maint: rename variables for clarity... and to avoid a false-positive "TO to" in new doubled word check. * src/install.c (change_timestamps): Rename parameters for readability. Make the comment match the code. maint: remove doubled words in comments, e.g., s/to to/to/ * tests/ls/color-norm: s/to to/to/ * gl/lib/mbsalign.h (mbs_align_t): s/or or/or/ * src/extent-scan.c (extent_scan_read): s/the the/the/ * src/libstdbuf.c: s/the the/the/ * tests/misc/stdbuf: s/on on/on/ * ChangeLog-2005: s/for\n\tfor /for\n\t/ 2011-04-11 Pádraig Brady maint: misc typo fixes * src/fiemap.h: s/can not/cannot/ * NEWS: s/in/is/ * doc/coreutils.texi: Remove spurious "and". s/effect/affect/ Use matched ``...'' quotes. 2011-04-07 Pádraig Brady maint: correct kernel version in NEWS * NEWS: Adjust to match commit 1c3654cb, 2011-04-02, "copy: require fiemap sync also for 2.6.38 kernels" copy: handle mergeable extents across fiemap scans * extent-scan.h (extent_scan_free): Init the pointer to NULL, and reset the count to 0, so that we can realloc the buffer. * src/extent-scan.c (extent_scan_init): Likewise. (extent_scan_read): Loop over multiple fiemap scans, so we handle mergeable extents that span across fiemap scan boundaries. Once we have enough unique extents, return so as to minimize memory use. copy: fix an unlikely memory leak when a fiemap copy fails * src/copy.c (extent_copy): Free the extents array when sparse_copy() fails. 2011-04-04 Jim Meyering tests: avoid spurious parallel failure due to temporary disk full Running the new fiemap-empty test uses 600MB of disk space via fallocate, and in so doing caused failure in unrelated tests that were running in parallel on a small file system. Rather than simply running fallocate (which allocates the space, inducing disk full when it fails), skip the test if there is less than 800MB of free space, as computed via stat and awk. * tests/init.cfg (require_file_system_bytes_free_): New function. * tests/cp/fiemap-empty: Use it. tests: don't ever leave a backgrounded "sleep 10m" process * tests/misc/help-version: Sleep only ~30s, not 10m. The latter was a problem when somehow that sleep process would hang around and thereby prevent (for up to 10m) a normal unmount of the temporary partition in which I'd run the tests. tests: preserve-gid: don't chown temporary PATH dir to a nameless UID * tests/cp/preserve-gid: Simply chmod a+rx instead. That is safer, in case the nameless UID actually has an account, and might take advantage of root running a program in a directory under its control tests: preserve-gid: remove useless use of "env" * tests/cp/preserve-gid: Remove useless use of "env". tests: convert common root-build test failure to a "skip" * tests/mv/sticky-to-xpart: Skip rather than failing this test when run as root and the binaries are not accessible by "nobody". tests: minor improvement of sc_tight_scope rule * src/Makefile.am (sc_tight_scope): Adjust rule to use an eval-based trap-setting for-loop rather than 4x hard-coded 128+N constants. Also catch SIGQUIT (3). Tweak comments. 2011-04-04 Eric Blake docs: mention POSIX 2008 * doc/coreutils.texi (Standards conformance): Give value of _POSIX2_VERSION matching the _POSIX_C_SOURCE of POSIX 2008. 2011-04-03 Jim Meyering maint: prohibit direct use of strncmp: prefer STREQ_LEN, STRNCMP_LIT * cfg.mk (sc_prohibit_strncmp): New rule, mostly from libvirt. * src/system.h (STREQ_LEN, STRPREFIX, STRNCMP_LIT): Define. * src/df.c (get_dev, get_point): Convert. * src/extent-scan.c (extent_need_sync): Likewise. * src/ls.c (is_colored, decode_switches): Likewise. (parse_ls_color, (print_color_indicator): Likewise. * src/md5sum.c (split_3): Likewise. * src/split.c (main, emit_ancillary_info): Likewise. * src/tr.c (look_up_char_class): Likewise. * src/uname.c (main): Likewise. * src/who.c (scan_entries): Likewise. copy: require fiemap sync also for 2.6.38 kernels * src/extent-scan.c (extent_need_sync): Require sync also for 2.6.38. Without this, part of the cp/fiemap-empty test would fail both on F15-to-be (2.6.38.1-6.fc15.x86_64) and rawhide. For details, see http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/22190 2011-04-02 Jim Meyering cp: always detect copy-into-self: avoid infloop w/large PATH_MAX When running the erroneous command, cp -rl A D D, and depending on the structure of directories A and D and the file system type (because that changes order of dir. entry traversal), cp would sometimes fail to detect that D was being copied into D, and would create D/D/D/D/D/... until it hit PATH_MAX or exhausted some resource. I noticed this via the occasional failure of the cp/into-self test when run using a ZFS file system. It is occasional because the bug is dependent on the order in which directory entries are traversed, and that is apparently indeterminate with ZFS. Technically, with the current recursive implementation, there is no risk of an infinite loop, due to stack limitations, but with an eventual fts-based implementation, it might have iterated until disk space or inodes are exhausted. * src/copy.c (copy_dir): Avoid copy-into-self interminable loop on systems with large PATH_MAX. On other systems, diagnose the copy-into- self error consistently. Handle the parameter, first_dir_created_per_command_line_arg, correctly when there are two or more sub-directories. maint: fix a comment typo * tests/cp/fiemap-empty: Correct typo in comment. Add "FIXME". 2011-04-01 Pádraig Brady copy: process empty extents more efficiently * src/copy.c (extent_copy): Treat an allocated but empty extent much like a hole. I.E. don't read data we know is going to be NUL. Also we convert the empty extent to a hole only when SPARSE_ALWAYS so that the source and dest have the same allocation. This will be improved soon, when we use fallocate() to do the allocation. * tests/cp/fiemap-empty: A new test for efficiency and correctness of copying empty extents. * tests/Makefile.am: Reference the new test. * NEWS: Mention the change in behavior. copy: protect against overlapping extents * src/extent-scan.c (extent_scan_read): Add a more stringent check for OFF_T overflow, to ensure subsequent code is immune. Detect overlapping extents and adjust, so as files always copied. Detection using a single scan with fallback to a standard copy was thought too expensive in memory or time. * NEWS: Mention the fix 2011-04-01 Pádraig Brady copy: link rather than copy symlinks, when --link used This bug was introduced in commit ca9e212c, 2009-09-24, "cp, mv: use linkat to guarantee semantics", which inadvertently disabled the creation of hardlinks to symlinks. However rather than implementing the intention of that commit and relying on gnulib linkat emulation, we'll revert to the previous emulation as that maintains ownership and timestamps. * src/copy.c (copy_internal): Use our existing hardlink to symlink emulation when link() might dereference the symlink. Also ensure that we copy the timestamps of the original symlink when we use the emulation. * tests/cp/link-symlink: Add a test to ensure timestamps copied. * tests/Makefile.am: Reference the new test. * NEWS: Mention the fix. Reported by Ruediger Meier 2011-03-31 Jim Meyering tests: inotify-rotate: avoid race condition with overloaded disk * tests/tail-2/inotify-rotate: Wait 50% longer for grep to succeed. Without this change, this test would fail consistently when using "make -j25 check" with F15 in a virtio- and spinning-rust-backed virtual machine. 2011-03-31 Pádraig Brady copy: with fiemap copy, only sync when needed * src/extent-scan.h (struct extent_scan): Add the fm_flags member to pass to the fiemap scan. * src/extent-scan.c (extent_need_sync): A new function used to detect Linux kernels before 2.6.38. (extent_scan_init): Add FIEMAP_FLAG_SYNC when needed. * tests/cp/sparse-fiemap: Adjust comment. * NEWS: Mention the change in behavior. Indirectly suggested by Mike Frysinger 2011-03-28 Mathieu Bridon tests: avoid unwarranted failure in mock-simulated non-SELinux env. * tests/init.cfg (require_selinux_): Skip the test also when /proc/filesystems does not list selinuxfs. Add comments. * cfg.mk (exclude_file_name_regexp--sc_file_system): Exempt tests/init.cfg, with its use of /proc/filesystems. Based on the patch by Mathieu Bridon in http://debbugs.gnu.org/8359. More discussion in http://bugzilla.redhat.com/573111 2011-03-28 Jim Meyering maint: correct formatting style in a header * src/find-mount-point.h: Move "*" to where it belongs. Move "const", too. * src/find-mount-point.c: Move "const" to conform. * src/Makefile.am (sc_tight_scope): Allow `*'s before the function name. Use perl's -l option and drop the \n after (and quotes around) $1. 2011-03-23 Pádraig Brady df: fix alignment of columns * src/df.c (alloc_table_row): A new function to allocate storage for a row of strings. (print_table): A new function to interate over all stored strings in the table, and apply alignment honoring the max width of each column. (get_header): Renamed from print_header, and adjusted accordingly. (get_dev): Renamed from show_dev. Also we no longer wrap longer device names over two lines, which can be an unexpected issue for scripts parsing the output from df. (get_disk): s/show_/get_/ (get_point): Likewise. (get_entry): Likewise. (get_all_entries): Likewise. * NEWS: Mention the change. 2011-03-22 Jim Meyering build: update gnulib submodule to latest tests: exercise tests new "==" operator * tests/misc/test: Exercise the new operator. * NEWS (Changes in behavior): Mention it. 2011-03-22 David A. Wheeler test: accept "==" as a synonym for "=" Make GNU coreutils' test recognize "==" as a synonym for "=". This is already the case in GNU coreutils' expr, bash, ksh, busybox ash, FreeBSD-current /bin/sh and /bin/test, and OpenBSD's /bin/sh. Before, env test a '==' a would fail with this diagnostic: "test: ==: binary operator expected". Now, it succeeds. * src/test.c: Accept "==" as a synonym for "=". * doc/coreutils.texi (String tests): Document it. Reported as http://debbugs.gnu.org/8263 Also see http://austingroupbugs.net/view.php?id=375 2011-03-21 Jim Meyering tests: fix a bug in the cp/preserve-gid test * tests/cp/preserve-gid: Ensure that every process under test uses the cp binary we've just built. Before this fix, with a restrictive umask or build-dir permissions, the UID-changing tests would end up using whatever cp happened to be available through $PATH Analysis by arbogast.cedric@gmail.com in http://debbugs.gnu.org/8292. 2011-03-20 Paul Eggert bootstrap: do not exclude m4/message.m4 * bootstrap.conf (excluded_files): Don't exclude m4/lcmessage.m4, as it's needed with the latest gnulib. 2011-03-20 Jim Meyering maint: remove a name from THANKS.in that is derived from git log The names in THANKS are generated from two sources: the hard-coded list, THANKS.in, and the names of committers from the git log. When a contributor on the hard-coded list commits a change, we remove their now-redundant name from THANKS.in. * THANKS.in: Remove a now-duplicate name. 2011-03-20 Pádraig Brady tests: fix the sparse-fiemap test * tests/filefrag-extent-compare: Merge adjacent extents in each list before processing, so we correctly account for split extents in either list. * tests/cp/sparse-fiemap: Remove the explicit syncing, which was only changing the way extents were arranged, and thus working around the extent comparison issue that was seen on ext4 loop back. 2011-03-16 Jim Meyering sort: avoid memory pressure of 130MB/thread when reading from pipe * src/sort.c (INPUT_FILE_SIZE_GUESS): Decrease initial allocation factor used to size buffer used when reading a non-regular file. For motivation, see discussion here: http://thread.gmane.org/gmane.comp.gnu.coreutils.general/878/focus=887 maint: stop using .x-sc_* files to list syntax-check exemptions Instead, use the brand new mechanism with which you merely use a variable (derived from the rule name) defined in cfg.mk to an ERE matching the exempted file names. * gnulib: Update to latest, to get maint.mk that implements this. * Makefile.am (syntax_check_exceptions): Remove variable. (EXTRA_DIST): Remove use of the variable. * cfg.mk (sc_x_sc_dist_check): Remove rule, no longer useful. (exclude_file_name_regexp--sc_space_tab): Define variable. (exclude_file_name_regexp--sc_bindtextdomain): Likewise. (exclude_file_name_regexp--sc_unmarked_diagnostics): Likewise. (exclude_file_name_regexp--sc_error_message_uppercase): Likewise. (exclude_file_name_regexp--sc_trailing_blank): Likewise. (exclude_file_name_regexp--sc_system_h_headers): Likewise. (exclude_file_name_regexp--sc_require_config_h_first): Likewise. (exclude_file_name_regexp--sc_require_config_h): Likewise. (exclude_file_name_regexp--sc_po_check): Likewise. (exclude_file_name_regexp--sc_prohibit_always-defined_macros): Likewise. (exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF): Likewise. (exclude_file_name_regexp--sc_program_name): Likewise. (exclude_file_name_regexp--sc_file_system): Likewise. (exclude_file_name_regexp--sc_prohibit_always_true_header_tests): Likewise. (exclude_file_name_regexp--sc_prohibit_fail_0): Likewise. (exclude_file_name_regexp--sc_prohibit_atoi_atof): Likewise. (exclude_file_name_regexp--sc_prohibit_tab_based_indentation): Likewise. (exclude_file_name_regexp--sc_prohibit_stat_st_blocks): Likewise. * configure.ac [whether localtime caches TZ]: Use return 0/1, not exit (0/1) to avoid triggering a sc_prohibit_magic_number_exit failure. * .x-sc_GPL_version: Remove file. * .x-sc_bindtextdomain: Likewise. * .x-sc_error_message_uppercase: Likewise. * .x-sc_file_system: Likewise. * .x-sc_obsolete_symbols: Likewise. * .x-sc_po_check: Likewise. * .x-sc_program_name: Likewise. * .x-sc_prohibit_always-defined_macros: Likewise. * .x-sc_prohibit_always_true_header_tests: Likewise. * .x-sc_prohibit_atoi_atof: Likewise. * .x-sc_prohibit_empty_lines_at_EOF: Likewise. * .x-sc_prohibit_fail_0: Likewise. * .x-sc_prohibit_magic_number_exit: Likewise. * .x-sc_prohibit_stat_st_blocks: Likewise. * .x-sc_prohibit_strcmp: Likewise. * .x-sc_prohibit_tab_based_indentation: Likewise. * .x-sc_require_config_h: Likewise. * .x-sc_require_config_h_first: Likewise. * .x-sc_space_tab (config): Likewise. * .x-sc_sun_os_names: Likewise. * .x-sc_system_h_headers: Likewise. * .x-sc_trailing_blank: Likewise. * .x-sc_unmarked_diagnostics: Likewise. * .x-sc_useless_cpp_parens: Likewise. 2011-03-14 Pádraig Brady maint: use wcswidth from gnulib * gl/lib/mbsalign.c (rpl_wcswidth): Remove this in favor of the equivalent wcswidth replacement in gnulib. * bootstrap.conf: Depend on the wcswidth module. Suggested by Bruno Haible. 2011-03-13 Jim Meyering touch: update to latest gnulib to fix Solaris 10 touch segfault * gnulib: Update to latest, to address http://debbugs.gnu.org/8230. When built on Solaris 9 and run on Solaris 10, touch would segfault. Reported by Ben Walton. * bootstrap: Update from gnulib. * tests/init.sh: Likewise. * NEWS (Bug fixes): Mention this. sort: spawn fewer threads for small inputs * src/sort.c (SUBTHREAD_LINES_HEURISTIC): Do not spawn a new thread for every 4 lines. Increase this from 4 to 128K. 128K lines seems appropriate for a 5-year-old dual-core laptop, but it is too low for some common combinations of short lines and/or newer systems. * NEWS (Bug fixes): Mention it. 2011-03-11 Pádraig Brady copy: merge similar extents before processing * src/extent-scan.c (extent_scan_read): Merge adjacent extents that vary only in size, so that we may process them more efficiently. This will be especially useful when we introduce fallocate() so that we don't reproduce fragmentation in the destination. 2011-03-06 Paul Eggert dd: avoid or diagnose some problems with short reads * src/dd.c (warn_partial_read): New static var. (iread): Diagnose partial reads if needed. (iwrite): Don't diagnose them here; not needed any more. (scanargs): Determine whether partial reads should be diagnosted. 2011-03-05 Pádraig Brady maint: fix dd nocache test to be independent of current stdin * tests/dd/nocache: Don't assume stdin is a pipe dd: add a flag to discard cached data * src/dd.c (FFS_MASK): A new macro (Find First Set) refactored from the following enum as it's now used twice. (usage): Mention the new 'nocache' flag. (cache_round): A new function to help ignore requests to drop cache, that are less than page_size. (invalidate_cache): A new function to call posix_fadvise() with the appropriate offset and length. Note we don't use fdadvise() so we can detect errors when count=0. (dd_copy): Call invalidate_cache() for the portions read. (iwrite): Likewise for the portions written. (main): Call invalidate_cache for page_size slop or for full file when count=0. * cfg.mk (sc_dd_O_FLAGS): Adjust to pass. * doc/coreutils.texi (dd invocation): Describe the 'nocache' flag, and give some examples of how it can be used. * tests/dd/nocache: A new test. * tests/Makefile.am: Reference the new test. * NEWS: Mention the new feature. doc: clarify that `dd bs=` can immediately output short reads * doc/coreutils.texi (dd invocation): Clarify that bs= can cause parital reads to be immediately written to output. * src/dd.c (usage): Hint that bs= can cause partial writes. See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8171 doc: group dd conv= options that are actually flags * src/dd.c (usage): Move 'sync' up with other data transformation options. Having it alongside 'fsync' and 'fdatasync' is particularly confusing. Also the double line description of the 'sync' option, serves as a visual break from the "flag" type options that follow. * doc/coreutils.texi (dd invocation): Apply the same grouping as above, by splitting the "conv=" table in two. 2011-03-05 Pádraig Brady dd: warn when we disable oflag=direct not at EOF An alternative to this is to auto enable iflag=fullblock when oflag=direct and bs= is specified. It was thought better though, to warn about the specific issue, and give full control of dd's options to the user. * src/dd.c (iwrite): Warn, when we write after having disabled O_DIRECT. See https://bugzilla.redhat.com/show_bug.cgi?id=614605 2011-03-03 Jim Meyering du: don't infloop for --files0-from=DIR * src/du.c (main): Fail on AI_ERR_READ error, rather than merely diagnosing and continuing. Based on a patch by Stefan Vargyas. Also move the handling of AI_ERR_EOF into the case stmt. Do not report ferror/fclose(stdin) failure when we've already diagnosed e.g., failure to read the DIR, above. Bug introduced by 2008-11-24 commit 031e2fb5, "du: read and process --files0-from= input a name at a time,". * src/wc.c: Handle read failure as with du: do not exit immediately, but rather go on to print any total and to clean-up. As above, move the handling of AI_ERR_EOF into the case stmt. * tests/du/files0-from-dir: New file, to test both du and wc. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it. wc: avoid NULL dereference on out-of-memory error * src/wc.c (main): Diagnose failed argv_iter_init_* failure, rather than falling through and dereferencing NULL. Bug introduced by 2008-11-25 commit c2e56e0d, "wc: read and process --files0-from= input a name at a time,". * NEWS (Bug fixes): Mention it. 2011-02-25 Pádraig Brady tests: without filefrag, only skip part of sparse-fiemap * tests/cp/sparse-fiemap: Move the PERL check to the top, since we don't test anything without it. In the loop, don't use skip_test_ as it exits the test completely. 2011-02-20 Gilles Espinasse maint: replace spaces with tab in tests/Makefile.am * tests/Makefile.am: Replace spaces with tabs for consistency 2011-02-18 Jim Meyering stdbuf: avoid even the appearance of a possible use-after-free There was an execution path by which "libstdbuf" could be used after being freed, but that would happen only if there were no libstdbuf.so alongside the stdbuf program and there had been an installation error leading to absence of the file, PKGLIBDIR/libstdbuf.so. * src/stdbuf.c (set_LD_PRELOAD): Rearrange loop to make it perfectly clear that there is no possibility of use-after-free. Steve Grubb reported this possible use-after-free of "libstdbuf". 2011-02-18 Gilles Espinasse tests: correct racy sparse-to-pipe test * tests/cp/sparse-to-pipe: Wait for backgrounded "cat" to complete before comparing the results. 2011-02-15 Paul Eggert uptime: omit unnecessary #if * src/uptime.c (print_uptime): Omit unnecessary "#if defined HAVE_GETLOADAVG || defined C_GETLOADAVG". This #if is always true, and removing it will help us simplify the gnulib getloadavg module. 2011-02-15 Pádraig Brady tests: support more file systems in the cp fiemap tests * tests/cp/sparse-fiemap: Check for fiemap support against a file rather than a directory to enable tests on BTRFS for example. Explicity disable the test on ext3 or file systems where we can't determine the type. * tests/cp/fiemap-perf: Likewise. Also disable the test on older BTRFS (like in Fedora 14), where extents are returned for holes. * tests/init.cfg: Comment that BTRFS only supports fiemap for regular files. 2011-02-11 Pádraig Brady copy: adjust fiemap handling of sparse files Don't depend on heuristics to detect sparse files if fiemap is available. Also don't scan for new holes unless --sparse=always has been specified. * src/copy.c (extent_copy): Pass the user specified sparse mode, and handle as described above. 2011-02-11 Pádraig Brady copy: suppress redundant lseeks when using fiemap * src/copy.c (extent_copy): Suppress redundant lseek()s in both the source and dest files, when there is no hole between extents. 2011-02-10 Jim Meyering tests: fix bug in preceding check.mk change * tests/check.mk (.built-programs): Run cd'd submake in a subshell so the redirected output ends up in the current directory, not ../src. tests: print "python missing:..." diagnostic where more will see it * tests/init.cfg (fiemap_capable_): Print with warn_, so that the diagnostic shows up alongside the corresponding SKIP message. tests: avoid gross inefficiency in "make test" Do not run a sub-make to set up the environment for each and every test script. Instead, run it just once and store the result in a file. * tests/check.mk (built_programs): Remove definition. (.built-programs): New rule to create the temporary file. (CLEANFILES): Arrange to remove it. (TESTS_ENVIRONMENT): Simply cat .built-programs, rather than running the sub-make. * .gitignore: Ignore it. 2011-02-08 Pádraig Brady test: improve the cp fiemap tests * tests/cp/fiemap-2: Enable the fiemap check for files, which will enable the test for files on ext3. * tests/cp/fiemap-perf: Comment why we're not enabling for ext3. * tests/cp/sparse-fiemap: Ditto. Also sync the files before doing a fiemap which was needed for ext4 loop back at least. Add a comment that FIEMAP_FLAG_SYNC is ineffective, thus requiring the explicit syncs. * tests/fiemap-capable: A new python script to determine if a specified path supports fiemap. * tests/init.cfg (fiemap_capable_): Use the new python script. * tests/Makefile.am (EXTRA_DIST): Include the new python script. 2011-02-08 Jim Meyering tests: randread-tests: use macro.h not "#define ASSERT..." * gl/modules/randread-tests (Files): Add tests/macros.h * gl/tests/test-rand-isaac.c: Remove now-unneeded #include directives. (ASSERT): Remove definition. Instead, include "macros.h". Prompted by suggestions from Bruno Haible. 2011-02-07 Jim Meyering maint: move di-set and ino-map modules from ./gl to gnulib * gl/lib/di-set.c: Remove file. * gl/lib/di-set.h: Likewise. * gl/lib/ino-map.c: Likewise. * gl/lib/ino-map.h: Likewise. * gl/modules/di-set: Likewise. * gl/modules/di-set-tests: Likewise. * gl/modules/ino-map: Likewise. * gl/modules/ino-map-tests: Likewise. * gl/tests/test-di-set.c: Likewise. * gl/tests/test-ino-map.c: Likewise. * gnulib: Update to latest, now that these two modules are there. 2011-02-07 Jim Meyering di-set: provide a lookup method This is required for patch, and hence is about to move to gnulib. * gl/lib/di-set.c (di_set_lookup): New function. * gl/lib/di-set.h: Declare it. * gl/tests/test-di-set.c (main): Exercise it. The bug was introduced on 2004-12-04 via commit 7380cf79. 2011-02-07 Jim Meyering cut: don't segfault for large unbounded range * src/cut.c (set_fields): When computing the maximum range endpoint, take into consideration the start of any unbounded range, like "999-". * NEWS (Bug fixes): Mention it. * tests/misc/cut (big-unbounded-b,c,f): Add tests. Reported by Paul Marinescu in http://debbugs.gnu.org/7993 The bug was introduced on 2004-12-04 via commit 7380cf79. 2011-02-05 Jim Meyering copy: don't let a failed lseek go undiagnosed Upon failed lseek, sparse_copy_finalize would mistakenly return true. Admittedly, that is very unlikely, since that particular lseek is attempted only if the preceding call to sparse_copy induced a hole at EOF (via lseek on the destination FD). However, now that sparse_copy has an output parameter, N_READ, there is no longer any reason to call lseek (fd, 0, SEEK_CUR), so... * src/copy.c (sparse_copy_finalize): Remove the function. (copy_reg): Call ftruncate with n_read, rather than sparse_copy_finalize with its now-unnecessary lseek. Lasse Collin spotted the bug in sparse_copy_finalize. 2011-02-04 Jim Meyering post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.10 * NEWS: Record release date. cp: avoid spurious failure on any non-linux kernel * src/extent-scan.c (extent_scan_read) [!linux]: Always set scan->initial_scan_failed so caller knows not to report the failure. tests: skip mv/i-3 on FreeBSD to avoid spurious failure * tests/mv/i-3: Skip when uname -s reports FreeBSD. 2011-02-03 Pádraig Brady sort: fix --debug key highlighting when key start after key end This case was overlooked in commit bdde34f9, 2010-08-05, "sort: tune and refactor --debug code, and fix minor underlining bug" * src/sort.c (debug_key): Don't adjust the key end when it's before the key start. * tests/misc/sort-debug-keys: Add a test case. 2011-02-02 Jim Meyering tests: correct part of fiemap-perf * tests/cp/fiemap-perf: Correct erroneous added test. Since nonexistent names were used, the final test ended up being "test =", which would always "succeed". build: update gnulib submodule to latest 2011-02-01 Pádraig Brady cp: fix the buffer size used when writing zeros * src/copy.c (write_zeros): This bug caused 4 or 8 bytes to be written at a time which is very inefficient. One could trigger the issue with `cp --sparse=never sparse non-sparse` on a file system that supports fiemap. 2011-01-31 Jim Meyering cp: always initialize extent_copy's output parameter * src/copy.c (extent_copy): Otherwise it would be used uninitialized. tests: exercise a rarely-used corner of copy.c * tests/cp/sparse-to-pipe: New test. * tests/Makefile.am (TESTS): Add it. cp: fix copying a sparse file to a pipe The recent FIEMAP-related changes made it so the unusual case of copying a sparse file to a non-regular destination (e.g., a pipe) would erroneously write one byte too many to that destination. That happened because extent_copy assumed that it could use lseek to obtain the number of bytes written to the output file descriptor. That was valid only for regular files. * src/copy.c (sparse_copy): Add a parameter, to be used by extent_copy, but not by reg_copy. Adjust callers. (extent_copy): Maintain new local, dest_pos, using new arg, n_read. Don't call lseek on dest_fd; use new var, dest_pos, instead. (copy_reg): Add unused arg. tests: gfs2 also supports FIEMAP * tests/init.cfg (fiemap_capable_): Add gfs2. Clarify comment. maint: remove unused inclusion of "fiemap.h" * src/copy.c: Don't include "fiemap.h". tests: factor fiemap-related predicate into init.cfg * tests/init.cfg (fiemap_capable_): New function. * tests/cp/fiemap-perf: Use it. * tests/cp/sparse-fiemap: Likewise. * tests/cp/fiemap-2: Likewise. maint: update copyright year lists in new files * src/extent-scan.h: Update copyright year list. * src/extent-scan.c: Likewise. * tests/cp/sparse-fiemap: Likewise. tests: modernize sparse-fiemap test * tests/cp/sparse-fiemap: Use print_ver_, not open-coded VERBOSE test. tests: remove duplicate fiemap-perf test * tests/cp/fiemap-perf: Copy block-comparing code from sparse-fiemap. * tests/cp/sparse-fiemap: The same test was here, alongside a much more involved test. Remove it, now that it is in its own file. 2011-01-30 Jim Meyering doc: NEWS: mention cp's improvement * NEWS (New Features): cp now copies sparse files efficiently. build: update gnulib submodule to latest copy, tee: assume EINTR is always defined: remove #ifdefs Don't use "#ifdef EINTR". dd.c has been doing that since 2004. * src/copy.c (sparse_copy): Remove #ifdef...#endif around EINTR use. * src/tee.c (tee_files): Remove #ifdef...#endif around EINTR use. If we need it, add something like this in system.h: /* When EINTR is not defined, define it to an improbable value so that each use does not have to be #ifdef'd. */ #ifndef EINTR # define EINTR 999988 #endif tests: cp/fiemap: exercise previously-failing parts * tests/cp/fiemap-2: New test. * tests/Makefile.am (TESTS): Add it. copy: make extent_copy use sparse_copy, rather than its own code * src/copy.c (extent_copy): Before this change, extent_copy would fail to create holes, thus breaking --sparse=auto and --sparse=always. I.e., copying a large enough file of all zeros, cp --sparse=always should introduce a hole, but with extent_copy, it would not. copy: remove obsolete comment * src/copy.c (sparse_copy): Remove now-obsolete comment about how we used to work around lack of ftruncate. Combine nested if conditions into one. copy: factor sparse-copying code into its own function, because we're going to have to use it from within extent_copy, too. * src/copy.c (sparse_copy): New function, factored out of... (copy_reg): ...here. Remove now-unused locals. fiemap copy: avoid leak-on-error * src/copy.c (extent_copy): Don't leak an extent_scan buffer on failed lseek, read, or write. fiemap copy: avoid a performance hit due to very small buffer * src/copy.c (extent_copy): Don't let what should have been a temporary reduction of buf_size (to handle a short ext_len) become permanent and thus impact the performance of all further iterations. fiemap copy: simplify post-loop logic; improve comments * src/copy.c (extent_copy): Avoid duplication in post-loop extend-to-desired-length code. fiemap copy: rename some locals (extent_copy): Rename locals: s/*ext_logical/*ext_start/ tests: ensure that FIEMAP-enabled cp copies a sparse file efficiently * tests/cp/fiemap-perf: New file. * tests/Makefile.am (TESTS): Add it. copy: don't allocate a separate buffer just for extent-based copy * src/copy.c (copy_reg): Move use of extent_scan to just *after* we allocate the main copying buffer, so we can... (extent_scan): Take a new parameter, BUF, and use that rather than allocating a private buffer. Update caller. copy: tweak variable name; improve a comment * src/copy.c (copy_reg): Rename a variable to make more sense from caller's perspective: s/require_normal_copy/normal_copy_required/. This is an output-only variable, and the original name could make it look like an input (or i&o) variable. copy: call extent_copy also when make_holes is false, ... so that we benefit from using extents also when reading a sparse input file with --sparse=never. * src/copy.c (copy_reg): Remove erroneous test of "make_holes" so that we call extent_copy also when make_holes is false. Otherwise, what's the point of that parameter? copy: remove else-after-goto and adjust indentation * src/copy.c (copy_reg): Remove useless else-after-goto. extent-scan: adjust naming and formatting * src/extent-scan.h [struct extent_scan]: Rename member: s/hit_last_extent/hit_final_extent/. "final" is clearer, since "last" can be interpreted as "preceding". Rename extent-scan functions to start with extent_scan_. * src/Makefile.am (copy_sources): Also distribute extent-scan.h. * src/extent-scan.c: Don't include error.h or quote.h. Neither is used. * src/copy.c: shorten a comment to fit in 80 columns * src/extent-scan.c, src/extent-scan.h: Correct formatting. fiemap copy: don't let write failure go unreported; adjust style, etc. * src/copy.c (write_zeros): Add comments. (extent_copy): Move decls of "ok" and "i" down to scope where used. Adjust comments. Rename local: s/holes_len/hole_size/ Print a diagnostic upon failure to write zeros. 2011-01-30 jeff.liu fiemap copy: add extent-scan.[ch], avoid a double-free and reorganize Changes: ======== 1. fix write_zeros() per Jim's comments. 2. remove char const *fname from struct extent_scan. 3. change the signature of open_extent_scan() from "void open_extent_scan(struct extent_scan **scan)" to "void open_extent_scan(struct extent_scan *scan)" to avoid having to malloc the extent_scan variable; instead save it on the stack. 4. move close_extent_scan() from a function defined in extent-scan.c to extent-scan.h as a macro definition, but it does nothing for now, since initial extent scan defined at stack. 5. add a macro "free_extents_info()" defined at extent-scan.h to release the memory allocated to extent info which should be called combine with get_extents_info(), it just one line, so IMHO, define it as macro should be ok. * src/extent-scan.c: New file; functions to read "extents". * src/extent-scan.h: Header file of extent-scan.c. * src/Makefile.am: Reference it and link it to copy_source. * src/copy.c: Use the new functions and avoid double-free. 2011-01-30 Jim Meyering build: distribute new test script, filefrag-extent-compare * tests/Makefile.am (EXTRA_DIST): Add filefrag-extent-compare. build: distribute new file, fiemap.h * src/Makefile.am (noinst_HEADERS): Add fiemap.h. 2011-01-30 Jie Liu copy.c: add FIEMAP_FLAG_SYNC to fiemap ioctl * src/copy.c (fiemap_copy): Force kernel to sync the source file before mapping. 2011-01-30 Jim Meyering fiemap.h: include , not * src/fiemap.h: Include stdint.h, not linux/types.h, now that this file uses only portable type names. 2011-01-30 Paul Eggert copy.c: ensure proper alignment of fiemap buffer * src/copy.c (fiemap_copy): Ensure that our fiemap buffer is large enough and well-aligned. Replace "0LL" with equivalent "0" as 3rd argument to lseek. 2011-01-30 Jim Meyering copy.c: adjust comments, tweak semantics * src/copy.c (fiemap_copy): Rename from fiemap_copy_ok. Add/improve comments. Remove local, "fail". (fiemap_copy): Do not require caller to set "normal_copy_required" before calling fiemap_copy. Report ioctl failure if it's the 2nd or subsequent call. tests: relax the root-tests cross-check * cfg.mk (sc_root_tests): Allow spaces before "require_root_", now that tests/cp/sparse-fiemap has a conditional use. tests: accommodate varying filefrag -v "flags" output * tests/cp/sparse-fiemap: Accommodate values other than "eof" in the "flags" column of filefrag -v output tests: exercise more of the new FIEMAP copying code * tests/cp/sparse-fiemap: Ensure that a file with many extents (more than fit in copy.c's internal buffer) is copied properly. Don't require root access if current partition is btrfs or xfs. Use init.sh, not test-lib.sh. * tests/filefrag-extent-compare: New file. 2011-01-30 Jie Liu tests: add a new test for FIEMAP-copy * tests/cp/sparse-fiemap: Add a new test for FIEMAP-copy against a loopbacked ext4 partition. * tests/Makefile.am (sparse-fiemap): Reference the new test. cp: copy sparse files efficiently using the FIEMAP ioctl * src/fiemap.h: Add fiemap.h for fiemap ioctl(2) support. Copied from linux's include/linux/fiemap.h, with minor formatting changes. * src/copy.c (copy_reg): Now, when `cp' is invoked with --sparse=[WHEN], we will try to do FIEMAP-copy if the underlying file system supports it, and fall back to a normal copy if it fails. 2011-01-30 Pádraig Brady doc: add alternatives for field processing not supported by cut * doc/coreutils.texi (cut invocation): Remove the tr -s '[:blank:]' example, as it doesn't handle leading and trailing blanks. Add `awk` examples for common field processing operations often asked about. Also document a `join` hack, to achieve the same thing. Note the join options are ordered so as to be compatible with other systems. 2011-01-30 Pádraig Brady join: don't report disorder against an empty file This allows one to use join as a field extractor like: join -a1 -o 1.3,1.1 - /dev/null * src/join.c (join): Don't flag unpairable lines when one of the files is empty. * tests/misc/join: Add a new test for empty input, and adjust a previous test that was only checking against empty input. * doc/coreutils.texi (join invocation): Document the change. * NEWS: Likewise. 2011-01-30 Pádraig Brady join: ensure --header skips the order check with empty files * src/join.c: Skip the header even if one of the files is empty. * tests/misc/join: Add a test case. * NEWS: Mention the fix 2011-01-30 Pádraig Brady join: add -o 'auto' to output a constant number of fields per line Lines with a different number of fields than the first line, will be truncated or padded. * src/join.c (prfields): A new function refactored from prjoin(), to output all but the join field. (prjoin): Don't swap line1 and line2 when line1 is blank so that the padding is applied to the right place. (main): Handle the -o 'auto' option. * tests/misc/join: Add 6 new cases to test the auto format. * NEWS: Mention the change in behavior. Suggestion from Assaf Gordon 2011-01-28 Jim Meyering tests: remove obsolete uses of "$$" in temporary file names Those were useful when tests might have been run in the same directory and in parallel. Now, each test is run in a newly- created empty directory. * tests/cp/backup-1: Remove obsolete uses of "$$". * tests/cp/same-file: Likewise. * tests/dd/misc: Likewise. * tests/mv/part-symlink: Likewise. * tests/mv/to-symlink: Likewise. * tests/touch/fail-diag: Likewise. 2011-01-26 Jim Meyering tests: don't hide all trace of the vc_exe_in_TESTS test There was a non-negligible delay after running a single test. Now, you'll know why when you see this test's name. * tests/check.mk (vc_exe_in_TESTS): Don't @-hide commands. Use $(AM_V_GEN) instead. 2011-01-25 Andreas Schwab tests: minor correction * tests/du/move-dir-while-traversing: Ignoring SIGTSTP is enough; don't also attempt to ignore SIGSTOP, it cannot be handled or ignored. Spotted by Andreas Schwab. 2011-01-25 Jim Meyering tests: avoid FP failure due to suspension * tests/du/move-dir-while-traversing: Prohibit suspension, to avoid false-positive failure. tests: avoid rare FP failure in new du test * tests/du/move-dir-while-traversing: Create an even larger tree to avoid a false-positive failure due to du terminating before the rename is triggered. 2011-01-24 Jim Meyering split: avoid a new, spurious warning from gcc-4.6.0 * src/split.c (lines_rr) [IF_LINT]: Initialize files, now that rawhide's gcc-4.6.0 would otherwise warn about use-uninitialized. tail: avoid new diagnostic when applying -f to a pipe on linux-2.3.38 * src/tail.c (fremote): Do not print a diagnostic when fstatfs (pipe_FD, &buf) fails, as it now does on linux-2.3.38. This avoids the spurious failure of tests/misc/tail's f-pipe-1 test, when running in input-from-pipe mode. 2011-01-21 Jim Meyering doc: fix wording in warning about potential conflict with built-in * doc/coreutils.texi (mayConflictWithShellBuiltIn): Fix wording. 2011-01-21 Paul Eggert manual: document floating point better * doc/coreutils.texi (Floating point): New section. (od invocation, tail invocation, sort invocation, printf invocation): (sleep invocation, seq invocation): Refer and defer to it. See . 2011-01-20 Jim Meyering build: update gnulib submodule to latest The previous gnulib submodule reference was *still* to a non-public commit. My submodule had a stray commit, so the reference was always to a local merge commit. Reported by Rob Vermaas. build: update gnulib submodule to latest The previous gnulib submodule reference was to a non-public commit. Reported by Rob Vermaas. 2011-01-19 Jim Meyering maint: use slightly more efficient process in README-release * README-release: Run cheaper root-only tests first. Use half of processing units (not just 1) for the expensive tests. 2011-01-18 Jim Meyering tests: avoid FP failure in new du test * tests/du/move-dir-while-traversing: Create a larger tree to avoid a false-positive failure due to du terminating before the rename is triggered. build: update gnulib submodule to latest doc: update NEWS * NEWS: Note when the uniq bug was introduced. It was mine, commit 1d9b3de9, "uniq: remove redundant test". 2011-01-17 Jim Meyering doc: show how to shred more efficiently * doc/coreutils.texi (shred invocation): Give an example showing how to invoke shred in single-pass mode, and warn that -n0 --zero may be inadequate. uniq: replace a wasteful loop with simple calculation * src/uniq.c (find_field): Remove the byte-skipping loop altogether. Instead, perform the simple calculation. This results in a 10% performance improvement for large byte offsets. tests: add a test for today's uniq bug * tests/misc/uniq-perf: New file. * tests/Makefile.am (TESTS): Add it. 2011-01-17 Sami Kerola uniq: don't continue field processing after end of line * NEWS (Bug fixes): Mention it. * src/uniq.c (find_field): Stop processing loop when end of line is reached. Before this fix, 'uniq -f 10000000000 /etc/passwd' would run for a very long time. 2011-01-15 Ondřej Vašík doc: specify how tr, echo, printf treat octal numbers * doc/coreutils.texi (tr's Character sets): Document how a 9-bit octal value is interpreted. tr does not ignore the ninth bit. (echo invocation, printf invocation): Document that any ninth bit in \OOO is ignored. (http://debbugs.gnu.org/7574) 2011-01-14 Pádraig Brady maint: refactor to use read-file from gnulib * bootstrap.conf: Add the read-file module * src/ptx.c: Replace the original code which would needlessly read SIZE_MAX bytes of files larger than this. * src/shuf.c: Replace the original code. 2011-01-13 Pádraig Brady maint: trivial system header file cleanups * src/system.h: Note where it should be included, and make ordering check portable to GLIBC > 2 * src/copy.c: Move along with other system headers as is done elsewhere. * src/install.c: Move along with other system headers as is done elsewhere. * src/ptx.c: Include rather than "regex.h" as is done elsewhere. Note is kept after "system.h" as per commit dba300a0. 2011-01-12 Jim Meyering doc: clean up HACKING guidelines * HACKING: Remove mention of "indent-tabs-mode: nil", since we've remove all of those directives. No longer needed. Remove dated (pre-emacs-23) reference regarding WhiteSpace mode. 2011-01-12 Paul Eggert gnulib: Also use dtoastr and ldtoastr modules. This adjusts to the recent splitting of the ftoastr module into 3 . * bootstrap.conf (gnulib_modules): Add dtoastr, ldtoastr, as coreutils needs all 3 modules now. build: update gnulib submodule to latest 2011-01-11 Nadav Har'El rm: ignore errno related to invalid file names * src/remove.c (nonexistent_file_errno): Also skip EINVAL and EILSEQ, for at least smbfs rejection of '*' in file names. * NEWS: Mention the fix. 2011-01-10 Jim Meyering build: update gnulib submodule to latest du: don't abort when a subdir is renamed during traversal * NEWS (Bug fixes): Mention it. * src/du.c (prev_level): Move declaration "up" to file-scope global. (du_files): Reset prev_level to 0 upon abnormal fts_read termination. Reported by Johathan Nieder in http://bugs.debian.org/609049 Also, improve a diagnostic. * tests/du/move-dir-while-traversing: Test for the above. * tests/Makefile.am (TESTS): Add it. 2011-01-07 Pádraig Brady maint: suppress some clang scan-build warnings * src/pr.c (char_to_clump): Remove a dead store. * src/remove.c (fts_skip_tree): Likewise. * src/sort.c (key_warnings): Likewise. (sort): Suppress an uninitialized pointer warning. maint: replace uses of ignore_ptr with ignore_value * gnulib: Update for enhanced ignore_value() * src/chcon.c (process_file): Don't use the deprecated ignore_ptr. * src/chmod.c (process_file): Likewise. * src/chown-core.c (change_file_owner): Likewise. 2011-01-04 Jim Meyering post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.9 * NEWS: Record release date. build: update gnulib to latest; portability fixes 2011-01-01 Jim Meyering maint: update all copyright year number ranges Run "make update-copyright". build: update gnulib for version-etc copyright year update * tests/sample-test: Update copyright to 2011, to appease syntax-check. 2011-01-01 Jim Meyering maint: generate much of the THANKS file Before this change, we had a tendency to manually list each contributor's name in THANKS. Now, each commit "Author" is included in the generated THANKS file automatically, and most of the old THANKS file is now a template, THANKS.in. We'll still have to manually list the names of people who report problems without a usable patch. * THANKS.in: New file, derived from THANKS, but removing names of those who are listed as git log 'Author:'s. * THANKS: Remove file. * thanks-gen: New file. * Makefile.am (THANKS): New rule. (EXTRA_DIST): Add .mailmap, THANKS.in and thanks-gen. * .gitignore: Add THANKS and THANKS-to-translators. * .mailmap: Unify on single address and name-spelling per contributor. 2010-12-31 Eric Blake maint: update to latest gnulib, for testsuite improvement * gnulib: Update to latest for init.sh fix. * bootstrap: Resync from gnulib. * tests/init.sh: Likewise. 2010-12-30 Eric Blake maint: allow gettext 0.17 again Commit 041c9c47 traded the 'gettext' module for the lighter 'gettext-h' module, so as to not require the latest gettext release (we only need the latest release if we ship gettext as a dependent library, but coreutils has long preferred to use it as an external library). But that commit overlooked two places necessary to allow the use of gettext 0.17. This does not force you to downgrade (using gettext 0.18.1.1 is still just fine), nor does it affect tarballs (once a tarball is built with a given gettext version, it can be built on other machines regardless of what gettext version is present). * bootstrap.conf (buildreq): Relax prerequisite. * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise. 2010-12-30 Pádraig Brady split: fix the suffix length calculation * src/split.c (set_suffix_length): Only auto-calculate the suffix length when the number of files is specified. * tests/misc/split-a: Add a case to trigger the bug, and exercise the suffix length auto-calculation. * NEWS: Mention the fix. Reported by Dmitry V. Levin and Sergey Vlasov at https://bugzilla.altlinux.org/show_bug.cgi?id=24841 2010-12-28 Paul Eggert coreutils: keep lines within 80-column limits * cfg.mk (LINE_LEN_MAX, FILTER_LONG_LINES): New macros. (sc_long_lines): New rule. * HACKING: Use shorter URLs to the same material. * doc/Makefile.am, doc/coreutils.texi, m4/boottime.m4: * man/help2man, man/stdbuf.x, src/Makefile.am, src/cat.c, src/copy.c: * src/cp.c, src/dd.c, src/df.c, src/du.c, src/groups.c, src/install.c: * src/ls.c, src/md5sum.c, src/mv.c, src/od.c, src/pinky.c, src/ptx.c: * src/readlink.c, src/remove.c, src/rmdir.c, src/setuidgid.c: * src/sort.c, src/tail.c, src/touch.c, tests/Coreutils.pm: * tests/cp/existing-perm-race, tests/cp/perm, tests/cp/preserve-gid: * tests/du/2g, tests/du/long-from-unreadable, tests/init.sh: * tests/install/basic-1, tests/ls/nameless-uid: * tests/ls/readdir-mountpoint-inode, tests/misc/chroot-credentials: * tests/misc/cut, tests/misc/date, tests/misc/join, tests/misc/md5sum: * tests/misc/sha1sum, tests/misc/sha224sum, tests/misc/sort: * tests/misc/sort-continue, tests/misc/sort-files0-from: * tests/misc/sort-rand, tests/misc/stdbuf, tests/misc/tr: * tests/misc/uniq, tests/mv/atomic, tests/mv/part-fail: * tests/mv/part-symlink, tests/mv/sticky-to-xpart, tests/pr/pr-tests: * tests/rm/fail-2eperm, tests/rm/interactive-always: Reformat to fit within 80 columns. * doc/Makefile.am (BAD_POSIX_PERL): New macro. * doc/coreutils.texi: Reword slightly, to make menus and index lines shorter. * src/md5sum.c: Redo --help output so that it fits within 79 columns, since that's a bit more portable and all the other --help strings fit in 79 columns. 2010-12-24 Jim Meyering maint: avoid syntax-check failure due to unused #include * src/getlimits.c: Don't include "c-ctype.h"; no longer used. 2010-12-23 Paul Eggert csplit: diagnose file counter wraparound * src/csplit.c (create_output_file): Detect overflow when the file counter wraps around, and exit with a diagnostic. Formerly the code silently wrapped around and wrote to the wrong file, losing output data. sort: minor performance tweak with num_processors * src/sort.c (main): Don't invoke num_processors twice. getlimits: port to hosts with very wide int, or non-ASCII * src/getlimits.c (decimal_ascii_add): Remove, replacing with ... (decimal_absval_add_one): New function, with different signature, which does not assume ASCII. All callers changed. (print_int): Remove assumptions that integers fit in 206 bits, and that characters are ASCII. These assumptions are portable in practice but are easy to remove here. 2010-12-22 Jim Meyering post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.8 * NEWS: Record release date. csplit: update gnulib for Solaris 8,9 snprintf fix maint: correct test-related comments * tests/mv/i-3: Adjust comment to match just-changed code. Spotted by Pádraig Brady. * tests/init.cfg (retry_delay_): Correct spelling of function name in usage example. tests: adjust preceding change to handle general WERROR_CFLAGS values * gnulib-tests/Makefile.am (test_xvasprintf_CFLAGS): (test_lock_CFLAGS, test_tls_CFLAGS): Avoid a syntax error when $(WERROR_CFLAGS) expands to more than one token. 2010-12-22 Paul Eggert tests: do not assume compiler knows -Wxxx flags * gnulib-tests/Makefile.am (test_xvasprintf_CFLAGS): (test_lock_CFLAGS, test_tls_CFLAGS): Do not append GCC-specific flags like -Wno-format-security unless the GCC-specific flag -Werror is also specified. This avoids a "make check" failure on Solaris when using Sun C 5.8. 2010-12-22 Jim Meyering tests: mv/i-3: avoid false-positive failure on a slow/busy system * tests/mv/i-3: Quadruple the timeout duration. Without this, I saw an expired timeout on a heavily-loaded system. 2010-12-21 Jim Meyering tests: avoid new false-positive failure on at least FreeBSD 8.1 * tests/mv/trailing-slash: Accommodate different diagnostic on FreeBSD 8.1. 2010-12-21 Paul Eggert who: omit useless definitions of MAXHOSTNAMELEN This prevents a compilation failure on Solaris 8, GCC 4.4.2, with "configure --enable-gcc-warnings". * src/who.c (MAXHOSTNAMELEN): Remove; no longer needed. * src/pinky.c: Likewise. 2010-12-20 Pádraig Brady maint: fix a typo in sort --parallel help message Also fix up Chen Guo's contacts * src/sort.c (usage): Add a missing "of" * THANKS: Add Chen Guo * .mailmap: Add Chen Guo's UCLA address 2010-12-20 Jim Meyering build: update gnulib: ACL-vs-Solaris 8 portability etc. 2010-12-19 Paul Eggert tests: sync init.sh from gnulib * tests/init.sh (setup_): Initialize fail=0 before invoking mktempd_. Ensure that IFS is defined initially. (mktempd_): Remove fail=0 initialization; no longer needed. 2010-12-19 Pádraig Brady wc: fix a possible hang with --files0-from * src/wc.c (main): exit when we get a read error on the --files0-from file, rather than retrying and spinning the CPU cp: ensure backups are created when -T specified * src/cp.c (do_copy): When -T is specified, initialize the NEW_DST and SB variables, which are checked when running: cp -T --force --backup file file * tests/cp/backup-1: Add the -T case sort: use at most 8 threads by default * src/sort.c (main): If --parallel isn't specified, restrict the number of threads to 8 by default. If the --parallel option is specified, then allow any number of threads to be set, independent of the number of processors on the system. * doc/coreutils.texi (sort invocation): Document the changes to determining the number of threads to use. Mention the memory overhead when using multiple threads. * tests/misc/sort-spinlock-abuse: Allow single core systems that support pthreads. * tests/misc/sort-stale-thread-mem: Likewise. * tests/misc/sort-unique-segv: Likewise. * NEWS: Mention the change in behaviour. 2010-12-18 Jim Meyering doc: split: add examples showing how to use the new option * doc/coreutils.texi (split invocation): Add examples. tests: avoid spurious du/bigtime failure * tests/du/bigtime: Map nonzero block count to 0. Reported by Assaf Gordon. * THANKS: Update. 2010-12-18 Paul Eggert tests: set fail=0 by default * tests/init.sh (setup_): Set fail=0. This was the intent as per but the assignment in mktempd_ is ineffective, since mktempd_ is used inside `` and its assignments are in a subshell. 2010-12-17 Jim Meyering build: update gnulib submodule to latest 2010-12-17 Paul Eggert sort: do not generate thousands of subprocesses for 16-way merge Without this change, tests/misc/sort-compress-hang would consume more than 10,000 process slots on my RHEL 5.5 x86-64 server, making it likely for other applications to fail due to lack of process slots. With this change, the same benchmark causes 'sort' to consume at most 19 process slots. The change also improved wall-clock time by 2% and user+system time by 14% on that benchmark. * NEWS: Document this. * src/sort.c (MAX_PROCS_BEFORE_REAP): Remove. (reap_exited): Renamed from reap_some; this is a more accurate name, since "some" incorrectly implies that it reaps at least one process. All uses changed. (reap_some): New function: it *does* reap at least one process. (pipe_fork): Do not allow more than NMERGE + 2 subprocesses. (mergefps, sort): Omit check for exited processes: no longer needed, and anyway the code consumed too much CPU per line when 2 < nprocs. 2010-12-16 Paul Eggert sort: fix hang with sort --compress * NEWS: Document this. * src/sort.c (UNCOMPRESSED, UNREAPED, REAPED): New constants. (struct tempnode): New member 'state', to hold these constants. The pid member is now undefined if state == UNCOMPRESSED. (struct sortfile): Replace member 'pid' with member 'temp'. (uintptr): Remove. (proctab_hasher, proctab_comparator, register_proc, delete_proc): Proctab entries are now struct tempnode *, not pid_t, to handle the case where multiple tempnode objects correspond to the same pid. This avoids a race condition that can cause a hang. (register_proc): Arg is now struct tempnode *, not pid_t. All callers changed. (delete_proc): Set tempnode state to REAPED. (create_temp_file): No need to set pid member here; it's now done when the pid is known. (maybe_create_temp, create_temp): Remove PPID arg. Return struct tempnode *, not char *. All callers changed. (maybe_create_temp): Set node state to UNCOMPRESSED or UNREAPED. No need to set node->pid to 0. (open_temp): Replace NAME and PID args with a single TEMP arg. All callers changed. Wait only for unreaped children. (zaptemp): Wait for decompressor to finish before removing its temporary-file input. This avoids .nfsXXXX hassles with NFS and fixes a race (leading to a hang) regardless of NFS. (open_input_files): Adjust to new way of dealing with temp files and their subprocesses. * tests/Makefile.am (TESTS): Add misc/sort-compress-hang. * tests/misc/sort-compress-hang: New file. sort: don't dump core when merging from input twice * NEWS: Document this. * src/sort.c (avoid_trashing_input): The previous fix to this function didn't fix all the problems with this code. Replace it with something simpler: just copy the input file. This doesn't change the number of files, so return void instead of the updated file count. Caller changed. * tests/misc/sort-merge-fdlimit: Test for the bug. 2010-12-14 Jim Meyering doc: tail: semi-deprecate --sleep-interval and --max-unchanged-stats Those options are useful only on systems that lack inotify support and in the unusual event that a system with inotify support must resort to polling. * src/tail.c (usage): Note that the --max-unchanged-stats=N and --sleep-interval=N options are rarely useful on systems with inotify support. * doc/coreutils.texi (tail invocation): Likewise. 2010-12-14 Paul Eggert sort: fix very-unlikely buffer overrun when merging to input file * src/sort.c (avoid_trashing_input): Fix a typo that could cause a buffer overrun in theory. In practice this is extremely unlikely, as it requires running out of file descriptors in a small merge, presumably because some other process is hogging all the OS's file descriptors. sort: document --compress reaper fixes * NEWS: Document the --compress reaper fixes installed yesterday. tests: default to /tmp as the temporary directory * tests/check.mk (TESTS_ENVIRONMENT): Default TMPDIR to /tmp, rather than to the working directory; this is more common in practice, which makes the tests more real-worldish; and it is often faster. Also, it avoids some problems with NFS cleanups. * tests/misc/sort-compress: Remove unnecessary code setting TMPDIR. * tests/misc/sort-compress-proc: Likewise. Do the final sleep only if TMPDIR is relative, which should be rarely given the change to TESTS_ENVIRONMENT. sort: fix some --compress reaper bugs * src/sort.c (uintptr): New type. (enum procstate, struct procnode, update_proc): Remove. (proctab_hasher, proctab_comparator, register_proc, wait_proc): (reap_some): The proctab is now simply a hash of process-IDs rather than of pointers to objects with reference counts and states; this is smaller and faster and easier to understand. (nprocs): Now pid_t, not size_t, since one cannot have more than PID_MAX children. (reap): If the argument is -1, wait; if 0 (a new value), do not. Delete pid from proctab as needed. Ignore children that are not in proctab, as they are from the program that exec'ed us and are irrelevant to our success or failure. (delete_proc, reap_all): New functions. (open_temp): Register the child. (sort): Clean up all children afterwards; without this patch, 'sort' sometimes missed failures in children due to race conditions. * tests/Makefile.am (TESTS): Add misc/sort-compress-proc. * tests/misc/sort-compress-proc: New file, to test for the bugs fixed above. 2010-12-13 Paul Eggert tests: typo fix * tests/misc/sort-stale-thread-mem: Fix typo in comment. 2010-12-13 Jim Meyering tests: tweak basic-1 to use warn_ rather than literal "exit 77" * tests/install/basic-1 (just_built_dd): Use warn_, rather than cat and exit 77. tests: mark new test as very expensive * tests/misc/sort-stale-thread-mem: Don't initialize fail=0 here; that is done in init.sh. This avoids a syntax-check failure. Invoke "Exit $fail" at end, too. Mark as a very expensive test. 2010-12-12 Paul Eggert tests: test for access to stale thread memory * tests/misc/sort-stale-thread-mem: New tests. * tests/Makefile.am (TESTS): Add it. 2010-12-11 Jim Meyering tests: avoid FP failure when run under valgrind * tests/misc/printenv: Filter out LD_PRELOAD, as the comment said, not LD_LIBRARY. sort: avoid segfault when using two or more threads This change does not fix the actual bug. That was done by commit c9db0ac6, "sort: preallocate merge tree nodes to heap". The fix was to store each "node" structure on the heap, not on the stack. Otherwise, a node from one thread's stack could be used in another thread after the first thread had expired (via pthread_join). This bug was very hard to trigger when using spinlocks, but easier once we began using mutexes. * NEWS (Bug fixes): Mention it. For details, see http://debbugs.gnu.org/7597. sort: syntax cleanup * src/sort.c (xfopen, debug_key, sortlines, sort, main): Adjust formatting: fix misplaced braces, use consistent spacing, split a 2-stmt line. 2010-12-11 Paul Eggert sort: integer overflow checks in thread counts, etc. * src/sort.c (specify_nthreads, merge_tree_init, init_node): (queue_init, sortlines, struct thread_args, sort, main): Use size_t, not unsigned long int, for thread counts, since thread counts are now used to compute sizes. (specify_nthreads): Check for size_t overflow. (merge_tree_init, sort): Shorten name of local variable, for readability. (merge_tree_init): Move constants next to each other in product, so that the constant folding is easier to see. (init_node): Now static. Add 'restrict' only where it might be helpful for compiler optimization. (queue_init): 2nd arg is now nthreads, not "reserve", which is a bit harder to follow. All uses changed. (struct thread_args): Rename lo_child to is_lo_child, so that it's obvious to the reader when we're talking about this boolean as opposed to the new lo_child member of the other structure. All uses changed. (sort): Remove unused local variable end_node. (main): Don't allow large thread counts to cause undefined behavior later, due to integer overflow. 2010-12-11 Chen Guo sort: preallocate merge tree nodes to heap. * src/sort.c: (merge_tree_init) New function. Allocates memory for merge tree nodes. (merge_tree_destory) New function. (init_node) New function. (sortlines) Refactor node creation code to init_node. Remove now superfluous arguments. All callers changed. (sort) Initialize/destory merge tree. Refactor root node creation to merge_tree_init. 2010-12-11 Paul Eggert sort: comment fix * src/sort.c: Comment fix re spin locks. 2010-12-11 Chen Guo sort: use mutexes, not spinlocks (avoid busy loop on blocked output) Running a command like this on a multi-core system sort < big-file | less would peg all processors at near 100% utilization. * src/sort.c: (struct merge_node) Change member lock to mutex. All uses changed. * tests/Makefile.am (XFAIL_TESTS): Remove definition, now that this test passes once again. I.e., the sort-spinlock-abuse test no longer fails. * NEWS (Bug reports): Mention this. Reported by DJ Lucas in http://debbugs.gnu.org/7489. 2010-12-09 Pádraig Brady split: fix a case where --elide-empty causes invalid chunking When -n l/N is used and long lines are present that both span partitions and multiple buffers, one would get inconsistent chunk sizes. * src/split.c (main): Add a new undocumented ---io-blksize option to support full testing with varied buffer sizes. (cwrite): Refactor most handling of --elide-empty to here. (bytes_split): Remove handling of --elide-empty. (lines_chunk_split): Likewise. The specific issue here was the first handling of elide_empty_files interfered with the replenishing of the input buffer. * test/misc/split-lchunk: Add -e and the new ---io-blksize combinations to the test. 2010-12-05 Jim Meyering tests: remove useless definition of $SORT in sort-compress * tests/misc/sort-compress (SORT): Remove unused definition. 2010-12-04 Jim Meyering tests: make it harder to lose a race in spinlock-abuse * tests/misc/sort-spinlock-abuse: On a busy system, with only 12 pauses of length 0.1 seconds, the buggy (busy-spinlock blocked) sort would fail to accumulate 1 second of CPU time, and hence would mistakenly pass. Increase from 12 to 50. 2010-12-04 Paul Eggert sort: merge_queue -> queue * src/sort.c (struct thread_args, sortlines_thread, sortlines, sort): Rename "merge_queue" to "queue", for consistency with other functions that just use the name "queue" for these things. sort: clarify queue_check_insert * src/sort.c (queue_check_insert): Clarify body a bit, and remove no-longer-needed comment. sort: fix problems with merge node dest pointer * src/sort.c (mergelines_node): Return void, not size_t. All callers changed. Change *node->dest here, not in caller. Do not change node->dest: it's not needed and could cause problems on (mostly theoretical) hosts that do not allow adding integers to null pointers. (queue_check_insert_parent): Omit MERGED parameter; no longer needed. All callers changed. sort: simplify write_unique * src/sort.c (write_unique): Simplify slightly so that there is just one call to write_line, not two. sort: put queue arg first * src/sort.c (queue_check_insert, queue_check_insert_parent): Make the queue arg first, for consistency with other functions such as queue_insert that put the queue arg first. Rename from check_insert and update_parent, respectively. All callers changed. sort: tune struct_merge_node slightly * src/sort.c (struct merge_node): 'lock' is now the actual lock, not a pointer to the lock; there's no need for indirection here. Make 'level' unsigned int instead of size_t, since it is a bit-shift count; also, move it next to a bool so that it's more likely to take less space. All uses changed. (sortlines, sort): Spell out initialization instead of using an initializer. This makes the initializer a bit easier to understand, and avoids unnecessary stores into the spin lock. sort: Clarify comments * src/sort.c: Improve comments a bit. 2010-12-03 Paul Eggert tests: cleanup rm -rf fails under NFS This problem was observed on RHEL 5.5 x86-64 when running as a client of a NetApp FAS2050. * tests/cp/cp-mv-backup: Don't leave a file descriptor open to a file in a directory that will be cleaned up with "rm -rf". Under NFS, when the rm unlinks that file, it is instead renamed to .nfsXXXX and then rm cannot remove the parent directory, and the test fails. * tests/cp/same-file: Likewise. cp: fix bug with fine-grained src to nearby coarse-grained dest The actual fix is in gnulib's lib/utimecmp.c. * NEWS: Document fix. build: update gnulib submodule to latest 2010-12-02 Paul Eggert sort: fix bug on 64-bit hosts with at least 32768 processors * src/sort.c (MAX_MERGE): Avoid integer overflow when on a machine with (say) 32-bit int and 64-bit size_t and when level == 15. Without this fix, on such a machine with 32768 or more processors, the level computation could overflow on large input, and this would result in division by zero. 2010-12-01 Jim Meyering tests: add test for parallel sort -u segfault bug * tests/misc/sort-unique-segv: New file. * tests/Makefile.am (TESTS): Add it. 2010-12-01 Paul Eggert sort -u: fix a thread-race pointer corruption bug * src/sort.c (write_unique): Save the entire "struct line", not just a pointer to one. Otherwise, with a multi-thread run, sometimes, with some inputs, fillbuf would would win a race and clobber a "saved->text" pointer in one thread just before it was dereferenced in a comparison in another thread. * NEWS (Bug fixes): Mention it. 2010-11-27 Jim Meyering tests: don't let the OMP_NUM_THREADS envvar affect sort tests * tests/envvar-check (vars): Add OMP_NUM_THREADS. tests: test for parallel sort spinlock abuse * tests/misc/sort-spinlock-abuse: New file. * tests/Makefile.am (TESTS): Add it. (XFAIL_TESTS): Mark this as an expected-to-fail (for now) test. 2010-11-27 Pádraig Brady tsort: suppress a valgrind memory leak warning * src/tsort.c (tsort): Unconditionally invoking the free() doesn't increase scalability, so do it only with -Dlint 2010-11-24 Pádraig Brady maint: update the valgrind support script * README-valgrind: Include the "noinst" programs in those wrapped by valgrind. Update $PATH in check.mk rather than Makefile.am. Make wrapper scripts work when suppressions not setup. Keep lines < 80 chars. 2010-11-22 Paul Eggert cp: give a better diagnostic for nonexistent dest/ This patch was written by Jim Meyering and myself. * src/copy.c (copy_reg): Turn EISDIR to ENOTDIR to improve the quality of diagnostics for commands like "cp a nosuch/". Reported by Марк Коренберг and Alan Curry in the thread starting at: http://lists.gnu.org/archive/html/bug-coreutils/2010-11/msg00178.html * THANKS: Update. * tests/mv/trailing-slash: Add a test. 2010-11-22 Chen Guo split: add --number to generate a particular number of files * src/split.c (usage, long_options, main): New options --number, --unbuffered, --elide-empty-files. (set_suffix_length): New function to auto increase suffix length to handle a specified number of files. (create): New function. Refactored from cwrite() and ofile_open(). (bytes_split): Add max_files argument to support byte chunking. (lines_chunk_split): New function. Split file into chunks of lines. (bytes_chunk_extract): New function. Extract a chunk of file. (of_info): New struct. Used by functions lines_rr and ofile_open to keep track of file descriptors associated with output files. (ofile_open): New function. Shuffle file descriptors when there are more output files than available file descriptors. (lines_rr): New function to distribute lines round-robin to files. (chunk_parse): New function. Parses K/N syntax. * tests/misc/split-bchunk: New test for byte chunking. * tests/misc/split-lchunk: New test for line delimited chunking. * tests/misc/split-rchunk: New test for round-robin chunking. * tests/Makefile.am: Reference new tests. * tests/misc/split-fail: Add failure scenarios for new options. * tests/misc/split-l: Fix a typo. s/ln/split/. * doc/coreutils.texi (split invocation): Document --number. * NEWS: Mention the new feature. * .mailmap: Map new email address for shortlog. 2010-11-19 Jim Meyering build: update gnulib to fix a syntax error in a test 2010-11-18 Jim Meyering maint: avoid NEWS-related syntax-check failure * NEWS: Add 2nd blank line to separate latest changes from those of 8.7, to avoid syntax-check failure. 2010-11-18 Paul Eggert od: fix bugs in displaying floating-point values * NEWS: Describe patch. * bootstrap.conf (gnulib_modules): Add ftoastr. * src/od.c: Include ftoastr.h, not float.h. (FLT_DIG, DBL_DIG): Remove. No need to verify LDBL_DIG. (FMT_BYTES_ALLOCATED): No need to worry about floating point now, since this format is no longer used for floating point. (PRINT_FIELDS): New macro, with most of the guts of the old PRINT_TYPE. (PRINT_TYPE): Rewrite to use PRINT_FIELDS. (PRINT_FLOATTYPE): New macro. This uses the new functions from ftoastr. (print_float, print_double, print_long_double): Reimplement using PRINT_FLOATTYPE. (decode_one_format): Calculate field widths based on ftoastr-supplied macros. * tests/Makefile.am (TESTS): Add misc/od-float. * tests/misc/od-float: New file. build: update gnulib submodule to latest 2010-11-18 Jim Meyering maint: syntax-check: prevent new $VERBOSE/--version tests * cfg.mk (sc_prohibit_verbose_version): New rule. 2010-11-17 Jim Meyering tests: convert tests/misc/selinux manually 2010-11-17 Jim Meyering tests: convert the multi-prog $VERBOSE/--version uses E.g., -test "$VERBOSE" = yes && { env -- pwd --version; readlink --version; } +print_ver_ pwd readlink -test "$VERBOSE" = yes && { stdbuf --version; mv --version; } +print_ver_ stdbuf mv Use this command: git grep -l 'VERBOSE.*--version'|xargs perl -ni \ -e '/^test "\$VERBOSE" = yes && { .*--version/ or print,next;' \ -e 's/env -- //g;' \ -e 's/test "\$VERBOSE" = yes && { /print_ver_ /;' \ -e ' s/(\w+) --version;/$1/g; s/ *}$//; print' 2010-11-17 Jim Meyering tests: convert "... env -- prog --version" uses E.g., -test "$VERBOSE" = yes && env -- pwd --version +print_ver_ pwd git grep -l 'VERBOSE.*--version'|xargs perl -pi -e \ 's/test "\$VERBOSE" = yes && env -- (\w+) --version/print_ver_ $1/' 2010-11-17 Jim Meyering tests: substitute the single-program $VERBOSE/--version uses Automatically make all of the changes like this: -test "$VERBOSE" = yes && chgrp --version +print_ver_ chgrp git grep -l 'VERBOSE.*--version'|xargs perl -pi -e \ 's/test "\$VERBOSE" = yes && (\w+) --version/print_ver_ $1/' 2010-11-17 Jim Meyering tests: factor out VERBOSE-only --version-printing code * tests/init.cfg (print_ver_): New function. tests: remove test-lib.sh; now all tests use gnulib's init.sh * tests/test-lib.sh: Remove file. No longer used. * tests/Makefile.am (EXTRA_DIST): Remove it here, too. * tests/sample-test: Correct a comment. tests: convert remaining uses of test-lib.sh to init.sh RHS='. "\${srcdir=.}/init.sh"; path_prepend_ ../src' git grep -l test-lib.sh \ | xargs perl -pi -e 's,^\. \$srcdir/test-lib\.sh$,'"$RHS", tests: convert 'if test "$VERBOSE" = yes; then' to test ... && 2010-11-17 Jim Meyering tests: convert first batch of tests from test-lib.sh to init.sh Initially, I did this, git grep -l srcdir/test-lib.sh|xargs perl -p0i -e '~180-byte script' but that line would have been much longer than the maximum permitted by coreutils' commit hook, and wasn't readable besides, so here's a more readable version: lhs=$(printf '%s\\n' \ 'if test "$VERBOSE" = yes; then' \ ' set -x' \ ' touch --version' \ 'fi' \ '' \ '. $srcdir/test-lib.sh' \ | sed 's/\$/\\\$/g;s/touch/(\\w+)/') rhs=$(printf '%s\\n' \ '. "${srcdir=.}/init.sh"; path_prepend_ ../src' \ 'test "$VERBOSE" = yes && FIXME --version' \ | sed 's/\$/\\\$/g;s/FIXME/\$1/') git grep -l srcdir/test-lib.sh|xargs perl -p0i -e "s,$lhs,$rhs," 2010-11-17 Jim Meyering tests: move a comment so automated conversion works maint: add a NEWS-checking syntax-check rule * cfg.mk (sc_NEWS_two_empty_lines): New syntax-check rule. 2010-11-16 Pádraig Brady build: add `patch` as a bootstrap dependency * bootstrap.conf (buildreq): require `patch` as it's used by gnulib-tool to apply local diffs to gnulib modules split: fail immediately if impossible to create a large file * src/split.c (main): Error if -[bC] value > OFF_T_MAX * tests/misc/split-fail: Adjust for the new lower limits truncate: fix a very unlikely case for undiagnosed errors src/truncate.c (main): Use a bool to store if an error occurred, rather than an int, to protect against overflow. (do_ftruncate): Likewise. Also change 0/false to mean failure rather than success. maint: fix a new -Wpointer-sign gcc warning * src/csplit.c (max_out): Fix a new warning introduced with commit 6568b173, 2010-11-10, "csplit: do not rely on..." 2010-11-16 Pádraig Brady build: enable the -Wpointer-sign gcc warning ... when configured with the --enable-gcc-warnings option. This follows on from commit 34ef0a01, 2010-10-14, "sort: fix unportable cast of unsigned char * -> char *" * configure.ac: -Wall implicitly enables this warning so remove the explicit disabling. 2010-11-15 Pádraig Brady maint: add a missed fadvise-tests module * gl/modules/fadvise-tests: Add the module previously missed in commit 63b5e816, 2010-07-14, "fadvise: new module ...". * gl/tests/test-fadvise.c: Add a comment as to why we don't check return values. 2010-11-13 Paul Eggert doc: tweak NEWS and coreutils.texi * doc/coreutils.texi (stat invocation): Add sentence-ending period. * NEWS: Correct stat change description: s/floating point //. * cfg.mk (old_NEWS_hash): Update, to match this NEWS change. 2010-11-13 Jim Meyering post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.7 * NEWS: Record release date. build: update gnulib... ...to fix the failing update-copyright test, and for the openat portability fix. build: update gnulib for linux 2.6.9 nanosleep workaround Also, do the following to avoid "make syntax-check" failure induced by new rules. * .x-sc_bindtextdomain: Exempt files with an #ifdef'd "main". * Makefile.am: Add this file. maint: remove fstimeprec (variable precision time stamp) support The implementation of variable-precision time stamps relied on heuristics that made the output subtly nondeterministic, or at least hard to reproduce: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/21531/focus=21538 So, for now at least, we're removing that feature. * bootstrap.conf (gnulib_modules): Remove fstimeprec. * gl/lib/fstimeprec.c, gl/lib/fstimeprec.h: Remove files. * gl/modules/fstimeprec, gl/modules/fstimeprec-tests: Likewise. * gl/tests/test-fstimeprec.c: Remove file. stat: do not provide variable precision time stamps * src/stat.c: Don't include fstimeprec.c. (out_epoch_sec): Don't call fstimeprec. * NEWS: Update description. * doc/coreutils.texi: Likewise. 2010-11-11 Paul Eggert csplit: do not rely on undefined behavior in printf formats * doc/coreutils.texi (csplit invocation): Say that %d and %i are aliases for %u. * src/csplit.c (FLAG_THOUSANDS, FLAG_ALTERNATIVE): New constants. (get_format_flags): Now take char const * and int * and return size_t. It now stores info about the flags instead of merely scanning them. Also, it handles '0' correctly. Drop support for the undocumented '+' and ' ' flags since the value is unsigned. Add support for the (undocumented) "'" flag. All uses changed. (get_format_width, get_format_prec): Remove. (check_format_conv_type): Renamed from get_format_conv_type, with a different signature. It now converts the format to one that is compatible with unsigned int, and checks flags. All uses changed. (max_out): Have snprintf compute the number of bytes needed rather than attempting to do it ourselves (which doesn't work portably with outlandish formats such as %4294967296d). (check_format_conv_type, main): Check for overflow in size calculations. Don't assume size_t fits in unsigned int. * tests/misc/csplit: Check for proper handling of flags, with %0#6.3x. Coreutils 8.6 mishandles this somewhat-weird example. 2010-11-11 Pádraig Brady csplit: fix a memory leak per input buffer * src/csplit.c (free_buffer): Also free the line offsets buffers (remove_line): Also free the containing structure * tests/misc/csplit-heap: A new test to trigger with leaks of this magnitude. * tests/Makefile.am: Reference the new test * NEWS: Mention the fix Reported by David Hofstee 2010-11-10 Jim Meyering tests: fix comments and --version invocation in new test * tests/misc/csplit-1000: Fix comments and --version invocation. csplit: avoid buffer overrun when writing more than 999 files Without this fix, seq 1000 | csplit - /./ '{*}' would write the NUL-terminated file name, xx1000, into a buffer of size 6. * src/csplit.c (main): Use properly sized file name buffer. * NEWS (Bug fixes): Mention it. * tests/misc/csplit-1000: New test to trigger the bug. * tests/Makefile.am (TESTS): Add misc/csplit-1000. 2010-11-09 Pádraig Brady tests: avoid portability problem with dash vs. symlinked ttys * tests/mv/i-3: Adjust so that the symlink is resolved before redirecting to the background command, as otherwise the stdin descriptor passed to the command will fail the isatty() or ttyname() test. 2010-11-08 Pádraig Brady tests: avoid portability problem with dash vs. local v=$splittable_val * tests/init.cfg (retry_delay_): Adjust awk script to print a single floating point value, rather than many. 2010-11-07 Jim Meyering tests: don't disqualify FreeBSD 8.1's /bin/sh just yet, because dash-0.5.6-2.fc14.x86_64 would also be disqualified. This reverts part of yesterday's commit 6c058b2d, "tests: avoid failure due to bug in FreeBSD 8.1's /bin/sh". Note that the offending aspect of those shells is not officially a bug, since "local" is not specified by POSIX. However, it is very unintuitive that prepending "local" to an existing, standards-compliant assignment would evoke such a fundamental change in semantics. * tests/init.sh: Remove snippet requiring sane "local" support. Upstream dash bug report: http://thread.gmane.org/gmane.comp.shells.dash/419 2010-11-07 Paul Eggert stat: do not rely on undefined behavior in printf formats * src/stat.c (digits, printf_flags): New static vars. (make_format): New function. (out_string, out_int, out_uint, out_uint_o, out_uint_x): (out_minus_zero): Use it to avoid undefined behavior when invoking printf. (print_it): Check for invalid conversion specifications such as %..X and %1-X, which would otherwise rely on undefined behavior when invoking printf. * tests/misc/stat-nanoseconds: Check that the "I" printf flag doesn't mess up in the C locale, as it formerly did on non-GNU hosts. 2010-11-06 Jim Meyering tests: avoid failure due to bug in FreeBSD 8.1's /bin/sh * tests/init.sh: Arrange not to accept FreeBSD 8.1's /bin/sh, since it fails this test: /bin/sh -c 'f(){ local s=$IFS; test -n "$s"; }; f' * tests/init.cfg (sanitize_path_): Stop-gap measure to work around a bug in FreeBSD 8.1's /bin/sh. We'll un-do this change once all 300+ tests use init.sh. build: update gnulib to latest for strtod and icc fixes 2010-11-06 Paul Eggert stat: use e.g. %.3X instead of %X.%3:X for sub-second precision * NEWS: Document this. * doc/coreutils.texi (stat invocation): Likewise. * gl/lib/fstimeprec.c, gl/lib/fstimeprec.h, gl/modules/fstimeprec: * gl/modules/fstimeprec-tests, gl/tests/test-fstimeprec.c: New files. * bootstrap.conf (gnulib_modules): Add fstimeprec. * src/stat.c: Include fstimeprec.h. Don't include xstrtol.h. (decimal_point, decimal_point_len): New static vars. (main): Initialize them. (epoch_sec, out_ns): Remove. (out_int, out_uint): Now returns whatever printf returned. (out_minus_zero, out_epoch_secs): New functions. (print_stat): Use out_epoch_sec instead of out_ns and epoch_sec. (print_stat, print_it, usage): Remove the %:X-style formats. * tests/misc/stat-nanoseconds: Set TZ=UTC0 to avoid problems with weird time zones. Use a time stamp near the Epoch so that we don't have to worry about leap seconds. Redo test cases to match new behavior. * tests/touch/60-seconds: Change %Y.%:Y to %.9Y, to adjust to new behavior. 2010-11-04 Eric Blake cp: NEWS entry for previous fix Resolves bug#7324 * NEWS: Document the extent of the Solaris crash. 2010-11-04 Eric Blake cp, mv, touch: fix file time manipulation on Solaris 10 * gnulib: Update to latest, for futimens fix. * .gitignore: Ignore another recent gnulib-generated file. 2010-11-03 Jim Meyering build: update gnulib to latest stat: revert %X-%Y-%Z change; use e.g., %:X to print fractional seconds This reverts part of the recent commit 9069af45, "stat: print timestamps to full resolution", which made %X, %Y, %Z print floating point numbers. We prefer to retain portability of %X, %Y and %Z uses, while still providing access to full-resolution time stamps via modified format strings. Also make the new %W consistent. * src/stat.c: Include "xstrtol.h". (print_it): Accept a new %...:[XYZ] format directive, e.g., %:X, to print the nanoseconds portion of the corresponding time. For example, %3.3:Y prints the zero-padded, truncated, milliseconds part of the time of last modification. (print_it): Update print_func signature to match. (neg_to_zero): New helper function. (epoch_time): Remove function; replace with... (epoch_sec): New function; use timetostr. (out_ns): New function. Use "09" only when no other modifier is specified. (print_statfs): Change type of "m" to unsigned int, now that it must accommodate values larger than 255. (print_stat): Likewise. Map :X to a code of 'X' + 256. Likewise for Y, Z and W. (usage): Update. * tests/touch/60-seconds: Use %Y.%:Y in place of %Y. * tests/misc/stat-nanoseconds: New file. * tests/Makefile.am (TESTS): Add it. * NEWS (Changes in behavior): Mention this. With improvements by Pádraig Brady. Thanks to Andreas Schwab for raising the issue. 2010-11-01 Nix tests: fix a false positive for 32 bit on 64 bit hosts * tests/ls/stat-free-symlinks: strace currently outputs an informational message about arch difference to stdout. Therefore we need to strip that before comparison. 2010-10-28 Patrick W. Plusnick II maint: remove an unnecessary FIXME comment * src/seq.c (terminator): This does not need to be specifiable via an option. Remove the FIXME comment. 2010-10-27 Pádraig Brady cp: make --attributes-only override --reflink completely * doc/coreutils.texi (cp invocation): Change the description slightly so as users might not immediately discount using this option. Mention that --reflink is overridden by the other linking options and --attributes-only, and give an example where this might be useful. * src/copy.c (copy_internal): Bypass the reflink if --attributes-only is specifed. * tests/cp/reflink-perm: Ensure both --reflink modes are overridden by --attributes-only. * NEWS: Mention the change in behavior. Reported by Jim Meyering. 2010-10-26 Jim Meyering tests: mention that btrfs also causes failure of misc/ls-time * tests/misc/ls-time: Mention that this test also fails on btrfs, at least until http://bugzilla.redhat.com/591068 is addressed. 2010-10-25 Eric Blake maint: update THANKS * THANKS: Update. 2010-10-25 Tobias Quathamer date: correct typos in date --help * src/date.c (usage): Use "e.g." correctly. 2010-10-25 Pádraig Brady tail: support rechecking currently missing remote dirs src/tail.c (main): As an optimization, don't bother checking for stdin or remote files, when ---disable-inotify is specified. To improve the fix in commit 61b77891, set the disable_inotify flag when we fall back to polling, so that we recheck remote files. NEWS: Mention the fix 2010-10-24 Paul Eggert du: don't print junk when diagnosing out-of-range time stamps * src/du.c (show_date): Fix call to fputs with a buffer that contains some uninitialized data. * tests/Makefile.am (TESTS): Add du/big-timestamp. * tests/du/bigtime: New file, which checks for the bug. 2010-10-20 Rodrigo Campos doc: add a cross reference from cat's man page to "tac" * man/cat.x: See also "tac". 2010-10-19 Jim Meyering tests: trigger and test for md5sum's new diagnostics * tests/misc/md5sum: Test for new diagnostics. 2010-10-19 Benno Schulenberg md5sum: print a summary warning for improperly formatted lines And remove the now-superfluous totals from the other two warnings, so the plurals will also work in other languages than English. * src/md5sum.c (digest_check): Change as above. * tests/misc/md5sum (check-quiet2): Adjust accordingly. 2010-10-18 Jim Meyering build: enable -Werror for gnulib-tests, too * gnulib: Update to latest for warning-free tests. * gnulib-tests/Makefile.am (AM_CFLAGS): Uncomment $(WERROR_CFLAGS), now that these tests are warning-free. 2010-10-17 Jim Meyering maint: update bootstrap from gnulib * bootstrap: Update from gnulib. .gitignore: anchor patterns * .gitignore: Anchor most patterns. Remove .tarball-version. * doc/.gitignore: Anchor all patterns. Remove getdate.texi and get_date.texi. tests: sort-float: avoid spurious test failure on ppc/ppc64 * tests/misc/sort-float: On systems with DBL_MIN < LDBL_MIN, this test would fail because the expected output was not sorted. Detect that case, and if needed, reverse those two values. 2010-10-16 Andreas Schwab fold: fix fadvise hint * src/fold.c (fold_file): Apply fadvise to istream, not stdin. This bug would have inhibited the fadvise optimization when not reading from standard input. 2010-10-15 Jim Meyering post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.6 * NEWS: Record release date. build: update gnulib for vasnprintf fix 2010-10-14 Paul Eggert bug#7213: [PATCH] sort: fix buffer overrun on 32-bit hosts when warning re obsolete keys * src/sort.c (key_warnings): Local buffer should be of size INT_BUFSIZE_BOUND (uintmax_t), not INT_BUFSIZE_BOUND (sword). This bug was discovered by running 'make check' on a 32-bit Solaris 8 sparc host, using Sun cc. I saw several other instances of invoking umaxtostr on a buffer declared to be of size INT_BUFSIZE_BOUND (VAR), and these instances should at some point be replaced by INT_BUFSIZE_BOUND (uintmax_t) too, as that's a less error-prone style. tests: work around portability and clock-skew problems * tests/misc/ls-misc (push_ls_colors): Don't assume LS_COLORS is set. This part of the fix is by Jim Meyering. (sl-dangle2, sl-dangle3, sl-dangle4, sl-dangle5): Don't assume that newly-created files will have time stamps in the past. They might not, due to clock skew, if the file systems are remote. http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/21322/focus=21346 install: avoid warning with Solaris 10 cc * src/install.c (extra_mode): Don't assign ~S_IRWXUGO & ~S_IFMT to a mode_t variable, as the number might be too big to fit. Solaris 10 cc warns about this, and the C standard says it has undefined behavior. mbsalign: avoid warning with Solaris 10 cc * gl/lib/mbsalign.c: Include for SIZE_MAX. Use SIZE_MAX rather than (size_t) -1, to avoid warning for "size_t x = -1" on Solaris 10 cc. * gl/modules/mbsalign (Depends-on): Add stdint. sort: fix unportable cast of unsigned char * -> char * * src/sort.c (fold_toupper): Change this back from char to unsigned char, fixing a portability issue introduced in commit 59e2e55d0f154a388adc9bac37d2b45f2ba971f8 dated February 26, as the C Standard doesn't let you convert from unsigned char * to char * without a cast, and the (in theory more portable) style here is to convert char values, not pointer values. (getmonth): Convert char to unsigned char when needed for comparison. 2010-10-13 Jim Meyering build: prepare to enable -Werror also for gnulib-tests/ * configure.ac (GNULIB_WARN_CFLAGS): Define new variable, for use in gnulib-tests. * gnulib-tests/Makefile.am: Disable specific -W___ options, but only for a few specific offending tests: (test_xvasprintf_CFLAGS): Define. (test_lock_CFLAGS, test_tls_CFLAGS): Define. 2010-10-13 Paul Eggert tests: fix rand-isaac test * gl/tests/test-rand-isaac.c (main): Fix swapped arguments to strtol. 2010-10-12 Pádraig Brady tail: fix checking of currently unavailable directories * src/tail.c (tail_forever_inotify): Handle the case where tail --follow=name with inotify, is not able to add a watch on a specified directory. This may happen due to inotify resource limits or if the directory is currently missing or inaccessible. In all these cases, revert to polling which will try to reopen the file later. Note inotify returns ENOSPC when it runs out of resources, and instead we report a particular error message, lest users think one of their file systems is full. (main): Document another caveat with using inotify, where we currently don't recheck directories recreated after the initial watch is setup. * tests/tail-2/F-vs-rename: Fix the endless loop triggered by the above issue. * tests/tail-2/inotify-hash-abuse: Likewise. * tests/tail-2/wait: Don't fail in the resource exhaustion case. * tests/tail-2/F-vs-missing: A new test for this failure mode which was until now just triggered on older buggy linux kernels which returned ENOSPC constantly from inotify_add_watch(). * NEWS: Mention the fix. 2010-10-11 Jim Meyering build: update gnulib to latest; to fix failing Solaris 5.11 test maint: add new file: .mailmap * .mailmap: Map git author names and email addresses to canonical/preferred form. This file is used e.g., by "git shortlog". 2010-10-08 Jim Meyering build: update gnulib, to fix OpenBSD test failures build: update gnulib to latest; for parse-datetime.y fix build: update gnulib to latest, to avoid FreeBSD compilation failure: http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/23501 2010-10-07 Pádraig Brady split: fix reporting of read errors The bug was introduced with commit 23f6d41f, 19-02-2003. * src/split.c (bytes_split, lines_split, line_bytes_split): Correctly check the return from full_read(). * tests/misc/split-fail: Ensure split fails when it can't read its input. * NEWS: Mention the fix. 2010-10-06 Jim Meyering build: update gnulib to latest, for memmem/strstr fix maint: describe coreutils' policy on copyright year number ranges * README: Mention coreutils' long-standing policy on use of M-N ranges in copyright year lists. Requested by Richard Stallman. 2010-10-05 Eric Blake build: complete the rename of get_date * gnulib: Update to latest. * src/date.c (includes, batch_convert, main): Track rename. * src/touch.c (includes, get_reldate): Likewise. * doc/coreutils.texi (Top, Date input formats): Likewise. * bootstrap.conf (gnulib_modules): Likewise. * doc/Makefile.am (EXTRA_DIST): Likewise. * doc/.gitignore: Likewise. * bootstrap: Synchronize from upstream. stat: drop %C support when printing file system details * src/stat.c (print_statfs, usage): Drop %C, since it applies to files, not file systems. (out_file_context): Match style of other out_* functions. (print_stat): Update caller. * doc/coreutils.texi (stat invocation): Document %C. * NEWS: Document the change. build: fix build on Solaris 10 * gnulib: Update to latest, for reduced -lgen scope. * bootstrap: Synchronize from upstream. Reported by Clemens Brogi, as bug #7142. 2010-10-05 Pádraig Brady stat: adjust the printing of SELinux context * src/stat.c (default_format): Don't print SELinux context when in file system (-f) mode, as the context is associated with the file, not the file system. Fix logic inversion, so that in terse mode, %C is included only when is_selinux_enabled and not vice versa. 2010-10-04 Pádraig Brady tests: refactor the stat-birthtime test to use retry_delay_ * tests/misc/stat-birthtime: This recently added test fits the pattern of requiring a delay to pass, so get it to use retry_delay_() 2010-10-03 Jim Meyering maint: add a release prerequisite: check the NixOS/Hydra autobuilder * README-release: Add a note to check the autobuilder. build: update gnulib submodule to latest maint: suppress a bogus used-uninitialized warning in tr.c * src/tr.c (string2_extend): Insert an abort call to tell gcc that char_to_repeat is not used uninitialized. 2010-10-01 Eric Blake tests: output --version of program under test This touches all new tests added since commit b062bbd9, when init.cfg was added. Older tests still exist that could use conversion, but we can address those later. * tests/sample-test: Restore hint for --version output. * tests/misc/stat-birthtime: Include --version if verbose. * tests/misc/tr-case-class: Likewise. * tests/misc/stat-mount: Likewise. * tests/misc/sort-unique: Likewise. * tests/misc/sort-benchmark-random: Likewise. Suggested by Jim Meyering. 2010-10-01 Eric Blake stat: print SELinux context when available * src/stat.c (default_format): Include context when present. * NEWS: Update blurb explaining the replacement for -Z. 2010-10-01 Eric Blake stat: optimize and translate default format strings Yes, this patch intentionally leaks the results of default_format(), since it is called only twice, and since the results are in scope until main() exits. Not worth the extra code to pacify valgrind. * src/stat.c (main): Hoist default format computation out of loop. (do_statfs, do_stat): Move default format generation... (default_format): ...into new function. Allocate the result in pieces, rather than repeating mostly-similar chunks. Allow translation of verbose format. Pass a second format to do_stat, for the one aspect of the default format that is conditional on file type. * NEWS: Document the translation aspect. 2010-10-01 Eric Blake stat: print timestamps to full resolution * src/stat.c (epoch_time): New function. (print_stat): Use it for %[WXYZ]. * NEWS: Document this. * tests/touch/60-seconds: Adjust test to match. * tests/misc/stat-birthtime: Likewise. stat: support printing birthtime * src/stat.c (print_stat): New %w and %W formats. (do_stat): Include %w in default format. (usage): Document new specifiers. * doc/coreutils.texi (stat invocation): Likewise. * NEWS: Likewise. maint: update sample test template * tests/sample-test: Recommend modern idiom. 2010-10-01 Pádraig Brady maint: ensure the mbsalign module is C89 compatible This module may be moved to gnulib at some stage, so keep it C89 compatible. * gl/lib/mbsalign.c (mbsalign): Declare variables at start of scope (ambsalign): Likewise * gl/lib/mbsalign.h: Remove trailing comma from enum Reported by Andrei Suhan 2010-09-30 Eric Blake maint: update gnulib * gnulib: Update to latest. * doc/coreutils.texi (date): Reflect new module name. * doc/Makefile.am (EXTRA_DIST): Likewise. * doc/.gitignore: Likewise. maint: update gnulib * gnulib: Update to latest. * bootstrap.conf (gnulib_modules): Reflect new module name. * bootstrap: Resync from upstream. 2010-09-30 Jim Meyering maint: mention the du-exclude--vs--cycle-dir fix * NEWS (Bug fixes): Mention the du-exclude--vs--cycle-dir fix. Reported by Graham Cobb in http://bugs.debian.org/598438, that bug was fixed by the 2010-07-24 commit, 77428214f, "du: tune, and fix some -L bugs with dangling or cyclic symlinks" 2010-09-29 Jim Meyering build: update gnulib submodule to latest 2010-09-29 Pádraig Brady tr: fix various issues with case conversion This valid translation spec aborted: LC_ALL=en_US.iso-8859-1 tr '[:upper:]- ' '[:lower:]_' This invalid translation spec aborted: LC_ALL=en_US.iso-8859-1 tr '[:upper:] ' '[:lower:]' This was caused by commit 6efd1046, 05-01-2008, "Avoid tr case-conversion failure in some locales" This misaligned conversion spec was allowed: LC_ALL=C tr 'A-Y[:lower:]' 'a-z[:upper:]' This was caused by commit af5d0c36, 21-10-2007, "tr: do not reject an unmatched [:lower:] or [:upper:] in SET1" This misaligned spec was allowed by extending the class: LC_ALL=C tr '[:upper:] ' '[:lower:]' * src/tr.c (validate_case_classes): A new function to check alignment of case conversion classes. Also it adjusts the length of the sets so that locales with different numbers of upper and lower case characters, don't cause issues. (string2_extend): Disallow extending the case conversion class as in the above example. That is locale dependent and most likely not what the user wants. (validate): Do the simple test for "restricted" char classes earlier, so we don't redundantly do more expensive validation. (main): Remove the case class validation, and simplify. * tests/misc/tr-case-class: A new test to test the various alignment and locale issues, associated with case conversion. * tests/misc/tr: Move case conversion tests to new tr-case-class. * tests/Makefile.am: Reference the new test. * NEWS: Mention the fixes. 2010-09-21 Paul Eggert build: update gnulib submodule to latest sort: destroy spin locks portably * src/sort.c (sortlines, sort): Use pthread_spin_destroy when a spin lock is no longer used. This isn't needed on GNU/Linux or Solaris, but POSIX says it may free up resources on some platforms. 2010-09-20 Pádraig Brady tests: fix a printf portability issue * tests/misc/sort-debug-keys: Don't depend on printf supporting \xhh format, which isn't supported by dash for example. Also change from double quoted strings to single quoted, when we don't need any variable interpolation. tests: fix an erroneous stat failure with bind mounts * tests/misc/stat-mount: Don't try to correlate the mount points output by df and stat, as they're similar, but sometimes different in the presence of bind mounts. * doc/coretuils.texi (stat invocation): Clarify the bind mount difference between stat and df. 2010-09-18 Jim Meyering build: update gnulib submodule to latest tests: sync tests/init.sh from gnulib * tests/init.sh: Update from gnulib. build: use gnulib's new termios module With it, we can remove the two sole tests of HAVE_TERMIOS_H. * bootstrap.conf (gnulib_modules): Add termios. * src/ls.c: Don't test HAVE_TERMIOS_H. * src/stty.c: Likewise. * m4/jm-macros.m4 (gl_CHECK_ALL_TYPES): Remove configure-time test for termios.h. maint: don't use obsolete gnulib modules * bootstrap.conf (gnulib_modules): Use calloc-gnu, malloc-gnu and realloc-gnu modules, rather than calloc, malloc and realloc. The shorter-named modules are now deprecated. (obsolete_gnulib_modules): Remove. (gnulib_modules): Remove raise, strbprk; they're obsolete, too. Move strtod, strtol here, from obsolete_gnulib_modules. 2010-09-17 Eric Blake maint: update to latest gnulib * gnulib: Update to latest. * src/copy.c (copy_reg): Use fdutimens instead of gl_futimens. * src/touch.c (touch): Adjust parameter order. * tests/init.sh: Resync from upstream. rm: remove no-op -d option * src/rm.c (long_opts, main): Resolve a fixme. * NEWS: Document the change. Based on a report by William Plusnick. maint: update to latest gnulib * gnulib: Update to latest. * bootstrap.conf (gnulib_modules): Add fdutimensat. * src/touch.c (touch): Use fdutimensat instead of gl_futimens. 2010-09-14 Dmitry V. Levin dircolors: add rxvt-unicode-256color terminal type rxvt-unicode introduced new terminal type: http://cvs.schmorp.de/rxvt-unicode/src/rxvt.h?r1=1.398&r2=1.399 * src/dircolors.hin: Add rxvt-unicode-256color terminal type. Reported by Alexey I. Froloff in . 2010-09-07 Pádraig Brady tests: work around a failure with dash 0.5.4 * tests/misc/env: Check that the shell can support the operation, before filtering through `env`. Note dash 0.5.5 is unaffected by this issue. tests: make various timeouts more robust * tests/init.cfg (retry_delay_): Describe the backoff method used. * tests/ls/readdir-mountpoint-inode: Add a timeout to the stat call to eliminate the chance of hangups. * tests/mv/i-3: Change the timeout required to pass from 1 second to a range of .1s - 3.1s. * tests/rm/dangling-symlink: Likewise. 2010-09-07 Pádraig Brady tests: exclude some tests when running on NFS All tests currently pass on NFS on Linux kernel 2.6.22 at least, but some fail on 2.6.9, so we exclude those here. * tests/init.cfg (is_local_dir_): A new function returning if the specified directory is on a local file system. (require_local_dir_): A new function to skip tests if the current directory is not on a local file system. * tests/cp/existing-perm-race: Skip if non local. * tests/cp/file-perm-race: Likewise. * tests/cp/parent-perm: Likewise. * tests/cp/parent-perm-race: Likewise. * tests/cp/preserve-2: Likewise. * tests/mv/part-symlink: Likewise. * tests/du/basic: Use refactored function. * tests/install/basic-1: Likewise. * tests/mkdir/p-3: Likewise. * tests/dd/skip-seek-past-dev: Likewise. * tests/du/slink: Likewise. Remove redundant test for NFS file system. * tests/misc/join: s/local/locale/. 2010-09-04 Jim Meyering build: update gnulib submodule to latest build: use gettext-h, not gettext * bootstrap.conf (gnulib_modules): Use gettext-h, not gettext. The latter is overkill for a package that uses AM_GNU_GETTEXT([external]... 2010-09-01 Jim Meyering tac: suppress technically unneeded "free" * src/tac.c (main): Guard final free with #ifdef lint. Suggested by Paul Eggert. 2010-09-01 Pádraig Brady join: improve performance when operating on whole lines Following on from commit f86bb696, 01-02-2010, "join: make -t '' operate on the whole line". Bypassing the delimiter search in this case, gives about an 8% performance boost. * src/join (xfields): Don't bother looking for '\n' in the data, which we know won't be present. 2010-08-28 Jim Meyering tac: avoid double free * src/tac.c (main): Reading a line longer than 16KiB would cause tac to realloc its primary buffer. Then, just before exit, tac would mistakenly free the original (now free'd) buffer. This bug was introduced by commit be6c13e7, "maint: always free a buffer, to avoid even semblance of a leak". * NEWS (Bug fixes): Mention it. * tests/misc/tac (double-free): New test, to exercise this. Reported by Salvo Tomaselli in . 2010-08-27 Pádraig Brady doc: clarify that stat -f implies -L (follows symlinks) * doc/coreutils.texi (stat invocation). Since there is no lstatfs, document that -L is implicit with -f. 2010-08-27 Aaron Burgemeister stat: add %m to output the mount point for a file * src/find-mount-point.c: A new file refactoring find_mount_point() out from df.c * src/find-mount-point.h: Likewise. * src/df.c: Use the new find-mount-point module. * src/stat.c (print_stat): Handle the new %m format. (find_bind_mount): A new function to return the bind mount for a file if any. (out_mount_mount): Print the bind mount for a file, or else the standard mount point given by the find-mount-point module. (usage): Document the %m format directive. * src/Makefile.am: Reference the refactored find-mount-point.c * po/POTFILES.in: Add find_mount_point.c to the translation list * doc/coreutils.texi (stat invocation): Document %m, and how it may differ from the mount point that df outputs. * test/misc/stat-mount: A new test to correlate mount points output from df and stat. * tests/Makefile.am: Reference the new test. * NEWS: Mention the new feature * THANKS: Add the author 2010-08-27 Eric Blake maint: update to latest gnulib * gnulib: Update to latest, to avoid warnings with latest autoconf.git. maint: avoid a hung 'make syntax-check' in VPATH build * cfg.mk (sc_system_h_headers): Look for files in correct location. 2010-08-26 Pádraig Brady df: always print the device name for bind mounted files * src/df (show_point): Remove the optimization for comparing the specified path with the device name, as this produces inconsistent results in the presence of bind mounts. For bind mounts, the device name is populated with the bind mount target. * NEWS: Mention the change in behavior. 2010-08-23 Pádraig Brady stat: fix a small memory leak with %N * src/stat.c (print_stat): Free the buffer returned from areadlink_with_size(). 2010-08-15 Pádraig Brady maint: exclude tests from the set_program_name syntax-check * .x-sc_program_name: Exclude all current and future c files in gl/tests from this check * gl/tests/test-di-set.c: Remove the hack to work around the set_program_name syntax-check * gl/tests/test-ino-map.c: Likewise * gl/tests/test-rand-isaac.c: Likewise 2010-08-15 Ralf Wildenhues doc: avoid a warning from newer texinfo * doc/coreutils.texi (sort invocation): Use @pxref inside parentheses. 2010-08-15 Bruno Haible doc: improve the info on md5sum security weaknesses * doc/coreutils.texi (md5sum invocation): Mention currently known security problems. Don't recommend SHA-1 as alternative. * man/md5sum.x (BUGS): Warn about the vulnerabilities and reference the SHA-2 based alternatives. Reported by Simon Josefsson 2010-08-14 Paul Eggert * tests/misc/sort (use-nl): Fix comment to match the test case. 2010-08-11 Paul Eggert sort, who: prefer free+malloc to realloc when contents are irrelevant This change was prompted by the previous one: I audited the code looking for similar examples. Too bad valgrind doesn't catch this. * src/sort.c (check, mergefps): xrealloc -> free + xmalloc * src/who.c (print_user): Likewise. 2010-08-10 Paul Eggert sort: free/xmalloc rather than xrealloc * src/sort.c (compare_random): Use free/xmalloc rather than xrealloc, since the old buffer contents need not be preserved. Also, don't fail if the guessed-sized malloc fails. Suggested by Bruno Haible. 2010-08-10 Eric Blake build: update to latest gnulib Fixes bug 6053 for NFS on HP-UX not recognizing ACL operations. * gnulib: Update to latest version. 2010-08-10 Jim Meyering sort: avoid gcc warning: explicitly ignore strtold result * src/sort.c: Include "ignore-value.h". (debug_key): Use ignore_value. 2010-08-09 Eric Blake tests: silence 'make syntax-check' * gl/tests/test-rand-isaac.c (main): Avoid warnings from syntax-check. 2010-08-09 Mike Frysinger dircolors: add screen.rxvt & terminator to TERM list Resolves bug#6793. * src/dircolors.hin: Add screen.rxvt & terminator. 2010-08-09 Dan Hipschman ls: fix a test failure that should have been skipped * tests/ls/readdir-mountpoint-inode: Check to see if skip_test_ is called in a helper function via $() instead of mistakenly failing. * THANKS: Update. 2010-08-09 Paul Eggert sort: speed up -R with long lines in hard locales * src/sort.c (compare_random): Guess that the output will be 3X the input. This avoids the overhead of calling strxfrm twice on typical implementations. Suggested by Bruno Haible. 2010-08-07 Paul Eggert sort: support all combinations of -d, -f, -i, -R, and -V * NEWS: Document this. * src/sort.c (getmonth): Omit LEN arg, as MONTH is now null-terminated. (compare_random): Don't null-terminate keys, as caller now does that. (compare_version): Remove. (debug_key): Null-terminate string for getmonth. (keycompare): Support combining -R with any of -d, -f, -i, -V. Also, support combining -V with any of -d, -i. (check_ordering_compatibility): Allow newly-supported combinations. * tests/misc/sort (02q, 02r, 02s): New tests, for new combinations. (incompat2): Now test -nR, since -fR are now compatible. 2010-08-05 Paul Eggert sort: tune and refactor --debug code, and fix minor underlining bug Formerly, the 'compare' function and some of its subroutines had a debugging flag, which caused them to output underlines. This change refactors the code so that debugging output is more-separated from the actual sorting. In the process, the change fixes a minor error in the debugging output. The change shortens the source code and executable size a tad, and improves CPU performance by 2.4% on my platform with a simple benchmark (C locale, line sorting, no debug). * src/sort.c (long_double, strtold): Move back to prelude, since they're now used by multiple functions again. (unit_order): Move to file scope, since it's now used by two functions. (find_unit_order, human_numcompare, numcompare, general_numcompare): Remove endptr parameter. All callers changed. (human_numcompare): Args are now const pointers. (getmonth): Endptr is now non-const. (key_numeric): Move up, since it's needed earlier. (debug_key): Take a line and a key as argument, instead of having the caller figure out where the field is. (debug_line): New function. (keycompare, compare): Omit debug parameter; debug output now done elsewhere. All callers changed. (write_line): Renamed from write_bytes; all callers changed. Use debug_line (not 'compare') to output debug info. Use a slightly faster check for whether output file is stdout. (check): Don't do debugging output; it's not that useful here, and it confuses the code. (main): Check for incompatibility between -c and --debug. Use standard diagnostic for incompatible options. * tests/misc/sort-debug-keys: Fix test case: "--Mi-1" is not a number, so its first character should not be underlined when debugging a numeric sort. 2010-08-05 Paul Eggert sort: -R now uses less memory on long lines with internal NULs * lib/Makefile.am (libcoreutils_a_SOURCES): Remove xmemxfrm.c, xmemxfrm.h. * lib/memxfrm.c, lib/memxfrm.h, lib/xmemxfrm.c, lib/xmemxfrm.h: Remove. * m4/memxfrm.m4: Likewise. * m4/prereq.m4 (gl_PREREQ): Remove gl_MEMXFRM. * po/POTFILES.in: Remove lib/xmemxfrm.c. * src/sort.c: Don't include xmemxfrm.h. (cmp_hashes): Remove. (xstrxfrm): New function. (compare_random): If a line contains NULs, don't create a big buffer that contains the strxfrm output of each string in the line. Instead, accumulate checksums and differences as we go, so that at any one time we have to store at most the output of a single strxfrm call when processing the line. This removes the need for an memxfrm function. 2010-08-03 Paul Eggert init.sh: work around trap limitation of some shells * tests/init.sh (setup_): Move exit trap outside of shell function. This patch is imported from gnulib. sort: fix bug in --debug when \0 is followed by \t * src/sort.c (debug_width): New function, which does not stop counting tabs at \0, and also invokes mbsnwidth. Stamp out strnlen! (count_tabs): Remove. (debug_key): Use debug_width instead of mbsnwidth and count_tabs. * tests/misc/sort-debug-keys: Check that \0 and \t intermix. sort: revert recent -h changes and use a more-conservative approach * NEWS: Document changes to sort -h, which are now minor with respect to the pre-July-30th version. * doc/coreutils.texi (sort invocation): Likewise. The documentation now describes how -h comparison is done rather than being vague with border cases. * src/sort.c (long_double, strtold): Move back to general_numcompare. (LD, compute_human): Remove. (find_unit_order): Remove THOU_SEP parameter, since thousands separators are now allowed by all callers. Revert to previous behavior of sorting by suffix, and returning the order rather than 2 * order + binary, since we no longer care whether binary powers are being used. However, treat all zeros the same, instead of sorting 0M before 0G; this is more consistent with the desired behavior of sorting -1G before -1M. * tests/misc/sort (h1, h3, h6): Adjust to match mostly-reverted behavior. However, check that all zeros sort together. * tests/misc/sort-debug-keys: Omit a "_", since the trailing "i" in "1234Gi" is no longer part of the key. 2010-07-30 Paul Eggert sort: -h now handles comparisons such as 6000K vs 5M and 5MiB vs 5MB * NEWS: Document changes to sort -h. * doc/coreutils.texi (sort invocation): Likewise. * src/sort.c (long_double, strtold): Move to prelude, since they're now used by multiple functions. (LD): New macro. (struct keyfield.iec_present): Remove this member. All uses removed. (check_mixed_SI_IEC): Remove. This code was busted in the presence of multiple threads, as it had a race condition. (find_unit_order): Remove arg KEY; add arg THOU_SEP; arg ENDPTR is now char ** rather than char const **. Return an integer that distinguishes decimal from binary powers. Parse the number consistently with the intersection of strtold and strnumcmp. Set *ENDPTR unconditionally. (compute_human): New static function. (human_numcompare): Remove arg KEY. Remove 'const' from other args. Use strnumcmp if possible, but fall back on floating point if not. (numcompare, general_numcompare): Arg EA is now char ** rather than char const **. (numcompare): Adjust to new find_unit_order signature and behavior. (keycompare): Adjus to new human_numcompare signature. * tests/misc/sort (h1, h3, h4, h6): Adjust to new behavior. * tests/misc/sort-debug-keys: Likewise. 2010-07-27 Paul Eggert sort: fix --debug display with very large offsets * src/sort.c (mark_key): Don't assume offset <= INT_MAX. Make the code a bit clearer when width != 0. sort: fix bug with EOF at buffer refill * src/sort.c (fillbuf): Don't append eol unless the line is nonempty. This fixes a bug that was partly but not completely fixed by the aadc67dfdb47f28bb8d1fa5e0fe0f52e2a8c51bf commit (dated July 15). * tests/misc/sort (realloc-buf-2): New test, which catches this bug on 64-bit hosts. sort: omit some "inline"s * src/sort.c (mergelines, queue_destroy, queue_init, queue_insert): (queue_pop, write_unique, mergelines_node, check_insert): (update_parent): No longer inline; these uses of "inline" seemed unlikely to help performance much. 2010-07-26 Paul Eggert sort: don't assume ASCII when parsing K, M, G suffixes * src/sort.c (find_unit_order): Don't assume ASCII. 2010-07-26 Paul R. Eggert sort: make struct heap private * gl/lib/heap.c (struct heap): Move this here... * gl/lib/heap.h (struct heap): ... from here, as outside code no longer needs to access any of these members. sort: omit unnecessary mutex unlock+lock; simplify heap access * src/sort.c (queue_pop): Omit unnecessary unlock+lock after pthread_cond_wait returns. Don't access "count" member of the heap; any efficiency gains should be quite minor, the access complicates this code, and "count" should be private anyway. sort: omit 'restrict' in doubtful cases * src/sort.c (lock_node, unlock_node, queue_destroy, queue_init): (queue_pop): Omit 'restrict'; it shouldn't help here, as these functions have just one pointer parameter and don't access static storage. (queue_insert, check_insert, update_parent): Omit 'restrict', as the pointer types differ, and are not char * or unsigned char *, and therefore can't alias. (write_unique): Omit 'restrict', as the pointer types are all read-only. (merge_loop, sortlines): Omit 'restrict', as any performance advantages are extremely unlikely and it's not worth cluttering the code for that. (struct thread_args): Omit 'restrict': this seems to be incorrect. It's unlikely for 'restrict' to be correct inside a typedef. sort: omit unnecessary casts * src/sort.c (inittables, general_numcompare, compare_nodes): (queue_init, queue_pop): Omit casts that are not needed, typically because they are between void * and some other pointer type. sort: use more-consistent style with const * src/sort.c (proctab_hasher, proctab_comparator, stream_open, xfopen): (open_temp, zaptemp, struct_month_cmp, begfield, limfield): (find_unit_order, human_numcompare, numcompare, general_numcompare): (count_tabs, keycompare, compare, compare_nodes, lock_node): (unlock_node, queue_destroy, queue_init, queue_insert, queue_pop): (write_unique, mergelines_node, check_insert, update_parent): (merge_loop, sortlines, struct thread_args, set_ordering): Prefer the style "T const" to "const T". * gl/lib/heap.h (struct heap, heap_alloc): Likewise. * gl/lib/heap.c (heap_default_compare, heapify_down, heapify_up): (heap_alloc): Likewise. 2010-07-25 Paul Eggert du: add NEWS entry for recent du -L fixes 2010-07-24 Paul R. Eggert du: tune, and fix some -L bugs with dangling or cyclic symlinks * src/du.c (process_file): Avoid recalculation of hashes and of file-exclusion for directories. Do not descend into the same directory more than once, unless -l is given; this is faster. Calculate stat buffer lazily, since it need not be computed at all for excluded files. Count space if FTS_ERR, since stat buffer is always valid then. No need for 'print' local variable. (main): Use FTS_NOSTAT. Use FTS_TIGHT_CYCLE_CHECK only when not hashing everything, since process_file finds cycles on its own when hashing everything. * tests/du/deref: Add test cases for -L bugs. tests/misc/sort-merge-fdlimit: don't assume -R opens /dev/urandom * tests/misc/sort-merge-fdlimit: This test was written assuming that -R typically opens /dev/urandom, but that's no longer the case. Redo test to specify a random source; this resurrects the point of checking for file descriptor exhaustion. Also try plain -R, since that implementation may change in the future too. randread: run 2x faster on 64-bit hosts, don't assume no padding bits * gl/lib/rand-isaac.c: Remove the I/O; this belongs elsewhere. Add support for ISAAC64. Port to hosts with padding bits. Add self to author list. Include , for CHAR_BIT. Don't include string.h, sys/time.h, unistd.h. (min, just): New functions. (IF32): New macros. (ind, ISAAC_STEP, isaac_refill, mix, isaac_init, isaac_seed): Add support for ISAAC64. Port to hosts with padding bits. (ind): Now an inline function rather than a macro; no need for it to be a macro with modern compilers. (ISAAC_STEP): Renamed from isaac_step, since it's not function-like. Don't bother to pass args that are always the same. All uses changed. (ISAAC_STEP, ISAAC_SEED): Move to inside the only function body that can use it. (ISAAC_MIX): Renamed from isaac_mix, since it's now a macro and is no longer function-like. Don't bother saving and restoring state; no longer needed now that we're not a function. All uses changed. (isaac_seed_start, isaac_seed_data, isaac_seed_finish): Remove. (isaac_seed): Take just the one arg; the caller now sets s->m. * gl/lib/rand-isaac.h: Use _GL_RAND_ISAAC_H to protect, instead of RAND_ISAAC_H. Try out " #" rather than "# " for indenting. (ISAAC_BITS_LOG, ISAAC_BITS): New macros. (ISAAC_WORDS_LOG): Renamed from ISAAC_LOG. (isaac_word): New type. All uses of uint32_t changed to isaac_word, to support ISAAC64. (struct isaac_state): Rename member MM to M, and make it public. (isaac_seed, isaac_refill): Adjust to new API. * gl/lib/randread.c: Include sys/time.h. (get_nonce): New function, containing the nonce stuff that used to be in rand-isaac.c but better belongs here. (randread_new): Use it. * gl/modules/randread (Depends-on): Add inline. * gl/modules/randread-tests: New file. * gl/tests/test-rand-isaac.c: New file. 2010-07-22 Pádraig Brady provide POSIX_FADV_SEQUENTIAL hint to appropriate utils Following on from commit dae35bac, 01-03-2010, "sort: inform the system about our input access pattern" apply the same hint to all appropriate utils. This currently gives around a 5% speedup for reading large files from fast flash devices on GNU/Linux. * src/base64.c: Call fadvise (..., FADVISE_SEQUENTIAL); * src/cat.c: Likewise. * src/cksum.c: Likewise. * src/comm.c: Likewise. * src/cut.c: Likewise. * src/expand.c: Likewise. * src/fmt.c: Likewise. * src/fold.c: Likewise. * src/join.c: Likewise. * src/md5sum.c: Likewise. * src/nl.c: Likewise. * src/paste.c: Likewise. * src/pr.c: Likewise. * src/ptx.c: Likewise. * src/shuf.c: Likewise. * src/sum.c: Likewise. * src/tee.c: Likewise. * src/tr.c: Likewise. * src/tsort.c: Likewise. * src/unexpand.c: Likewise. * src/uniq.c: Likewise. * src/wc.c: Likewise, unless we don't actually read(). 2010-07-22 Pádraig Brady fadvise: new module providing a simpler interface to posix_fadvise * bootstrap.conf: Include the new module * gl/lib/fadvise.c: Provide a simpler interface to posix_fadvise. (fadvise): Provide hint to the whole file associated with a stream. (fdadvise): Provide hint to the specific portion of a file associated with a file descriptor. * gl/lib/fadvise.h: Redefine POSIX_FADV_* to FADVISE_* enums. * gl/modules/fadvise: New file. * m4/jm-macros.m4: Remove the no longer needed posix_fadvise check. * .x-sc_program_name: Exclude test-fadvise.c from this check. * gl/tests/test-fadvise (main): New test program. * gl/modules/fadvise-testss: A new index to reference the tests. * src/sort.c (stream_open): Use the new interface. * src/dd.c (iwrite): Likewise. 2010-07-22 Mike Frysinger build: support fully excluding stdbuf from the build * configure.ac (optional_pkglib_progs): Only update after the main programs have been selected, so that libstdbuf.so can be excluded if stdbuf also is. 2010-07-20 Paul R. Eggert randread: use /dev/urandom to seed, not just getpid etc * gl/lib/rand-isaac.c (isaac_seed_start): New arg SEEDED. (isaac_seed): New args FD and BYTES_BOUND. Read from FD if possible. Don't bother with low-quality sources if FD has enough bytes. * gl/lib/rand-isaac.h: New size_t arg for isaac_seed. * gl/lib/randread.c: Include fcntl.h, unistd.h. (NAME_OF_NONCE_DEVICE): New #define. (nonce_device): New static var. (randread_new): Use nonce device if available. 2010-07-19 Paul R. Eggert sort: -R no longer disables multithreading * src/sort.c (random_md5_state): New static var. (random_md5_state_init): New function, to initialize random_md5_state. (random_state, randread_source): Remove. (cmp_hashes): Use random_md5_state rather than random_state. Break ties using memcmp, not by getting more randomness. If MD5 collisions turn into a problem in practice, we should simply use a better checksum. (main): If -R is given, call random_md5_state_init rather than going single-threaded. 2010-07-17 Paul R. Eggert randread: don't require -lrt Programs like 'sort' were linking to -lrt in order to get clock_gettime, but this was misguided: it wasted considerable resources while gaining at most 10 bits of entropy. Almost nobody needs the entropy, and there are better ways to get much better entropy for people who do need it. * gl/lib/rand-isaac.c (isaac_seed): Include not "gethrxtime.h". (isaac_seed): Use gettimeofday rather than gethrxtime. * gl/modules/randread (Depends-on): Depend on gettimeofday and not gethrxtime. * src/Makefile.am (mktemp_LDADD, shred_LDADD, shuf_LDADD, sort_LDADD): (tac_LDADD): Omit $(LIB_GETHRXTIME); no longer needed. 2010-07-16 Paul R. Eggert sort: add a test case for the sort -u bug * tests/Makefile.am (TESTS): Add misc/sort-unique. * tests/misc/sort-unique: New file. sort: fix a bug with sort -u and xmemcoll0, and tune keycompare * src/sort.c (keycompare): Use xmemcoll0, as it avoids a couple of stores. (write_bytes): Leave the buffer the way we found it, as it might be used again for a later comparison, if -u is used. 2010-07-15 Pádraig Brady sort: fix a bug when sorting unterminated lines * src/sort.c (fillbuf): The previous commit incorrectly terminated the buffer when the last line of input didn't contain a terminating character. 2010-07-15 Chen Guo sort: speed up default full line sorting Don't write NUL after the comparison buffers on each compare, which increases performance by about 3% for short lines on a pentium-m with gcc-4.4.1 * src/sort.c: (fillbuf): Delimit input items with NUL. (write_bytes): Restore the item delimiter char which was replaced with NUL in fillbuf(). 2010-07-14 Jim Meyering heap_alloc: avoid integer overflow * gl/lib/heap.c (heap_alloc): Use xnmalloc rather than xmalloc, to avoid pathological overflow. 2010-07-14 Paul R. Eggert maint: omit $(POW_LIB) when linking, as this is no longer needed * src/Makefile.am (printf_LDADD, seq_LDADD, sleep_LDADD, sort_LDADD): (tail_LDADD, uptime_LDADD): Omit $(POW_LIB), as it's no longer needed due to recent gnulib changes, where the strtod module no longer uses the pow function. strtold needs pow only because it's sometimes aliased to strtod. See http://lists.gnu.org/archive/html/bug-gnulib/2010-07/msg00076.html 2010-07-14 Pádraig Brady build: update gnulib submodule to latest; update bootstrap, too * gnulib: Update for xmemcoll0 and fix for systems without pthreads * bootstrap: Update for translation project sync fix 2010-07-13 Pádraig Brady maint: reorganize latest NEWS * NEWS: Add another blank line before the previous version. (Bug fixes): Move to the start. (Changes in behavior): Add the item about the du mem usage change from the "New features" section. maint: heap.c: simplify dynamic allocations * gl/lib/heap.c (heap_alloc): Use the fact that the xalloc routines will not return NULL. Also remove the redundant temporary variables. (heap_insert): From Jim Meyering, use x2nrealloc() which is simpler while handling overflow and increasing the size more efficiently. This reallocation is currently unused by coreutils in any case as it preallocates enough. 2010-07-13 Chen Guo sort: parallelize internal sort This patch is by Gene Auyeung, Chris Dickens, Chen Guo, and Mike Nichols, based off of a patch by Paul Eggert, Glen Lenker, et. al., with a basic heap implementation based off of the GDSL heap, originally by Nicolas Darnis. The number of sorts done in parallel is limited to the number of available processors by default, or can be further restricted with the --parallel option. On a dual-die, 8 core Intel Xeon, results show sorting with 8 threads is almost 4 times faster than using a single thread. Timings when sorting a 96MB file: THREADS TIME (s) 1 5.10 2 2.87 4 1.75 8 1.31 Single threaded sorting has also been improved, especially for cheaper comparison operations: COMMAND BEFORE (s) AFTER (s) sort 8.822 8.716 sort -g 10.336 10.222 sort -n 3.077 2.961 LANG=C sort 2.169 2.066 * bootstrap.conf: Add heap, pthread. * coreutils.texi (sort): Describe the new --parallel option. * gl/lib/heap.c: New file. Very basic heap implementation. * gl/lib/heap.h: New file. * gl/modules/heap: New file. * src/Makefile.am: Add LIB_PTHREAD. * src/sort.c: Include heap.h, nproc.h, pthread.h. (MAX_MERGE): New macro. (SUBTHREAD_LINES_HEURISTIC, PARALLEL_OPTION): New constants. (MERGE_END, MERGE_ROOT): New constants. (struct merge_node): New struct. (struct merge_node_queue): New struct. (sortlines temp): Remove declaration. (usage, long_options, main): New option, --parallel. (specify_nthreads): New function. (mergelines): New signature, to emphasize the fact that the HI area must be part of the destination. All callers changed. (sequential_sort): New function, renamed from sortlines. Merge in the functionality of sortlines_temp. (compare_nodes): New function. (lock_node, unlock_node): New functions. (queue_destroy): New function. (queue_init): New function. (queue_insert): New function. (queue_pop): New function. (write_unique): New function. (mergelines_node): New function. (check_insert): New function. (update_parent): New function. (merge_loop): New function. (sortlines): Rewrite to support and use parallelism, with a new signature. All callers changed. (struct thread_args): New struct. (sortlines_thread): New function. (sortlines_temp): Remove. (sort): New argument NTHREADS. All uses changed. Output moved to mergelines_node. (main): disable threading if we are sorting at random. * tests/Makefile.am (TESTS): Add misc/sort-benchmark-random. * tests/misc/sort-benchmark-random: New file. 2010-07-13 Jim Meyering di-set, ino-map: adjust a type, improve readability * gl/lib/ino-map.c (ino_hash): Declare "i" as unsigned int. Use an intermediate variable for the for-loop upper bound, so it's a little more readable. Adjust comment. * gl/lib/di-set.c (di_ent_hash): Likewise. 2010-07-13 Paul R. Eggert dd: also spell out size on memory exhaustion * src/dd.c (dd_copy): Use requested blocksize (not adjusted) in diagnostic, to forestall user complaints that the numbers don't match exactly. Report both exact and human-readable sizes, using a message format that is consistent with both "BBBB bytes (N XB) copied" in dd.c and "memory exhausted" in lib/xmalloc.c. 2010-07-09 Paul Eggert chcon, chmod, chown, du: don't translate "%s" * src/chcon.c (process_file): Replace _("%s") with "%s". * src/chmod.c (process_file): Likewise. * src/chown-core.c (change_file_owner): Likewise. * src/du.c (process_file): Likewise. 2010-07-07 Paul Eggert du: avoid spurious warnings with 64-bit gcc -W Problem reported by Jim Meyering in: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6524#74 * gl/lib/di-set.c (di_ent_hash): Rework so that the compiler does not incorrectly warn about shifting by 64-bits in unreachable code. * gl/lib/ino-map.c (ino_hash): Likewise. 2010-07-06 Paul Eggert du: Hash with a mechanism that's simpler and takes less memory. * gl/lib/dev-map.c, gl/lib/dev-map.h, gl/modules/dev-map: Remove. * gl/lib/ino-map.c, gl/lib/ino-map.h, gl/modules/ino-map: New files. * gl/modules/dev-map-tests, gl/tests/test-dev-map.c: Remove. * gl/modules/ino-map-tests, gl/tests/test-ino-map.c: New files. * gl/lib/di-set.h (struct di_set): Renamed from struct di_set_state, and now private. All uses changed. (_ATTRIBUTE_NONNULL_): Don't assume C99. (di_set_alloc): Renamed from di_set_init, with no size arg. Now allocates the object rather than initializing it. For now, this no longer takes an initial size; we can put this back later if it is needed. * gl/lib/di-set.c: Include hash.h, ino-map.h, and limits.h instead of stdio.h, assert.h, stdint.h, sys/types.h (di-set.h includes that now), sys/stat.h, and verify.h. (N_DEV_BITS_4, N_INO_BITS_4, N_DEV_BITS_8, N_INO_BITS_8): Remove. (struct dev_ino_4, struct dev_ino_8, struct dev_ino_full): Remove. (enum di_mode): Remove. (hashint): New typedef. (HASHINT_MAX, LARGE_INO_MIN): New macros. (struct di_ent): Now maps a dev_t to a inode set, instead of containing a union. (struct dev_map_ent): Remove. (struct di_set): New type. (is_encoded_ptr, decode_ptr, di_ent_create): Remove. (di_ent_hash, di_ent_compare, di_ent_free, di_set_alloc, di_set_free): (di_set_insert): Adjust to new representation. (di_ino_hash, map_device, map_inode_number): New functions. * gl/modules/di-set (Depends-on): Replace dev-map with ino-map. Remove 'verify'. * gl/tests/test-di-set.c: Adjust to the above changes to API. * src/du.c (INITIAL_DI_SET_SIZE): Remove. (hash_ins, main): Adjust to new di-set API. 2010-07-05 Jim Meyering stat: getfilecon failure now evokes nonzero exit status Add comments and adjust interfaces to allow low-level failure to propagate out to callers. * src/stat.c (out_file_context): Return bool, not void, so we can tell callers about failure. (print_statfs, print_stat, print_it): Propagate failure to caller. (do_statfs): Propagate print_it failure to caller. (do_stat): Likewise. I nearly forgot to update do_stat to propagate print_it failure, and it compiled just fine in spite of that. To prevent possibility of a repeat, I've marked each function that returns non-void with ATTRIBUTE_WARN_UNUSED_RESULT. system.h: define ATTRIBUTE_WARN_UNUSED_RESULT * src/system.h (ATTRIBUTE_WARN_UNUSED_RESULT): Define. 2010-07-05 Pádraig Brady tests: make tests requiring a delay to pass, more robust * tests/init.cfg: Introduce a retry_delay_() function to repeatedly call a test function that requires a delay. This delay can now be shorter for the common case on fast systems, but will double until a configurable limit it reached before failing on slower systems. * tests/dd/reblock: Use retry_delay_. * tests/misc/cat-buf: Likewise. * tests/misc/stdbuf: Likewise. * tests/tail-2/F-vs-rename: Likewise. * tests/tail-2/flush-initial: Likewise. * tests/tail-2/tail-n0f: Likewise. * tests/tail-2/wait: Likewise. * test/dd/misc: Comment that delay is needed to trigger failure. 2010-07-05 Paul Eggert doc: Add advice about ChangeLogs and synchronizing submodules * README-hacking: Update accordingly. 2010-07-04 Jim Meyering du: increase the initial dev-inode set size * src/du.c (INITIAL_DI_SET_SIZE): Increase to the prime just under 1024. This gives a speed-up of about 2% when processing a tree containing 100,000 files, each with a link count greater than 1, all pointing to files in some other tree. 2010-07-04 Jim Meyering du: use less than half as much memory when tracking hard links When processing a hard-linked file, du must keep track of the file's device and inode numbers in order to avoid counting its storage more than once. When du would process many hard linked files -- as are created by some backup tools -- the amount of memory required for the supporting data structure could become prohibitively large. This patch takes advantage of the fact that the amount of information in the numbers of the typical dev,inode pair is far less than even 32 bits, and hence usually fits in the space of a pointer, be it 32 or 64 bits wide. A typical du traversal examines files on no more than a handful of distinct devices, so the device number can be encoded in just a few bits. Similarly, few inode numbers use all of the high bits in an ino_t. Before, we would represent the dev,inode pair using a naive struct, and allocate space for each. Thus, an entry in the hash table consisted of a pointer (to that struct) and a "next" pointer. With this change, we encode the dev,inode information and put those bits in place of the pointer, and thus do away with the need to allocate additional space for each dev,inode pair. * src/du.c: Include "di-set.h". Don't include "hash.h"; it's no longer used. (INITIAL_DI_SET_SIZE): Define. (di_set): New global, to replace "htab". (entry_hash, entry_compare, hash_init): Remove functions. (hash_ins): Use di-set functions, rather than ones from the hash module. (main): Likewise. * bootstrap.conf (gnulib_modules): Add the new di-set module. * NEWS (New features): Mention it. 2010-07-04 Jim Meyering di-set: manipulate sets of dev/inode pairs efficiently * gl/lib/di-set.c: Implementation. * gl/lib/di-set.h: Declarations. * gl/modules/di-set: Define module. * gl/modules/di-set-tests: Define test module. * gl/tests/test-di-set.c: Likewise. dev-map: map device number to small non-negative * gl/lib/dev-map.c: New file. * gl/lib/dev-map.h: Declarations. * gl/modules/dev-map: Define primary modules. * gl/modules/dev-map-tests: Define test module. * gl/tests/test-dev-map.c: Test it. 2010-07-03 Paul Eggert du: don't miscount duplicate directories or link-count-1 files * NEWS: Mention this. * src/du.c (hash_all): New static var. (process_file): Use it. (main): Set it. * tests/du/hard-link: Add a couple of test cases to help make sure this bug stays squashed. * tests/du/files0-from: Adjust existing tests to reflect change in semantics with duplicate arguments. 2010-07-02 Jim Meyering build: update gnulib submodule to latest; update bootstrap, too * gnulib: Update to latest, for hash.c improvement. * bootstrap: Update from gnulib, too. 2010-07-01 Pádraig Brady cp: add an option to only copy the file attributes * src/copy.c (copy_attr): A new function which merges copy_attr_by_fd and copy_attr_by_name. Also display all errors when --attributes-only * src/copy.c (copy_reg): Skip copying the file contents if specified. Refactor the SELinux error handling code a little and display all SELinux errors when only copying attributes. * src/copy.h (struct cp_options): Add a data_copy_required boolean * src/cp.c (main): Default to copying data but don't if specified * src/install.c: Default to copying data * src/mv.c: Likewise tests/cp/reflink-perm: Add a test to check that --attributes-only does not copy data * tests/cp/acl: Likewise. Also refactor to remove redundant acl manipulation * doc/coreutils.texi (cp invocation): Describe the new option * NEWS: Mention the new feature ls: use the POSIX date style when the locale does not specify one Previously we defaulted to "long-iso" format in locales without specific format translations, like the en_* locales for example. This reverts part of commit 6837183d, 08-11-2005, "ls ... acts like --time-style='posix-long-iso' if the locale settings are messed up" * src/ls.c (decode_switches): Only use the ISO format when specified. * NEWS: Mention the change in behavior. Reported by Daniel Qarras at http://bugzilla.redhat.com/525134 2010-06-30 Jim Meyering tests: fail rather than infloop in tail's inotify-rotate test * tests/tail-2/inotify-rotate: Switch to new init.sh-based framework. (grep_timeout): New function. Use it in place of open-coded loops that might infloop. This was prompted by my encountering an inexplicable, and so far unreproducible, infloop in the code that was waiting for "b" to appear in "out". tests: move most helper functions from test-lib.sh to new init.cfg From there, they will be used by both test-lib.sh (as we phase it out) and the newer init.sh, to which all tests will migrate. * tests/test-lib.sh: Move most functions from here, ... * tests/init.cfg: ...to here. New file. * tests/Makefile.am (EXTRA_DIST): Add init.cfg. tests: sync tests/init.sh from gnulib * tests/init.sh: Update from gnulib. 2010-06-29 Jim Meyering doc: df, du, ls: improve --blocksize description in --help * src/du.c (usage): Print better --blocksize description. Prompted by Samuel Thibault in . * src/df.c (usage): Likewise. * src/ls.c (usage): Likewise. 2010-06-29 Pádraig Brady doc: reference POS syntax in --help for sort --key * src/sort.c (usage): Reference the additional description of the POS syntax. 2010-06-27 Benno Schulenberg ln: print a clearer error message when linking fails 2010-06-22 Jim Meyering stat: remove support for deprecated --context (-Z) option * src/stat.c (main): Remove support for the --context (-Z) option. In upstream releases this option has always been a no-op. It was first ignored for compatibility, and since the June 2008 commit, 574f7614 (coreutils-7.0), its use has evoked a warning. * NEWS (Changes in behavior): Mention it. 2010-06-21 Jim Meyering doc: fix comm's --help output so we generate a better man page * src/comm.c (usage): Don't align example comments in --help output, since the extra space (sequence of two spaces) there would be interpreted by help2man and induce an unwanted line break in the resulting man page. Reported by Jari Aalto. 2010-06-14 Eric Blake maint: ignore another gnulib generated file * .gnulib: Exclude lib/c++defs.h. cat: improve documentation * src/cat.c (usage): Clarify that -b overrides -n. * doc/coreutils.texi (cat invocation): Likewise. * THANKS: Update. Suggested by Chas. Owens, in bug 6383. 2010-06-14 Jim Meyering doc: dd: discourage use of very large block sizes * doc/coreutils.texi (dd invocation): Warn against using a very large block size. Suggested by Imre Péntek. dd: print a better diagnostic for an invalid block size * src/dd.c (dd_copy): Give a better diagnostic than "dd: memory exhausted" for an over-large bs= block size setting. Same for ibs= and obs=. Reported by Imre Péntek in http://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/591969 2010-06-11 Jim Meyering build: update gnulib submodule to latest build: don't let a large sparse temporary file cause "make dist" to fail * bootstrap.conf (bootstrap_epilogue): Replace the offending grep command from po/Makefile.in.in's $(DOMAIN).pot-update rule. 2010-06-10 Jim Meyering ls: avoid just-introduced buffer overrun * src/ls.c (gobble_file): Revert part of my preceding change, to avoid clobbering stack. 2010-06-08 Jim Meyering maint: adjust INT_BUFSIZE_BOUND usage for maintainability * src/tail.c (xlseek): Give INT_BUFSIZE_BOUND a variable name, not a type name. * src/ls.c (gobble_file, format_user_or_group_width): Likewise. * src/head.c (elide_tail_bytes_pipe): Likewise. (elide_tail_lines_seekable, main): Likewise. [This change is not complete -- there are doubtless other uses that can be updated in the same way.] sort: avoid unnecessary use of sprintf sprintf is relatively heavy-weight. * src/sort.c (key_warnings): Use umaxtostr and stpcpy rather than sprintf. Also, replace each INT_BUFSIZE_BOUND "type_name" argument with the equivalent variable name. More maintainable that way. 2010-06-08 Eric Blake dirname: tweak summary wording * doc/coreutils.texi (dirname invocation): Reword to be more precise. * src/dirname.c (usage): Likewise. * THANKS: Update. Reported by Filipus Klutiero, bug 6175. 2010-06-02 Jim Meyering doc: mention the new coreutils@ mailing lists * README-package-renamed-to-coreutils: Mention the new mailing list and a mirror. touch: remove support for --file=REF_FILE option * src/touch.c (main): Remove support for the deprecated, long-named --file option, which is an alternate name for --reference (-r). That option was undocumented with the arrival of --reference, in the 1995-10-29 commit, 8b92864e1d. Since the 2009-02-09 commit, ed85df444a, use of --file has elicited a warning. Not only was this code due for removal, but the long-name-use-detecting code was buggy in that it would use a stale or uninitialized "long_idx", as reported by Robin H. Johnson in http://bugs.gentoo.org/322421. * NEWS (Changes in behavior): Mention it. 2010-05-31 Jim Meyering maint: make spacing around "=" consistent, even in IF_LINT E.g., - size_t desired_width IF_LINT (= 0); + size_t desired_width IF_LINT ( = 0); Use this command: g grep -l IF_LINT | grep '\.[ch]$' \ | xargs perl -pi -e 's/(IF_LINT \()= /$1 = /' maint: replace each "for (;;)" with "while (true)" Run this command: git ls-files | grep '\.[ch]$' \ | xargs perl -pi -e 's/for \(;;\)/while (true)/g' ...except for randint.c, which does not include stdbool.h. In that case, use "while (1)". * gl/lib/randint.c (randint_genmax): Use "while (1)" for infloops. * src/cat.c (simple_cat, cat): Use "while (true)" for infloops. * gl/lib/randread.c (readsource, readisaac): Likewise. * src/copy.c (copy_reg): Likewise. * src/csplit.c (record_line_starts, process_regexp): Likewise. * src/cut.c (set_fields): Likewise. * src/dd.c (iread, parse_symbols): Likewise. * src/df.c (find_mount_point, main): Likewise. * src/du.c (main): Likewise. * src/expand.c (expand): Likewise. * src/factor.c (factor_using_division, do_stdin): Likewise. * src/fmt.c (get_space): Likewise. * src/ls.c (decode_switches): Likewise. * src/od.c (main): Likewise. * src/pr.c (main, read_line): Likewise. * src/shred.c (dopass, genpattern): Likewise. * src/sort.c (initbuf, fillbuf, getmonth, keycompare): Likewise. * src/split.c (bytes_split, lines_split): Likewise. * src/tac.c (tac_seekable): Likewise. * src/test.c (and, or): Likewise. * src/tr.c (squeeze_filter, main): Likewise. * src/tsort.c (search_item): Likewise. * src/unexpand.c (unexpand): Likewise. * src/uniq.c (main): Likewise. * src/yes.c (main): Likewise. maint: correct indentation of case_GETOPT_* macro uses * src/base64.c (main): Correct indentation of syntactically questionable case_GETOPT_HELP_CHAR and case_GETOPT_VERSION_CHAR macros. * src/who.c (main): Likewise. stat: use gnulib's alignof module * src/stat.c (alignof): Remove definition. Instead, include "alignof.h", and sort the #include directives. And get its definition from the gnulib module by that name: * bootstrap.conf (gnulib_modules): Add alignof. tests: remove unnecessary single quotes in perl hash use: ->{'SYM'} Run this command: git grep -l "limits->{'" \ | xargs perl -pi -e "s/limits->{'(.*?)'}/limits->{\$1}/g" * cfg.mk (sc_prohibit_perl_hash_quotes): New rule to match. * tests/misc/join: Remove quotes. * tests/misc/sort: Likewise. * tests/misc/sort-merge: Likewise. * tests/misc/test: Likewise. * tests/misc/unexpand: Likewise. * tests/misc/uniq: Likewise. 2010-05-29 Pádraig Brady truncate: improve handling of non regular files Previously we copied `dd` and suppressed error messages when truncating neither regular files or shared mem objects. This was valid for `dd`, as truncation is ancillary to copying it may also do, but for `truncate` we should display all errors. Also we used the st_size from non regular files which is undefined, so we display an error when the user tries this. * src/truncate (do_truncate): Error when referencing the size of non regular files or non shared memory objects. Display all errors returned by ftruncate(). (main): Error when referencing the size of non regular files or non shared memory objects. Don't suppress error messages for any file types that can't be opened for writing. * tests/misc/truncate-dir-fail: Check that referencing the size of a directory is not supported. * tests/misc/truncate-fifo: Ensure the test doesn't hang by using the `timeout` command. Don't test the return from running ftruncate on the fifo as it's system dependent as to whether this fails or not. NEWS: Mention the change in behavior. Reported by Jim Meyering. 2010-05-28 Pádraig Brady truncate: support sizes relative to an existing file * doc/coreutils.texi (truncate invocation): Mention that --reference bases the --size rather than just setting it. * src/truncate.c (usage): Likewise. Also remove the clause describing --size and --reference as being mutually exclusive. (do_truncate): Add an extra parameter to hold the size of a referenced file, and use it if positive. (main): Pass the size of a referenced file to do_truncate(). * tests/misc/truncate-parameters: Adjust for the new combinations. * NEWS: Mention the change Suggested by Richard W.M. Jones 2010-05-26 Jim Meyering tests: update help-version to work with parted, too * tests/misc/help-version: Add init code for GNU Parted. 2010-05-25 Jim Meyering maint: don't emit an extra newline in each of two diagnostics * src/shuf.c (main): Remove a stray newline in a diagnostic. * src/od.c (main): Likewise. Detected via these: git grep -A1 'error *(.*,$' | grep -C1 '\\n"[,)]' git grep 'error *(.*;$' | grep '\\n"[,)]' maint: remove unneeded double quotes on RHS of shell assignments Run this command: git grep -l 'LC_[A-Z]*="' \ | xargs perl -pi -e 's/(LC_[A-Z]*)="(.*?)"/$1=$2/' * src/Makefile.am: Write LC_ALL=$$locale, not LC_ALL="$$locale". * src/date.c (main): Similar, in a comment. * tests/misc/sort-month: Write LC_ALL=$LOC, not LC_ALL="$LOC". 2010-05-24 Pádraig Brady maint: remove a redundant sort parameter from a test * tests/misc/sort-month: Remove the -b option which is redundant and ignored. sort: adjust the leading blanks --debug warning * src/sort.c (key_warnings): Always warn about significant leading blanks when character offsets are specified, unless they key is possibly a line offset, i.e. of the form -k1.x,1.y. Also suppress this warning if the user could be sorting right aligned indexes. 2010-05-23 Jim Meyering maint: make copyright comment consistent with all others * tests/misc/mktemp: Change punctuation to make copyright paragraph consistent with all of the others. 2010-05-21 Jim Meyering tests: fix cp-a-selinux to skip cleanly upon mkfs failure * tests/cp/cp-a-selinux: Initialize skip, to avoid a syntax error in subsequent "test". Remove redirect-to-/dev/null, now that output is always to a log file. 2010-05-19 Jon Ringuette du: recognize -d N as equivalent to --max-depth=N * NEWS (New features): Mention it. * src/du.c (DEBUG_OPT): Remove. Use long-named ---debug instead. Commented out. (MAX_DEPTH_OPTION): Remove. Use 'd' instead. (main): Insert literal "d:"; remove DEBUG_OPT. * doc/coreutils.texi (du invocation): Add -d to indices. * tests/du/max-depth: Exercise -d, too. 2010-05-19 Jim Meyering tests: exercise du's --max-depth option * tests/Makefile.am (TESTS): Add du/max-depth. * tests/du/max-depth: New file. 2010-05-19 Pádraig Brady tests: fix sort-debug-keys when fr_FR.utf8 not available * tests/misc/sort-debug-keys: Correctly check for the absence of the French UTF8 locale. 2010-05-17 Jim Meyering maint: fix the fs-magic-compare rule * src/Makefile.am (fs-def): Sort definitions. This is required by fs-magic-compare's use of join. tests: update init.sh from gnulib * tests/init.sh: Update from gnulib. build: avoid a new -Wformat-induced warning * src/sort.c (mark_key): Add a cast-to-int of a printf field width, to placate -Wformat. 2010-05-16 Pádraig Brady doc: fix sort info about version sort skipping blanks * doc/coreutils.text (sort invocation): leading blanks are significant for 'V'. sort: --debug: output data independent warnings and info * src/sort.c (usage): Mention --debug can output warnings to stderr. Also split the translatable string to aid translation. (default_key_compare): A new function refactored from main(), and now also called from the new key_warnings() function. (key_to_opts): A new function refactored from incompatible_options(), and now also called from the new key_warnings() function. (key_numeric): A new function refactored to test if key is numeric. (key_warnings): A new function to output warnings to stderr, about questionable use of various options. Currently it warns about zero length keys and ineffective global options. (incompatible_options): Refactor out key_to_opts() (main): Use key_init() to initialize gkey. Refactor out default_key_compare(). Call key_warnings() in debug mode. * doc/coreutils.texi (sort invocation): Mention that warnings are output by --debug. * tests/misc/sort-debug-warn: A new test for debug warnings. * tests/Makefile.am: Reference the new test. * NEWS: Mention the new feature 2010-05-12 Pádraig Brady tests: fix sort-debug-keys when fr_FR.utf8 not available * tests/misc/sort-debug-keys: Don't verify (or even run) the fr_FR tests when that locale is not available on the system. sort: add a --debug option to highlight key extents * src/sort (usage): Add description for --debug. (write_bytes): Pass a line structure so it can subsequently be passed to compare to highlight the keys when in debug mode. Also transform TAB and NUL characters written to stdout so that the highlighting in debug mode aligns correctly. (human_numcompare): Pass an "endptr" so we can record the extent of the number matched. (general_numcompare): Likewise. (find_unit_order): Likewise. (getmonth): Likewise. (numcompare): Likewise. Note we reuse find_unit_order() for this, which is a good enough approximation, and means we don't need to change the strnumcmp() interface. (check_mixed_SI_IEC): Return whether iec_present, so that can be used to set the "endptr" in find_unit_order. Also make the key parameter optional, which will be the case from numcompare(). (count_tabs): A new function to determine how much to adjust the mbswidth() values by (TABs don't have a width). (mark_key): A new function to output the key highlighting to stdout. (debug_key): A new function to determine the offset and width of the key highlighting. (key_compare): Pass the show_debug parameter so the key highlighting is only displayed when explicitly called. For each key type, set the length (lena) and whether leading blanks are auto skipped (skipb) which are then used by debug_key() to highlight the portion of the key used in the comparison. (compare): Pass the show_debug parameter so the key highlighting is only displayed when explicitly called. Call debug_key() to highlight the last resort comparison. (check): Output highlighting for disorder line to stdout. (main): Process the --debug option and make it mutually exlusive with the -o option as I don't see it useful there, even potentially harmful if someone left a --debug in by mistake when updating a file. Also restricting debug output to stdout, simplifies the logic for dealing with temporary files. * doc/coreutils.texi (sort invocation): Describe the --debug option, and reference it from the --key description. * tests/misc/sort-debug-keys: A new test for highlighting keys. * tests/Makefile.am: Reference the new test. * NEWS: Mention the new feature. 2010-05-11 Jim Meyering build: record the gettext-0.18 requirement also in configure.ac * configure.ac: Require gettext-0.18 here, too. build: update gnulib submodule to latest * tests/init.sh: Update from gnulib, to fix typo. 2010-05-10 Jim Meyering build: record that when building from git, gettext-0.18 is required * bootstrap.conf (buildreq): Require gettext-0.18. tests: avoid a new syntax-check failure * .x-sc_prohibit_fail_0: Exempt tests/init.sh. tests: provide a definition of gl_trap_ in cfg.mk * cfg.mk (gl_trap_): Define here, now that it's gone from maint.mk. * gnulib: Update to latest. tests: begin using init.sh * tests/init.sh: New file. * tests/Makefile.am (EXTRA_DIST): Add it here. 2010-05-09 Jim Meyering tests: update help-version * tests/misc/help-version: Use init.sh, rather than test-lib.sh. Add idutils' setup. tests: move sc_prohibit_always-defined_macros to gnulib's maint.mk * cfg.mk (sc_prohibit_always-defined_macros): Remove it from here. * gnulib: Update to latest, for a maint.mk that includes that rule. tests: rename a syntax-check * cfg.mk (sc_prohibit_always-defined_macros): Rename from sc_always_defined_macros. * .x-sc_prohibit_always-defined_macros: New file, renamed from... * .x-sc_always_defined_macros: ...removed. * Makefile.am (syntax_check_exceptions): Rename here, too. tests: loosen/tighten the always_defined_macros check * cfg.mk (.re-defmac): Generate better regexps: allow white space before the '#', and append a word-boundary requirement. Without the latter, #define NULL_DEV ... would evoke a false-positive. tests: improve the always_defined_macros check * cfg.mk (sc_always_defined_macros): Adjust its helpers not to depend on the existence of ./lib. Instead, extract symbols directly from gnulib/lib/*.in.h files. 2010-05-03 Jim Meyering doc: factor hard-coded project-specific bits from README-release, ... using the new --mail-headers option to gnulib's announce-gen, and the updated maint.mk rules to connect the pieces. * README-release: Remove hard-coded To:, Cc: etc. parts, now that they're emitted automatically into the announcement template. * cfg.mk (announcement_Cc_): Override the default. * gnulib: Update to latest, to get newer announce-gen and maint.mk. doc: update release procedure * README-release: Rearrange slightly: post the announcement to Savannah first, so you can include a link to that post in the email. maint: factor trap-related code out of two syntax-check rules * cfg.mk (gl_trap_): Define, using a loop and eval'd trap, rather than repeated "trap" uses. Also handle "13", SIGPIPE. (sc_always_defined_macros): Use it. (sc_system_h_headers): Likewise. maint: extend the always_defined_macros syntax-check * cfg.mk (gl_generated_headers_): Define. (headers_with_interesting_macro_defs): Remove headers covered by the above. (.re-defmac): Extract symbol names from many more files. (sc_always_defined_macros): Use VC_LIST_EXCEPT, not VC_LIST, so that we can use the usual exception mechanism. Test for $(gnulib_dir), not system.h. * .x-sc_always_defined_macros: New file. Exempt src/seq.c. * Makefile.am (syntax_check_exceptions): Add it here. maint: remove now-redundant definitions provided by signal.h * src/dd.c (SA_NODEFER, SA_RESETHAND): Remove definitions, now that gnulib guarantees they are defined in . * src/ls.c (SA_RESTART): Likewise. maint: remove now-redundant definitions provided by sys/wait.h * src/timeout.c (WIFSIGNALED, WTERMSIG): Remove definitions, now that gnulib guarantees they are defined in . * src/operand2sig.c: Likewise. * src/kill.c: Likewise. 2010-05-02 Paul Eggert sort: use long doubles only when effective * src/sort.c (general_numcompare): Don't use long double if strtold is not available, as it may introduce needless overhead. 2010-04-30 Jim Meyering build: update gnulib submodule to latest; bootstrap, too 2010-04-29 Pádraig Brady sort: use long doubles for general numeric mode * src/sort.c (general_numcompare): Use long doubles unconditionally, and strtold when available, to convert numbers with greater range and precision. Performance was seen to be on par with standard doubles. * doc/coreutils.texi (sort invocation): Amend the -g description to mention long double rather than double, and strtold rather than strtod. * src/getlimits.c (main): Output floating point limits for use in tests. * tests/misc/sort-float: A new test to ensure sort is using long doubles when possible, and that locale specific floats are handled. * tests/Makefile.am: Reference the new test. * tests/test-lib.sh (getlimits_): Normalize indenting. * NEWS: Mention the new behaviour. Reported by Nelson Beebe. 2010-04-29 Jim Meyering build: remove now-duplicate use of AC_SYS_LARGEFILE * m4/jm-macros.m4 (gl_CHECK_ALL_TYPES): Don't require AC_SYS_LARGEFILE, now that gnulib does it. build: remove now-useless configure-time header checks * m4/jm-macros.m4 (gl_CHECK_ALL_HEADERS): Don't test for headers that gnulib now provides: sys/ioctl.h, sys/time.h, sys/wait.h. 2010-04-25 Jim Meyering doc: tweak factor-describing wording * doc/coreutils.texi (factor invocation): Don't say that "factoring large prime numbers is hard". A pedant might ding you, since it's trivial to factor a number that is known to be prime. Instead, say that "factoring large numbers... is hard". Reported by Andreas Eder. 2010-04-24 Jim Meyering maint: remove now-unnecessary #if HAVE_header_H tests. * .x-sc_prohibit_always_true_header_tests: New file. * Makefile.am (syntax_check_exceptions): Add it. * src/cat.c: Remove #if HAVE_SYS_IOCTL_H test. * src/copy.c: Likewise. * src/ls.c: Likewise. * src/stty.c: Likewise. * src/install.c: Remove #if HAVE_SYS_WAIT_H test. * src/kill.c: Likewise. * src/operand2sig.c: Likewise. * src/timeout.c: Likewise. * src/pathchk.c: Remove #if HAVE_WCHAR_H test. * src/stat.c: Remove #if HAVE_NETINET_IN_H test. build: enable gnulib modules for more replacement headers * bootstrap.conf (gnulib_modules): Add the following: netinet_in, sys_ioctl, sys_wait, so that we can eliminate the #if HAVE_
_H tests guarding their header inclusions. tests: clean up also upon SIGQUIT * tests/test-lib.sh: Also trap on SIGQUIT. Spotted by Dmitry V. Levin. 2010-04-23 Jim Meyering post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.5 * NEWS: Record release date. 2010-04-23 Dmitry V. Levin tests: fix exit status of signal handlers in shell scripts The value of `$?' on entrance to signal handlers in shell scripts cannot be relied upon, so set the exit code explicitly. * cfg.mk (sc_always_defined_macros, sc_system_h_headers): Set the exit code in signal handler explicitly to 128 + SIG. * src/Makefile.am (sc_tight_scope): Likewise. * tests/test-lib.sh: Likewise. 2010-04-22 Eric Blake base64: always treat input in binary mode Necessary for cygwin. Technically, this patch is not correct, in that it clobbers O_APPEND, but it is no different than any other use of xfreopen to force binary mode, so all such uses should be fixed at once in a later patch. * src/base64.c (main): Open input in binary mode. * THANKS: Update. Reported by Yutaka Amanai. 2010-04-21 Jim Meyering build: update gnulib submodule to latest 2010-04-21 Eric Blake docs: document transformation of obsolete sort syntax * doc/coreutils.texi (sort invocation): Mention the conversion. 2010-04-21 Pádraig Brady maint: update a couple of NEWS items for the pending release * NEWS: Mention that cp and mv from the previous release did not support preserving extended attributes (fixed in e489fd04). Improve the grammar for the "cp capabilities" item. 2010-04-20 Pádraig Brady sort: fix parsing of end field in obsolescent key formats This regression was introduced in commit 224a69b5, 2009-02-24, "sort: Fix two bugs with determining the end of field". The specific regression being that we include 1 field too many when an end field is specified using obsolescent key syntax (+POS -POS). * src/sort.c (struct keyfield): Clarify the description of the eword member, as suggested by Alan Curry. (main): When processing obsolescent format key specifications, normalize eword to a zero based count when no specific end char is given for an end field. This matches what's done when keys are specified with -k. * tests/misc/sort: Add a few more tests for the obsolescent key formats, with test 07i being the particular failure addressed by this change. * THANKS: Add Alan Curry who precisely identified the issue. * NEWS: Mention the fix. Reported by Santiago Rodríguez 2010-04-17 Pádraig Brady cp: preserve "capabilities" when also preserving file ownership * src/copy.c (copy_reg): Copy xattrs _after_ setting file ownership so that capabilities are not cleared when setting ownership. * tests/cp/capability: A new root test. * tests/Makefile.am (root_tests): Reference the new test. * NEWS: Mention the fix. 2010-04-16 Jim Meyering * HACKING (Add tests): Change example name, "newtest" to "new-test". Not that anyone would confuse with something newt-related, but just because it is more readable that way. doc: tweak HACKING 2010-04-16 Jim Meyering doc: tweak HACKING * HACKING (Curly braces): Tweak a sentence. Filter a few paragraphs through "fmt". 2010-04-16 Pádraig Brady maint: fix build on platforms that replace strsignal * src/Makefile.am (kill_LDADD): Add $(LIBTHREAD) so that we link with the appropriate libraries to provide Thread Local Storage on platforms that replace strsignal (like AIX for example). Tested-by: Daniel Richard G. 2010-04-16 Pádraig Brady tests: avoid spurious failure of ls/color-norm test * tests/ls/color-norm: Use the "time" output by `ls -l` to check normal style. Previously we used the size from `ls -s`, but the size of "empty" files can vary depending on whether SELinux is enabled for example. 2010-04-15 Jim Meyering doc: document our code formatting policy regarding curly braces * HACKING (Curly braces: use judiciously): New section. 2010-04-14 Jim Meyering tests: avoid spurious failure of root-only ls/capability test * tests/ls/capability: Adjust this test not to expect the no-op escape sequence that was removed from all other tests by 2010-01-30 commit 5d43617e, "ls --color: don't emit a final no-op escape sequence". 2010-04-13 Pádraig Brady cp: treat selinux warnings consistently * src/copy.c (copy_reg): Suppress SELinux ENOTSUP warnings consistently between the destination being present or not. Previously we did not suppress ENOTSUP messages when the destination was present. (copy_internal): Use the same ENOTSUP supression method as copy_reg() even though the issue was not seen in this case. * tests/cp/cp-a-selinux: Add a test case for the issue and group the other test cases in the file more coherently. * tests/cp/cp-mv-enotsup-xattr: Do the same check for xattr warnings, even though they did not have the issue. 2010-04-12 Pádraig Brady doc: clarify when cp and mv output xattr warnings The 2010-03-26 commit, 4c38625e, "doc: fix info on cp --preserve..." was not entirely correct as cp --preserve=all does produce some xattr warnings. * src/copy.h: Update and clarify the comments for reduce_diagnostics and require_preserve_{xattr,context}. * doc/coreutils.texi (cp invocation): Update the -a and --preserve=xattr,context options to say when and which xattr warnings are output. (mv invocation): Mention that some warnings are output when preserving xattrs. 2010-04-11 Pádraig Brady doc: mention that "capabilities" are preserved by cp/mv * doc/coreutils.texi (cp invocation): Mention that "capabilities" are preserved when implemented using extended attributes. (mv invocation): Mention ACLs etc. are maintained due to xattrs being copied. 2010-04-11 Jie Liu build: tell ./bootstrap to check for xz up-front * bootstrap.conf (buildreq): Add xz to the list. 2010-04-11 Jim Meyering tests: more syntax-checks * gnulib: update to latest * cfg.mk (sc_prohibit_empty_lines_at_EOF): Remove, now that it's in gnulib's maint.mk. (_hv_file): Override the default. 2010-04-10 Jim Meyering maint: new syntax-check rule: prohibit empty lines at EOF * cfg.mk (detect_empty_lines_at_EOF_): Define. (sc_prohibit_empty_lines_at_EOF): New rule. * .x-sc_prohibit_empty_lines_at_EOF: New file. Exempt pr test inputs. * Makefile.am (syntax_check_exceptions): Add it. Pádraig Brady suggested to parse the output of tail -n1. 2010-04-09 Mike Frysinger dircolors: add rxvt-256color and rxvt-unicode256 * src/dircolors.hin: Add them. 2010-04-09 Jim Meyering maint: ftruncate is always available, even without gnulib Now that even MinGW provides ftruncate, we know that all reasonable portability targets provide this function. Remove the workaround code. We nearly removed the gnulib module three years ago: http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/9203 and it is now officially "obsolete". * bootstrap.conf (gnulib_modules): Remove ftruncate. * src/copy.c (copy_reg): Remove use of HAVE_FTRUNCATE and its no-longer-used workaround code. * src/truncate.c: Remove a comment about handling missing ftruncate. 2010-04-08 James Youngman doc: make wc --help say how it defines a 'word' * src/wc.c (usage): Add wc's definition of "word". 2010-04-08 Jim Meyering doc: adjust a header in announcement email template * README-release: Use Mail-Followup-To: rather than Reply-To:. The former works more reliably, at least with Gnus. 2010-04-07 Jim Meyering tests: add a PATH-sanity-check to help-version * tests/misc/help-version: Sync from gzip's version. * tests/check.mk (TESTS_ENVIRONMENT): Export VERSION, as required for new help-version test. 2010-04-06 Jim Meyering maint: fix a masked syntax-check violation * m4/jm-macros.m4 (ARGMATCH_DIE): Use usage(EXIT_FAILURE), not usage(1). * .x-sc_prohibit_magic_number_exit: Remove *.m4 exemption that was masking the above. build: update gnulib submodule to latest 2010-04-05 Jim Meyering build: update gnulib submodule to latest 2010-04-04 Marc Kleine-Budde tail: include sys/vfs.h (if possible) when sys/statfs.h is absent * src/tail.c [HAVE_INOTIFY && !HAVE_SYS_STATFS_H]: Include . 2010-04-02 Jim Meyering build: update gnulib submodule to latest * cfg.mk: Update to use new _sc_search_regexp interface. Run this: perl -pi -e 's/\b_prohibit_regexp\b/_sc_search_regexp/;' -e 's/\bmsg=/halt=/; s/\bre=/prohibit=/;' cfg.mk and then adjust backslashes so they still line up. 2010-03-31 Jim Meyering doc: synchronize parts of README-release from grep's version * README-release (FIXME): Add Reply-To, use coreutils@gnu.org for announcements. Update savannah-verbatim-announcement procedure. 2010-03-29 Jim Meyering build: update gnulib submodule to latest tests: disable new texinfo-acronym syntax-check from gnulib * cfg.mk (local-checks-to-skip): Add new sc_texinfo_acronym, to skip it. 2010-03-29 Bruno Haible build: update after change in gnulib's lib-ignore module * src/Makefile.am (AM_LDFLAGS): Define. Use gnulib's new $(IGNORE_UNUSED_LIBRARIES_CFLAGS). 2010-03-29 Jim Meyering tests: avoid spurious sc_prohibit_test_minus_ao syntax-check failures * tests/misc/ls-time: Change comments and diagnostics. * tests/misc/xattr: Likewise. 2010-03-26 Jim Meyering tests: fix typos in envvar-check script * tests/envvar-check: Fix variable name typos. Probably harmless, since no selected shell would fail to unset. 2010-03-26 Pádraig Brady nice,chroot: use more standard option parsing Related to the 2010-03-25 commit, 88d4b346, "timeout: use more standard option parsing". * src/nice.c (main): Don't use parse_long_options() which is a helper for commands that don't have any long options specific to them. * src/chroot.c (main): Likewise. * tests/misc/nice-fail: Remove a case that now passes due to us accepting multiple instances of the --help and --version options. * tests/misc/chroot-fail: Likewise. 2010-03-26 Kim Hansen timeout: use more standard option parsing * src/timeout.c (main): Don't use parse_long_options() which is a helper for commands that don't have any long options specific to them. * tests/misc/timeout-parameters: Remove a case that now passes due to us accepting multiple instances of the --help and --version options. * THANKS: Add the author. 2010-03-26 Pádraig Brady doc: fix info on cp --preserve=all, which does _not_ give xattr warnings The info docs have been inaccurate since 2009-04-17, commit 941bd482, "mv: ignore xattr-preservation failure when not supported by filesystem" * doc/coreutils.texi (cp invocation): Say that cp --preserve=all does _not_ output errors when failing to copy xattrs. 2010-03-21 Jim Meyering cfg.mk: remove comments with sed rather than cpp -fpreprocessed * cfg.mk (_sed_remove_comments): Define, starting with gettext's moopp sed code, but factoring it to be more understandable. (sc_space_before_open_paren): Adapt. Prompted by Bruno Haible's suggestion to use gettext's moopp code. 2010-03-20 Jim Meyering cfg.mk: fix copy-paste-o in a diagnostic * cfg.mk (sc_space_before_open_paren): Mention cpp -fpreprocessed, not cppi, when cpp -fpreprocessed doesn't work. Spotted by Eric Blake. maint: enforce one small aspect of formatting style: space-before-"(" * cfg.mk (sc_space_before_open_paren): New rule. maint: code formatting nit * src/system.h (ST_NBLOCKS): Add space before paren. 2010-03-19 Pádraig Brady maint: mbsalign: fix an edge case where we truncate too much * gl/lib/mbsalign.c (mbsalign): Ensure the temporary destination buffer is big enough, as it may need to be bigger than the source buffer in the presence of single byte non printable chars. * gl/tests/test-mbsalign.c (main): Add a test to trigger the issue. maint: update the mbsalign module * gl/lib/mbsalign.c (mbsalign): Support the MBA_UNIBYTE_FALLBACK flag which reverts to unibyte mode if one can't allocate memory or if there are invalid multibyte characters present. Note memory is no longer dynamically allocated in unibyte mode so one can assume that mbsalign() will not return an error if this flag is present. Don't calculate twice, the number of spaces, when centering. Suppress a signed/unsigned comparison warning. (ambsalign): A new wrapper function to dynamically allocate the minimum memory required to hold the aligned string. * gl/lib/mbsalign.h: Add the MBA_UNIBYTE_FALLBACK flag and also document others that may be implemented in future. (ambsalign): A prototype for the new wrapper. * gl/tests/test-mbsalign.c (main): New test program. * gl/modules/mbsalign-tests: A new index to reference the tests. * .x-sc_program_name: Exclude test-mbsalign.c from this check. 2010-03-19 Paolo Bonzini tests: change help-version to per-program functions * help-version: Change each *_args variable to a *_setup function. 2010-03-19 Jim Meyering doc: tweak README-prereq again * README-prereq: Change one more: s/coreutils/This package/ doc: make README-prereq more generic * README-prereq: Adjust wording and reduce number of mentions of "coreutils", so it's easier to reuse in another package: grep. 2010-03-18 Eric Blake rm: tweak wording about loss of data warning * src/rm.c (usage): Update wording to make two points more apparent: undelete is not trivial, and partial recovery should be a consideration factor in deciding whether rm is secure enough. Initially suggested by Reuben Thomas. 2010-03-18 Ralf Wildenhues revert "maint: mark makefile "dist-hook" target as PHONY" * src/Makefile.am (dist-hook): Do not mark this target as PHONY, explicitly. Automake does it for us. 2010-03-18 Eric Blake doc: improve ls --help's description of --escape (-b) * src/ls.c (usage): Be more precise about how --escape (-b) works: say "C-style escapes", not "octal escapes". Reported by Jacky Fong. 2010-03-18 Jim Meyering maint: mark makefile "dist-hook" target as PHONY * src/Makefile.am (dist-hook): Mark target as PHONY. 2010-03-17 Jim Meyering maint: add a space before open-paren, where lacking * src/copy.c (copy_reg): Likewise. * src/cut.c (main): Likewise. * src/dd.c (main): Likewise. * src/getlimits.c (print_int): Likewise. * src/join.c (join): Likewise. * src/pwd.c (logical_getcwd): Likewise. * src/sort.c (specify_nmerge, mergefps, avoid_trashing_input): Likewise. (merge): Likewise. * src/uptime.c (usage): Likewise. 2010-03-17 Pádraig Brady timeout: add the --kill-after option Based on a report from Kim Hansen who wanted to send a KILL signal to the monitored command when `timeout` itself received a termination signal. Rather than changing such a signal into a KILL, we provide the more general mechanism of sending the KILL after the specified grace period. * src/timeout.c (cleanup): If a non zero kill delay is specified, (re)set the alarm to that delay, after which a KILL signal will be sent to the process group. (usage): Mention the new option. Separate the description of DURATION since it's now specified in 2 places. Clarify that the duration is an integer. (parse_duration): A new function refactored from main(), since this logic is now called for two parameters. (main): Parse the -k option. * doc/coreutils.texi (timeout invocation): Describe the new --kill-after option and use @display rather than @table to show the duration suffixes. Clarify that a duration of 0 disables the associated timeout. * tests/misc/timeout-parameters: Check invalid --kill-after. * tests/misc/timeout: Check a valid --kill-after works. * NEWS: Mention the new feature. 2010-03-13 Jim Meyering build: update gnulib submodule to latest The latest from gnulib once again passes all tests. revert to previous working version of gnulib This reverts commit 0c31cdc2d13a1e47106ce708ca9c94df8d21f764. 2010-03-13 Thien-Thi Nguyen doc: use mktemp, not tempfile, in a shred usage example * doc/coreutils.texi (shred invocation): Use mktemp(1) instead of Debian-specific tempfile(1). 2010-03-12 Jim Meyering build: update gnulib submodule to latest 2010-03-11 Eric Blake maint: drop *.lzma suport * .gitignore: Remove *.lzma lines. maint: ignore *.xz files * .gitignore: Ignore *.xz created by 'make dist', now that we no longer produce *.lzma. 2010-03-10 Jim Meyering remove: without -f, avoid unnecessary-expense/issues with euidaccess * src/remove.c (write_protected_non_symlink): If faccessat fails, return 1 or -1 directly, rather than falling back on euidaccess*. 2010-03-09 Pádraig Brady doc: Add an example for cutting fields separated by runs of blanks * doc/coreutils.texi (cut invocation): Show how tr can be used to process the input for cut in this case. Suggestion from Dan Jacobson. 2010-03-04 Pádraig Brady maint: rename the si_present variable in sort to iec_present * src/sort.c: The units containing 'i' are actually IEC not SI. 2010-03-04 Joey Degges sort: inform the system about our input access pattern Tell the system that we'll access input sequentially, so that we more efficiently process uncached files in a few cases: Reading from faster flash devices. E.g. 21 MB/s key: NORMAL 31.6s (26.8 user) SEQUENTIAL 27.7s WILLNEED 27.7s Processing in parallel with readahead when using a small 1M buffer: NORMAL 24.7s (21.1 user) SEQUENTIAL 22.7s WILLNEED 25.6s A small benefit when merging: NORMAL 25.0s (16.9 user) SEQUENTIAL 24.6s (16.6 user) WILLNEED 38.4s (13.1 user) Note WILLNEED is presented above for comparison to show it has some unwanted characteristics due to its synchronous prepopulation of the cache. It has a good benefit on a mechanical disk @ 80MB/s and a multicore system with competing processes: NORMAL 14.73s SEQUENTIAL 10.95s WILLNEED 05.22s However the scheduling differences causing this result are probably best explicitly managed using `nice` etc. * m4/jm-macros.m4 (coreutils_MACROS): check for posix_fadvise(). * src/sort.c (fadvise_input): A new function to apply the POSIX_FADV_SEQUENTIAL hint to an input stream. (stream_open): Call the above function for all input streams. 2010-03-04 Jim Meyering tests: don't let the LANGUAGE envvar perturb tests * tests/envvar-check (vars): Add LANGUAGE to the list of envvars to unset. At least in glibc (as an extension to POSIX), its value actually trumps LC_ALL: $ LC_ALL=es_ES LANGUAGE=fr_FR.UTF-8 /bin/cat no-such /bin/cat: no-such: Aucun fichier ou dossier de ce type but only when the default locale is not C: $ LC_ALL=C LANGUAGE=fr_FR.UTF-8 /bin/cat no-such /bin/cat: no-such: No such file or directory Prompted by a report from Mads Kiilerich. 2010-03-01 Pádraig Brady sort: fix issues with month sorting in some locales * src/sort.c (char fold_toupper[]): Change to unsigned so as the correct comparisons are made in getmonth(). This fixes unibyte locales where abbreviated months have characters that are > 0x7F, but it also works for multibyte locales with the caveat that multibyte characters are matched case sensitively. With this change, the following example sorts correctly: $ echo -e "1 márta\n2 Feabhra" | LANG=ga_IE.utf8 sort -k2,2M 2 Feabhra 1 márta * src/sort.c (inittables): Since we ignore blanks around months in the input, don't include them when they're present in the locale. With this change, the following example sorts correctly: $ echo -e "1 2月\n2 1月" | LANG=ja_JP.utf8 sort -k2,2M 2 1月 1 2月 * tests/misc/sort-month: A new test to exercise the above cases. * tests/Makefile.am: Reference the new test. * NEWS: Mention the fix. 2010-02-25 Eric Blake bootstrap: resynchronize from gnulib * gnulib: Update to latest. * bootstrap: Copy from gnulib/build-aux/bootstrap. * README-hacking: Describe how to use GNULIB_SRCDIR. expr: clarify error message * src/expr.c (eval4, eval3): Clarify that expr expects integers, and not the broader category of numbers. * tests/misc/expr: Update test accordingly. Suggested by Dan Jacobson. 2010-02-19 Pádraig Brady maint: clean up the output from syntax-check rules * cfg.mk (sc_tight_scope): Pass the -s (silent) flag to `make` so that it doesn't report about calling sub makes. (sc_check-AUTHORS): Likewise. (sc_strftime_check): Don't display stderr from `info`. * src/Makefile.am (sc_tight_scope): Don't annotate with "GEN". (sc_check-AUTHORS): Likewise. 2010-02-18 Moritz Orbach ls: fix a regression by honoring NORMAL attributes again Output the NORMAL attribute before non file name text. This attribute will continue into file names that would not otherwise be colored unless FILE is also set. The regression was introduced with commit 483297d5, 28-02-2009, "ls --color no longer outputs unnecessary escape sequences". * src/ls.c (set_normal_color): A new function to output the NORMAL attribute sequence if it's enabled. (print_current_files): Output NORMAL before printing long format info. (print_file_name_and_frills): Output NORMAL before printing file name. (print_color_indicator): Reset the attributes before a file name with attributes so that NORMAL attributes will not combine with them. (print_name_with_quoting): Ensure attributes are reset after printing the file name if NORMAL attributes were output. * tests/ls/color-norm: A new test for NORMAL and FILE combinations. * tests/Makefile.am: Reference the new test. * NEWS: Mention the fix. Reported in https://savannah.gnu.org/bugs/?26512 2010-02-16 Pádraig Brady maint: fix the man page correlation tests These checks were not being run as distcheck-hook targets are only supported in the top-level Makefile. Instead these tests are now run during a syntax-check. * cfg.mk (sc_man_file_correlation): A new syntax check to call the 2 existing tests to check the correlation between the programs and man/*.[1x]. * man/Makefile.am (sc_man_file_correlation): Call the 2 existing man page correlation tests. (check-x-vs-1): Remove the "GEN" annotation as it's a bit verbose. (check-programs-vs-x): Likewise. * src/Makefile.am (all_programs.list): Exclude libstdbuf.so from the list of programs. This issue was not noticed as the checks were not actually being run. 2010-02-16 Pádraig Brady tests: fix an unlikely race in tail-2/inotify-hash-abuse2 * tests/tail-2/inotify-hash-abuse2: Explicitly kill the process by using cleanup_() rather than using a timeout which may trigger a failure on very slow systems (< 20 iterations of the loop per second). doc: fix inconsistent capitalization in --help output * src/base64.c (usage): Don't capitalize the first character in an --option description. * src/stdbuf.c (usage): Likewise. * src/truncate.c (usage): Likewise. * cfg.mk (sc_option_desc_uppercase): A new syntax check to stop this happening in future. * man/Makefile.am (sc_option_desc_uppercase): Ensure all man pages are generated, then search for erroneous uppercase chars. * src/Makefile.am (all_programs): Ensure all commands are built so that all man pages can be generated. 2010-02-15 Jim Meyering remove.c: remove three unnecessary #include directives * src/remove.c: Don't include hash.h, hash-pjw.h or obstack.h. They have been unused since the fts rewrite. 2010-02-15 Eric Blake build: ignore another gnulib artifact * .gitignore: Add lib/warn-on-use.h. dirname: improve man page description * doc/coreutils.texi (dirname invocation): Properly cover behavior on directory. * man/dirname.x: Likewise. * THANKS: Update. Reported by Emmanuel Lacour. 2010-02-11 Pádraig Brady doc: remove extraneous periods from --help output * src/join.c (usage): Mention "fields" rather than repeating "line" so that it's more obvious that the fields are still parsed, and thus -o is still honored for headers. Also remove an extraneous '.' reported by Stéphane Raimbault. * src/base64.c (usage): Remove extraneous blank line and order the options alphabetically. Also remove an extraneous '.' * src/chown.c (usage): Remove extraneous '.' * src/cp.c (usage): Likewise. * src/mktemp.c (usage): Likewise. * src/pr.c (usage): Likewise. * src/stat.c (usage): Likewise. * src/uniq.c (usage): Likewise. 2010-02-10 Jim Meyering doc: add a TODO item * TODO: Consider adding a col implementation. 2010-02-07 Jim Meyering copy.c: improve a comment * src/copy.c (copy_reg): The comment about POSIXLY_CORRECT refers only to cp, not to any other application that uses copy.c. 2010-02-07 James R. Van Zandt doc: add a cross reference from tac's man page to "rev" * man/tac.x: See also "rev". 2010-02-07 Jim Meyering tests: include help-version test settings used by gzip and grep * tests/misc/help-version: ...the better to keep this file in sync. doc: rewrite part of README-release * README-release (Pre-release testing): Reorganize. 2010-02-05 Jim Meyering sync with gnulib * gl/lib/regcomp.c.diff: Update to apply to changed version in gnulib. * gnulib: Update submodule to latest. 2010-02-02 Pádraig Brady tests: fix various timeout races Prompted by the continuous integration build failure at: http://hydra.nixos.org/build/277485 * tests/misc/timeout: Set all expected timeouts to 1s and all unexpected timeouts to 10s. In this way, tests normally proceed quickly but may delay up to 10s before reporting failures. * tests/ls/infloop: Likewise. * tests/tail-2/pid: Likewise. * tests/tail-2/pipe-f: Likewise. * tests/tail-2/wait: Likewise. * tests/dd/skip-seek-past-dev: Likewise. 2010-02-01 Ondřej Vašík tests: cp-a-selinux: skip the test if mounting a loop device fails * tests/cp/cp-a-selinux: Skip the test (instead of fail) if we fail to mount a loop device (e.g., none available). 2010-02-01 Pádraig Brady maint: fix a typo in NEWS * NEWS: s/contains/contain/ 2010-02-01 Pádraig Brady join: make -t '' operate on the whole line Previously passing an empty parameter to -t would raise an error, but now it means to treat each line as a single field for matching. This matches the default operation of `sort` which is usually used in conjunction with join. * src/join.c (main): Set the field delimiter to '\n' if an empty parameter is passed to -t. (usage): Mention the operation of -t ''. * tests/misc/join: Add 2 new tests, for the existing -t '\0' and the new -t '' functionality. * doc/coreutils.texi (join invocation): Mention that join -t '' always operates on the whole line, while join -t '\0' usually does. * NEWS: Mention the change in behavior. 2010-02-01 Assaf Gordon join: add --header option to always output the first line This essentially allows one to use --check-order with headings. Note join without --check-order will already handle the common case where headings do match in each file, however using --check-order will fail often when the header sorts after the first line of data. Note also that this will join header lines from each file even if they don't match, with headings from the first file being used. * NEWS: Mention the new option. * doc/coreutils.texi (join invocation): Describe the new option. * src/join.c (usage): Likewise. (join): Join the header lines unconditionally. * tests/misc/join: Add 5 new tests. 2010-02-01 Pádraig Brady maint: fix an inconsequential memory leak in join * src/join.c (join): Refactor the code that checks for misorder at the tail of the files. The most significant change here is that freeline() is called thus silencing a valgrind warning about a definite but inconsequential memory leak. (freeline): Make more general by doing nothing when passed NULL, and setting freed pointers to NULL. maint: use $(CONFIG_INCLUDE) rather than the hardcoding lib/config.h * tests/check.mk (TESTS_ENVIRONMENT): Use the generated CONFIG_INCLUDE variable. Note $(abs_builddir)/$(CONFIG_HEADER) also currently works, but $(CONFIG_HEADER) is deprecated and may not be generated in future. $(CONFIG_INCLUDE) was made available by gnulib in commit, 22970f8a, "syntax-check: detect incorrect boolean macro values in config.h" 2010-02-01 Jim Meyering ls --color: don't emit a final no-op escape sequence * src/ls.c (main): With --color, avoid emitting the final color- resetting escape sequence when it would be a no-op. * tests/ls/color-clear-to-eol: Adjust expected output accordingly. * tests/ls/color-dtype-dir: Likewise. * tests/ls/multihardlink: Likewise. * tests/ls/stat-free-symlinks: Likewise. * tests/misc/ls-misc: Likewise. * NEWS (Changes in behavior): Mention it. C de-Avillez rebased and adapted four of the new sl-dangle* tests in tests/misc/ls-misc. Reported by Jim Avera in http://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/494663 2010-01-28 Jim Meyering maint: move vulnerable-Makefile.in-check to gnulib * cfg.mk (sc_vulnerable_makefile_CVE-2009-4029): Move rule to... * gnulib: Update to latest, to get updated "maint.mk". 2010-01-27 Jim Meyering maint: add a syntax-check rule to check for vulnerable Makefile.in * cfg.mk (sc_vulnerable_makefile_CVE-2009-4029): New rule. 2010-01-25 Kamil Dudka who --mesg (-T) can use a more accurate test for TTY writability Enabled when coreutils is configured with --with-tty-group. Based on a patch written by Piotr Gackiewicz. Details at http://bugzilla.redhat.com/454261 * src/who.c (is_tty_writable): A new function returning true if a TTY device is writable by the group. Additionally it checks the group to be the same as TTY_GROUP_NAME when compiled with --with-tty-group. * m4/jm-macros.m4: Introduce a new configure option --with-tty-group. * NEWS: Mention the change. 2010-01-24 Jim Meyering tests: fix a syntax-check rule to pass in non-srcdir build * cfg.mk (sc_x_sc_dist_check): This coreutils-specific syntax-check rule would fail in a non-srcdir build, since in that case, each name from $(VC_LIST) starts with "$(srcdir)/". Fix that. * gnulib: Update to latest, to pull in a required maint.mk change. 2010-01-24 Pádraig Brady tests: make cp-mv-enotsup-xattr independent of the host file system * tests/cp-mv-enotsup-xattr: Create a file system from which to copy the xattrs so that the test is not skipped if the host file system does not have user_xattr support. Also don't erroneously fail when built without xattr support. doc: add nproc to the texinfo overview menu * doc/coreutils.texi: Add nproc to the System context command list in the overview menu. 2010-01-23 Pádraig Brady maint: ensure test independence from config macro format * tests/cp/acl: Support USE_ACL not being defined. * tests/mv/acl: Likewise. Also fix typo in skip message. * tests/cp/preserve-slink-time: Support HAVE_UTIMENSAT being 0. * tests/touch/no-dereference: Likewise. * tests/ls/capability: Normalize so 1 is not required to be last char. 2010-01-19 Eric Blake build: fix failure from bogus USE_XATTR definition * m4/xattr.m4 (gl_FUNC_ADDR): Fix regression introduced in commit 6beca4248. * THANKS: Update. Reported by Adam Sampson. 2010-01-18 Jim Meyering libstdbuf: plug a very unlikely leak * src/libstdbuf.c (apply_mode): Don't leak "buf" upon setvbuf failure. pr: avoid two over-allocations * src/pr.c (init_store_cols): Allocate N*sizeof(*VAR) bytes, not N*sizeof(int*). The latter would mistakenly allocate double the required space on a system with 8-byte pointers. 2010-01-14 Jim Meyering maint: add missing "post-release push" step to release procedure * README-release: Push the automated release and post-release NEWS-updating commits. Pádraig Brady reported that I'd pushed the tag without also pushing the followup commit. 2010-01-13 Jim Meyering post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.4 * NEWS: Record release date. 2010-01-13 Pádraig Brady tests: avoid spurious failures on older shells * tests/tail-2/inotify-hash-abuse: Use kill rather than wait to determine if the tail process is still running. * tests/tail-2/inotify-hash-abuse2: Ditto. 2010-01-13 Jim Meyering tests: work around spurious test failure with OpenBSD4.5's /bin/sh * tests/ls/infloop: OpenBSD4.5's /bin/sh would mistakenly include "set -x"-output in an application's stderr stream when stderr is redirected before stdout. This was causing one spurious test failure. The work-around: redirect stdout first. Reported by Nelson Beebe. tests: don't silently skip the sort-version tests * tests/misc/sort-version: Don't use <<- and indented here-doc contents. s/<<-/<[4]: here document `x' unclosed [Exit 1] by contrast, bash warns but still exits successfully: $ printf 'cat<<-x\n foo\n x\n'|bash && echo you lose bash: line 3: warning: here-document at line 1 delimited by \ end-of-file (wanted `x') foo x you lose 2010-01-12 Eric Blake tests: avoid spurious failure on old kernel * tests/touch/no-dereference: Skip test if utimensat doesn't support symlinks. Reported by Bernhard Voelker. 2010-01-12 Pádraig Brady maint: update info about getting the prerequisite automake * README-prereq: Now that we require automake-1.11.1 update the instructions from getting it from the git repo maint: remove an already handled item from TODO * TODO: The question regarding printf octal escapes is answered in commit 4bcefa62, 2003-04-21, "Fix printf POSIX compatibility bug ..." maint: fix tests on solaris by using /usr/xpg4/bin * tests/check.mk: Prepend /usr/xpg4/bin to the $PATH if present. Using the more standard utilities allows tests such as misc/printenv, which uses the -E option to grep, to complete. 2010-01-12 Jim Meyering build: update gnulib, to get fixed getlogin-related tests build: fix build failure due to missing libxattr Configure is supposed to detect insufficient XATTR support. However, if a system has the required headers, but no library, the configure script would mistakenly enable USE_XATTR. * m4/xattr.m4 (gl_FUNC_XATTR): If the attr_copy_file function is not found, don't set USE_XATTR. Nelson Beebe reported a link failure on RHEL 5.3. Also, do not let the combination of --disable-xattr and a stray LIB_XATTR environment setting perturb the build. * NEWS (Build-related): Mention it. doc: mention the wchar.h vs. glibc build problem * NEWS (Build-related): Mention the wchar.h issue. 2010-01-12 Pádraig Brady nproc: return a possibly more accurate total CPU count * gnulib: Update, for num_processors() improvement. * NEWS: Mention the fix. 2010-01-12 Kamil Dudka ls: reorder includes to work around broken * src/ls.c: Include later, to avoid build failure with a header from libcap-2.16-1 or earlier. See http://bugzilla.redhat.com/483548 for details. 2010-01-08 Eric Blake maint: move coreutils specific rule into cfg.mk * gnulib: Update, for maint.mk improvement. * cfg.mk (_makefile_at_at_check_excpetions): New rule, needed for latest change to maint.mk. 2010-01-07 Jim Meyering post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.3 * NEWS: Record release date. maint: change an email address in THANKS * THANKS: Adjust Denis' address. 2010-01-07 Eric Blake pr: ensure the page header line is of the required format Before this change, with too long a file name, the name would abut the date field on the left and possibly also the "Page N" field on the right, rather than leaving a one-space separator in each case. Fixes a regression introduced on Mar 6 2009, by commit a4053c5291d5797734b3e4f042f9e1adf3944fd6 * src/pr.c (print_header): Ensure that there is at least one space before and after the file name part of the header line. * NEWS: Mention it. * tests/pr/W20l24f-ll: s/xPage/ x Page/. * THANKS: Update. Reported by Denis McKeon, in https://savannah.gnu.org/bugs/?28492. 2010-01-07 Eric Blake maint: apply correct license to auxiliary files * gnulib: Update, for maint.mk improvements. * HACKING: Use GFDL 1.3, not 1.2. * NEWS: Likewise. * README: Likewise. * cfg.mk (old_NEWS_hash): Update accordingly. * .gitignore: Ignore file created by 'make update-NEWS-hash'. 2010-01-06 Jim Meyering build: require newer versions of automake and autoconf * configure.ac: Require autoconf-2.62 and automake-1.11.1 or newer. * bootstrap.conf (buildreq): Require automake-1.11.1 or newer, to ensure people use a version with the fix for CVE-2009-4029. Note that the coreutils-8.2 tarball included a fixed Makefile.in. Require autoconf-2.62, per automake. 2010-01-06 Eric Blake cp, touch: avoid problem with new glibc * gnulib: Update, for utimens fix. * NEWS: Mention the fix. Reported by Guillaume Ayoub in http://bugs.debian.org/563726. See also http://bugzilla.redhat.com/552320. 2010-01-05 Philip Rowlands doc: fix typo in NEWS * NEWS: Fix typo: s/repeated/repeatedly/ 2010-01-05 Jim Meyering build: update gnulib submodule to latest maint: always free a buffer, to avoid even semblance of a leak * src/tac.c (main): Free the input buffer in most cases. 2010-01-04 Jim Meyering maint: use more readable operator: "||" rather than "|" * src/cp.c (make_dir_parents_private): Use "||" rather than "|", so that clang understands there is no undefined pointer dereference. 2010-01-03 Jim Meyering maint: record update-copyright options for this package * cfg.mk: Next time, just run "make update-copyright". 2010-01-01 Eric Blake ls: fix color of broken symlinks colored as target * src/ls.c (print_color_indicator): When using 'LINK target' in dircolors, treat broken symlink as C_ORPHAN. * tests/misc/ls-misc (sl-dangle2, sl-dangle3, sl-dangle4) (sl-dangle5): Test for it, and add more coverage. * NEWS: Document it. * THANKS: Update. Reported by Chris Jones. 2010-01-01 Jim Meyering df: use fputs in place of printf in a few more places * src/df.c (print_header): Use fputs rather than printf in more places. Suggested by Eric Blake. build: update gnulib submodule to latest maint: add a few copyrights; remove obsolete README file * tests/README: Remove long-obsolete file. * tests/Makefile.am (EXTRA_DIST): Remove README. * tests/misc/truncate-dir-fail: Add copyright comment. * tests/misc/selinux: Likewise. * tests/misc/chcon: Likewise. * tests/misc/chcon-fail: Likewise. * tests/sample-test: Use only 2010 in this list. maint: update all FSF copyright year lists to include 2010 Use this command: git ls-files | grep -v COPYING \ | xargs env UPDATE_COPYRIGHT_USE_INTERVALS=1 \ build-aux/update-copyright 2010-01-01 Stéphane Raimbault pr --help: add missing space between short and long options usage message * src/pr.c (usage): Add missing space. pr --help: improve a line-break * src/pr.c (usage): Move the newline character a bit farther. df: add comments to help translators align column headers * src/df.c (print_header): Add a comment telling translators to retain the message length, and another to align header translations. 2009-12-31 Jim Meyering maint: newer gnulib; don't hard-code my GPG key ID * cfg.mk (gpg_key_ID): Remove definition, now that maint.mk automates it. * gnulib: Update to latest. doc: update tail's documentation to allow for new -F semantics * src/tail.c (usage): Reword tail -F description, so that it no longer mentions details specific to the non-inotify implementation. Also, join diagnostic strings (while staying under the 509-byte limit) to ease formatting of translations. The latter was prompted by a report from Stéphane Raimbault. * doc/coreutils.texi (tail invocation): Update description here, too. 2009-12-31 Eric Blake touch: work around ntfs-3g bug * gnulib: Update, for utimensat fix. * NEWS: Improve wording about touch fixes. * THANKS: Update. Reported by Stuart Citrin. 2009-12-30 Jim Meyering build: update gnulib submodule to latest doc: mention two tail -F bug fixes in NEWS * NEWS (Bug fixes): Two tail -F fixes. tail: test for a bug in inotify-enabled tail -F tail -F a b would stop tracking additions to b after "mv a b". * tests/tail-2/F-vs-rename: New file. * tests/Makefile.am (TESTS): Add it. 2009-12-30 Giuseppe Scrivano tail -F: don't stop following the target of a rename This fixes a bug whereby tail -F would fail to track changes to a file that was a target of a rename, and when the source of the rename was another tailed file. * src/tail.c (tail_forever_inotify): Ensure the wd is not already present in the hash table before trying to add it. When a new watch descriptor is added to the `wd_to_name' hash table, check that it is not already present. If it is present then remove the previous element. 2009-12-30 Pádraig Brady maint: improve the info about $PATH in README-prereq * README-prereq: It wasn't obvious that the $PATH should be set before building any of the prerequisite packages, so move that information up. 2009-12-29 Jim Meyering tail: add another test to exercise abort-inducing flaw in tail -F * tests/tail-2/inotify-hash-abuse2: New test, based on a reproducer by Rob Wortman. * tests/Makefile.am (TESTS): Add it. tail: add a test to exercise abort-inducing flaw in tail -F * tests/tail-2/inotify-hash-abuse: New file, derived from a report by Rob Wortman. * tests/Makefile.am (TESTS): Add it. Improved by: Pádraig Brady. 2009-12-29 Giuseppe Scrivano tail: remove `fdspec' from the hash table before changing its key * src/tail.c (tail_forever_inotify): Avoid modifying fdspec->wd while it is in the wd_to_name hash table. Once it is removed, it can be added using the new `wd' as key for the hash table. This fixes the abort-inducing bug reported by Rob Wortman in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/19372 2009-12-29 Jim Meyering maint: quiet "make" in doc/ * doc/Makefile.am (constants.texi): Add a use of AM_V_GEN. tail: rename an internal variable * src/tail.c (tail_forever_inotify): s/wd_table/wd_to_name/ tail: avoid read-beyond-end-of-buffer error * src/tail.c (tail_forever_inotify): Do not use f[i] in a context where i may be larger than the largest valid index. In the final "if" clause in which we'd remove an inotify watch, we might have used f[n_files]. Use fspec instead, since it is guaranteed to be defined. 2009-12-26 Eric Blake maint: ignore more built files Recent gnulib changes added new built files. * .gitignore: Add arg-nonnull.h, link-warning.h, unused-parameter.h. 2009-12-26 Eric Blake tac: supply link dependency * src/Makefile.am (tac_LDADD): Add LIB_GETHRXTIME. * THANKS: Update. Reported by Robert Schwebel. 2009-12-26 Jim Meyering build: update gnulib submodule to latest tail: shrink internal struct by 8 bytes * tail.c (struct File_spec): Rearrange struct members to decrease size by 8 bytes to 76,96 on i686,x86_64 respectively. 2009-12-25 Jim Meyering maint: tail: avoid in-function #if directives * src/tail.c (fremote): Add a comment. Move definition "up" to precede first use, so we can remove its prototype and the #if..#endif around each use. (any_remote_file): Rename from any_remote_files. 2009-12-25 Pádraig Brady tail: fix --follow to not use inotify on remote files * src/tail.c (struct File_spec): Add a flag to record if file is remote. (recheck): If we're using inotify then check if the file has gone remote and if so, drop it with a warning. (any_remote_files): A new function to check for any open remote files. (tailable_stdin): A new function to refactor the check for whether a tailable file was specified through stdin. (fremote): A new function to check if a file descriptor refers to a remote file. (tail_forever_inotify): Add some comments. (tail_file): Record if a file is remote when initially opened. (main): Disable inotify if any remote files specified. Also document the caveat about remounted files not being noticed by inotify. * NEWS: Mention the fix. 2009-12-23 Pádraig Brady wc: line-buffer the printed counts * src/wc.c (main): Set stdout to line buffered mode to ensure parallel running instances don't intersperse their output. This adds 6.5% to the run time in the worst case of many zero length files, but has neglible impact for standard sized files. * tests/misc/wc-parallel: New test for atomic output. * tests/Makefile.am: Reference it. * NEWS: Mention the fix This is similar to commit 710fe413, 20-10-2009, "md5sum, sha*sum, sum: line-buffer the printed checksums" 2009-12-22 Pádraig Brady stat: Recognize k-afs, gfs, ocfs2 file system types * src/stat.c (human_fstype): Add k-afs, gfs/gfs2 and ocfs2. * NEWS: Update the stat -f entry. stat: add support for more file system types * src/stat.c (human_fstype): Add the following FS types: fuseblk, rpc_pipefs. Also fix a typo of minux3 to minix3, and mention the fs-magic-compare make target to help update the list. * NEWS: Mention the fix. 2009-12-20 Jim Meyering build: correct coreutils-specific distcheck rules * dist-check.mk (built_programs): Use $(bin_PROGRAMS), not $(PROGRAMS). Otherwise, my-instcheck would fail due to non-installation of e.g., the noinst_PROGRAMS, setuidgid and getlimits. (taint-distcheck): Correct the grep command that checks for libtool traces in configure. 2009-12-20 Eric Blake touch: fix ctime regression in 'touch -a' Regression introduced in coreutils 8.1 due to a bug in the Linux kernel implementation of utimensat with mtime of UTIME_OMIT. * gnulib: Update to latest, to pick up utimensat fix. * NEWS: Mention the change. * THANKS: Update. Reported by John Stanley. 2009-12-19 Pádraig Brady maint: don't include the strverscmp gnulib module * bootstrap.conf (gnulib_modules): Remove the strverscmp module which is not used since commit e505736f, on 03-10-2008, "ls and sort: use filevercmp instead of strverscmp" doc: enhance and reference info about version comparison * doc/coreutils.texi (sort invocation): Reference the additional info about filevercmp rather than the unused strverscmp. (Details about version sort): Add some examples that are not handled well by fileversmp. * src/ls.c: Change a comment referencing the now unused strverscmp. rm: fix --one-file-system regression due to fts conversion * src/remove.c (rm_fts): Fix incorrect comparison of device and inode numbers. * tests/rm/one-file-system2: Add a separate test so that it can be run as a normal user (It doesn't need to mount). * tests/Makefile.am: Reference it. * NEWS: Mention the fix. Reported by Jan Larres. 2009-12-14 Jim Meyering maint: improve dist-check.mk rules * dist-check.mk (null_AM_MAKEFLAGS): Remove LIBTOOL. Adding it was erroneous, since it is required when building from a distribution tarball of a libtool-using project. Reported by Ralf Wildenhues. (my-distcheck): Reorganize to use a subshell and set -e, so that failures propagate "out". Without this change, setting LIBTOOL=false would cause a failure that would then be ignored, probably due to a problem in $(install-transform-check). 2009-12-14 Thiago Farina base64: use *_OPTION_DESCRIPTION macros instead of hard-coded strings * src/base64 (usage): Use HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION macros, not literal strings. 2009-12-13 Jim Meyering tests: unpack xz-compressed tarballs when possible, not always *.gz * dist-check.mk: Unpack compressed tarball using xz when possible, since that's faster. maint: make dist-check.mk more easily shared * dist-check.mk (built_programs): More generic, but still assumes src/. Don't set GZIP in environment when untarring. (my-distcheck): Use $(DIST_ARCHIVES), rather than assuming that there is always a .tar.gz file. nohup: if fd_repoen fails (redirecting stdin), report it * src/nohup.c (main): Don't ignore fd_reopen failure. tests: make the taint-distcheck rule easier to share with other projects * dist-check.mk (taint-distcheck): Skip this test in a project that uses libtool. stat: recognize "sockfs" file system type, ... ... now that its magic number appears in . * src/stat.c (human_fstype) [S_MAGIC_SOCKFS]: Add case. maint: move definitions from maint.mk to dist-check.mk * dist-check.mk (null_AM_MAKEFLAGS): Define here, not in maint.mk. (built_programs): Likewise. (my-distcheck): Move comments to... (coreutils-path-check): ...the code they refer to. Remove obsolete comments. (null_AM_MAKEFLAGS): Add gperf, even though it's not used here. * gnulib: Update to latest, for fixed maint.mk. 2009-12-12 Jim Meyering tests: tail-without-inotify: avoid spurious test failure * tests/tail-2/wait: Account for the possibility that the kernel lacks inotify support. Reported by Chris Clayton. factor: add a missing va_end * src/factor.c (debug): Add missing va_end. 2009-12-11 Jim Meyering build: update gnulib submodule to latest; adapt a patch * gl/lib/tempname.c.diff: Adjust patch to apply to gnulib, now that most TABs in indentation have been converted to spaces by running this command: f=tempname.c.diff; patch-xform $f > k && mv k $f post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.2 * NEWS: Record release date. tests: use a slightly better CU_TEST_NAME setting * tests/check.mk (CU_TEST_NAME): Better test names. tail: don't call fstat on an uninitialized FD This bug showed up via valgrind as a "Conditional jump or move depends on uninitialized value(s)" error. * src/tail.c (ignore_fifo_and_pipe): New function. (main): Use it only when tailing forever. The code to compute n_viable and mark some F[i] as ignored would call isapipe on an uninitialized file descriptor. But n_viable and those .ignored marks are useful/used only when tailing forever. This bug was introduced via commit f0ff8c73 (7.6), "tail: make the new piped-stdin test as portable as the old one". * NEWS (Bug fixes): Mention it. doc: NEWS: mention that gnulib's mgetgroups fix affects id * NEWS (Bug fixes): Mention the "id" bug fix inherited via this gnulib change: "mgetgroups: do not write bytes beyond end of malloc'd buffer" http://git.sv.gnu.org/cgit/gnulib.git/commit/?id=51d5e813e9ee6cf23 2009-12-10 Jim Meyering build: update gnulib submodule to latest tests: avoid spurious failure when run via valgrind * tests/misc/printenv: Ignore LD_PRELOAD differences. 2009-12-09 Jim Meyering doc: NEWS: the "make distcheck" vulnerability dates back to 5.0 * NEWS (Bug fixes): Correct the introduced-in version number. This was introduced on 2003-04-02 by commit 722a49ea. doc: NEWS: mention the "make distcheck" vulnerability * NEWS (Bug fixes): Mention implications of the "make distcheck" change. This was introduced on 2008-07-22 by commit 9bb0d576, "tests: ensure "make check" w/tainted build dir no longer impacts $HOME". tests: don't let "umask 077" cause root-only cp/preserve-gid failure * tests/cp/preserve-gid: Use working_umask_or_skip_ to set umask to 022. 2009-12-08 Jim Meyering build: update gnulib submodule to latest 2009-12-08 Pádraig Brady maint: remove an erroneous comment * tests/misc/timeout: Remove an erroneous comment introduced through copy and paste. sort: fix failure if sort's parent has ignored SIGCHLD * src/sort.c (main): Reset the SIGCHLD handler to the default as otherwise wait() could return an error. * tests/misc/sort-compress: Set the CHLD handler in a subshell to SIG_IGN to ensure the sort command resets it to SIG_DFL. * NEWS: Mention the fix. timeout: fix failure if timeout's parent has ignored SIGCHLD * src/timeout.c (main): Reset the SIGCHLD handler to the default as otherwise wait() could return -1 and set errno to ECHILD. This condition was ignored until commit 0b1dcf33, on 31-08-2009, "timeout: defensive handling of all wait() errors" but subsequently timeout would run the command correctly but then fail with an error message. * tests/misc/timeout: In a subshell set the CHLD handler to SIG_IGN to ensure the timeout command resets it to SIG_DFL. * NEWS: Mention the fix. tests: fix stty-row-col failure on small fixed terminals * tests/misc/stty-row-col: Linux virtual consoles at least, issue an error if you try to increase their size, so skip the test if we can't increase the dimensions of the tty by 1 cell. Reported by Matthew Burgess. tests: fix stty failure with serial control settings * tests/misc/stty: Don't check the serial control settings as these are ignored by various Linux kernels. Reported by Matthew Burgess. 2009-12-07 Jim Meyering build: update gnulib submodule to latest build: distcheck: do not leave a $TMPDIR/coreutils directory behind * dist-check.mk (tmpdir): Rename from TMPDIR. Use ./tests/torture unconditionally, rather than $TMPDIR-with-default-to-/tmp. Otherwise, running "make distcheck" could leave an empty /tmp/coreutils directory behind. (tp): Simplify, now that it's always in the build-dir. (taint-distcheck): Set HOME earlier, in case $(MAKE) misbehaves. (my-instcheck, coreutils-path-check): Add diagnostics, so it's easier to diagnose when each runs. (coreutils-path-check): Run configure with --quiet, to reduce output. Inspired by Ralf Wildenhues' report of /tmp/coreutils being left behind. 2009-12-06 Jim Meyering tests: readdir-mountpoint-inode avoid false-positive w/virtualbox * tests/ls/readdir-mountpoint-inode: With some systems, stat can succeed on a mount point and report that the inode number is 0. Since ls displays "?" for those, that would otherwise show up as a difference. Skip such mount points. Reported by Sergei Steshenko in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/19142 2009-12-06 Pádraig Brady tests: don't run tail-2/inotify-race by default * tests/tail-2/inotify-race: Note the caveats of the test. I.E. the intermittent skips and the gdb hang reported by Alan Curry. Add extra info to the log on why the test is skipped as it may be due to multiple reasons. Mark the test as very expensive so that it's not normally run. 2009-12-05 Eric Blake id: handle systems without getgroups support If getgroups failed with ENOSYS, mgetgroups would unnecessarily fail, and that provoked id into freeing an uninitialized pointer. Meanwhile, we were not using xalloc_die properly. Both issues are better solved in gnulib, by introducing xgetgroups; this patch uses the new interface. Regression introduced by commit 6a31fd8d7. * gnulib: Update, for mgetgroups improvments. * src/id.c (print_full_info): Adjust caller to die on allocation failure, and no longer worry about ENOSYS. * src/group-list.c (print_group_list): Likewise. * src/setuidgid.c (main): Likewise. * NEWS: Mention the fix. * THANKS: Update. Reported by Scott Harrison. 2009-12-03 Jim Meyering tests: fix a bug in sanitize_path_ that inhibited verbose output * tests/test-lib.sh (sanitize_path_): Use "set -- ...", not "set - ...", since the latter turns off the -x setting we rely on for VERBOSE=yes output. 2009-12-01 Eric Blake sort: fix link failure on Solaris Commit f9d0bb8481 made sort depend on xnanosleep. * src/Makefile.am (sort_LDADD): Add LIB_NANOSLEEP. 2009-12-01 Jim Meyering rm: fix empty-name bug introduced with conversion to use fts While "rm ''" would properly fail, "rm F1 '' F2" would fail to remove F1 and F2, due to the empty string argument. This bug was introduced on 2009-07-12, via commit 4f73ecaf, "rm: rewrite to use fts". * gnulib: Update to latest, for fixed fts.c. * NEWS (Bug fixes): Describe it. * tests/rm/empty-name: Adjust for changed diagnostic. (mk_file): Define, copied from misc/ls-misc. (empty-name-2): New test, for today's fix. * lib/xfts.c (xfts_open): Reflect the change in fts_open, now that it no longer fails immediately when one argument is the empty string. Assert that the bit flags were not the cause of failure. * po/POTFILES.in: Remove xfts.c. * THANKS: Update. Reported by Ladislav Hagara. 2009-11-30 Pádraig Brady bootstrap: fix handling of various perl --version formats * bootstrap (get_version): Don't use perl's $] special variable, as that requires updating all bootstrap.conf files to use perl's x.yyyzzz version format. Instead make the regular expression more general to support version formats from older perl-5.005_002 (5.5.2) and perl-5.11 which has other numbers in the version line. 2009-11-29 Jim Meyering bootstrap: update from gnulib, for perl-5.11.x support * bootstrap (get_version): Handle perl separately, since perl-5.11's --version output is different. build: update gnulib submodule to latest 2009-11-28 Jim Meyering maint: chown.c: remove a comment * src/chown.c: Remove old spec-like comment. 2009-11-24 Eric Blake tests: fix link failure on cygwin Counterpart to commit 8fe40b84bd8, since test-link.c uses rename, and we override gnulib with a rename() replacement that can xalloc_die. * gl/modules/link-tests.diff: New file. 2009-11-24 Eric Blake build: fix link failure on cygwin Cygwin 1.5 has a broken sleep, and the gnulib tests dragged in rpl_sleep which then caused a link failure because it wasn't in libcoreutils.a. We could solve it by using the gnulib sleep module. However, sleep and usleep may interact poorly with SIGALRM, and they have less granularity; so it is better to adopt a policy that if we must sleep, prefer xnanosleep. * src/sort.c (pipe_fork): Use xnanosleep, to avoid the need for rpl_sleep on cygwin, and to reduce granularity. (MAX_FORK_TRIES_COMPRESS, MAX_FORK_TRIES_DECOMPRESS): Increase, to account for reduction in granularity. * src/tail.c (tail_file): Use xnanosleep in debug code. * cfg.mk (sc_prohibit_sleep): New rule. 2009-11-23 Jim Meyering tests: avoid test failures when PATH contains an unsearchable directory * tests/test-lib.sh (sanitize_path_): New function. Always call it. 2009-11-22 Dmitry V. Levin tests: do not fail on read-only root file system * tests/touch/not-owner: Handle the case when the root file system is mounted read-only. Reported by Solar Designer. 2009-11-20 Jim Meyering maint: cfg.mk: remove factored-out ftp host/dir definitions * cfg.mk (gnu_ftp_host-alpha, gnu_ftp_host-beta gnu_ftp_host-stable): (gnu_rel_host, url_dir_list): Remove definitions. The defaults, now provided by maint.mk, are the same. * gnulib: Update for latest, including those maint.mk additions. maint: correct comments in test scripts * tests/misc/pwd-long: Fix spelling of cygwin1.dll in comment. * tests/rm/fail-eperm: Likewise. Reported by Eric Blake. maint: don't list "warnings" module explicitly * bootstrap.conf (gnulib_modules): Remove "warnings", now that it's pulled in automatically via "manywarnings". maint: move xfreopen module to gnulib * gl/lib/xfreopen.c: Remove file. * gl/lib/xfreopen.h: Likewise. * gl/modules/xfreopen: Likewise. build: update gnulib submodule to latest 2009-11-19 Jim Meyering tests: avoid spurious failures due to insecure directory in PATH These tests perform no PATH search, and used to simply delete PATH from the environment. However, that is not portable, as seen on Cygwin, where cygwin.dll must be resolvable via PATH when starting a sub-shell. With commit 0cc04241, we took the alternate approach of untainting the incoming $ENV{PATH}, but that fails when it contains an other-writable directory. Instead, now we hard code it to '/bin:/usr/bin'. * tests/misc/pwd-long: Hard code $ENV{PATH} to a safe value. * tests/rm/fail-eperm: Likewise. Reported by Gilles Espinasse, Andreas Schwab, and Bauke Jan Douma. 2009-11-18 Jim Meyering build: "make stable" emitted an invalid gnupload command * cfg.mk (gnu_ftp_host-stable): Rename from gnu_ftp_host-major. * README-release: Change another s/major/stable/. post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.1 * NEWS: Record release date. build: update gnulib for Solaris utimens workaround build: update gnulib submodule to latest 2009-11-17 Jim Meyering maint: remove local gnulib-related patches * gl/lib/printf-args.c.diff: Remove file. No longer needed. * gl/lib/vasnprintf.c.diff: Likewise. build: update gnulib for Solaris 10 unsetenv work-around doc: mention the du/fts vs. NFSv4 mount-point work-around * NEWS (Changes in behavior): Mention it. build: update from gnulib for (un)setenv fixes 2009-11-16 Jim Meyering build: update gnulib submodule to latest true, false: perform initialization only when argc == 2 * src/true.c (main): There is no reason to examine argv[0], call atexit, etc., in the usual case in which we're about to exit. This has the side effect of making it so that these programs no longer segfault when subjected to execve abuse. Before this change, these commands would make "true" segfault: printf '%s\n' '#include ' 'int main(int c, char**v)' \ '{ execve (v[1], 0, 0); }' > k.c && gcc k.c && ./a.out $PWD/true Now it succeeds. Reported by Tetsuo Handa and Bart Van Assche via Ondřej Vašík in http://bugzilla.redhat.com/537684. tail -F can fail to track a file after it's been rotated Tailing forever and by-name (--follow=name, -F), tail would sometimes fail to follow a file that had been removed via rename. If you can't apply this patch and have tail 7.6 or newer, you can work around the bug via the undocumented --disable-inotify option. * src/tail.c (tail_forever_inotify): When tailing by name (-F), do not un-watch a file upon receipt of the IN_MOVE_SELF event. Reported by Arjan Opmeer in http://bugs.debian.org/548439. * NEWS (Bug fixes): Mention it. Also see http://marc.info/?l=coreutils-bug&m=125829031916515 * tests/Makefile.am (TESTS): Add tail-2/inotify-rotate. * tests/tail-2/inotify-rotate: New test. 2009-11-14 Jim Meyering tests: help-version: exit nonzero when $built_programs is empty * tests/misc/help-version: Use "Exit 1", rather than "Exit $fail" with fail defined to 0 when $built_programs is empty. build: do use AM_GNU_GETTEXT's "need-formatstring-macros" option * configure.ac: Revert commit 49741b61 and add a comment. Reported by Eric Blake. 2009-11-14 Pádraig Brady tests: avoid a spurious failure on a loaded system * tests/misc/timeout-parameters: This test could fail due to the 1-second timeout expiring before a command of "no_such" could be exec'd and fail. Increase to 10 seconds. 2009-11-13 Jim Meyering build: require gettext-0.17 * configure.ac: Require gettext-0.17; it was released two years ago. build: correct gettext configure-time support * configure.ac: Use AM_GNU_GETTEXT([external], [need-ngettext]), rather than AM_GNU_GETTEXT([external], [need-formatstring-macros]). Reported by Martin Jacobs in http://thread.gmane.org/gmane.comp.parsers.bison.bugs/3181 * THANKS: Add his name. build: update gnulib to latest, for fixed test-getgroups.c tests: avoid a spurious timeout on a heavily-loaded system * tests/misc/timeout-parameters: This test would fail due to the 1-second timeout expiring before a command of "." could be exec'd and fail. Increase to 10 seconds. 2009-11-13 Eric Blake build: update gnulib, for getgroups improvements A replacement getgroups is now guaranteed to exist, but it may fail with ENOSYS. mgetgroups is moved to gnulib, and now takes gid_t instead of GETGROUPS_T (but setgroups still needs GETGROUPS_T). * gnulib: Update to latest. * gl/modules/mgetgroups: Delete, moved to gnulib. * gl/m4/mgetgroups.m4: Likewise. * gl/lib/mgetgroups.h: Likewise. * gl/lib/mgetgroups.c: Likewise. * src/group-list.c (print_group_list): Adjust callers. * src/id.c (print_full_info): Likewise. 2009-11-12 Jim Meyering build: bootstrap: add a comment; generalize autoheader check * bootstrap: Sync from gnulib and diff. build: update gnulib to latest; more *BSD and Solaris work-arounds 2009-11-11 Jim Meyering bootstrap: use git_modules_config in one more place * bootstrap: Make bootstrap's --gnulib-srcdir more useful (for testing). 2009-11-10 Eric Blake doc: fix typo * doc/coreutils.texi (mktemp invocation): Quote shell variable. 2009-11-09 Jim Meyering build: update gnulib submodule to latest for its FreeBSD fixes 2009-11-09 Pádraig Brady ls: fix capability coloring Capability checking was incorrectly done on just the base name rather than on the whole path. Consequently there could be both false positives and negatives when coloring files with capabilities. Also capability checking was not done at all in certain cases for non executable files. Note passing absolute rather than relative names to cap_get_file() reduces the has_capability() overhead from around 33% to 30%. I.E. ls --color is now around 3% faster. * src/ls.c (struct fileinfo): Add a has_capability member. (print_color_indicator): Refactor to pass just a fileinfo pointer and a flag to say if we're dealing with a symlink target. (print_name_with_quoting): Likewise. (gobble_file): Set has_capability in the fileinfo struct. Also do a capability check even if executable coloring is disabled. Ditto for SETUID and SETUID coloring. Comment on how expensive has_capability() is. (print_long_format): Adjust to refactored print_name_with_quoting. (quote_name): Likewise. (print_file_name_and_frills): Likewise. * tests/ls/capability: Test the various false positive and negatives. * THANKS: Add reporter (Ivan Labath). * NEWS: Mention the fix. 2009-11-07 Eric Blake build: consistently use freopen-safer cat, head, ptx, shuf, tac, tail, tee, tr, and uniq used freopen on stdout, and were potentially vulnerable. dircolors, du, and tsort only used it on stdin, which is unaffected by freopen_safer, but this covers all uses for consistency. * cfg.mk (sc_require_stdio_safer): New rule. * gl/modules/xfreopen (Depends-on): Add freopen-safer. * gl/lib/xfreopen.c (includes): Use stdio--.h. * src/ptx.c (includes): Likewise. * src/shuf.c (includes): Likewise. * src/uniq.c (includes): Likewise. * src/dircolors.c (includes): Likewise. * src/du.c (includes): Likewise. * src/tsort.c (includes): Likewise. 2009-11-07 Eric Blake mktemp: fix bug with -q and closed stdout If stdin or stdout is closed, then freopen(,stderr) can violate the premise that STDERR_FILENO==fileno(stderr), which in turn breaks mktemp -q. * bootstrap.conf (gnulib_modules): Add freopen-safer. * src/mktemp.c (includes): Use stdio--.h. * tests/misc/close-stdout: Enhance test to catch bug. 2009-11-07 Jim Meyering maint: make du's cycle-detection code consistent * src/du.c (process_file): Revert the du.c-changing part of commit 8ba5d1a7. Use cycle_warning_required instead. chcon, chgrp, chmod and chown now diagnose a directory cycle * lib/xfts.c (cycle_warning_required): New function. * lib/xfts.h: Declare it. * src/chown-core.c (change_file_owner): Diagnose a cycle. * src/chmod.c (process_file): Likewise. * src/chcon.c (process_file): Likewise. * NEWS (Bug fixes): Mention this. 2009-11-06 Giuseppe Scrivano nproc: A new program to count the available processors * AUTHORS: Add my name. * NEWS: Mention it. * README: Likewise. * bootstrap.conf (gnulib_modules): Add nproc. * doc/coreutils.texi (nproc invocation): Add nproc info. * man/Makefile.am (nproc.1): Add dependency. * man/nproc.x: New template. * man/.gitignore: Ignore generated man page. * po/POTFILES.in: Add src/nproc.c. * src/.gitignore: Exclude nproc. * src/Makefile.am (EXTRA_PROGRAMS): Add nproc. * src/nproc.c: New file. * tests/Makefile.am (TESTS): Add misc/nproc-{avail,positive}. * tests/misc/nproc-avail: New file. * tests/misc/nproc-positive: New file. 2009-11-06 Jim Meyering build: move do-release-commit-and-tag to gnulib * bootstrap.conf (gnulib_modules): Add do-release-commit-and-tag. * build-aux/do-release-commit-and-tag: Remove file. Now it's in gnulib. * gnulib: Update submodule to the latest, to get the just-moved script. 2009-11-05 Eric Blake mktemp: use more robust means to avoid double-close of stdout Reverts earlier patch - fflush() can succeed but fclose() fail for some cases of write failures, and we want to catch those. * src/mktemp.c (stdout_closed): New variable. (maybe_close_stdout): New function, borrowed from dd.c. (main): Track whether stdout has been closed. 2009-11-05 Eric Blake mktemp: enhance test to catch just-fixed typo behavior Penance for botching the conflict resolution while rebasing my series. * tests/misc/mktemp (check_tmp): Test for the bug when wrong parameter is used. 2009-11-05 Jim Meyering mktemp: don't try to close stdout twice * src/mktemp.c (main): Rather than calling close_stream (which would make atexit-called close_stdout try to close it a second time), check for write failure via ferror and fflush. mktemp: don't use suff_len in place of #-of-`X's variable * src/mktemp.c (mkstemp_len, mkdtemp_len): Pass x_len as final argument, and not suff_len. 2009-11-05 Eric Blake mktemp: add suffix handling Now that mkstemps is supported, we might as well use it. * src/mktemp.c (TMPDIR_OPTION): New enum value. (longopts): Add new option. (usage): Document it. (count_trailing_X_s): Rename... (count_consecutive_X_s): ...to this, and add parameter. (mkstemp_len, mkdtemp_len): Add parameter. (main): Implement new option. (AUTHORS): Add myself. * AUTHORS (mktemp): Likewise. * tests/misc/mktemp: Test new option. * doc/coreutils.texi (mktemp invocation): Document it. * NEWS: Likewise. Fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=548316. 2009-11-05 Eric Blake build: reflect gnulib changes to tempname In glibc 2.11 and gnulib, gen_tempname added a parameter suffixlen (unfortunately, it is typed as int rather than size_t, for historical compatibility to a poor choice by BSD). * gnulib: Import latest changes. * gl/lib/tempname.h.diff: Accommodate new suffixlen parameter. * gl/lib/tempname.c.diff (check_x_suffix): Allow for X in suffix beyond x_suffix_len. (gen_tempname_len): Add suffixlen parameter. (__gen_tempname): Update caller. * src/mktemp.c (mkstemp_len, mkdtemp_len): Update callers. 2009-11-05 Eric Blake build: override gnulib tempname via diff Diffs are more robust than wholesale replacement, because bootstrap will inform us of any incompatible changes made in upstream gnulib. * gl/lib/tempname.h: Change... * gl/lib/tempname.h.diff: ...to diff. * gl/lib/tempname.c: Change... * gl/lib/tempname.c.diff: ...to diff. 2009-11-05 Eric Blake mktemp: rearrange --help output * src/mktemp.c (usage): Align indentation and sort by long options. Describe valid templates. Suggested by http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=548316. tests: enhance mktemp test * tests/misc/mktemp: Add more coverage. doc: document mktemp * doc/coreutils.texi (mktemp invocation): New node. * TODO: Delete completed task. mktemp: don't leave file behind on write failure * src/mktemp.c (main): Remove just-created file if stdout had problems. * bootstrap.conf (gnulib_modules): Add remove. * tests/misc/close-stdout: Test it. * NEWS: Document it. 2009-11-05 Jim Meyering du: cleanup: remove dead-code vestige of already-removed option * src/du.c (MEGABYTES_LONG_OPTION, main): Remove vestiges of already-removed long option, --megabytes. du now diagnoses cycles, rather than ignoring them * src/du.c (symlink_deref_bits): New global, decl moved from ... (main): ...here. (process_file): When fts detects a directory cycle that can't be due to symlinks, report it and arrange to exit nonzero. * NEWS (Bug fixes): Mention it. maint: factor out cycle warning, now that du will use it, too * src/system.h (emit_cycle_warning): Define. Factored out of... * src/remove.c (rm_fts): ...here. Use the new macro. 2009-11-03 Jim Meyering tests: rm: add test for today's change in behavior * tests/Makefile.am (root_tests): Add rm/read-only to the list. * tests/rm/read-only: New file. rm -f: ignore EROFS when it's really ENOENT rm -f must not print a diagnostic for a nonexistent file. However, most linux-based kernel unlinkat functions set errno to EROFS when the named file (regardless of whether it exists) would lie on a read-only file system. remove.c now performs an extra fstatat call in that case, to determine whether the file exists. * src/remove.c (excise): Map EROFS to ENOENT, if a file is nonexistent. Reported by Steven Drake in . * NEWS (Changes in behavior): Mention it. tests: inotify-race: don't let malfunctioning gdb hang the test * tests/tail-2/inotify-race: Apply timeout to each gdb invocation. 2009-11-02 Eric Blake build: avoid some warnings * gl/lib/mbsalign.c (mbsalign): Mark unused parameter. * bootstrap.conf (gnulib_modules): Remove obsolete rename-dest-slash. * gnulib-tests/Makefile.am (AM_CFLAGS): Reduce set of warnings for gnulib tests. * gl/modules/rename-tests.diff (Makefile.am): New file, to add LIBINTL to LDADD, since we avoid canonicalize-lgpl module. * gl/lib/regcomp.c.diff (regerror, calc_next) (build_collating_symbol, parse_bracket_element, build_equiv_class) (free_tree): Mark unused parameters. * gl/lib/regex_internal.h.diff (re_string_elem_size_at): New file, to mark unused parameters. * gl/lib/printf-args.c.diff (PRINTF_FETCHARGS): New file, to avoid type mismatch. * gl/lib/vasnprintf.c (VASNPRINTF): New file, to avoid shadowing local variable name. * .gitignore: Ignore temporary build artifacts. build: update gnulib submodule to latest, for fewer compiler warnings 2009-10-31 Jim Meyering admin: automate one more part of the release process This script automates the process of updating NEWS, performs the resulting final commit (thus with a consistent log message), and applies a signed tag (v$VERSION) to the result. * build-aux/do-release-commit-and-tag: New script. * README-release: Document it. admin: fix typo in release procedure * README-release: s/gzip/coreutils/ 2009-10-30 Jim Meyering tests: prohibit fail=0 initialization * cfg.mk (sc_prohibit_fail_0): New rule. * .x-sc_prohibit_fail_0: New file. * Makefile.am (syntax_check_exceptions): Distribute the new file. tests: factor 350 fail=0 initializations into test-lib.sh Run this command to remove the factored-out "fail=0" lines. perl -ni -e '/^fail=0$/ or print' $(g grep -l '^fail=0$') * tests/test-lib.sh: Initialize fail=0 here, not in 300+ scripts. * tests/...: nearly all bourne shell scripts Suggested by Eric Blake. tests: remove the less-regular fail=0 assignments manually * tests/tail-2/assert-2: * tests/tail-2/assert: * tests/cp/file-perm-race: * tests/misc/df: * tests/misc/truncate-dir-fail: 2009-10-29 Jim Meyering tests: don't let a fail=1 env. setting induce unwarranted test failure * cfg.mk (sc_fail_is_initialized): New rule. Fix the offenders: * tests/cp/acl: Set fail=0 * tests/cp/backup-is-src: Likewise. * tests/cp/file-perm-race: Likewise. * tests/cp/reflink-auto: Likewise. * tests/cp/same-file: Likewise. * tests/ln/backup-1: Likewise. * tests/misc/su-fail: Likewise. * tests/misc/truncate-owned-by-other: Likewise. * tests/mkdir/p-3: Likewise. * tests/mkdir/selinux: Likewise. * tests/mkdir/special-1: Likewise. * tests/mv/acl: Likewise. * tests/mv/backup-is-src: Likewise. * tests/mv/diag: Likewise. * tests/mv/force: Likewise. * tests/mv/hard-link-1: Likewise. * tests/mv/into-self-3: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/touch/now-owned-by-other: Likewise. remove stray closing comment delimiter, "*/", in previous change * gl/lib/regexec.c.diff: Fix a typo. 2009-10-29 Eric Blake maint: avoid exiting with magic number Cope with gnulib's new sc_prohibit_magic_number_exit rule. * .x-sc_prohibit_magic_number_exit: New file, to add exemptions. * Makefile.am (syntax_check_exceptions): Distribute it. * lib/euidaccess-stat.c (main): Fix culprits. * src/chcon.c (main): Likewise. * src/runcon.c (main): Likewise. * src/setuidgid.c (main): Likewise. 2009-10-29 Jim Meyering build (--enable-gcc-warnings): enable gcc's -Werror also in lib/ * configure.ac (GNULIB_WARN_CFLAGS): Define. * lib/Makefile.am (AM_CFLAGS): Use $(GNULIB_WARN_CFLAGS) rather than $(WARN_CFLAGS) and add $(WERROR_CFLAGS). * gl/lib/regcomp.c.diff: New file. * gl/lib/regex_internal.c.diff: New file. * gl/lib/regexec.c.diff: New file. build: update gnulib submodule to latest build: allow whitespace violations in gl/lib/*.diff files * .gitattributes: Exempt gl/lib/*.diff. * .x-sc_prohibit_tab_based_indentation: Likewise. * .x-sc_space_tab:Likewise. 2009-10-29 Eric Blake nice, nohup, su: detect write failure to stderr These programs can print non-fatal diagnostics to stderr prior to exec'ing a subsidiary program. However, if we thought the situation warranted a diagnostic, we insist that the diagnostic be printed without error, rather than blindly exec, as it may be a security risk. For an example, try 'nice -n -1 nice 2>/dev/full'. Failure to raise priority (by lowering niceness) is not fatal, but failure to inform the user about failure to change priority is dangerous. * src/nice.c (main): Declare failure if writing advisory message to stderr fails. * src/nohup.c (main): Likewise. * src/su.c (main): Likewise. * tests/misc/nice: Test this. * tests/misc/nohup: Likewise. * NEWS: Document this. 2009-10-28 Jim Meyering doc: tell --enable-gcc-warnings users where to report problems * README-hacking: Add a caveat for --enable-gcc-warnings. build: make doc checks more user-friendly * doc/Makefile.am (check-texinfo): Begin moving each individual test into its own rules. (sc-avoid-builtin, sc-avoid-path): New rules. Extracted from check-texinfo. (syntax_checks): Add them. doc: avoid failing "make check" * doc/coreutils.texi (env invocation): s/builtin/built-in/ 2009-10-28 Pádraig Brady doc: improve the echo and printf help on escapes * src/printf.c (usage): Merge strings with echo.c to aid translators. Move the description for \NNN beside the other numeric escape codes. Don't mention "character" as that suggests character conversion. * src/echo.c (usage): Likewise. Also mention the \xHH escape sequence. echo, printf: interpret \e as the Escape character Match gcc, perl, bash, ksh, tcsh, ... in supporting \e. * src/printf.c (print_escape_char): Output \x1B when \e encountered. * src/echo.c (main): Likewise. * src/stat.c (print_escape_char): Likewise. * doc/coreutils.texi (echo invocation): Add \e to the list. * tests/misc/printf: Verify that \e outputs \x1B. * NEWS: Mention the change in behaviour. 2009-10-28 Eric Blake printenv: ignore bogus variable names Exposed by env a=b=c printenv a=b. * src/printenv.c (main): Silently reject = in names. * tests/misc/printenv: Test for it. * NEWS: Document this. 2009-10-28 Pádraig Brady maint: avoid "make syntax-check" failure * src/printenv.c: Remove unused "long-options.h" 2009-10-28 Eric Blake doc: turn env comments into documentation * src/env.c: Convert introductory comments... * doc/coreutils.texi (env invocation): ...into documentation. Suggested by Jim Meyering. 2009-10-28 Eric Blake env, printenv: add -0/--null option Allows for unambiguous processing when environment values (or even non-portable names!) contain newline. * src/env.c (longopts): Add new option. (usage): Document it. (main): Implement it. * src/printenv.c (longopts): New variable. (usage): Document new option. (main): Implement it. * doc/coreutils.texi (Common options): New macro optNull. (du invocation, env invocation, printenv invocation): Use it. * NEWS: Mention this. * tests/misc/env-null: New test. * tests/Makefile.am (TESTS): Run it. 2009-10-28 Eric Blake tests: add printenv coverage * tests/misc/printenv: New test. * tests/Makefile.am (TESTS): Run it. * .gitignore: Ignore more cruft. tests: fix PATH problems on cygwin * tests/misc/sort-compress: Remove non-portable over-restriction of PATH; besides, commit 3ea177e changed sort to no longer default to gzip. * tests/rm/fail-eperm: Untaint, rather than clear, PATH. * tests/misc/pwd-long: Likewise. Also skip test if long path cannot be created. (normalize_to_cwd_relative): Use eq rather than ==, since cygwin perl doesn't properly handle 64-bit ino_t numerically. 2009-10-27 Eric Blake tests: clean up tests of env -- handling The comment in env.c about -- handling has not matched the behavior in the code since the initial commit back in 1992. * src/env.c: Fix bogus comment. * tests/misc/env: Further tweaks, avoiding PATH problems inherent in testing -i, and testing program name containing =. * doc/coreutils.texi (env invocation): Mention that intermediate program is needed to invoke program with name containing =. 2009-10-27 Eric Blake doc: document PATH interactions with env * doc/coreutils.texi (env invocation): Mention that PATH is modified prior to exec. * tests/misc/env: Test this. env: reject bogus -u arguments * src/env.c (main): Use unsetenv rather than putenv to remove items from environ, and check for failure. * bootstrap.conf (gnulib_modules): Add unsetenv. * tests/misc/env: Test this. * NEWS: Document it. maint: let gnulib provide environ * bootstrap.conf (gnulib_modules): Add environ. * src/env.c (environ): Delete declaration. * src/printenv.c (environ): Likewise. * src/stdbuf.c (environ): Likewise. * src/su.c (environ): Likewise. 2009-10-26 Eric Blake tests: avoid file name not portable to cygwin * tests/misc/chroot-fail: Use 'no_such', not '...', since cygwin 1.5 silently strips trailing dots. * tests/misc/nice-fail: Likewise. * tests/misc/stdbuf: Likewise. * tests/misc/timeout-parameters: Likewise. 2009-10-26 Jim Meyering tests: rm/one-file-system: work around umount failure * tests/rm/one-file-system (cleanup_): Unmount a/b, rather than "$other_partition_tmpdir", to accommodate those who link /etc/mtab to /proc/mounts. Reported by Gilles Espinasse in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/18508 tests: adjust new env test not to fail * tests/misc/env: Create ./-i as a link to our "echo" binary, rather than as a bourne shell script, so that env can exec it. Set PATH to ".". tests: nice: adjust new tests to work more portably * tests/misc/nice (tests): Accommodate a nice program for which "nice -n -1 nice" prints nothing. It should print -1 or (usually) 0. Otherwise, we'd get syntax errors. nice: execute program even when setpriority fails due to EACCES * src/nice.c (perm_related_errno): New function. (main): Use it, rather than testing only errno == EPERM. * NEWS (Bug fixes): Mention it. 2009-10-26 Pádraig Brady timeout: don't orphan monitored programs if they ignore specified signals * src/timeout.c (install_signal_handlers): Handle any user specified signal, so that if it does not cause the child to exit then we don't exit and orphan the child. Previously this for example, would leave an orphan dd process running: timeout -sUSR1 1s dd if=/dev/zero of=/dev/null * NEWS: Mention the fix. 2009-10-24 Eric Blake tests: test recent status changes * tests/misc/nice: Enhance test. * tests/misc/chroot-fail: New test. * tests/misc/env: Likewise. * tests/misc/nice-fail: Likewise. * tests/misc/su-fail: Likewise. * tests/Makefile.am (TESTS): Run new tests. maint: move chroot test * tests/chroot/credentials: Move... * tests/misc/chroot-credentials: ...here, to reduce number of directories. * tests/Makefile.am (root_tests): Reflect rename. tests: enhance stdbuf and timeout tests * tests/misc/timeout-parameters: Validate exact exit status. * tests/misc/stdbuf: Likewise. * tests/misc/timeout: Likewise. Use require_built_. * tests/misc/arch: Likewise. nohup: use EXIT_CANCELED if not POSIXLY_CORRECT * src/nohup.c (NOHUP_FAILURE): Rename... (POSIX_NOHUP_FAILURE): ...to this. (main): Pay attention to POSIXLY_CORRECT, to determine whether to use status 125 or 127. * doc/coreutils.texi (nohup invocation): Document this. * NEWS: Likewise. * tests/misc/invalid-opt (exit_status): Adjust expected results. * tests/misc/help-version (expected_failure_status): Likewise. * tests/misc/nohup: Likewise. chroot, env, nice, su: use EXIT_CANCELED for internal failure * src/chroot.c (main): Use EXIT_CANCELED, not EXIT_FAILURE. * src/env.c (main): Likewise. * src/nice.c (main): Likewise. * src/su.c (change_identity, main): Likewise. * doc/coreutils.texi (chroot invocation, env invocation) (nice invocation, su invocation): Document this. * NEWS: Likewise. * tests/misc/invalid-opt (exit_status): Adjust expected results. * tests/misc/help-version (expected_failure_status): Likewise. tests: accommodate BSD getopt * tests/misc/invalid-opt (err_subst): Support alternate spelling. 2009-10-23 Eric Blake build: prohibit improper use of stat and lstat * cfg.mk (sc_prohibit_stat_macro_address): New rule. * src/ln.c (do_link): Adjust comment to avoid false positive. * src/stat.c (do_stat): Likewise. * src/touch.c (main): Likewise. build: update gnulib submodule to latest, for test cleanups 2009-10-22 Eric Blake maint: turn on compiler warnings for gnulib tests * gnulib-tests/Makefile.am (AM_CFLAGS): Add WARN_CFLAGS. * configure.ac (enable-gcc-warnings): Also use -funit-at-a-time, to silence gcc 4.3.4 -Wdisabled-optimization. * .gitignore: Ignore some more files. 2009-10-22 Jim Meyering build: prohibit direct use of readlink or readlinkat * cfg.mk (sc_prohibit_readlink): New rule. Suggested by Eric Blake. 2009-10-22 Giuseppe Scrivano tests: add a test for the `tail -f' race condition bug If new data becomes available between the initial read and when tail registers the inotify watch descriptors, ensure that it is read before a new event happens on the file. * tests/Makefile.am (TESTS): Add tail-2/inotify-race. * tests/tail-2/inotify-race: New file. tail -f: avoid a race condition * NEWS (Bug fixes): Mention it. * src/tail.c (check_fspec): New function. (tail_forever_inotify): Ensure there is no new data before entering the inotify events wait loop. 2009-10-22 Eric Blake build: update gnulib submodule to latest, for utimens enhancements tests: ensure touch honors trailing slash * tests/touch/trailing-slash: New test. * tests/Makefile.am (TESTS): Run it. 2009-10-21 Pádraig Brady md5sum, sha*sum, sum: line-buffer the printed checksums * src/md5sum.c (main): Set stdout to line buffered mode to ensure parallel running instances don't intersperse their output. This adds 5% to the run time in the worst case of many zero length files, or 2% with standard file sizes. * src/sum.c (main): Likewise. * tests/misc/md5sum-parallel: New test for atomic output. * tests/Makefile.am: Reference it. * NEWS: Mention the fix 2009-10-20 Pádraig Brady maint: issue warnings for more missing optional libraries * README-hacking: Suggest to use ./configure --quiet so that any warnings are easily noticed. * m4/gmp.m4 (cu_GMP): Warn if libgmp is not available. * m4/jm-macros.m4 (coreutils_MACROS): Normalize the libcap warning. * m4/xattr.m4 (gl_FUNC_XATTR): Warn if libattr is not available. 2009-10-19 Jim Meyering build: use gnulib's isblank module * bootstrap.conf (gnulib_modules): Add isblank. * src/system.h (isblank): Don't define. * m4/check-decl.m4: Don't check for isblank declaration. * gnulib: Update submodule to latest. 2009-10-18 Jim Meyering maint: factor out duplication in currently unused rules * src/Makefile.am (fs_normalize_perl_subst): Define. (fs-magic, fs-kernel-magic): Use it. 2009-10-17 Eric Blake touch: add -h to change symlink timestamps, where supported * src/touch.c (no_dereference): New flag variable. (longopts): Add -h/--no-dereference. (touch): Add symlink handling. (usage): Document new option. (main): Accept new option. * NEWS: Document it. * doc/coreutils.texi (touch invocation): Likewise. Also mention birthtime. * tests/touch/no-dereference: New test. * tests/Makefile.am (TESTS): Run it. 2009-10-17 Jim Meyering tests: abmon-align: avoid test failure * tests/ls/abmon-align: Don't remove (1d;) the first line of output. That was making the test consider only 11 of 12 month names. Rewrite not to use \(.*\), as that provoked a malfunction in GNU sed on powerpc Mac OS X (though we don't know yet whether this is due to a sed bug, or to miscompilation). Nelson Beebe reported the test failure. build: update gnulib submodule to latest 2009-10-15 Jim Meyering build: don't let environment settings perturb build Setting the envvars, LIB_FDATASYNC, LIB_XATTR or LIB_CRYPT could cause a configure-time and/or build-time malfunction. Typically, a configure-time function-in-library test is performed via code like this: LIB_VAR= AC_SUBST([LIB_VAR]) prefix_saved_LIBS=$LIBS AC_SEARCH_LIBS([FUNC], [LIB_NAME], [test "$ac_cv_search_FUNC" = "none required" || LIB_VAR=$ac_cv_search_FUNC]) LIBS=$prefix_saved_LIBS However, in each of the files affected by this change, the LIB_VAR= initialization was omitted. Thus, when set in the environment, its value would propagate into generated Makefiles when FUNC is not found in LIB_NAME. * m4/jm-macros.m4 (coreutils_MACROS): Initialize AC_SUBST'd var * m4/lib-check.m4 (cu_LIB_CHECK): Likewise. * m4/xattr.m4 (gl_FUNC_XATTR): Likewise. 2009-10-13 C de-Avillez tail: add add missing backslash at the end of a line in usage * src/tail.c (usage): Add missing backslash at the end of a line. 2009-10-12 Eric Blake tail: tweak usage for more clarity * src/tail.c (usage): Spell out -n +K. * THANKS: Update. Reported by Jan-Pawel Wrozstinski. 2009-10-10 Eric Blake touch: optimize use of utimens * src/touch.c (main): Use UTIME_NOW rather than calling gettime. (touch): Use UTIME_OMIT rather than stat. copy: allow symlink timestamp preservation on more systems * src/copy.c (utimens_symlink): Simplify by using lutimens. * m4/jm-macros.m4 (coreutils_MACROS): Drop utimensat; gnulib does this for us. * tests/cp/preserve-slink-time: Recognize lutimes support. build: update gnulib submodule to latest, for utimens improvements 2009-10-10 Jim Meyering tests: adjust tail-2/pid to work around FreeBSD 6.1 failure * tests/tail-2/pid: Run tail -f --pid=... on an actual file, not on /dev/null, to avoid this failure on FreeBSD 6.1: tail: /dev/null: cannot change nonblocking mode: Inappropriate ioctl for device 2009-10-10 Eric Blake maint: touch up previous LDADD patch * src/Makefile.am (dir_LDADD): Delete; the ls_LDADD line covers this. 2009-10-10 Jim Meyering build: build uname(1) unconditionally Before, on a system without the uname function, the build system would detect that and not build/install a uname program. Now that gnulib guarantees a uname function, ... * configure.ac: Don't check for the uname function. * src/Makefile.am (build_if_possible__progs): Move uname... (EXTRA_PROGRAMS): ...to this list. maint: list program names one per line * src/Makefile.am (EXTRA_PROGRAMS): List them one per line. (build_if_possible__progs): Likewise. build: ls: fix link failure due to missing -lacl * src/Makefile.am (ls_LDADD): Re-add $(LIB_ACL). Inadvertently-removed by commit 78c93601. 2009-10-10 Eric Blake maint: touch up previous LDADD patch * src/Makefile.am (stdbuf_LDADD): Add missing primer. (hostname_LDADD, uname_LDADD): Add GETHOSTNAME_LIB. * bootstrap.conf (gnulib_modules): Add uname. maint: improve additional library tracking * src/Makefile.am (LDADD): Refactor, to make per-library additions to individual programs easier to maintain. 2009-10-09 Jim Meyering chcon: don't disable just because SELinux is disabled * src/chcon.c (main): Now that gnulib provides getfilecon wrappers, we can revert most of the 2009-10-05 commit 3a97d664, "chcon: exit immediately if SELinux is disabled", since chcon is still useful as long as the file system provides handlers for the security.* name space. gnulib's getfilecon wrappers ensure that an offending context now evokes a return value of -1. Prompted by comments from Stephen Smalley in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/18378/focus=18394 * NEWS (Bug fixes): Mention it. ls: remove explicit getfilecon work-around * src/ls.c (gobble_file): Remove l?getfilecon work-around, now that the gnulib wrappers handle it for us. build: update gnulib submodule to latest, for getfilecon wrappers 2009-10-09 Eric Blake maint: use X2NREALLOC in more places * src/chroot.c (set_additional_groups): Use X2NREALLOC rather than x2nrealloc. * src/factor.c (emit_factor): Likewise. * src/setuidgid.c (main): Likewise. maint: remove unused macros and declarations * src/system.h (EDQUOT, EISDIR, ENOSYS, EOVERFLOW, F_OK, X_OK) (W_OK, R_OK): Delete; macros provided by gnulib. (includes): Gnulib guarantees both and , in either order. (free, malloc, memchr, realloc, getenv, lseek): Delete, gnulib guarantees these declarations. * m4/check-decl.m4 (gl_CHECK_DECLS): Delete checks now done by gnulib. maint: move timeout exit statuses * src/timeout.c (EXIT_TIMEDOUT, EXIT_CANCELED): Remove as macros... * src/system.h (EXIT_TIMEDOUT, EXIT_CANCELED): ...and provide as enum values instead. * src/stdbuf.c (EXIT_CANCELED): Delete. stat: test recent patch * tests/misc/stat-slash: New test. * tests/Makefile.am (TESTS): Run it. 2009-10-08 Eric Blake stdbuf: improve path search * src/stdbuf.c (set_program_path): Use gnulib methods for better file name handling. * bootstrap.conf (gnulib_modules): Add xreadlink. stat: work with recent gnulib changes * src/stat.c (do_stat): Don't mask function-like stat macro. 2009-10-08 Jim Meyering stat: add support for many more file system types * src/stat.c (human_fstype): Add the following FS types, from : afs, anon-inode FS, btrfs, cgroupfs, cramfs-wend, debugfs, futexfs, inotifyfs, minux3, securityfs, selinux, xenfs. Also add "nilfs". * src/Makefile.am (fs-kernel-magic): New rule. * NEWS (Bug fixes): Mention this. stat: recognize CIFS and HFS file system types * src/stat.c (human_fstype) [CIFS, HFS]: Add new file system types. Prompted by a report from Stuart Kemp. Normalize the form of a few hexadecimal magic numbers. Alphabetize on S_MAGIC_ case names. * src/Makefile.am (fs-magic-compare, fs-def, fs-magic): New rules, to automate comparison of our list with that in the Linux statfs man page. * NEWS (Bug fixes): Mention it. 2009-10-07 Guenter Knauf md5sum, sha*sum: also accept openssl checksum syntax * src/md5sum.c (split_3): Accept openssl checksum syntax, which differs only by two spaces from that of the bsd checksum tools: openssl: MD5(f)= d41d8cd98f00b204e9800998ecf8427e bsd: MD5 (f) = d41d8cd98f00b204e9800998ecf8427e 2009-10-06 Jim Meyering maint: make release-making instructions more generic * README-release: Make instructions more generic. post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 8.0 * NEWS: Record release date. build: update gnulib submodule to latest 2009-10-06 Ondřej Vašík chcon: exit immediately if SELinux is disabled This change happens to avoid an abort in chcon when SELinux is disabled while operating on a file with an "unlabeled" context from back in 2006. However, that same abort can still be triggered by the same file when running chcon with SELinux enabled. This bug in chcon will be fixed in a subsequent commit via a getfilecon wrapper. See http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/18378/focus=18384 for how to correct your disk attributes to avoid triggering this bug. * src/chcon.c (main): Exit immediately if SELinux is disabled. Reported in http://bugzilla.redhat.com/527142 by Yanko Kaneti. * src/runcon.c (main): Do not hardcode program name in error message. * THANKS: Update. 2009-10-03 Jim Meyering build: update gnulib submodule to latest 2009-10-02 James R. Van Zandt dircolors: highlight .cgm and .emf as images * src/dircolors.hin: Add .cgm, .emf. * THANKS: Update. 2009-10-02 Jim Meyering maint: remove obsolete syntax-check exclusion * cfg.mk (local-checks-to-skip): Remove strftime-check. 2009-10-02 Pádraig Brady tail: avoid a race where we could miss new data with --pid * src/tail.c (tail_forever, tail_forever_inotify): Close a race in tail_forever_inotify where new data written after the file check by a now dead process, but before the pid check, is not output. We use the POSIX guarantee that read() and write() are serialized wrt each other even in separate processes, to assume full file consistency after exit() and so poll for new data _after_ the writer has exited. This also allows us to not redundantly _wait_ for new data if the process is dead. * tests/tail-2/pid: Remove the now partially invalid sub second sleep check as we now don't unconditionally wait, and replace it with a check for the redundant sleep. Also clarify some of the existing comments. * NEWS: Mention the fix. 2009-10-02 Jim Meyering maint: move gnu-web-doc-update script to gnulib * bootstrap.conf (gnulib_modules): Add gnu-web-doc-update. Remove gendocs, since gnu-web-doc-update depends on it. * gnu-web-doc-update: Remove file, now that we get it from gnulib. build: update gnulib submodule to latest 2009-09-30 Jim Meyering tests: tail-2/pid: use a 3-second timeout, not 1 * tests/tail-2/pid: When using the timeout program to ensuring that tail -s.1 --pid=$PID_T_MAX does not wait forever, use a timeout longer than 1 second. A 1-second timeout could be too short on a very busy system, and result in a timeout, and hence false-positive failure. 2009-09-30 Jim Meyering 2009-09-30 Jim Meyering build: update gnulib submodule to latest build: translate diagnostics from two new files * po/POTFILES.in: Add two new files: lib/siglist.h, lib/strsignal.c build: now that we use the lock module, don't exclude lock.m4 * bootstrap.conf: Don't exclude lock.m4. 2009-09-30 Pádraig Brady ls: always print "?" for allocated size of a dereferenced dangling symlink Previously for `ls -Ls` (but not `ls -Lsl`), we referenced the st_blocks returned from the previous failed stat() call. This undefined value was seen to be 0 for dangling symlinks at least. * src/ls.c (print_file_name_and_frills, length_of_file_name_and_frills): Don't use st_blocks if the previous stat() failed * tests/ls/dangle: Add a test case * NEWS: Mention the fix, and roll up related items into a single entry. 2009-09-30 Jim Meyering build: use gnulib's freopen module * bootstrap.conf (gnulib_modules): Add freopen, strsignal, fsync. Exposed via make CFLAGS=-DGNULIB_POSIXCHECK 2>&1 \ |perl -lne '/.* use gnulib module (\S+).*/ and print $1' \ |sort |uniq -c|sort -nr (avoided_gnulib_modules): Don't avoid the "lock" module. Now it's required, as a dependency of the strsignal module. 2009-09-29 Jim Meyering stat: interpret "-" as standard input * src/stat.c (do_stat): Interpret a command line argument of "-" to mean "standard input", like many other tools do. (do_statfs): Fail upon any attempt to use "-". * NEWS (Changes in behavior): Mention it. * tests/misc/stat-hyphen: New test, to exercise the above. * tests/Makefile.am (TESTS): Add misc/stat-hyphen. ls: don't use an undefined struct stat after failed stat/lstat * src/ls.c (format_inode): Access f->stat only if f->stat_ok is set. * NEWS (Bug fixes): Mention it. Improved-by: Pádraig Brady ls: print "?", not "0" as inode of dereferenced dangling symlink ls prints inode numbers two ways: for long (-l) listings, and for short ones, e.g., ls -li and ls -i. The code to print long listings properly printed "?" when the inode was unknown, but the code for handling short listings would print 0 instead. Factor out the formatting code into a new function so ls prints the right string ("?") from both places: * NEWS (Bug fixes): Mention it. * src/ls.c (format_inode): New function. (print_long_format): Use it here. (print_file_name_and_frills): Use it here, too. * tests/ls/dangle: Exercise this fix. Reported by Yang Ren in http://bugzilla.redhat.com/525400 ls: with -LR, exit with status 2 upon detecting a cycle * src/ls.c (print_dir): Diagnosing the cycle is not enough. Also set exit status to 2. This is what Solaris' /bin/ls does, too. * tests/ls/infloop: Rework test: match both expected stdout and stderr. Require an exit status of 2 in this case. * doc/coreutils.texi (ls invocation): Mention that a loop provokes in an exit status of 2. * NEWS (Bug fixes): Mention it. Reported by Yang Ren in http://bugzilla.redhat.com/525402. * THANKS: Correct ordering of Yang Ren's names. 2009-09-26 Jim Meyering maint: factor coreutils-specific code out of bootstrap * bootstrap (bootstrap_epilogue): Define a default, empty function. Remove coreutils-specific code, and instead, invoke this new function at the end of this script. * bootstrap.conf (bootstrap_epilogue): Define, to override the default. 2009-09-25 Eric Blake cp, mv: use linkat to guarantee semantics * src/copy.c (copy_internal): Use linkat, not link. ln: add -L/-P options * src/ln.c (STAT_LIKE_LINK): Delete. (logical): New flag. (long_options): Add -L, -P. (usage): Mention them. (main): Choose between them. (do_link): Perform correct action. * tests/ln/misc: Move hard-to-sym portion of test... * tests/ln/hard-to-sym: ...into new test, and add more. * tests/Makefile.am (TESTS): Run new test. * NEWS: Document this. * doc/coreutils.texi (link invocation, ln invocation): Likewise. * bootstrap.conf (gnulib_modules): Add linkat. build: update gnulib submodule to latest 2009-09-23 Pádraig Brady maint: Use logical rather than bitwise operators on bools This is because bitwise operators are: - confusing and inconsistent in a boolean context - non short circuiting - brittle in C89 where bool can be an int (so > 1) maint: expr: avoid compiler warnings without GMP * src/expr.c (mpz_clear, mpz_get_str, mpz_out_str) [!HAVE_GMP]: Reference unused arguments. 2009-09-23 Eric Blake build: update gnulib submodule to latest maint: summarize gnulib changes * NEWS: Provide a blurb about recent gnulib improvements. Fix typo in readlink blurb. 2009-09-23 Jim Meyering doc: ls: further improve --help message re --color * src/ls.c (usage): Correct grammar, change voice, shorten. Inspired by a report from Bruno Schulenberg. 2009-09-23 Eric Blake readlink: pick up gnulib changes to readlink -f * bootstrap.conf (obsolete_gnulib_modules): Move rename... (gnulib_modules): ...here. Add symlink. * NEWS: Document the change in readlink. * doc/coreutils.texi (readlink invocation): Likewise. * tests/readlink/can-f: Update test to new semantics, and add test of loop. 2009-09-23 Jim Meyering maint: df.c: adapt to newer gnulib * src/df.c: Don't include "canonicalize.h". No longer needed, since canonicalize_file_name is now guaranteed to be declared in , thanks to gnulib. build: update gnulib submodule to latest 2009-09-22 Pádraig Brady doc: stdbuf: mention it can have a non standard exit status * doc/coreutils.texi (Exit status): Add stdbuf to the list maint: uptime: fix a theoretical compile warning * src/uptime.c (print_uptime) [!HAVE_UTMPX_H && !HAVE_UTMP_H]: Reference possibly unused arguments. ls: fix a performance regression * src/ls.c (print_color_indicator): This reinstates commit f3f1ccfd, 21-10-2008, "ls: make it possible to disable file capabilities checking" which was inadvertently reverted with commit 3a169f4c, 14-09-2009, "ls: handle disabling of colors consistently ...". 2009-09-22 Eric Blake build: avoid compiler warnings on cygwin 1.5 * src/copy.c (utimens_symlink): Avoid unused variables. * src/su.c (getusershell): Rely on gnulib for prototype. 2009-09-21 Jim Meyering doc: ls: add an article, "the" * src/ls.c (usage): Tweak wording. 2009-09-21 Pádraig Brady ls: handle disabling of colors consistently for all file types * src/ls.c (print_color_indicator): Use consistent syntax for all file and directory subtypes, and fall back to the color of the base type if there is no enabled color for the subtype. This allows turning off specific colors for o+w dirs for example. * tests/ls/color-dtype-dir: Add a case to test that turning off coloring for o+w directories, falls back to standard dir color. * NEWS: Mention the fix Introduced by commit ac467814, 2005-09-05, "Colorize set-user-ID ... files and sticky ... directories." doc: ls: make help for --color more concise and accurate * src/ls.c (usage): Shorten the --color ancillary info by two lines, while replacing --color=none with --color=never. Mention "always" is the default parameter of the --color option, along with the primary help for that option. Mention the ancillary --color info in the --color primary help. doc: normalize and add missing entries to texinfo menu * doc/coreutils.texi: Add the missing arch, base64, link, readlink, and unlink entries. Also remove extraneous '.' from some entries and try to align all entries on the same column. * THANKS: Add Benno Schulenberg. doc: mention the texinfo documentation in --help * src/system.h: Rename emit_bug_reporting_address() to emit_ancillary_info() and update it to not print the translation project address in en_* locales, and _do_ print it in the 'C' (and other) locales so that it's included in the default man page. Also mention how to invoke the texinfo documentation for each command. Also move the "hard-locale.h" include to the 8 files that now use it. * man/help2man: Strip the newly added texinfo reference from the --help output as a more verbose version is already added by help2man. Suggestion from C de-Avillez 2009-09-21 Jim Meyering maint: automate the web-doc updating procedure * gnu-web-doc-update: New script, destined for gnulib. * README-release: Refer to the new script. 2009-09-19 Jim Meyering dircolors: arrange to highlight names with the .lz suffix * src/dircolors.hin: Add .lz, for GNU lzip. Suggested by Matias A. Fonzo. mktemp: adapt to new, 3-argument gen_tempname_len * src/mktemp.c (mkstemp_len, mkdtemp_len): Update callers of gen_tempname_len. * gl/lib/tempname.c, gl/lib/tempname.h: Rebase against recently API-modified copy of tempname module in gnulib. Reported by Lluís Batlle. 2009-09-17 Jim Meyering build: merge bootstrap changes from gnulib * bootstrap: Update from gnulib. 2009-09-17 Eric Blake rm, rmdir: improve cross-compilation support * bootstrap.conf (gnulib_modules): Drop rmdir-errno. * src/rmdir.c (errno_rmdir_non_empty): Check both cases allowed by POSIX, rather than relying on configure-time check that might fail during cross-compilation. Reverts commit 9b6eb98d41. 2009-09-15 Ondřej Vašík cp: fix a probably redundant chmod when setting xattrs * src/copy.c (copy_reg): Fix initial value of access_changed variable. This was introduced by Pádraig Brady in commit cca83faf, 2009-09-14, "cp,mv: preserve extended attributes even for read-only files" 2009-09-14 Jim Meyering doc: NEWS: mention origin of touch -t ....60 bug * NEWS: It is an old bug. doc: touch, document that it accepts .60 * doc/coreutils.texi (touch invocation): Document that SS may be 60. touch: don't reject "60" as number of seconds in a legacy time stamp A valid command like "touch -t 197101010000.60 F" would fail due to the suffix of ".60". This bug is fixed via the latest change to gnulib's posixtm module. * tests/touch/60-seconds: New test. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it. build: update gnulib submodule to latest, for fixed posixtm module maint: use #!/bin/sh consistently in shell-based test scripts * tests/misc/sort-continue: Change first line to standard #!/bin/sh, not #!/bin/bash (though it doesn't matter, since each is invoked via $(SHELL) dir/test-name. 2009-09-14 Pádraig Brady tests: fix dd/skip-seek-past-file to work on ecryptfs * tests/dd/skip-seek-past-file: Require sparse support to ensure that when we're checking if we can create an $OFF_T_MAX length file, that we don't actually allocate any space. This was an issue on ecryptfs and was reported by Bert Wesarg. 2009-09-14 Ondřej Vašík cp,mv: preserve extended attributes even for read-only files * src/copy.c (copy_reg): Temporarily set u+rw on the destination file to allow GNU/Linux to set xattrs. * tests/misc/xattr: Test that change. * NEWS (Bug fixes): Mention it. Reported by Ernest N. Mamikonyan. 2009-09-14 Jim Meyering doc: improve timeout's --help message * src/timeout.c (usage): Improve --help description. 2009-09-13 Jim Meyering maint: use consistent cpp indentation in all .c files * src/stty.c: Make cpp indentation reflect nesting. * src/factor.c: Likewise. doc: NEWS: say quadratic and linear, rather than O(N^2) and O(N) * NEWS: Use a slightly less technical description. Suggested by Andreas Schwab. doc: improve NEWS * NEWS (rm -r, without -f): Mention that the N in "O(N)" represents hierarchy depth. Suggested by Ralf Wildenhues. (rm -r, standards conformance): Make wording more accurate. 2009-09-11 Jim Meyering id: don't print context=... when POSIXLY_CORRECT is set * src/id.c (print_full_info) [POSIXLY_CORRECT]: Don't print context. Reported by Ulrich Drepper. * NEWS (Changes in behavior): Mention it. * doc/coreutils.texi (id invocation): Document that id also prints the security context, when possible, and when POSIXLY_CORRECT is not set. * tests/id/no-context: New file. Test for this. * tests/Makefile.am (TESTS): Add it. 2009-09-11 Eric Blake rm: avoid compiler warning * src/remove.c (rm_fts): Don't allow fall-through when assertions are disabled. euidaccess-stat: remove unnecessary macros * lib/euidaccess-stat.c (F_OK, R_OK, W_OK, X_OK): Delete; now guaranteed by gnulib. rm: use gnulib faccessat * bootstrap.conf (gnulib_modules): Add faccessat. Replace strdup with strdup-posix. * m4/jm-macros.m4 (coreutils_MACROS): Revert previous change, now that gnulib does it for us. * src/remove.c (write_protected_non_symlink): Use faccessat in more situations. 2009-09-11 Jim Meyering rm: improve efficiency of rm -r (without -f) from O(N^2) to O(N) where N is the depth of the deepest hierarchy rm is processing. * src/remove.c (write_protected_non_symlink): Use faccessat to avoid O(N)-per-entry cost of calling euidaccess. * m4/jm-macros.m4 (coreutils_MACROS): Check for faccessat. * NEWS (Improvements): Mention it. build: placate gcc's new -Wskip-jump-init * remove.c (rm_fts): Put braces around each of the two offending blocks. * configure.ac: Don't turn off -Wjump-misses-init. With the rewrite of remove.c, it is no longer needed. rm: rewrite to use fts * remove.c: Don't include "unlinkdir.h"; no longer used. Do not include or "cycle-check.h". Likewise. Include "xfts.h". (dir_name, dir_len): Remove definitions. (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Likewise. (INODE_SORT_DIR_ENTRIES_THRESHOLD, NEED_REWIND, D_TYPE): Likewise. (struct dirstack_state, Dirstack_state): Likewise. (g_buf, g_n_allocated): Remove declarations. (hash_freer, hash_compare_strings, rm_malloc): Remove functions. (rm_free, push_dir, top_dir, pop_dir, right_justify): Likewise. (full_filename0, xfull_filename, full_filename_): Likewise. (AD_stack_height, AD_stack_top, AD_stack_pop, AD_stack_clear): Likewise. (obstack_init_minimal, ds_init, ds_clear, ds_free): Likewise. (AD_pop_and_chdir, AD_ensure_initialized, AD_mark_helper): Likewise. (AD_mark_as_unremovable, AD_mark_current_as_unremovable): Likewise. (AD_push_initial, AD_push, AD_push, AD_is_removable): Likewise. (write_protected_non_symlink): Change 3rd parameter from dirstack_state "ds" to full_name. (prompt): Adjust parameters. Now, state comes from FTS/FTSENT pair. Those replace fd_cwd and "ds". Remove "filename". Remove pdirent_type in favor of new "is_dir" parameter. Rename is_empty to is_empty_p. (DO_RMDIR, DO_UNLINK): Remove definitions. (remove_entry, fd_to_subdirp, compare_ino): Remove functions. (dirent_count, dirent_inode_sort_may_be_useful): Likewise. (preprocess_dir): Likewise. (fts_skip_tree, mark_ancestor_dirs, excise, rm_fts): New functions. (remove_cwd_entries, remove_dir, rm_1): Remove functions. (rm): Rewrite as a simple loop calling fts_read and dispatching each entry via rm_fts. * src/rm.c (main): Adapt to new signature of rm(). * bootstrap.conf (gnulib_modules): Remove unlinkdir, no longer used. * src/Makefile.am (sc_tight_scope): Also recognize an extern "enum" declaration. * tests/rm/empty-name: Adjust expected output to match new diagnostic. * NEWS (Improvements): Mention it. maint: doc: adjust README-release * README-release: Remove mention of bootstrap's old --gnulib-srcdir=/gnulib option. No longer needed, and its use can lead to subtle problems. post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 7.6 * NEWS: Record release date. 2009-09-10 Jim Meyering link,ln: use gnulib's link module to work around Solaris 10 deficiency Before this change, :>f; ln -T f no-such/ would succeed on Solaris 10. After it, ln fails, as it should: ln: accessing `z/': Not a directory The command, link f no-such/, had the same problem on that system. * bootstrap.conf (gnulib_modules): Add "link". * tests/ln/slash-decorated-nonexistent-dest: New test. * tests/Makefile.am (TESTS): Add it. * NEWS (Portability): Mention the improvement. build: update gnulib submodule to latest 2009-09-10 Ondřej Vašík doc: improve various BLOCKSIZE and SIZE help * doc/coreutils.texi (multiplierSuffixes): Mention that the suffix can be specified without a leading number * src/split.c (usage): Refactor SIZE help to within a function * src/truncate.c (usage): Likewise * src/ls.c (usage): Likewise * src/df.c (usage): Likewise. Also add a function with BLOCKSIZE help * src/du.c (usage): Likewise. * src/system.h: Define 2 functions to emit common help text This was prompted by https://bugzilla.redhat.com/show_bug.cgi?id=511188 2009-09-10 Jim Meyering dd conv=unblock: print final newline consistently * src/dd.c (dd_copy) [C_UNBLOCK]: Always print the final newline for non-empty output, not just when output size is a multiple of cbs. * doc/coreutils.texi (dd invocation) [conv=unblock]: Mention that dd prints a newline after each output record, not just when replacing trailing spaces. Reported by Ulrich Drepper. * tests/dd/unblock: New file. Test for this. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it. 2009-09-09 Jim Meyering maint: make cfg.mk slightly more generic * cfg.mk (url_dir_list): Don't hard-code "coreutils". Use $(PACKAGE). 2009-09-08 Jim Meyering * gnulib: Update submodule to latest. tail: make the new piped-stdin test as portable as the old one * src/tail.c (main): Adapt piped-stdin test to use the same isapipe, test as was used in the preceding POSIXLY_CORRECT condition. Remove the now-subsumed POSIXLY_CORRECT test. Reported by Pádraig Brady. * doc/coreutils.texi (tail invocation): Document this change. * NEWS (Changes in behavior): Reclassify, clarify. 2009-09-08 Pádraig Brady tests: tail-2/assert: reduce risk of race condition * tests/tail2/assert: This reverts commit be853120, 25-08-2009, "tests: tail-2/assert: avoid risk of race condition" kill -0 doesn't send a signal and so will only confirm that the background process was forked, which we know already because we have its pid. tests: address a race condition in misc/cat-buf * tests/misc/cat-buf: Increase the delay between writes to decrease the chance that dd will read both at once. Since the test is inherently racy, print a warning via skip_test_ rather than failing outright. Reported by Jim Meyering. 2009-09-07 Jim Meyering tail: syntax-only: use "false", rather than equivalent, 0 * src/tail.c (record_open_fd): Initialize "->ignore" to false, not 0. tail: ignore -f for piped-stdin, as POSIX requires * src/tail.c (main): Tailing a pipe "forever" is not useful, and POSIX specifies that tail ignore the -f when there is no file argument and stdin is a FIFO or pipe. So we do that. In addition, GNU tail excludes "-" arguments from the list of files to tail forever, when the associated file descriptor is connected to a FIFO or pipe. Before this change, ":|tail -f" would hang. Reported by Ren Yang and Ulrich Drepper. * tests/tail-2/pipe-f: Test for this. * tests/tail-2/pipe-f2: Ensure tail doesn't exit early for a fifo. * tests/Makefile.am (TESTS): Add these tests. * NEWS (POSIX conformance): Mention it. 2009-09-07 Pádraig Brady tests: tail-2/flush-initial should not rely on stdbuf * tests/tail-2/flush-initial: stdbuf is not built on all systems. In any case it's redundant since stdout will automatically be buffered since we're redirecting to file. So just call tail without using stdbuf. 2009-09-07 Jim Meyering tail: don't give up on inotify mode for an already-ignored "-" * src/tail.c (main): Adjust today's change to honor the F[i].ignore flag that may have been set in tail_file. tests: misc/cat-buf: clean up syntax * tests/misc/cat-buf: Don't suppress dd's stderr. Remove useless quotes. tests: ls/color-clear-to-eol: append NL to accommodate old sed * tests/ls/color-clear-to-eol: Some vendor sed programs fail to operate on lines that are not NL-terminated. This affects at least Solaris 10's /bin/sed. Reported by Pádraig Brady. tests: tail-2/infloop-1: avoid rare test failure on a busy system * tests/tail-2/infloop-1: Sleep 3 seconds, not 1, but in increments of 0.1 second. Before, this test would fail ~1 time in 20 via "make -j9 check" on a quad-core system. Correct comment. build: update gnulib submodule to latest doc: tweak NEWS * NEWS (dd): Tweak wording. Two blank lines between sections. tail -f: handle "-"/stdin once again * src/tail.c (main) [HAVE_INOTIFY]: When stdin (i.e., "-", or no args, but not /dev/stdin) is specified on the command line, don't use inotify. Reported by Bill Brelsford in . * tests/tail-2/follow-stdin: New file. Test for this. * tests/Makefile.am (TESTS): Add the test. * NEWS (Bug fixes): Mention it. This bug was introduced in coreutils-7.5 via commit ae494d4b, 2009-06-02, "tail: use inotify if it is available". 2009-09-06 Jim Meyering tests: tail-2/flush-initial: correct race avoidance code * tests/tail-2/flush-initial: Wait for the file to be nonempty, not for the process. Based on a suggestion from Pádraig Brady. tests: ls-misc: don't let a bogus umask cause test failure * tests/misc/ls-misc: Set umask to 022. A umask setting permitting world-write access, e.g., umask o+w, would cause this test to fail. Report by Mathias Brodala and analysis by Tom Fitzhenry in . tail: flush initial output before possibly blocking * src/tail.c (main): Flush any output from tail_file, before calling tail_forever_inotify, which can block. * tests/tail-2/flush-initial: New file. Test for the bug. * tests/Makefile.am (TESTS): Add tail-2/flush-initial. * NEWS (Bug fixes): Mention it. This bug was introduced in coreutils-7.5 via commit ae494d4b, 2009-06-02, "tail: use inotify if it is available". 2009-09-05 Jim Meyering maint: remove unused file: lib/fdopendir-glibc.c * lib/fdopendir-glibc.c: Remove unused file. 2009-09-05 Jim Meyering 2009-09-05 Jim Meyering tests: ls/stat-vs-dirent: avoid spurious test failure * tests/ls/stat-vs-dirent: Avoid test failure when run from a directory whose name (or ancestor directory name) starts with ".". 2009-09-05 Pádraig Brady doc: make the tail --sleep-interval help less confusing * src/tail.c (usage): I read "approximately S seconds" as "approximately 5 seconds" for approximately 5 seconds. maint: remove some tab indentation from copy.c * src/copy.c (copy_internal): Remove tabs erroneously added in commit 3346c0af. tests: test old tail -f method even on systems with inotify * src/tail.c (main): Add an undocumented ---disable-inotify option to allow disabling inotify. * tests/tail-2/pid: Run test in both normal and "disable_inotify" modes. * tests/tail-2/tail-n0f: Likewise. * tests/tail-2/wait: Likewise. * tests/tail-2/append-only: Likewise. 2009-09-05 Jim Meyering build: update gnulib submodule to latest 2009-09-05 Petr Salinger stty: use TAB0, TAB1, and TAB2 only if defined * src/stty.c (mode_info) [TAB0, TAB1, TAB2]: Guard each entry with #ifdef. Required for GNU/kFreeBSD. Reported by Petr Salinger in http://bugs.debian.org/520368. 2009-09-05 Eric Blake build: update from gnulib * gnulib: Update submodule to latest. 2009-09-04 Eric Blake ln: add comments related to POSIX 2008 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Delete. (do_link): Update comments per POSIX; add FIXME for -L, -P. mv, cp: tweak LINK_FOLLOWS_SYMLINKS logic * gnulib: Update to latest gnulib. * src/copy.c (copy_internal): Adjust comment in light of POSIX 2008, and deal with macro now being tri-state. 2009-09-04 Petr Salinger tests: fix a tail-2/pid failure on GNU/kFreeBSD * tests/tail-2/wait: Increase the file name recheck frequency to fix a failure on systems without inotify and a file timestamp precision of 1 second (like GNU/kFreeBSD). 2009-09-04 Pádraig Brady tests: fix a failure when running tail-2/wait as root * tests/tail-2/wait: Silently skip a portion of the test when running as root, rather than failing the whole test. This regression was introduced with commit 84b5844d, 2009-09-03, "tests: simplify and fix a race in 2 tail --follow tests". 2009-09-04 Mike Frysinger build: fix libcap configure flag handling * m4/jm-macros.m4 (coreutils_MACROS): The code to handle configure-time enabling or disabling of libcap support was broken. It would treat any libcap configure option as --disable-libcap because it doesn't check $enableval at all. This change makes sure we do the sane thing: --disable-libcap -> disable and don't run any tests --enable-libcap -> run tests and fail if not found default -> run tests and warn if not found 2009-09-03 Jim Meyering df: don't fail due to an unreadable argument * src/df.c (main): If open or fstat fails when we're trying to ensure that all arg-partitions are automounted, fall back on using stat. Inspired by the report and patch from Olivier Fourdan in http://bugzilla.redhat.com/520630. * NEWS (Bug fixes): Mention it. * tests/df/unreadable: New test for the above. * tests/Makefile.am (TESTS): Add df/unreadable. The bug was introduced in coreutils-7.3 via commit dbd17157, 2009-04-28, "df: use open(2), not stat, to trigger automounting". 2009-09-03 Kamil Dudka doc: install -C: fix bug in the texi documentation * doc/coreutils.texi: Move the documentation for install --compare (-C) from the section on fmt to that for install. Reported by Florian Schlichting. 2009-09-03 Pádraig Brady tests: simplify and fix a race in 2 tail --follow tests * tests/tail-2/pid: Use the timeout command to determine process longevity, rather than querying /proc/$pid/status. The latter was racy in any case when inotify is used, as then tail wakes up periodically even for unchanging files therefore causing the check for "S (sleeping)" state to fail intermittently. * tests/tail-2/wait: Likewise. 2009-09-03 Ondřej Vašík cp: don't leak resources for each xattr preservation failure * src/copy.c (copy_reg): Don't return from the function after an unsuccessful and required preservation of extended attributes. This resulted in leaking the copy buffer and file descriptors. * NEWS (Bug fixes): Mention the fix. The bug was introduced in coreutils-7.1 via commit 0889381c, 2009-01-23, "cp/mv: add xattr support". 2009-09-01 Pádraig Brady chcon, chmod, chgrp, chown, du: report fts_close failure * src/du.c (du_files): Don't fail silently upon fts_close failure. * src/chcon.c (process_files): Likewise. * src/chmod.c (process_files): Likewise. * src/chown-core.c (chown_files): Likewise. 2009-09-01 Jim Meyering build: update from gnulib * gnulib: Update submodule to latest. chcon, chmod, chgrp, chown, du: do not ignore fts_close failure This is probably never visible, but who knows... * src/chcon.c (process_files): Don't ignore fts_close failure. * src/chmod.c (process_files): Likewise. * src/chown-core.c (chown_files): Likewise. * src/du.c (du_files): Likewise. maint: du: remove unnecessary initialization * src/du.c (main): Don't set "skip_file" unnecessarily. maint: chown, chgrp, chmod, chcon: remove unnecessary initialization * src/chown-core.c: Include "ignore-value.h". (change_file_owner): Don't set "ent" only to ignore it. * src/chcon.c (process_file): Likewise. * src/chmod.c: Include "ignore-value.h". (process_file): Don't set "ent" only to ignore it. After diagnosing root-dev/ino failure, return false immediately: Now that we don't set "ent" we must be sure not to use it uninitialized, and there's no point in issuing --verbose-related output in this case. maint: shred: remove unnecessary initialization * src/shred.c (genpattern): Value stored to "n" is never used. maint: dd: remove unnecessary initialization * src/dd.c (skip): Remove set-but-never-used variable, soffset. maint: tail: remove unnecessary initialization * src/tail.c (tail_bytes): Don't compute "diff" twice. maint: mbsalign.c: remove unnecessary assignment * gl/lib/mbsalign.c (mbsalign): Remove assignment, the result of which is never used. 2009-09-01 Pádraig Brady timeout: remove a redundant assignment * src/timeout.c (main): While keeping argc and argv in sync may be marginally useful, it is redundant to update argc, so just remove that to suppress the clang warning. timeout: defensive handling of all wait() errors * src/timeout.c (main): Handle all possible cases of unexpected failures from wait(). This was prompted by the clang tool reporting the possible non-initialization of the status variable. 2009-09-01 Jim Meyering ls -i: print consistent inode numbers also for mount points On most unix- and linux-based kernels, ls -i DIR_CONTAINING_MOUNT_POINT would print the wrong inode number for any entry that is a mount point. It would do that by relying on readdir's dirent.d_ino values, while most readdir implementations return the inode number of the underlying, inaccessible directory. Thus, it is not consistent with what you'd get when applying stat to the same entry. This bug led to surprising results like "ls -i" and "ls -i --color" printing different numbers (ls must usually "stat" a file to colorize its name). This change makes it so that on offending systems, ls must stat non-command-line-arguments for which otherwise it would be able to use "for free" dirent.d_ino values. Regardless of this change, ls is already required to stat every command-line argument. Note: versions of GNU ls prior to coreutils-6.0 did not perform the invalid optimization, and hence always printed correct inode numbers. Thus, for the sake of correctness, ls -i is forgoing the readdir optimization, for any kernel (including linux!) with POSIX-nonconforming readdir. Note that currently, only Cygwin has been agile enough to conform. * src/ls.c (RELIABLE_D_INO): Define. (print_dir): Use it. For plenty of discussion, see this long thread: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14020 This bug was introduced by the 2006-02-26 commit, 33eb3efe: "In ls, avoid calling stat for --inode (-i), when possible." * tests/ls/readdir-mountpoint-inode: New test. * tests/Makefile.am (TESTS): Add it. * tests/ls/stat-vs-dirent: Don't suppress failure of this test, now that ls -i is fixed. Though note that it doesn't test well, since it compares only the always-stat'd command-line arguments. * NEWS (Bug fixes): Mention it. 2009-08-31 Jim Meyering maint: revert my stdbuf change: the result didn't even compile This reverts commit c1e158489d88bad418d52ceadf37af0b6f5b2112. 2009-08-30 Jim Meyering maint: stdbuf: move a declaration; no-semantic-change * src/stdbuf.c (set_program_path): Move a declaration down into the scope where it's used. build: quiet "make check" in src/ * src/Makefile.am (check-duplicate-no-install): Use $(AM_V_GEN). (check-README): Likewise. And $(AM_V_at). doc: cp: update note on preserving symlink time stamps * doc/coreutils.texi (cp invocation): Now, we *do* preserve time stamps on symlinks, when possible. build: update bootstrap from gnulib * bootstrap: Merge from gnulib. 2009-08-30 Pádraig Brady tests: don't misbehave if $TMPDIR contains spaces * tests/misc/xattr: Add quotes. * tests/mv/acl: Likewise. * tests/mv/backup-is-src: Likewise. * tests/mv/hard-link-1: Likewise. * tests/mv/leak-fd: Likewise. * tests/mv/mv-special-1: Likewise. * tests/mv/part-fail: Likewise. * tests/mv/part-hardlink: Likewise. * tests/mv/part-rename: Likewise. * tests/mv/part-symlink: Likewise. * tests/mv/partition-perm: Likewise. * tests/mv/sticky-to-xpart: Likewise. 2009-08-29 Jim Meyering tests: other-fs-tmpdir: don't misbehave for quote-unfriendly $TMPDIR * tests/other-fs-tmpdir: Quote uses of variables that might expand to strings containing e.g., whitespace. build: update from gnulib * gnulib: Update submodule to latest. tests: move a coreutils-specific test from maint.mk to Makefile.am * Makefile.am (distcheck-hook): Make taint-distcheck here, since it's no longer done via maint.mk. tests: cp/reflink-auto guard against a pathological $TMPDIR * tests/cp/reflink-auto: Add quotes. 2009-08-29 Pádraig Brady cp --reflink: preserve attributes on cloned files if asked * src/copy.c (copy_reg): When cloning only skip the data copying * tests/cp/reflink-perm: New test to check times and modes copied * tests/Makefile.am: Reference the new test * NEWS: Mention the fix cp --reflink: add an "auto" parameter to fall back to a normal copy * doc/coreutils.texi (cp invocation): Document the new "auto" and "always" options to --reflink. * src/copy.c (copy_reg): Fall back to a standard copy when reflink() is not supported and --reflink=auto specified. * src/copy.h [struct cp_options] (reflink): Change type s/bool/enum/. * src/cp.c (usage): Describe the --reflink={always,auto} options and expand a little on what --reflink does. (main): parse the new parameters to --reflink and allow all --sparse options with --reflink=auto. * src/install.c (cp_option_init): Init the enum instead of bool. * src/mv.c (cp_option_init): Likewise. * tests/cp/reflink-auto: A new test for falling back to normal copy. * tests/Makefile.am: Reference the new test. * NEWS: Mention the new feature. stdbuf: fix a small typo in --help output * src/stdbuf.c (usage): s/then/the/ 2009-08-28 Eric Blake build: avoid unused variable warnings on cygwin * src/copy.c (clone_file, copy_attr_by_fd, copy_attr_by_name): Mark up unused variables. * src/remove.c (dirent_inode_sort_may_be_useful): Likewise. dd: detect closed stderr * src/dd.c (maybe_close_stdout): Always flush stderr; regression introduced in commit 381e69ea. * tests/misc/close-stdout (p): Use consistent style. * tests/dd/stderr: New test, borrowing from misc/close-stdout. * tests/Makefile.am (TESTS): Run it. * NEWS: Mention this. 2009-08-28 Jim Meyering maint: ignore only man/*.1, not all *.1 files * .gitignore: Ignore *.1 only in man/ 2009-08-27 Jim Meyering build: prefix a few rules with $(AM_V_GEN) * Makefile.am (.version, dist-hook, gen-ChangeLog): Use $(AM_V_GEN) and $(AM_V_at), so that automake's silent-rules option (make V=1/V=0) now controls whether the commands are printed at build time. (THANKS-to-translators, check-ls-dircolors): Likewise. 2009-08-26 Jim Meyering build: stop earlier if touching ChangeLog fails * bootstrap.conf: Exit right away if touching ChangeLog fails. Otherwise, the touch failure message is buried under configure output. tests: mkdir/selinux: avoid spurious failure on some SELinux systems * tests/test-lib.sh (require_selinux_enforcing_): New function. * tests/mkdir/selinux: Use it. Otherwise, this test would fail on Rawhide with SELinux disabled. tests: tail-2/assert: avoid risk of race condition * tests/tail-2/assert: Avoid spurious failure due to race condition. Rather than sleeping for 1 second and crossing fingers, wait explicitly for backgrounded tail process to start. Otherwise, this test would fail under heavy load. 2009-08-25 Jim Meyering maint: ensure we don't embed Emacs indent-tabs-mode setting lines Now that we prohibit indentation via TABs, there's no need for Emacs indent-tabs-mode setting lines, so prohibit those, too. * cfg.mk (sc_prohibit_emacs__indent_tabs_mode__setting): New rule. maint: remove Local Variables: indent-tabs-mode: nil from all sources * src/getlimits.c: Likewise. * src/group-list.c: Likewise. * src/groups.c: Likewise. * src/mktemp.c: Likewise. * src/setuidgid.c: Likewise. * src/stdbuf.c: Likewise. * src/timeout.c: Likewise. * src/truncate.c: Likewise. * gl/lib/mbsalign.c: Likewise. * tests/test-lib.sh: Likewise. * bootstrap: Likewise. * README-hacking: Likewise. doc: HACKING: mention the new space-only indentation policy maint: teach "make syntax-check" the space-only indentation rule * cfg.mk (sc_prohibit_tab_based_indentation): New rule. * .x-sc_prohibit_tab_based_indentation: New file. * Makefile.am (syntax_check_exceptions): Add file, .x-sc_prohibit_tab_based_indentation. global: convert indentation-TABs to spaces Transformed via this shell code: t=$'\t' git ls-files \ | grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \ | grep -vE 'tests/pr/|help2man' \ | xargs grep -lE "^ *$t" \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_' 2009-08-24 Jim Meyering cp: ignore obscure failure to preserve symlink time stamps, ...when run on a kernel older than what was implied by headers and libraries tested at configure time. * src/copy.c (utimens_symlink): Ignore failure when errno == ENOSYS. * NEWS (Bug fixes): Mention it. Reported by Todd Zullinger and Kamil Dudka. Details in this thread: http://thread.gmane.org/gmane.linux.redhat.fedora.devel/119834 2009-08-23 Jim Meyering tests: skip (don't fail) a cp test, upon mount-related failure * tests/cp/cp-mv-enotsup-xattr: Upon a set-up failiure, rather than failing the test with a "framework failure" diagnostic, just skip it. Russell Whitaker reported that this test failed on slackware. build: update from *public* gnulib * gnulib: Update submodule to latest. Kamil Dudka reported that bootstrap was broken. 2009-08-22 Jim Meyering build: update from gnulib * gnulib: Update submodule to latest. 2009-08-20 Jim Meyering post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 7.5 * NEWS: Record release date. tests: skip the stdbuf tests when the abs build directory name is bogus * tests/misc/stdbuf: Avoid spurious failure when the directory name from which we'd set LD_PRELOAD contains unsafe characters. install: avoid a portability bug when compiling with non-gcc * src/install.c (extra_mode): Be careful to return only a 0 or 1 value, since this is a "bool" function, and there are still some compilers for which this is necessary. Without this change, Bernhard Voelker reported that the Forte Developer 7 C 5.4 2002/03/09 compiler would produce a malfunctioning "install" binary. Details in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/17710/focus=17760 2009-08-19 Jim Meyering tests: make install-C slightly less prone to confusion * tests/install/install-C: Invoke framework_failure, if necessary. build: avoid "make dist" failure in man/ Now that "make check" no longer builds programs like arch, ... * src/Makefile.am (dist-hook): Depend on $(all_programs), so that the subsequent build in man/ doesn't fail due to lack of a program like arch that is not going to be installed. 2009-08-18 Jim Meyering build: update from gnulib * gnulib: Update submodule to latest. 2009-08-18 Giuseppe Scrivano nl: deprecate --page-increment in favor of --line-increment * NEWS: Mention the change. * doc/coreutils.texi: Document the new --line-increment option. * src/nl.c (struct option): Add --line-increment, (usage): Describe it, (main): Use it. 2009-08-18 Jim Meyering tests: stdbuf: fix a bug in test script * tests/misc/stdbuf: Use skip_test_ only after it's defined. Reported by Berhnard Voelker. (sc_check-AUTHORS): Rename rule from check-AUTHORS. 2009-08-18 Jim Meyering build: perform check-AUTHORS via syntax-check, not via "make check" * src/Makefile.am (check): Don't depend on check-AUTHORS. That check fails on systems for which a program like stdbuf is not built. Instead, move this check to "make syntax-check". (sc_check-AUTHORS): Rename rule from check-AUTHORS. * cfg.mk (sc_check-AUTHORS): New rule. Reported by Berhnard Voelker. sort: use more portable initialization syntax * src/sort.c (find_unit_order): Spell out 256-element static initializer, rather than relying on C99 syntax. Required for Forte Developer 7 C 5.4 2002/03/09 on Solaris 10. Reported by Bernhard Voelker. 2009-08-17 Jim Meyering build: suppress warnings due to gcc's new -Wjump-misses-init * configure.ac: Ignore -Wjump-misses-init violations in remove.c. build: update from gnulib * gnulib: Update submodule to latest. 2009-08-16 Jim Meyering tests: tail-2/append-only: don't discard stderr * tests/tail-2/append-only: Don't discard a diagnostic that may help explain why this test fails for some. Details in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/17621/focus=17641 2009-08-14 Jim Meyering tests: skip the misc/stdbuf test if stdbuf was not built * tests/misc/stdbuf: Skip this test when stdbuf is not built. Reported by Eric Blake. build: use gnulib's getopt-gnu module (getopt is now deprecated) * bootstrap.conf (gnulib_modules): Gnulib's getopt module is now deprecated; use the new, preferred name, getopt-gnu. * gnulib: Update to latest. 2009-08-14 Pádraig Brady cp,mv: fix issues with preserving timestamps of copied symlinks * src/copy.c (copy_internal): On systems without utimensat don't use utimens on a symlink, as that would dereference the symlink. * tests/cp/abuse: To work around possible attribute preservation failures breaking the test, use cp -dR rather than cp -a. doc: clarify the cp --reflink NEWS * NEWS: Remove the description associated with the removed experimental code which unconditionally tried to reflink() on copy. Also clarify where --reflink works exactly. 2009-08-13 Jim Meyering tests: raise ulimit virt-mem limit to avoid new failure * tests/cp/link-heap: Raise limit from 16MB to ~20MB, to avoid spurious failure on rawhide. 2009-08-13 Pádraig Brady tail: fix tail -f failure when inotify used * src/tail.c (tail_forever_inotify): Remove the redundant and incorrect error check of the return from inotify_add_watch(). Also initialize the wd member of each File_spec to an invalid value. Reported by C de-Avillez. dd: fix a signal handling race * src/dd.c (main): Install the signal handlers at startup rather than just before the copy starts. In this way signals received before the copy (like during a slow truncate for e.g.) will be deferred and handled consistently. * THANKS: Add Bernhard's email address. * NEWS: Mention the fix. Reported by Bernhard Voelker. 2009-08-12 Pádraig Brady tests: improve one of the tail --pid tests * tests/tail-2/pid: Speed up the test by specifying a timeout of 100ms rather than the default 1s. Also skip the test instead of failing in the unlikely case were the pid required to be missing pid is present. 2009-08-10 Jim Meyering nl, pinky: replace uses of strcat * src/nl.c (main): Avoid strcat, on principle. Use stpcpy instead. * src/pinky.c (print_long_entry): Likewise. build: update from gnulib, for HOST_NAME_MAX on solaris 10 * gnulib: Update submodule to latest. 2009-08-07 Giuseppe Scrivano cp: accept the --reflink option * NEWS: Mention it. * doc/coreutils.texi (cp invocation): Describe it. * src/copy.h (struct cp_options) [reflink]: New member. * src/copy.c (usage): Describe it. (copy_reg): If reflink is true try to clone the file. (main): Check for --reflink. (cp_option_init): Initialize the new member. * src/install.c (cp_option_init): Initialize the new member. * src/mv.c (cp_option_init): Likewise. * tests/cp/sparse: Add a new test case. 2009-08-07 Jim Meyering dd: preserve semantics of O_DIRECT even for final block * src/dd.c: Include "ignore-value.h" (iwrite): When disabling O_DIRECT, try to compensate via POSIX_FADV_DONTNEED and fsync. Suggested by Eric Sandeen. 2009-08-06 Jim Meyering maint: move selinux-at module from gl/ to gnulib * gl/lib/selinux-at.c: Remove file. * gl/lib/selinux-at.h: Likewise. * gl/modules/selinux-at: Likewise. * gnulib: update to latest, to get the new module. 2009-08-06 Jim Meyering dd: work around buffer length restrictions with oflag=direct (O_DIRECT) dd oflag=direct would fail to copy a file with size that is not a multiple of 512 (destination file system specific) * NEWS (Bug fixes): Mention it. * src/dd.c (iwrite): Turn off O_DIRECT for any smaller-than-obs-sized write. Don't bother to restore it. * tests/dd/direct: New test for the above. * tests/Makefile.am (TESTS): Add dd/direct. * doc/coreutils.texi (dd invocation): Mention oflag=direct buffer size restriction. Details in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/17586 Reported by Eric Sandeen. 2009-08-04 Jim Meyering dd: remove unnecessary #if HAVE_FTRUNCATE * src/dd.c (main): Remove unnecessary cpp directives. Gnulib guarantees that ftruncate is usable. cp -pP (and e.g., -a): preserve time stamps on symlinks, too * src/copy.c (utimensat_if_possible): New function. (copy_internal): Remove variable, "preserve_metadata". Replace with "dest_is_symlink". That covers all cases but one: the one in which cp --link has created hard links to non-directories. In that case, there is no need to update attributes of the links. Use utimensat_if_possible, to preserve timestamps of symlinks. * NEWS (New features): Mention this. * tests/Makefile.am (TESTS): Add cp/preserve-slink-time. * tests/cp/preserve-slink-time: New file. * m4/jm-macros.m4 (coreutils_MACROS): Test for utimensat. Reported in http://bugzilla.redhat.com/230866 2009-08-04 Kamil Dudka install runs faster again with SELinux enabled * m4/jm-macros.m4: Pull in SELinux libraries while checking for matchpathcon_init_prefix (). Emit configure warning when not found with SELinux enabled. * NEWS (Bug fixes): Mention it. The bug was introduced in coreutils-7.0 via commit 0647f3eb, 2008-06-02, "accommodate older SELinux which lacks matchpathcon_init_prefix". 2009-08-04 Jim Meyering maint: move the update-copyright rule to gnulib's maint.mk * gnulib: Update submodule to get latest maint.mk. * Makefile.am (update-copyright): Remove rule; now it's in maint.mk. * m4/check-decl.m4: Update sole remaining copyright year list. 2009-07-31 Jim Meyering build: *really* update to a usable gnulib commit build: update to a usable gnulib commit The commit, 5ef90695, 2009-07-29, "maint: move update-copyright to gnulib" recorded a local-only commit. Reported by Pádraig Brady. 2009-07-30 Jim Meyering tests: new function: require_openat_support_ * tests/rm/inaccessible: Factor out openat-support-detection code... * tests/test-lib.sh (require_openat_support_): ...into this new function. tail: tweak indentation * src/tail.c (tail_forever_inotify): Adjust indentation of continued line. 2009-07-30 Pádraig Brady tail: properly parse fractional seconds when monitoring a pid * src/tail.c (tail_forever_inotify): The fractional part of the delay was 1000 times too large. * tests/tail-2/pid: Add a test to ensure the timeout happens for this case. 2009-07-30 Jim Meyering tests: test for just-fixed tail --pid bug * tests/tail-2/pid: Ensure tail exits successfully when PID dies. 2009-07-30 Giuseppe Scrivano tail: exit successfully upon watched process death * src/tail.c (tail_forever_inotify): If a PID is specified and the watched process dies, exit with status EXIT_SUCCESS, rather than falling through to an EXIT_FAILURE. 2009-07-29 Jim Meyering maint: move update-copyright to gnulib * build-aux/update-copyright: Remove file. * bootstrap.conf (gnulib_modules): Add update-copyright. * gnulib: Update submodule to latest. maint: make update-copyright work in yet another case * build-aux/update-copyright: Handle the case in which "\n#" appears between the final year number and the copyright holder name. * m4/lib-check.m4: Update copyright year list. Reported by Joel E. Denny. maint: update NEWS * NEWS (New features): Mention it. 2009-07-29 Giuseppe Scrivano cp: support btrfs' copy-on-write file clone operation * src/copy.c [HAVE_SYS_IOCTL_H]: Include . (BTRFS_IOCTL_MAGIC, BTRFS_IOC_CLONE): Define. (clone_file): New function. (copy_reg): Use the btrfs clone operation if possible. 2009-07-29 Jim Meyering maint: update sleep.c's copyright year list * src/sleep.c: Update copyright year list to include 2009. * tests/sort-time/rand-gen: Remove long-unused file. * tests/sort-time/README: Likewise. 2009-07-29 Joel E. Denny maint: improve update-copyright rule * Makefile.am (update-copyright): Relax the selection rule to match any file containing the word "Copyright". Correct the exclusion rule so that it also excludes ChangeLog and COPYING files that are not in the top level directory. 2009-07-29 Jim Meyering maint: update-copyright: fix just-introduced bug * build-aux/update-copyright: ... and revert-for-now the change that made this script invoke localtime only once. maint: make update-copyright handle more cases * build-aux/update-copyright: Handle cases in which the final year number and copyright holder are on separate lines. Prompted by a report from Joel E. Denny. Also, do not invoke localtime for each line we process. 2009-07-29 Pádraig Brady doc: fix the generated HTML index * doc/coreutils.texi: Move the "SELinux context" section down below the "System context" nodes so that the HTML index is generated correctly. Also some extraneous and missing '.' characters were corrected in the index. Reported by Benno Schulenberg. 2009-07-28 Giuseppe Scrivano tail: use the inotify backend also with --pid=PID * src/tail.c (tail_forever_inotify): When a PID is specified, use select to block for no more than sleep_interval seconds at a time, and check for process death upon timeout. (main): Adapt to new tail_forever_inotify interface. 2009-07-27 Jim Meyering tests: new test for bug in ls -1U dir arg ... * tests/misc/ls-misc (multi-arg-U1): New test. 2009-07-27 Kamil Dudka ls -1U dir arg ... now works again * src/ls.c (print_dir): Emit "$dir_name:\n" *before* accumulating (and possibly printing) directory entry names. The bug was introduced in coreutils-7.0 via commit 8d974b00, 2008-07-30, "ls -U1 now uses constant memory". Reported by Julian Bradfield. * NEWS (Bug fixes): Mention it. 2009-07-27 Heikki Orsila tr: improve --help's description of --complement (-c) 2009-07-27 Pádraig Brady doc: add a sort by line length example * doc/coreutils.texi (sort invocation): Add an example showing how to sort data not directly supported by the sort command. doc: mention realpath in the readlink info * doc/coreutils.texi (readlink invocation): Add realpath to the index, and also mention it in the readlink description so people searching for that functionality can easily make the connection. 2009-07-26 Jim Meyering build: use a fixed-name temporary in man/Makefile.am * man/Makefile.am (check-x-vs-1): Using a fixed-name temporary file is better than one ending in -$$, because many -$$-suffixed files may accumulate over time. 2009-07-24 Kamil Dudka doc: improve readlink description here, too * doc/coreutils.texi (readlink invocation): Update menus. Add @cindex entries. 2009-07-24 Jim Meyering readlink: improve one-line summary: prints canonical file names, too * src/readlink.c (usage): Adjust one-line summary. * man/readlink.x: Likewise. Suggested by Kamil Dudka. 2009-07-21 Jim Meyering build: update from gnulib * gnulib: Update submodule to latest. 2009-07-14 Jim Meyering doc: point to Guile's ChangeLog-writing guidelines * HACKING (Commit log requirements): Point to Guile's http://www.gnu.org/software/guile/changelogs/guile-changelogs_3.html. Mention that a bit of prose can be welcome. 2009-07-11 Jim Meyering tail: adjust type of a local variable * src/tail.c (tail_forever_inotify): Declare "len" to be of type size_t, not ssize_t, since the former is what safe_read returns. 2009-07-09 Jim Meyering tests: avoid false-positive cp/link-heap failure * tests/cp/link-heap: Increase address space limit from 14000KB to 16000KB, to avoid failure with Debian unstable's libc6-dev-2.9-19 build: avoid build warn/failure due to -Wstack-protector * configure.ac: Do not enable -Wstack-protector. Otherwise, at least df.c would provoke a warning. 2009-07-08 Ondřej Vašík copy.c: remove a duplicate expression * src/copy.c (copy_attr_error): remove a redundant expression added in commit e0cf592f, 2009-04-27, "factor out test for errno ...". 2009-07-08 Jim Meyering build: update from gnulib * gnulib: Update submodule to latest. tail: use size_t for counter and index variables, ... * src/tail.c (any_live_files): ... not "int" or even unsigned int (tail_forever, tail_forever_inotify, main): Likewise. tail: declare "file descriptor" variable to be "int", not size_t * src/tail.c (tail_forever_inotify): Use "int", not size_t as the type of a file descriptor variable. 2009-07-04 Jim Meyering move argv-iter module to gnulib * gl/lib/argv-iter.c: Remove file. * gl/lib/argv-iter.h: Remove file. * gl/modules/argv-iter: Remove file. * gl/modules/argv-iter-tests: Remove file. * gl/tests/test-argv-iter.c: Remove file. * gnulib: Update submodule, to get argv-iter 2009-07-04 Giuseppe Scrivano tests: refactor code to use require_proc_pid_status_ * tests/tail-2/tail-n0f: Read the process status using the test-lib.sh require_proc_pid_status_ function. tests: use the "nobody" user's group as the default group id * tests/chroot/credentials: Use the group id, not its name. * tests/test-lib.sh (NON_ROOT_GROUP): Use the "nobody" user's group in place of "nogroup". 2009-07-03 Jim Meyering build: update from gnulib * gnulib: Update submodule to latest. 2009-07-03 Pádraig Brady sort: allow SI and IEC units on separate human sort fields * src/sort.c: Store the si_present state per key rather than globally * tests/misc/sort: Add a check that would have previously failed. Also add a test to demonstrate that invalid IEC/SI mixtures are not always noticed when they're not significant to the sort. 2009-07-03 Giuseppe Scrivano tail: avoid an inotify portability problem in kernels prior to 2.6.21 * src/tail.c (tail_forever_inotify): Handle the special case in which an old inotify watcher returns 0. Affects kernels in [2.6.13, 2.6.21). 2009-07-03 Jim Meyering tests: tail-2/wait: rename internal file name * tests/tail-2/wait: Rename file from not_accessible to unreadable, since all the test cares about is readability. 2009-07-03 Giuseppe Scrivano tests: tail-2/wait: don't fail when run as root * tests/tail-2/wait: Ensure that the unreadable file really is not readable before trying to run "tail -f" on it. 2009-07-03 Pádraig Brady doc: update the info on sort -b and -k * doc/coreutils.texi (sort invocation): Mention in the description of -b, that the locale can also affect whether blanks are significant. Update the list of ordering options for a --key that cause it to not inherit any global ordering options. Update the list of ordering options that implicitly skip whitespace. maint: generalize the development prerequisites docs * README-hacking: Add a little more high level info and merge notes on specific developer prerequisites into README-prereq * README-prereq: Remove the Fedora 8 specific information and generalize the information to be applicable to any system. 2009-06-29 Jim Meyering tail: add comments noting potential inotify-related problems * src/tail.c (tail_forever_inotify): Add two FIXME comments. 2009-06-28 Jim Meyering maint: bootstrap: merge changes from gnulib * bootstrap: Indent using spaces, not TABs. maint: bootstrap: sync submodule usage from gnulib * bootstrap: Config for git submodule use only if .gitmodules exists. maint: bootstrap: split a few long lines * bootstrap (found_aux_dir): Avoid lines longer than 80 columns. 2009-06-27 Jim Meyering maint: don't change COPYING * COPYING: Don't modify Copyright date list in imported file. This file is one of very few exceptions in that we version-control it, even though its primary source is another package. Spotted by Eric Blake. maint: add a rule to automate the annual copyright-year-update process * build-aux/update-copyright: New file. * Makefile.am (changelog_etc): Add update-copyright. (update-copyright): New rule. 2009-06-27 Pádraig Brady stdbuf: fix to stop -i option causing an assertion * src/stdbuf.c (main): Fix the array bounds check in the assert * tests/misc/stdbuf: Add a test for all standard streams 2009-06-25 Pádraig Brady doc: clarify the tail inotify NEWS * NEWS: Say why inotify was used 2009-06-23 Jim Meyering maint: update all Copyright year lists to include 2009 maint: remove old TODO files * lib/TODO: Remove file. * tests/join/TODO: Likewise. doc: README-hacking tweak * README-hacking: Move the "While building..." sentence down to where it belongs. tests: tail-2/pid: include more info upon failure * tests/tail-2/pid: Print unexpected $state upon failing. 2009-06-20 Jim Meyering doc: typo fix in README-hacking * README-hacking: Fix a typo. Don't make building from a git-cloned tree sound so hard. build: update from gnulib (hash module updates; maint.mk tweak) * gnulib: Update submodule to latest. 2009-06-17 Jim Meyering doc: fix a typo * doc/coreutils.texi (stdbuf invocation): Insert missing "to". 2009-06-17 Pádraig Brady stdbuf: A new program to run a command with modified stdio buffering * AUTHORS: Register as the author. * NEWS: Mention this change. * README: Add stdbuf command to list. * configure.ac: Only enable on ELF systems with GCC. * cfg.mk (sc_system_h_headers): Use VC_LIST_EXCEPT rather than VC_LIST, so we can add an exception, if needed. * .x-sc_system_h_headers: New file. Exempt libstdbuf.c. * Makefile.am (syntax_check_exceptions): Add .x-sc_system_h_headers. * doc/coreutils.texi (stdbuf invocation): Add stdbuf info. * man/.gitignore: Ignore generated manpage. * src/.gitignore: Ignore stdbuf and libstdbuf.so binaries. * man/Makefile.am (stdbuf.1): Add dependency. * man/stdbuf.x: New file with example usage. * po/POTFILES.in: Reference new command and shared library sources. * src/Makefile.am (build_if_possible__progs): Add stdbuf and libstdbuf, (pkglib_PROGRAMS): Reference optional shared lib, (libstdbuf_so_LDADD): Ensure we don't link with non PIC libcoreutils.a. (libstdbuf_so_LDFLAGS): Add -shared GCC option, (libstdbuf_so_CFLAGS): Add -fPIC GCC option. (check-README): Exclude libstbuf. (check-AUTHORS): ditto. (sc_tight_scope): Exclude functions starting with __. * src/libstdbuf.c: The LD_PRELOAD shared library to control buffering. * src/stdbuf.c: New file to setup env variables before execing command. * tests/Makefile.am: Reference new test file. * tests/misc/help-version: Set expected exit codes. * tests/misc/invalid-opt: ditto. * tests/misc/stdbuf: Add 9 tests. 2009-06-16 Jim Meyering doc: cp: describe an oddity of combining -H/-L and --preserve=links * doc/coreutils.texi (cp invocation) [-L]: Elaborate. [--preserve=links]: Remove comments saying that we need documentation for just this situation. Provide more explanation and examples. Reported by Brian M. Carlson in http://bugs.debian.org/525048. 2009-06-15 Jim Meyering maint: revert last change: we're not ready for "local" in scripts, yet Revert "use a local var: more readable" This reverts commit c0d82452883a10911c9cbc69c84144d99b7e6b08. use a local var: more readable 2009-06-15 Giuseppe Scrivano tail: use inotify if it is available * NEWS: Document the new feature. * m4/jm-macros.m4: Check if inotify is present. * src/tail.c (tail_forever_inotify): New function. (main): Use the inotify-based function, if possible. * tests/Makefile.am: Add new tests for tail. * tests/test-lib.sh (require_proc_pid_status_, get_process_status_): New functions. * tests/tail-2/pid: New file. * tests/tail-2/wait: New file. * tests/tail-2/tail-n0f: Refactor code into the test-lib.sh require_proc_pid_status_ function. 2009-06-13 Jim Meyering diag: say "failed to...", rather than "cannot..." in a few diagnostics * src/chroot.c (main): ...it's more precise. * src/nohup.c (main): Likewise. * src/setuidgid.c (main): Likewise. * src/timeout.c (main): Likewise. 2009-06-13 Cliff Miller sort: Ignore fields where end position is before the start position * NEWS: Mention the fix * THANKS: Add Cliff Miller * src/sort.c (keycompare): Ensure lima >= texta * tests/misc/sort: Add 3 corresponding tests 2009-06-11 Pádraig Brady tests: ls --color, permissions override hardlink coloring * tests/ls/multihardlink: Add a test case to demonstrate and test this non obvious behavior. 2009-06-11 Kamil Dudka ls --color: do not colorize files with multiple hard links by default * src/ls.c: Rename hl->mh, do not colorize files with multiple hard links by default. * src/dircolors.c: Rename HARDLINK -> MULTIHARDLINK, hl -> mh. * src/dircolors.hin: Do not colorize files with multiple hard links by default. * tests/Makefile.am: Rename the test case accordingly. * tests/ls/multihardlink: Additionally test ls' default behavior and factor out some duplication. * NEWS: Mention the change in behavior. 2009-06-08 Pádraig Brady maint: Add a syntax-check to ensure all .x-sc_ files are distributed * Makefile.am: Add a couple of missing entries to syntax_check_exceptions for distribution. * cfg.mk: Add a rule to ensure the syntax_check_exceptions list stays in sync with the .x-sc_* files in the repository. 2009-06-07 Jim Meyering build: update from gnulib * gnulib: Update submodule to latest. sort: die immediately upon heap allocation failure * src/sort.c (register_proc): Handle hash_insert failure. 2009-06-04 Mike Frysinger dircolors: add screen-256color-bce to TERM list * src/dircolors.hin: Add screen-256color-bce. 2009-06-03 Jim Meyering doc: HACKING: minor adjustments, additions * HACKING (Amending...): Remove spurious "-e" used with commit --amend. (log message policy): Mention the 72-column limit. "build:" and "maint:" are common prefixes, these days. doc: adjust wording in README-prereq dircolors: recognize .xz, .txz, .tbz and .tlz suffixes * src/dircolors.hin: Add .xz, .txz, .tbz and .tlz. doc: use newer URL for XZ utils * README-hacking: Use * README-prereq: Mention xz, not lzma. 2009-06-03 Matěj Cepl doc: adjust README-prereq instructions * README-prereq: Mention new requirement on automake-1.11, with its new location and updated dependency on autoconf-2.62. Remove the reference to coreutils-7.0 so that this file implicitly refers to the latest or release version of coreutils. Fix and clarify the instructions for updating the $PATH. 2009-06-02 Jim Meyering doc: HACKING: mention the GNU Coding Standards * HACKING (Add documentation): Add a link to the GCS. build: no longer list gnulib's "memchr" module as obsolete * bootstrap.conf (obsolete_gnulib_modules): Remove memchr from the list, now that it fixes a problem in some modern C libraries. (gnulib_modules): Add it here. build: make generated man/*.1 files read-only This should help people notice that they are generated. Note: each file already has a comment to that effect from help2man. * man/Makefile.am (.x.1): Make generated files read-only. Also, don't redirect directly to the target, $@. build (man/): use automake's new $(AM_V_GEN) variable * man/Makefile.am (.x.1, check-x-vs-1, check-programs-vs-x): Mark with $(AM_V_GEN), so that automake-1.11 prints "GEN $@" by default (stick with "GEN" in spite of the latter two rules not officially generating anything -- they're just tests). chroot: make --groups= work without --userspec=; be more robust * src/chroot.c (set_additional_groups): Add comments. Given an empty or all-comma group list, diagnose it and return nonzero. When more than one group is invalid, diagnose all of them, not just the first. (main): Honor --groups= also when --userspec= is not specified. Now that set_additional_groups consistently diagnoses its failures, don't diagnose it separately here. * tests/chroot/credentials: Do not invoke with an empty group list. chroot: don't set bogus user-ID or group-ID for --u=U: or --u=:G * src/chroot.c (main): Initialize both "uid" and "gid". To -1. This also allows one to set the user-ID or primary group-ID to 0, in case it's not that already. * tests/chroot/credentials: Test for the above. chroot: set-*-ID failure must provoke nonzero exit before execvp * src/chroot.c (main): Exit upon set-group-ID or set-user-ID failure. tests: use "nobody" as the default group name in chroot test * tests/test-lib.sh (NON_ROOT_GROUP): Use "nobody", not "nogroup". build: make distcheck rules use --enable-gcc-warnings * dist-check.mk (warn_cflags): Remove definition, now that it's been subsumed by --enable-gcc-warnings. (my-distcheck): Use configure with --enable-gcc-warnings and remove use of $(warn_cflags). 2009-05-30 Eric Blake head, tail: make --help less ambiguous * src/head.c (usage): Use -n K, not -n N, to avoid confusion. * src/tail.c (usage): Likewise. * doc/coreutils.texi (head invocation, tail invocation): Likewise. Reported by Christophe Lyon. 2009-05-26 Michael Speer sort: new --human-numeric-sort option to sort KiB MB etc. * NEWS: Document the new option * doc/coreutils.texi (sort invocation): ditto * src/sort.c (main): handle the new --human-numeric-sort option (-h). (human_numcompare): A new function to compare SI and IEC suffixes before falling back to the standard --numeric comparison. (find_unit_order): A new helper function to find the order of magnitude of a number string as determined by its suffix. (check_mixed_SI_IEC): A new helper function to exit with error if both SI and IEC suffixes are presented. * tests/misc/sort: Add 8 tests to test the new functionality. * THANKS: Update 2009-05-26 Giuseppe Scrivano chroot: accept new options --userspec=U:G and --groups=G1,G2,G3 * NEWS: Note chroot's new options. * doc/coreutils.texi: Document them. * src/chroot.c (main): Add support for --userspec and --groups. * tests/Makefile.am (root-tests): Add chroot/credentials. * tests/chroot/credentials: New file. * tests/test-lib.sh: Define NON_ROOT_GROUP to a default value. 2009-05-18 Pádraig Brady doc: clarify the operation of the comm -123 parameters * src/comm.c (usage): give more information on the -123 parameters, with examples to show that they can be combined. Addresses . * doc/coreutils.texi (comm invocation): Mention that the column separators are suppressed along with the column. Suggestion from Dan Jacobson. * man/comm.x: Reference other commands that match adjacent lines. * man/join.x: ditto. * man/uniq.x: ditto. 2009-05-18 Jim Meyering build: require automake-1.11 * bootstrap.conf (buildreq): Require automake-1.11, not 1.10b, for our use of AM_SILENT_RULES. * configure.ac (AM_INIT_AUTOMAKE): Likewise. 2009-05-17 Jim Meyering maint: HACKING: mention a few more useful git commands * HACKING (Miscellaneous useful git commands): Add a few. build: avoid new "make distcheck" failure with gcc 4.5.0 20090517 * dist-check.mk (warn_cflags): Add -Wno-enum-compare. build: avoid new warnings from gcc 4.5.0 20090517 * configure.ac: Add an explicit -Wno-logical-op, now that not listing -Wlogical-op is insufficient. maint: use ARRAY_CARDINALITY more * src/sort.c (main): Use ARRAY_CARDINALITY, rather than open-coding it. * src/factor.c (WHEEL_END): Likewise. * src/csplit.c (main): Likewise. * src/od.c: Likewise, * src/ls.c (main): Likewise. (N_ENTRIES): Remove definition. Use ARRAY_CARDINALITY instead. * src/dircolors.c: Likewise. (array_len): Remove definition. build: tr: avoid a warning due to newer gcc's -Wenum-compare * src/tr.c (N_CHAR_CLASSES): Remove anonymous enum definition. (look_up_char_class): Use ARRAY_CARDINALITY, rather than N_CHAR_CLASSES. maint: define ARRAY_CARDINALITY in system.h * src/system.h (ARRAY_CARDINALITY): Define if not already defined. build: turn off -Wlong-long * configure.ac: With --enable-gcc-warnings, -Wlong-long would cause compilation failure due to inclusion of lib/gethrxtime.h. Initialize "nw". 2009-05-16 Jim Meyering maint: cfg.mk: remove now-unnecessary gnulib_dir definition * cfg.mk (gnulib_dir): Remove definition, now that gnulib's maint.mk provides the default we want. * gnulib: Update submodule to latest. 2009-05-15 Pádraig Brady tests: fix date-next-dow failure on older systems * tests/misc/date-next-dow: In the strftime call use %Y-%m-%d rather than the newer %F equivalent which is not available on Solaris 8 for example. 2009-05-14 Jim Meyering build: update from gnulib, for rename.m4 fix, improved tests, etc. * gnulib: Update submodule to latest. maint: README-release: minor improvements * README-release: Mention gnu_ftp_host-{alpha,...} settings in cfg.mk. Now that XZ_OPT is set via maint.mk, don't mention it here. 2009-05-11 Eric Blake truncate: fix bug in use of isspace * src/truncate.c (main): Pass unsigned characters to isspace. * NEWS: Mention this. 2009-05-07 Jim Meyering post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 7.4 * NEWS (Build-related): Mention make check fixes. admin: update NEWS * NEWS (Bug fixes): Mention the date-related fixes. (Portability): Mention the ACL-related fixes on *BSD. 2009-05-05 Pádraig Brady doc: note the use of LC_COLLATE in comm, join and uniq * doc/coreutils.texi (uniq invocation): Simplify the text to remove the inconsequential mentioning of order, while implying that LC_COLLATE can alter equality comparisons. * src/comm.c (usage): Mention LC_COLLATE is significant. * src/join.c (usage): Ditto. * src/uniq.c (usage): Ditto. Also improve the summary. Suggestion from Andries Brouwer 2009-05-05 Jim Meyering tests: rm/one-file-system: umount more reliably * tests/rm/one-file-system: Run umount via trap, so it runs also upon irregular termination. 2009-05-05 Andreas Schwab tests: fix typo in check-AUTHORS rule * src/Makefile.am (check-AUTHORS): Set locale. 2009-05-04 Jim Meyering build: use a gnulib SHA1 that is not private * gnulib: Update submodule to latest *public*. build: update from gnulib, for ACL-related fixes * gnulib: Update submodule to latest. 2009-05-03 David Bartley mv, rm: adapt to new and improved gnulib interfaces Use gnulib's new priv-set module and updated write-any-file. With them, the remove-called can_write_any_file function no longer tries to drop the unlink-directory privilege, so now each caller of remove must do that separately, calling priv_set_remove_linkdir. * bootstrap.conf (gnulib_modules): Add priv-set. * src/rm.c: Include "priv-set.h". (main): Call priv_set_remove_linkdir. * src/mv.c (main): Likewise. * gnulib: Update submodule to latest. 2009-05-03 Jim Meyering tests: correct the "make check"-run check-AUTHORS test * src/Makefile.am (check-AUTHORS): Revert back to using en_US.UTF-8, to ease parsing (English-only) text around the list of names, even when .po files are not installed. Reported by Andreas Schwab. Along the way, use $(AM_V_GEN), not "@". (sc_tight_scope): Use $(AM_V_GEN) here, too. * gnulib: Update submodule to latest, for the proper_name_utf8 fix that makes --version output print the UTF-8 rendering of author names in more cases. tests: add tests of e.g., date -d 'next monday' * tests/misc/date-next-dow: New file. * tests/Makefile.am (TESTS): Add misc/date-next-dow. * gnulib: Update submodule to latest, for getdate.y that handles "next Monday" properly when run on a Monday. 2009-05-01 Jim Meyering post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 7.3 * NEWS: Record release date. maint: tweak release-building notes * README-release: Specify -j1 on the command to run all tests. Otherwise, running some in parallel would cause failures, e.g., for rm/ext3-perf and tail-2/assert-2. 2009-05-01 Eric Blake stdopen: remove unused code * m4/stdopen.m4: Delete now-unused file. * lib/stdopen.h: Likewise. * lib/stdopen.c: Likewise. 2009-04-30 Jim Meyering build: update from gnulib, for fixed lib/signbitl.c * gnulib: Update submodule to latest. build: "make check" now fails in a friendlier manner for missing Perl * doc/Makefile.am (sc-lower-case-var): Don't redirect stderr of $(PERL) (which is sometimes build-aux/missing) to /dev/null, so that a failing "make check" explains that Perl is not installed. Reported by James Youngman. build: doc: emit something for each "make check"-run rule * doc/Makefile.am: Use $(AM_V_GEN) in place of each leading "@". (check-texinfo): Align line-continuation backslashes. 2009-04-29 Jim Meyering build: update from gnulib, for the lib/*-state.c compilation fixes * gnulib: Update submodule to latest. 2009-04-28 Pádraig Brady misc: correct NEWS entry about id -G portability * NEWS (Portability): getgrouplist has the portability issues, not getgroups. 2009-04-28 Jim Meyering df: adjust comment to match recent code change * src/df.c (main): Update comment to match. misc: mention the df vs. automount change * NEWS (Portability): Mention that df now accommodates the new behavior of some automounters. misc: alphabetize NEWS entries 2009-04-28 Tomas Smetana df: use open(2), not stat, to trigger automounting * src/df.c (main): When iterating over command-line arguments, attempting to ensure each backing file system is mounted, use open, not stat. stat is no longer sufficient to trigger automounting, in some cases. Based on a suggestion from Ian Kent. More details in http://bugzilla.redhat.com/497830 2009-04-28 Ondřej Vašík tests: ensure that cp's -a doesn't silence --preserve=context * tests/cp/cp-a-selinux: Ensure that the -a option does not silence error diagnostics from --preserve=context, when preserving context is required. tests: add test for xattr diagnostics on dest. FS lacking xattr support * tests/cp/cp-mv-enotsup-xattr: Ensure that xattr diagnostics are displayed correctly when destination filesystem lacks xattr support. * tests/Makefile.am (root_tests): Add new root-only test. 2009-04-27 Jim Meyering copy.c: factor out test for errno value indicating "unsupported" * src/copy.c (errno_unsupported): New function. (copy_attr_error, copy_internal): Use it. 2009-04-27 Ondřej Vašík cp -a: diagnose failure when preserving xattr/context required * src/copy.c (copy_attr_by_fs): Always print diagnostics when preserving xattrs is required. (copy_attr_by_name): Likewise. (copy_reg): Always print diagnostics when preserving SELinux context is required. (copy_internal): Likewise. Also, do not ignore ENOTSUP and ENODATA errors when preserving SELinux context is required. * NEWS (Bug fixes): Mention it. mv: ignore xattr-preservation failure when not supported by filesystem *src/copy.c: Do not warn about xattr-preservation failure when xattrs are not supported and preservation of xattrs is not explicitly required. Reported by Eric Sandeen in http://bugzilla.redhat.com/496142 2009-04-25 Jim Meyering build: update from gnulib, for the vc-list-files fix * gnulib: Update submodule to latest. build: adjust use of automake's new $(AM_V_GEN) variable * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, fs.h): (version.c, version.h): Use $(AM_V_GEN) only as a prefix of an existing command. Otherwise, it provokes warnings from some "make" programs. Suggestion from Ralf Wildenhues. 2009-04-25 Ralf Wildenhues tests: fix check-AUTHORS skip logic * src/Makefile.am (check-AUTHORS): When this test is skipped, be sure to avoid all commands in the recipe, not just those passed to the first shell. 2009-04-25 Eric Blake cfg.mk: update to latest gnulib change * cfg.mk (bootstrap-tools): Override maint.mk default to include bison. * gnulib: Update to latest gnulib. 2009-04-24 Jim Meyering build: move coreutils-specific rules from maint.mk to new file * dist-check.mk: New file: coreutils-specific rules extracted from maint.mk, now that maint.mk has migrated to gnulib. * Makefile.am (EXTRA_DIST): Add dist-check.mk. * coreutils/cfg.mk: Include $(srcdir)/dist-check.mk. * gnulib: Update submodule to latest. tests: avoid unusual (~1-in-20) failure of a new test * tests/misc/sort: Remove one of the generated tests. 363 remain in this file alone. build: use automake's new $(AM_V_GEN) and $(AM_V_at) variables * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, fs.h): (version.c, version.h): Mark with $(AM_V_GEN) and $(AM_V_at), so that the latest automake prints "GEN $@" by default. 2009-04-24 Simon Josefsson build: use maint.mk from gnulib * maint.mk: Remove file. Now it's generated. * .gitignore: Ignore it. * bootstrap.conf (gnulib_modules): Add maintainer-makefile. * gnulib: Update submodule to latest. 2009-04-23 Jim Meyering build: make --enable-silent-rules the default * configure.ac (AM_INIT_AUTOMAKE): Remove silent-rules. Instead,... (AM_SILENT_RULES): Use this, with it's undocumented [yes] argument. Those who want verbose build output may configure with --disable-silent-rules or use "make V=1". * gnulib: Update submodule to latest. sort -m: don't segfault when output file is also an input file * src/sort.c (avoid_trashing_input): Fix an off-by-one error and guard the use of memmove. * NEWS (Bug fixes): Mention it. * tests/misc/sort: Add tests to exercise the offending code. * THANKS: Update. Reported by Otavio Salvador in http://bugs.debian.org/525048. tests: make the check-AUTHORS test more portable, now that it's... run as part of "make check". * src/Makefile.am (check-AUTHORS): Don't depend on en_US.UTF-8. Instead, use the French UTF8 locale, if configure found one. If not found, just skip the test. avoid parallel "make distcheck" failure due to two run-in-src/ rules Move the check-AUTHORS rule from "syntax-check" to "check". * maint.mk (local-checks-available): Remove check-AUTHORS. (check-AUTHORS): Remove rule. * src/Makefile.am (CLEANFILES): Add $(no_install__progs), since they too are built sometimes. (check-AUTHORS): Split a longer-than-80 sed command. (../AUTHORS): Remove obsolete rule. 2009-04-22 Jim Meyering cp: work around linux kernel bug: short-read != EOF on /proc Remove the optimization that avoided up to 50% of cp's read syscalls. Do not assume that a short read on a regular file indicates EOF. When reading from a file in /proc on linux [at least 2.6.9 - 2.6.29] into a 4k-byte buffer or larger, a short read does not always indicate EOF. For example, "cp /proc/slabinfo /tmp" copies only 4068 of the total 7493 bytes. This optimization (25719a33154f0c62ea9881f0c79ae312dd4cec7a, Improve performance a bit by optimizing away; 2005-11-24) appears to have been worth less than a 2% speed-up (and usually much less), so the impact of removing it is negligible. * src/copy.c (copy_reg): Don't exit the loop early. * tests/cp/proc-short-read: New test, lightly based on a suggestion from Mike Frysinger, to exercise this fix. * tests/Makefile.am (TESTS): Add cp/proc-short-read. * NEWS (Improve robustness): Mention this change. 2009-04-22 Jim Meyering tests: avoid new "make distcheck" failure due to newer File::Temp With newer perl (e.g., Fedora 10's 4:5.10.0-68.fc10), tests/CuTmpdir.pm stopped removing its temporary directories, with diagnostics like this: cannot remove path when cwd is /c/coreutils/tests/misc/seq.tmp-e2up \ for /c/coreutils/tests/misc/seq.tmp-e2up: at \ /usr/lib/perl5/5.10.0/File/Temp.pm line 902 Chdir out of the target directory before that code runs: * tests/CuTmpdir.pm (END): chdir '..'. (chmod_tree): Remove explicit "chdir $dir". 2009-04-19 Jim Meyering doc: update README * README: (Reporting bugs): List the bug-reporting address here, too, not just in the following more test-oriented paragraph. Reported by Tim Mooney. All changes are no longer listed in version-controlled ChangeLog files, so note that contributions are attributed in the commit logs. Mention bootstrap.conf, now that it's the authoritative source of minimal prerequisite program/version# pairs. 2009-04-19 Aurelien Jarno tests: avoid failure of install-C test on FreeBSD UFS file system * tests/install/install-C: Use 2755 (set-gid), not 1755 (sticky), to test install -C with non-permission mode bits set. At least on FreeBSD with a UFS file system, a non-root user may not set the sticky bit on a non-directory. 2009-04-19 Jim Meyering comment touch up: insert a space between "#" and text of comment * bootstrap: It's easier to read that way. 2009-04-19 Ralf Wildenhues fix comment typos * bootstrap: Fix comment typos. * src/pr.c: Likewise. 2009-04-17 Jim Meyering maint: bootstrap: sync a tiny change from gnulib * bootstrap: rename variable to sync with gnulib: s/\$depth/$shallow/ 2009-04-16 Jim Meyering * gnulib: Update submodule to latest. build: use '.'-relative name, gnulib_dir * cfg.mk (gnulib_dir): Use "gnulib", not "/gnulib", now that the former is a git submodule, and guaranteed to exist. 2009-04-15 Jim Meyering maint: clean up skipped syntax-check rules * cfg.mk (local-checks-to-skip): Remove patch-check and changelog-check. * maint.mk (patch-check): Remove rule. (local-checks-available): Remove patch-check. (changelog-check): Remove rule. 2009-04-11 Ralf Wildenhues build: avoid parallel distcheck failure * Makefile.am (ALL_RECURSIVE_TARGETS): Initialize here, too, to please automake. Add install-root, check-root, distcheck-hook. * cfg.mk (ALL_RECURSIVE_TARGETS): Add sc_tight_scope. * maint.mk (ALL_RECURSIVE_TARGETS): Add patch-check, check-AUTHORS, maintainer-distcheck, vc-dist, taint-distcheck, my-distcheck, alpha, beta, major. 2009-04-10 Jim Meyering doc: fix a typo: s/is a is a/is a/ * doc/coreutils.texi (Putting the tools together): Fix typo. build: tight-scope test: don't build excluded programs * src/Makefile.am (sc_tight_scope): Depend on $(bin_PROGRAMS), not $(all_programs) gnulib: update to latest: fix ls -v & sort -V * NEWS (Bug fixes): Mention it. maint: remove obsolete utime module * bootstrap.conf (obsolete_gnulib_modules): Remove utime. maint: put each module name on its own line; sort * bootstrap.conf (gnulib_modules): List them one per line. 2009-04-09 Jim Meyering tests: misc/ls-misc: avoid shadowing local decl of $e * tests/misc/ls-misc (make_j_d): Rename latter $e to $env 2009-04-09 Pádraig Brady id: fix infinite loop on some systems Steven Parkes reported that `id -G $USER` went into an infinite loop on Darwin systems for users in more than 10 groups: http://bugs.gentoo.org/show_bug.cgi?id=264007 * gl/lib/mgetgroups.c (mgetgroups): Work around buggy getgrouplist implementations that don't update the required size correctly, by doubling the result buffer and retrying. Also return the parameter updated by getgrouplist rather than its return value, as the documentation doesn't actually state the number of groups stored is returned by getgrouplist. * tests/misc/id-groups: Add test to exercise this logic * tests/Makefile.am: Reference new test * NEWS: Mention the fix * THANKS: Update 2009-04-07 Jim Meyering maint: avoid "make syntax-check" failure * src/install.c (main): Tweak syntax of new diagnostic. 2009-04-07 Pádraig Brady install: deprecate the --preserve_context option src/install.c: Print a warning when --preserve_context rather than --preserve-context is used as per FIXME. maint: remove compiler warnings from randint and randread modules * gl/lib/randint.c: Remove unused MAX macro * gl/lib/randread.c (randread_error): Add __attribute__((__noreturn__)) shred,sort,shuf: don't use /dev/urandom by default Suggestion from Steven Schveighoffer at: http://savannah.gnu.org/patch/?6797 to greatly speed up the random passes done by shred. * gl/lib/randread.c: Default to using the internal pseudorandom generator, rather than reading /dev/urandom * src/shred.c (usage): remove mention of /dev/urandom * src/shuf.c (usage); ditto * src/sort.c (usage): ditto * doc/coreutils.text: Document the new behaviour for aquiring random data. maint: Clarify ambiguous refs to Linux kernels or GNU/Linux systems * README-prereq: s_linux_GNU/Linux_ or s_linux_Linux kernel_ * README-valgrind: ditto * src/chown-core.c: ditto * src/dd.c: ditto * src/df.c: ditto * src/ls.c: ditto * src/mv.c: ditto * src/pwd.c: ditto * src/remove.c: ditto * src/shred.c: ditto * src/stat.c: ditto * src/su.c: ditto * src/system.h: ditto * src/timeout.c: ditto * src/truncate.c: ditto doc: add missing documentation for some SELinux options * doc/coreutils.texi (ls invocation): Describe the --context (-Z) option (install invocation): Describe the --preserve-context and -Z options (id invocation): Describe the --context (-Z) option (mkdir invocation): ditto (mknod invocation): ditto (mkfifo invocation): ditto * TODO: remove the todo item 2009-04-06 Jim Meyering * doc/code-vs-command: Remove long-unused, never-distributed file. 2009-04-04 Jim Meyering gnulib: update to latest: includes Solaris 8 portability fixes maint: clean up Makefile.am, rename remaining ChangeLog files * Makefile.am (changelog_etc, syntax_check_exceptions): Define. (EXTRA_DIST): Use. Remove names that are now automatically included: build-aux/git-version-gen, build-aux/vc-list-files. * build-aux/ChangeLog-2007: Rename from */ChangeLog. * doc/ChangeLog-2007: Likewise. * lib/ChangeLog-2007: Likewise. * m4/ChangeLog-2007: Likewise. * po/ChangeLog-2007: Likewise. tests: tweak po_check syntax check * maint.mk (sc_po_check): Don't let dangling lib/*.[ch] links cause spurious "grep: lib/file.h: No such file or directory" warnings. tests: improve ChangeLog syntax check * maint.mk (sc_changelog): Use $(VC_LIST_EXCEPT), not find. Don't hang when there are no ChangeLog files. (sc_require_config_h): For the file-name-filter, use grep -l to be slightly more efficient. (sc_require_config_h_first, _header_without_use, sc_program_name): Likewise. 2009-04-04 Ralf Wildenhues tests: make syntax-checks more robust * maint.mk (_prohibit_regexp): Add ';' at end of ':'-introduced comment so that the comment doesn't gobble up the following test for a missing regexp definition. (_header_without_use): Escape all '.'s in a header file name, not just the first one. 2009-04-03 Jim Meyering * cfg.mk (old_NEWS_hash): Regenerate once more. doc: adjust 7.2 "cat,cp,install,mv,split speed-up" NEWS item * NEWS: Reword an entry from 7.2 and change "linux" to "GNU/Linux". The latter was requested by Richard Stallman. * cfg.mk (old_NEWS_hash): Regenerate. 2009-04-03 Pádraig Brady ls: fix alignment when month names have varying widths Reported by Samuel Thibault and Stéphane Raimbault, as the glibc fr_FR locale has recently changed to use the official but variable width abbreviated month names. Other glibc locales also have variable widths. http://sourceware.org/ml/libc-locales/2008-q1/msg00035.html http://sourceware.org/bugzilla/show_bug.cgi?id=9859 * NEWS: Mention the fix * gl/lib/mbsalign.c: A new module to align and truncate a string in a specified number of screen cells, while handling multi-byte characters appropriately. * gl/lib/mbsalign.h: Ditto * gl/modules/mbsalign: Ditto * bootstrap.conf: Reference the new module * src/ls.c (abmon_init): New function, precompute the abbreviated months aligned left in a minimum width column <= 5 screen cells. (align_nstrftime): New function, replace the first %b in the format specification to strftime with the precomputed month string. Note using the cached month strings speeds up `ls -lU` by around 17% on glibc-2.7-2 on linux at least. Also if we implement this function using heap storage rather than automatic storage, and use snprintf instead of strcpy, ls will slow down by 2% and 1% respectively (i.e. a net gain of 14% rather than 17%). * tests/ls/abmon-align: A new test to test ls alignment for various formats and locales * tests/Makefile.am: Reference the new test 2009-04-02 Pádraig Brady doc: Clarify the help for version sorting in ls and sort * src/ls.c: Update the -v help description * src/sort.c: Update the -V help description 2009-04-02 Jim Meyering doc: adjust README-prereq instructions * README-prereq: Reverse order of -b/--track options. Pádraig Brady mentioned that is required with at least git-1.5.3.6. Invoke automake's own bootstrap script. 2009-04-02 C de-Avillez build: require automake-1.10b or newer * bootstrap.conf: Require at least automake-1.10b. * README-prereq: Mention 1.10b, not 1.10a. 2009-04-02 Jim Meyering tests: skip mv/i-3 if /dev/stdin is unreadable * tests/mv/i-3: Skip if /dev/stdin is unreadable. Reported by Sergei Steshenko. 2009-03-31 Jim Meyering build: set automake's silent-rules option via configure.ac * bootstrap: Revert commit 9f39fa855, 2009-03-28, "build: use automake's --silent-rules option when possible". * configure.ac (AM_INIT_AUTOMAKE): Instead, set it here. Require the just-released version of automake: 1.10b. tests: enable automake's color-tests and parallel-tests via configure.ac * gnulib-tests/Makefile.am (AUTOMAKE_OPTIONS): Don't define here. * tests/Makefile.am (AUTOMAKE_OPTIONS): Likewise. * configure.ac (AM_INIT_AUTOMAKE): Instead, add color-tests and parallel-tests here. 2009-03-31 Ralf Wildenhues build: use Automake's new parallel-tests feature * build-aux/check.mk: Remove, not needed any more. * tests/Makefile.am (AUTOMAKE_OPTIONS): Add parallel-tests and color-tests. * tests/check.mk: Do not include build-aux/check.mk any more. (SUFFIXES, TEST_LOGS): Remove. (TESTS_ENVIRONMENT): Use $$f rather than $$tst in $PERL invocation. * gnulib-tests/Makefile.am: Do not include build-aux/check.mk. (AUTOMAKE_OPTIONS): New macro, add parallel-test and color-tests. (TEST_LOGS): Remove. 2009-03-31 Jim Meyering * README-release (savannah news): Also mention the Subject: to use. post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 7.2 * NEWS: Record release date. 2009-03-29 Jim Meyering tests: don't use lang-default from individual tests * tests/sample-test: Don't recommend using lang-default here. It is now run for each test automatically, via TESTS_ENVIRONMENT. * tests/dd/reblock: Don't source lang-default here. * tests/misc/truncate-fail-diag: Likewise. tests: other-fs-tmpdir: remove just-added duplicate /usr/tmp * tests/other-fs-tmpdir (CANDIDATE_TMP_DIRS): Remove 2nd /usr/tmp. tests: other-fs-tmpdir: avoid bogus "skipped **********..." diagnostic * tests/other-fs-tmpdir (CANDIDATE_TMP_DIRS): Add /dev/shm to the list. Don't use a line of asterisks as the first line of the "why skipped" diagnostic, now that that line is printed on 'make check's stderr. 2009-03-28 Jim Meyering build: use automake's --silent-rules option when possible * bootstrap: Use automake's --silent-rules option. 2009-03-27 Jim Meyering tests: test-argv-iter.c: avoid declaration-after-stmt * gl/tests/test-argv-iter.c: Move declaration "up", so as not to ruffle feathers of crufty compilers. We accommodate such compilers here solely because this module may migrate to gnulib. Tiny patch by Matthew Woehlke. 2009-03-27 Eric Blake tests: fix 'make sc_tight_scope' on cygwin * src/Makefile.am (sc_tight_scope): Ignore leading underscores in symbols. 2009-03-27 Jim Meyering tests: avoid spurious test failure in set-GID build dir * tests/install/install-C-root: Skip this test if in set-gid directory. Reported by Sven Joachim and C de-Avillez. tests: migrate setgid-check into test-lib.sh * tests/test-lib.sh (skip_if_setgid_): New function. * tests/setgid-check: Remove file. * tests/Makefile.am (EXTRA_DIST): Remove setgid-check. * tests/chmod/c-option: Use the new function rather than sourcing the separate file. * tests/cp/cp-parents: Likewise. * tests/install/install-C: Likewise. * tests/mkdir/parents: Likewise. * tests/mkdir/perm: Likewise. 2009-03-26 Jim Meyering tests: mark the rm/ext3-perf test as "very" expensive * tests/rm/ext3-perf: Relegate this test to the very_expensive category, since it is failing too often for me, when run in parallel (-j4) with other disk-hammering tests. This test fails when it takes too long, so the fact that it fails under pressure is an inconvenience more than a real problem. * gnulib: Update submodule to latest. 2009-03-26 Paul Eggert df: port the known-value fix to AIX as well * src/df.c (known_value): New function, which also works on AIX /proc file systems. (df_readable, show_dev): Use it instead of hardcoding comparison to UINTMAX_MAX. Suggested by Jim Meyering and Matthew Woehlke. df: fix a bug when totaling unknown values * src/df.c (show_dev): Don't add UINTMAX_MAX to grand totals, as that value indicates that the true value is unknown; adding it effectively subtracts 1 from the total, whereas we want to leave the total alone. 2009-03-25 Jim Meyering tests: don't fail "make syntax-check" on cygwin * maint.mk (NEWS_hash): Remove trailing " -" or " *-". * cfg.mk (old_NEWS_hash): Regenerate, removing " -". Reported by Eric Blake. 2009-03-25 Eric Blake pwd: support -L and -P * src/pwd.c (longopts): New variable. (logical_getcwd): New function. (main): Use it. (usage): Document new options. * doc/coreutils.texi (pwd invocation): Likewise. * NEWS: Likewise. * TODO (pwd): Mark it done. * tests/misc/pwd-option: New file. * tests/Makefile.am (TESTS): Add test. * THANKS: Update. Reported by Paul D. Smith, in savannah bug 24949. 2009-03-25 Ondřej Vašík doc: update suffix regex in version sort * doc/coreutils.texi: Reflect current filevercmp regex. 2009-03-25 Ralf Wildenhues tests: CuTmpdir.pm: avoid use of undefined variable in warning * tests/CuTmpdir.pm (chmod_tree): Do not warn if $dir is undefined. 2009-03-24 Jim Meyering tests: ls -v: exercise yet another change in gnulib's new filevercmp * tests/misc/ls-misc: Add names with ~ and ~.1~ suffixes. * gnulib: Update submodule to latest. 2009-03-24 Kamil Dudka ls: make it possible to disable coloring of hard links * src/ls.c (print_color_indicator): Don't color hard links if disabled (when there is an empty hl= in the LS_COLORS environment variable). * tests/ls/hardlink: Add test case for disabled hard link highlighting. * NEWS: Mention the change. 2009-03-21 Jim Meyering tests: search only files that are under version control * maint.mk (sc_error_exit_success): Search only files that are under version control. (sc_makefile_path_separator_check): Likewise. Check *.mk files, too, not just Makefile.am files. tests: follow own advice: use $(PATH_SEPARATOR), not ":" * maint.mk (coreutils-path-check): Use the variable, not the literal. tests: modernize: use $(var) makefile notation, not @var@ * maint.mk (sc_makefile_path_separator_check): Recommend the use of $(PATH_SEPARATOR), not @PATH_SEPARATOR@. Remove an obsolete comment. 2009-03-20 Jim Meyering tests: teach sc_dd_O_FLAGS about new syntax in dd.c * cfg.mk (sc_dd_O_FLAGS): Adapt to new syntax. 2009-03-20 Eric Blake dd: use a more portable definition of O_FULLBLOCK * src/dd.c (O_FULLBLOCK): Compute its value without using a 180KB macro. This avoids triggering a compilation failure with HP-UX's cc. Reported by Matthew Woehlke. 2009-03-20 Jim Meyering tests: avoid spurious mkdir/selinux test failure on HP-UX 11.23 * tests/mkdir/selinux: Accept yet another diagnostic. Reported by Matthew Woehlke. 2009-03-19 Jim Meyering tests: df/total-verify: avoid test failure with older Perl * tests/df/total-verify: Don't use perl's -f option. Reported by Matthew Woehlke. * gnulib: Update submodule to latest. 2009-03-18 Jim Meyering tests: adjust sort-continue not to fail under valgrind * tests/misc/sort-continue: Don't run cat inside fd-limited shell. If sort fails to run in an fd-limited shell, skip the test. 2009-03-18 Paul Eggert tests: add another sort/nmerge test * tests/Makefile.am (TESTS): Add sort-merge-fdlimit. * tests/misc/sort-merge-fdlimit: New file. * doc/coreutils.texi (sort invocation): Document that we now silently lower nmerge if necessary. Patch by Paul Eggert, Nima Nikzad, Max Chang, Alexander Nguyen, Sahil Amoli, and Nick Graham. 2009-03-18 Paul Eggert sort: handle fd exhaustion better when merging This is an alternative to my 9 March patch labeled "Silently lower nmerge; don't (sometimes incorrectly) range-check" . It differs by not using 'dup' to probe for extra file descriptors; instead, it simply calls 'open' (and 'pipe') to open files and pipes, until one of these calls fails due to file descriptor exhaustion; it then backs off by 1, does a merge with the files that it has opened, and then retries with the (now-smaller) number of files. This patch requires quite a few more changes to the source code than the earlier patch, but it is in some sense "better" because it doesn't need to call "dup" ahead of time in order to decide whether "open" or "pipe" will fail. Also, it's more robust in the case where "open" or "pipe" fails with errno==EMFILE because some system-wide limit is exhausted. * src/sort.c (create_temp_file): New arg SURVIVE_FD_EXHAUSTION. (stream_open): New function, containing guts of xfopen. (xfopen): Use it. (pipe_fork): Set errno on failure. (maybe_create_temp): New function, containing guts of create_temp. (create_temp): Use it. (open_temp): Distinguish failures due to file descriptor exhaustion from other failures, and on fd exhaustion return a notice to caller rather than dying. Don't test execlp's return value; when it returns, it *always* returns -1. (open_input_files): New function. (mergefps): New arg FPS. It's now the caller's responsibility to open the input and output files. All callers changed. (mergefiles): New function. (avoid_trashing_input, merge): Handle the case where a single merge can't merge as much as we wanted due to file descriptor exhaustion, by merging as much as we can and then retrying. * tests/Makefile.am (TESTS): Add misc/sort-continue. * tests/misc/sort-continue: New file. * THANKS: Add Glen Lenker and Matt Pham who coauthored this patch. 2009-03-18 Jim Meyering maint: normalize leading-TAB indentation in Makefiles * maint.mk (sc_makefile_TAB_only_indentation): New rule. Replace each TAB+8-space sequence with two TABs. * man/Makefile.am: Likewise. * build-aux/check.mk: Likewise. I used this command (run it more than once, if needed): t=$'\t'; git grep -l -E "$t {8}"|grep -E 'Makefile|\.mk$' \ | xargs perl -pi -e 's/\t {8}/\t\t/' 2009-03-15 Jim Meyering maint: remove long-unused Makefile * tests/sort-time/Makefile: Remove long-unused file. maint: remove unused include and definitions * gl/lib/randread.c (__attribute__): Remove unused definition. (ATTRIBUTE_UNUSED): Likewise. * gl/lib/selinux-at.c (_): Remove unused definition. Don't include . No longer needed. * gnulib: Update submodule to latest. 2009-03-14 Jim Meyering system.h: correct compilation error: MAX not defined * src/system.h (io_blksize): Move definition down, so it follows that of MAX -- to avoid compilation failure on OpenSolaris. Reported by David Bartley. Details in http://lists.gnu.org/archive/html/bug-coreutils/2009-03/msg00190.html * gnulib: Update to pull in select/interix work-around. 2009-03-13 Kamil Dudka doc: update "version sort" documentation * doc/coreutils.texi: Reflect current filevercmp behavior. 2009-03-12 Jim Meyering tests: groups-version: don't require that id be built * tests/misc/groups-version: groups is now independent of id. tests: skip the groups-dash test when "groups" is not built * tests/misc/groups-dash: Skip if groups is not being installed. Suggested by Mike Frysinger. Also fail if groups exits with nonzero status. 2009-03-12 Pádraig Brady maint: mention Autoconf version required to build Automake * README-prereq: coreutils currently requires an unreleased version of Automake, so mention the minimum version of Autoconf required to build that. Suggestion from James Youngman. 2009-03-12 Jim Meyering * gnulib: Update submodule to latest. 2009-03-11 Ondřej Vašík cp: make -a option preserve xattrs, but with reduced diagnostics * copy.c (copy_attr_by_fd): Reduce xattr diagnostics for 'cp -a'. (copy_attr_by_name): Likewise. * cp.c (main): Preserve xattrs with -a option, when possible. * doc/coreutils.texi: Document that xattrs are preserved with cp -a, with no added diagnostics. * NEWS: Mention the change. * tests/misc/xattr: Add tests for 'cp --preserve=all' and 'cp -a'. 2009-03-11 Pádraig Brady maint: Document how to best to enable gcc warnings for developers * README-hacking: Mention --enable-gcc-warnings configure option * configure.ac: Don't scare developers away from using gcc warnings 2009-03-11 Jim Meyering maint: remove an obsolete FIXME comment * src/Makefile.am (../AUTHORS): Remove obsolete FIXME comment. There are no longer any installed *.sh programs. 2009-03-11 Pádraig Brady cat: Fix immediate output of processed data Introduced by commit 790892db, 2006-06-08 "Ensure that cat works ...". * NEWS: Mention the bugfix. * src/cat.c (cat): Fix the typo which stopped the writing of processed data before a blocking read() is done. * tests/misc/cat-buf: Add to ensure processed data is not buffered. * tests/Makefile.am: Reference the new test. cat,cp,mv,install,split: Set the minimum IO block size used to 32KiB This is following on from this change: [02c3dc9d 2008-03-06 cat: use larger buffer sizes ...] which increased the IO block size used by cat by 8 times, but also capped it at 32KiB. * NEWS: Mention the change in behavior. * src/system.h: Add a new io_blksize() function that returns the max of ST_BLKSIZE or 32KiB, as this was seen as a good value for a minimum block size to use to get good performance while minimizing system call overhead. * src/cat.c: Use it. * src/copy.c: ditto * src/split.c: ditto 2009-03-08 Jim Meyering tests: add a test for newly-fixed bug in comm --check-order * tests/misc/comm (ooo-prefix): Add a test for today's fix. * NEWS (Bug fixes): Mention it. 2009-03-08 Bruno Haible comm: fix a bug in its new --check-order option * src/comm.c: Include memcmp2.h. (check_order): Use memcmp2 instead of memcmp. * bootstrap.conf (gnulib_modules): Add memcmp2. 2009-03-08 Jim Meyering tests: ls -v: exercise the bug fixed by gnulib's new filevercmp * tests/misc/ls-misc (version-sort): New test. (mk_file): New function. Reported by Josh Triplett in . Details in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/16902 * NEWS (Bug fixes): Mention it. gnulib: sync submodule to latest 2009-03-07 Jim Meyering pr: fix a bug whereby --indent=N (-o) did not indent header lines * src/pr.c (print_header): Honor chars_per_margin also for the header. Inspired by a patch from C de-Avillez. This change also adjusts two other %*s directives to be %*.*s instead, (for the padding on either side of "file_text") to correct a bug that could make pr print one space of padding instead of none. * NEWS (Bug fixes): Mention it. * tests/pr/o3Jml24f-lm-lo: Adjust for new expected output. * tests/pr/o3a3Sl24f-tn: Likewise. * tests/pr/o3a3Snl24f-tn: Likewise. * tests/pr/o3a3l24f-tn: Likewise. * tests/pr/o3b3Sl24f-tn: Likewise. * tests/pr/o3b3Snl24f-tn: Likewise. * tests/pr/o3b3l24f-tn: Likewise. * tests/pr/o3mSl24f-bl-tn: Likewise. * tests/pr/o3mSnl24fbltn: Likewise. * tests/pr/o3ml24f-bl-tn: Likewise. bootstrap: add to XGETTEXT_OPTIONS * bootstrap.conf (XGETTEXT_OPTIONS): Add c-format --flag options for verror and verror_at_line; alphabetize. maint: use a git submodule for gnulib * .gitmodules: New file, to track gnulib. * gnulib: New file, created by running this: git submodule add git://git.sv.gnu.org/gnulib.git gnulib build: allow ./bootstrap --srcdir=... to work with a git submodule * bootstrap (git_modules_config): Use GIT_CONFIG, not GIT_CONFIG_LOCAL. The latter was removed in v1.5.6.1-109-gdc87183. build: avoid "multiply defined..." warning from automake * Makefile.am (AM_CFLAGS): Add $(WARN_CFLAGS) via +=, not =, to avoid "multiply defined..." warning from automake. 2009-03-06 Jim Meyering cat: use larger buffer sizes to reduce read/write-syscall overhead * src/cat.c (max): Remove definition. Use MAX from system.h instead. (compute_buffer_size): New function to compute the input and output buffer sizes, which are now set at 8 times st_blksize with a maximum of 32KiB. Previously the typical block sizes used were 1KiB for pipes and 4KiB for files, and now will be 8KiB and 32KiB respectively. (main): Use it. This change can double throughput on modern systems. For timings, see http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/16040 Suggestion from Tzvi Rotshtein. maint: avoid new unused-macro warnings from gcc * src/ls.c (ASSERT_MATCHING_DEV_INO): Comment-out unused definition, to match commented-out use. * src/install.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE): (READ_SIZE): Remove definitions of unused macros. * src/mv.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE): Likewise. * src/dd.c (max): Likewise. * src/expand.c (OUTPUT_BLOCK): Likewise. * src/csplit.c (ALLOC_SIZE): Likewise. * src/pr.c (NULLCOL): Likewise. * src/ptx.c (Sword): Likewise. * src/unexpand.c (OUTPUT_BLOCK): Likewise. * src/factor.c (NDEBUG): Likewise. tests: fix just-introduced typo in rm/ext3-perf * tests/rm/ext3-perf: Fix typo in commit 2b1e6636bea, 2009-02-27 "tests: rm/ext3-perf: relax this test". maint: remove spurious case-ignoring option from a test * maint.mk (sc_trailing_blank): Remove useless/harmless ignore_case=1. 2009-03-04 Ralf Wildenhues policy: use git to help avoid trailing white space * HACKING (Avoid trailing white space): Describe how git can help. 2009-03-04 Andreas Schwab Update Andreas Schwab's email address * THANKS: Update Andreas Schwab's email address. 2009-03-03 Jim Meyering maint: improve release-related process and documentation * README-release: Fix typo. it's "maintainer-clean". Refer to HACKING for full list of dependencies. Use cvs add's -ko option to inhibit $Id$-style keyword expansion. * maint.mk (web-manual): Factor out definition of $(manual_title). (vc-dist): Set XZ_OPT=-9ev for the final "make dist". * cfg.mk (manual_title): Define it here. Suggestions from Eric Blake. 2009-03-02 Jim Meyering dist: document our release procedure * README-release: New file. dist: automate the post-release web-manual update process * maint.mk (web-manual): New rule, from m4's maint.mk. * bootstrap.conf (gnulib_modules): Add gendocs. tests: rm/ext3-perf: relax this test * tests/rm/ext3-perf: If set-up takes too long, use the set-up time as the removal time limit. Otherwise, a parallel "make check" would usually fail when run with RUN_VERY_EXPENSIVE_TESTS=yes. tests: don't skip setgid-dir related tests on SELinux-enabled systems * tests/setgid-check: The change in ls (use ".", not "+") caused this check always to report the working directory as set-gid. Now, use stat, not ls. tests: reflect the s/+/./ SELinux indicator change * tests/mkdir/perm: Now that this test is no longer always skipped, make it work independently of ls: use stat, not ls, to get perm string. * test-lib.sh (rwx_to_mode_): Use stat, not ls to get perm string This test was run only when RUN_VERY_EXPENSIVE_TESTS=yes was set. tests: when skipping a test, say why on screen, not just in the log * tests/test-lib.sh: Redirect also to descriptor 9. Better one-line why-skip diagnostics. * tests/check.mk (TESTS_ENVIRONMENT): Redirect 9 to stderr. * tests/misc/pwd-unreadable-parent: Remove redundant "skipping..." diag. maint: enable many gcc warnings * bootstrap.conf (gnulib_modules): Add manywarnings. * configure.ac: Use gl_MANYWARN_ALL_GCC, and exclude options I don't want or that provoke too many warnings. (WARN_CFLAGS, WERROR_CFLAGS): Define. (lint, GNULIB_PORTCHECK): Define. (_FORTIFY_SOURCE): Define to 2. maint: avoid gcc warning about missing attributes * src/prog-fprintf.h (prog_fprintf): Declare with printf attribute. * src/system.h (usage): Declare with the "noreturn" attribute. maint: avoid warnings about potentially-counterproductive "inline" * src/dd.c (quit): Remove "inline" attribute. * src/test.c (advance, unary_advance): Likewise. maint: cp: avoid gcc warning about unused macro definitions * src/cp.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE): Remove. dist: do not emit MD5 or SHA1 checksums into announcement template * maint.mk (announcement): Use announce-gen's new --no-print-checksums. 2009-02-28 Jim Meyering maint: detect unnecessary inclusion of signal.h * maint.mk (sc_prohibit_signal_without_use): New rule. maint: remove an unnecessary inclusion of * src/operand2sig.c: Don't include . 2009-02-28 Pádraig Brady tests: sort: Check skipping blanks in multibyte locales * tests/misc/sort: On Fedora 8 at least, sort -k1b,1 mishandles blanks in multibyte locales, so add test. 2009-02-27 Jim Meyering * HACKING: avoid trailing white space 2009-02-27 Jim Meyering cp: diagnose invalid "cp -rl dir dir" right away, once again Running "mkdir dir; cp -rl dir dir" would create dir/dir/dir/... rather than diagnosing the "copy-into-self" failure. The easy fix would have been to revert this part of the change [3ece0355 2008-11-09 cp: use far less memory in some cases] that introduced the bug: - remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev); + if (!x->hard_link) + remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev); However, that would have induced the failure of the new cp/link-heap test, due to the added memory pressure of recording 10k dev/ino pairs. And besides, I liked that improvement and wanted to keep it. Now that it's obvious recording the just-created-directory dev/ino needn't depend on the setting of hard_link, I realized it is necessary to record the pair only for the first directory created for each source command-line argument. I made that change, then noticed the new test, cp -rl a d d, would pass when run once, yet output the into-self diagnostic twice. Also note the side effect: it creates d/a and d/d. However, running that same command a second time, now with the modified directory, would fail. That turned out to be due to the fact that although the first into-self failure was detected in copy_dir, that function would continue copying other entries regardless -- and that would make it fail (eventually) with the unwanted recursion. * src/copy.c (copy_internal): This function needed an indicator of whether, for a give command line argument, it had already created its first directory. If so, no more need to record dev/ino pairs. If this is the first, then do record its pair. Hence, the new parameter. (copy_dir, copy): Update callers. (copy_dir): Upon any into-self failure, break out of the loop. * tests/cp/into-self: Test for the above. Reported by Mikael Magnusson. 2009-02-26 Jim Meyering tests: stty-row-col would hang when run in the background * tests/misc/stty-row-col: Don't hang when run in background at least on Solaris 10 and OpenBSD. 2009-02-26 Pádraig Brady sort: Fix two bugs with determining the end of field * src/sort.c: When no specific number of chars to skip is specified for the end field, always skip the whole field. Also never include leading spaces from next field. * tests/misc/sort: Add 2 new tests for these cases. * NEWS: Mention this bug fix. * THANKS: Add bug reporter. Reported by Davide Canova. 2009-02-26 Eric Blake argv-iter: avoid variadic macro * gl/lib/argv-iter.h (_ATTRIBUTE_NONNULL_): Don't assume C99 variadic macros are portable yet; needed for at least IRIX/MIPSpro. * THANKS: Update. Reported by Stuart Shelton. 2009-02-26 Pádraig Brady tests: Remove system specific error strings * tests/dd/skip-seek-past-file: Just check for the non system specific part of the error strings. This was causing an erroneous failure on NetBSD 1.6 at least. 2009-02-25 Jim Meyering tests: using printf with \e for ESC isn't portable * tests/ls/color-clear-to-eol: Use \33, not \e for ascii ESC. This test failed when using the built-in printf of /bin/sh from NetBSD 1.6. 2009-02-24 Pádraig Brady Ensure comment for translators is included in po file Issue reported by Göran Uddeborg. * src/system.h: Move the translator comment adjacent to the translated string. * THANKS: Update Göran's email address. 2009-02-22 Tobias Stoeckmann truncate: fix typo in man page * man/truncate.x: Fix spelling. * THANKS: Update. 2009-02-22 Andrew Church doc: describe dd's status=noxref option * doc/coreutils.texi (dd invocation): Describe status=noxref. 2009-02-22 Jim Meyering tests: reenable temporarily-disabled tests using e.g., trap '' TTOU Revert "tests: skip newly-modified tests unconditionally..." This reverts commit 773a88d33f68e50a2919c8a8310c646a7e5fabc2. * tests/misc/stty: Don't skip. * tests/misc/stty-invalid: Likewise. * tests/mv/i-3: Likewise. 2009-02-22 James Youngman update James Youngman's email address * THANKS: Update James Youngman's email address 2009-02-21 Jim Meyering post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 7.1 * NEWS: Record release date. * README: Mention that c99-to-c89.diff is no longer maintained. tests: skip new install-C test if working directory is set-gid * tests/install/install-C: Use setgid-check. tests: skip newly-modified tests unconditionally, just to be safe * tests/misc/stty-invalid: Skip. * tests/misc/stty: Likewise. * tests/mv/i-3: Likewise. tests: don't let SIGTTOU/TTIN hang a backgrounded "make check" Running "make check &" would hang due to SIGTTOU and SIGTTIN signals. * tests/misc/stty: Ignore SIGTTOU. * tests/misc/stty-invalid: Likewise. * tests/mv/i-3: Ignore SIGTTIN. 2009-02-20 Jim Meyering doc: ls: clarify description of -s * src/ls.c (usage): Make the description of -s mention "allocated size", so that it's less likely to be confused with an apparent byte-count. Suggested by Vito Caputo. 2009-02-19 Jim Meyering doc: dd: document that the default block size is 512 bytes * src/dd.c (usage): Document the default block size. * doc/coreutils.texi (dd invocation): Document that the default block size (bs, ibs, obs) is 512 bytes. Reported by Petr Uzel. 2009-02-18 Jim Meyering maint: changing NEWS' copyright date must not invalidate checksum * maint.mk (NEWS_hash): Don't let the Copyright date line contribute to the checksum. * cfg.mk (old_NEWS_hash): Update to reflect the new policy. doc: explain how to recover from changes committed to master * HACKING: A beginner's commit-to-master is so common, and causes enough confusion, that we describe how to recover. maint: add copyright notices * HACKING: Add copyright notice. * tests/test-lib.sh: Likewise. 2009-02-18 Ondřej Vašík cp: -a now preserves SELinux context, with reduced diagnostics * copy.c (copy_reg): Reduce SELinux context diagnostics for 'cp -a'. (copy_internal): Likewise * copy.h (cp_options): Add boolean reduce_diagnostics. * cp.c (usage): Say that --archive (-a) behaves like -dR --preserve=all. (cp_option_init): Initialize added reduce_diagnostics. (main): Add reduce_diagnostics for the -a option, and preserve SELinux context, if possible. * mv.c (cp_options_init): Initialize new cp_options booleans. * install.c (cp_option_init): Likewise. * NEWS: Mention those behaviour changes. * doc/coreutils.texi: Document --preserve=context, document that diagnostics are not shown for failures of non-mandatory attributes (just SELinux at the moment). * tests/cp/cp-a-selinux: Check not only failures, but succesful use of preserving SELinux context in cp. 2009-02-18 Eric Blake add missing copyright dates * NEWS: Add 2009 to copyright. * README: Likewise. * README-hacking: Likewise. * TODO: Likewise. * doc/Makefile.am: Likewise. * m4/prereq.m4: Likewise. * src/nl.c: Likewise. * src/seq.c: Likewise. * tests/cp/cp-i: Likewise. * tests/install/install-C: Likewise. * tests/install/install-C-root: Likewise. * tests/install/install-C-selinux: Likewise. * tests/misc/seq: Likewise. * tests/mv/mv-n: Likewise. 2009-02-17 Eric Blake install: compare files in binary mode * src/install.c (need_copy): Use O_BINARY when it matters. 2009-02-17 Kamil Dudka install: add --compare (-C) option to install file only when necessary * src/install.c (have_same_content): New function to compare files content. (extra_mode): New function checking for non-permission bits in mode. (need_copy): New function to check if copy is necessary. (main): Handle new option --compare (-C). (copy_file): Skip file copying if not necessary. (usage): Show new option --compare (-C) in --help. * tests/install/install-C: Basic tests for install --compare (-C). * tests/install/install-C-root: Tests requiring root privileges. * tests/install/install-C-selinux: Tests requiring SELinux. * tests/Makefile.am: Add new tests for install --compare (-C). * doc/coreutils.texi: Document new install option --compare (-C). * NEWS: Mention the change. 2009-02-17 Ondřej Vašík nl: correct long-option name for -v in usage * nl.c (usage): Use --starting-line-number, not --first-page for -v 2009-02-15 Jim Meyering doc: id: make --help and .man more descriptive * src/id.c (usage): Improve description, based on a suggestion from Brian M. Carlson in http://bugs.debian.org/514675 * man/id.x: Use a better one-liner, based on the one at top of id.c. 2009-02-15 Pádraig Brady seq: Fix equal width calculation when '.' added to last number Issue reported by Samuel Hapák. * src/seq.c: Account for '.' added to "last" number. * tests/misc/seq: Add corresponding test. * NEWS: Mention the fix. 2009-02-13 Jim Meyering du,chgrp,chmod,chown: use FTS_DEFER_STAT * src/du.c (main): Use FTS_DEFER_STAT, for better locality of inode reference. Important when traversing file systems with fake inodes. * src/chgrp.c (main): Likewise. * src/chmod.c (main): Likewise. * src/chown.c (main): Likewise. The only remaining fts client, chcon, doesn't need this, since it goes further and uses FTS_NOSTAT, which suppresses all non- directory stat calls. 2009-02-13 Pádraig Brady maint: mention how to run a single test in HACKING docs * HACKING: Give an example of how to run a test in isolation. * README: Fix/simplify example for running a single test. * README-hacking: Reference the HACKING file. 2009-02-12 Eric Blake ln: add details to --help text * src/ln.c (usage): Mention more about symlink properties. * doc/coreutils.texi (ln invocation): Likewise. * THANKS: Update. Reported by Vitali Lovich. 2009-02-10 Jim Meyering ls: clean up after wrapped+colored file names with clear-to-EOL This change addresses a relatively unusual case: ls --color, with a highlighted name being printed initially in the last row of a terminal emulator (possibly followed by other lines of output) such that it is wrapped onto the following line, as the terminal emulator scrolls the output. That would cause the entire following line to be highlighted, even if the name happened to use only one position. The least-invasive patch would have made colorized output larger for all uses. The approach taken below is more invasive, but limits the increase in overhead to only those lines that are expected to wrap. * src/ls.c (enum indicator_no): Add C_CLR_TO_EOL. (indicator_name): Add "cl". (color_indicator): Add default escape codes for "cl". (print_long_format): Propagate width to print_name_with_quoting. (print_name_with_quoting): Print new C_CLR_TO_EOL string if needed. Return the width of what we're printing. (print_file_name_and_frills): Propagate width. (print_type_indicator): Return bool (aka width). (print_many_per_line): Pass column position to print_* function. (print_current_files): Likewise. (print_horizontal): Likewise. (print_with_commas): Likewise. * src/dircolors.c (slack_codes): Add "CLRTOEOL". (ls_codes): Add "cl". * tests/ls/color-clear-to-eol: New file. Test for this fix. * tests/Makefile.am (TESTS): Add ls/color-clear-to-eol. * THANKS: Update. Reported by Alexander V. Lukyanov. See thread for details: http://thread.gmane.org/gmane.linux.kernel/740021/focus=14824 Thanks to Jan Engelhardt for helping me reproduce the problem. Demonstrate with this in an 80-column xterm: seq 200 # to start in the "bottom" row touch zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.foo env LS_COLORS='*.foo=0;31;42' ls -og --color=always Before the fix, you'd see something like this: (where the file name is printed in red on a green background, and each "=" denotes a space on a green background) ... -rw-r--r-- 1 0 Feb 5 11:31 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\ zzzzzzzzzzzzzz.foo=================================================== After the patch, the trailing green spaces are gone: -rw-r--r-- 1 0 Feb 5 11:31 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\ zzzzzzzzzzzzzz.foo 2009-02-10 Jim Meyering * tests/test-lib.sh: Use skip_test_... in place of echo...;exit 77. 2009-02-10 Nix tests: avoid skipping stty-* tests * tests/test-lib.sh (require_controlling_input_terminal_): Check stdout, not stdin. 2009-02-09 Jim Meyering touch: deprecate --file option: equivalent to --reference (-r) * src/touch.c: Mark long-undocumented --file for removal in 2010. (main): Warn upon use of --file. 2009-02-06 Pádraig Brady tests: fix dd skip=greater_max_file_size test on Solaris 10 * tests/dd/skip-seek-past-file: I had previously commented that on some systems lseek(> max file size) may succeed, but left the possibility of failure in that case, so that I could determine specific systems to put in the comments for both failure modes. 2009-02-05 Jim Meyering avoid spurious parentheses/arith-op-related warnings from newer gcc * src/copy.c (set_owner): Use && rather than &. * src/stty.c (main): Likewise. * src/wc.c (wc): Likewise. 2009-02-02 Jim Meyering maint: tighten atoi/atof-prohibiting regexp, clean up .x-sc- file * maint.mk (sc_prohibit_atoi_atof): Require "(" after token. * .x-sc_prohibit_atoi_atof: Remove names that no longer contain a match. doc: preserve --help line breaks in 'REPORTING BUGS' man page section * man/help2man: Insert .br between adjacent lines. * src/system.h (emit_bug_reporting_address): Remove periods. update copyright dates from recent changes * src/dd.c: Add 2009 to list of copyright years. * tests/dd/seek-skip-past-file: Likewise. * tests/dd/seek-skip-past-dev: Likewise. * m4/xattr.m4: Likewise. * src/copy.h: Likewise. * maint.mk (sc_redundant_const): Use $(_prohibit_regexp). 2009-02-02 jidanni@jidanni.org date doc: warn at -d about LC_TIME We also warn here about LC_TIME, so the user will know even if he doesn't look in the @xref{Date input formats}. document sort --ignore-case --unique interaction 2009-01-31 Jim Meyering maint: detect useless inclusion of c-ctype.h * maint.mk (sc_prohibit_c_ctype_without_use): New rule. 2009-01-29 Jim Meyering maint: teach "make syntax-check" to print each check name as it's run * maint.mk (%.m): New rules to print each syntax-checking rule name, just before running its commands. ($(syntax-check-rules)): Depend on it. maint: silence some syntax-check rules * cfg.mk (sc_strftime_check): Silence the rule. (sc_tight_scope): Likewise. * src/Makefile.am (check-AUTHORS): Likewise. maint: factor syntax-check rules * maint.mk (_ignore_case): New macro. (_prohibit_regexp): Use it. Factor many existing syntax-check rules to use $(_prohibit_regexp). 2009-01-29 Kamil Dudka cp/mv: add xattr support This patch was originally written by Andreas Grünbacher, nowadays available at http://www.suse.de/~agruen/coreutils/5.91/coreutils-xattr.diff * bootstrap.conf: Add gnulib module verror. * po/POTFILES.in: Add lib/verror.c. * m4/xattr.m4: Check for libattr availability, new configure option --disable-xattr. * m4/prereq.m4: Require gl_FUNC_XATTR. * src/Makefile.am: Link cp, mv and ginstall with libattr. * src/copy.h: Add preserve_xattr and require_preserve_xattr to cp_options. * src/copy.c (copy_attr_error): New function to handle errors during xattr copying. (copy_attr_quote): New function to quote file name in error messages printed by libattr. (copy_attr_free): Empty function requested by libattr to free quoted string. (copy_attr_by_fd): New fd-oriented function to copy xattr. (copy_attr_by_name): New name-oriented function to copy xattr. (copy_reg, copy_internal): Call copy_extended_attributes function. * src/cp.c (usage): Mention new --preserve=xattr option. (decode_preserve_arg): Handle new --preserve=xattr option. * src/mv.c: Always attempt to preserve xattr. * src/install.c: Never attempt to preserve xattr. * tests/misc/xattr: New test for xattr support in cp, mv and install. * tests/Makefile.am: Add the new test to list. * doc/coreutils.texi: Mention xattr support, new --preserve=xattr option. * NEWS: Mention the change. 2009-01-28 Jim Meyering system.h: add a comment re autoconf's new AC_PACKAGE_URL * src/system.h (emit_bug_reporting_address): Add a comment suggesting to use AC_PACKAGE_URL once we require autoconf-2.64. 2009-01-28 Pádraig Brady tests: Fixup shred-passes test * tests/misc/shred-passes: Set the $fail variable correctly. The issue was noticed by Jim Meyering. tests: Add a test to verify shred's default operations * tests/Makefile.am: add new test * tests/misc/shred-passes: Verify the operations shred does by default to overwrite and remove a zero length file. 2009-01-28 Pádraig Brady dd: Better handle user specified offsets that are too big Following are the before and after operations for seekable files, for the various erroneous offsets handled by this patch: skip beyond end of file before: immediately exit(0); after : immediately printf("cannot skip to specified offset"); exit(0); skip > max file size before: read whole file and exit(0); after : immediately printf("cannot skip: Invalid argument"); exit(1); seek > max file size before: immediately printf("truncate error: EFBIG"); exit(1); after : immediately printf("truncate error: EFBIG"); exit(1); skip > OFF_T_MAX before: read whole device/file and exit(0); after : immediately printf("cannot skip:"); exit(1); seek > OFF_T_MAX before: immediately printf("truncate error: offset too large"); exit(1); after : immediately printf("truncate error: offset too large"); exit(1); skip > device size before: read whole device and exit(0); after : immediately printf("cannot skip: Invalid argument"); exit(1); seek > device size before: read whole device and printf("write error: ENOSPC"); exit(1); after : immediately printf("cannot seek: Invalid argument"); exit(1); * NEWS: Summarize this change in behavior. * src/dd.c (skip): Add error checking for large seek/skip offsets on seekable files, rather than deferring to using read() to advance offset. (dd_copy): Print a warning if skip past EOF, as per FIXME comment. * test/Makefile.am: Add 2 new tests. * tests/dd/seek-skip-past-file: Add tests for first 3 cases above. * tests/dd/seek-skip-past-dev: Add root only test for last case above. 2009-01-27 Jim Meyering doc: emit better bug-reporting info, to help help2man * src/system.h (emit_bug_reporting_address): End each "sentence" with period, mark URLs with <...>. Based on a suggestion from Eric Blake. Use fputs on a string without %s, not printf. doc: ensure that emit_bug_reporting_address changes propagate to *.1 * man/Makefile.am ($(MAN)): Depend on system.h. doc: restore "REPORTING BUGS" section to generated man pages * man/help2man ($PAT_BUGS): Update regexp to match the newer "Report PROG bugs ..." --help output, as well as "Report bugs...". Reported by Eric Blake. 2009-01-26 Jim Meyering tests: generalize install-transform-check * maint.mk (install-transform-check): Generalize to work also in a project that installs manuals in a section other than "1". 2009-01-23 Jim Meyering build: resolve conflict with new declaration from version-etc.h * src/system.h (emit_bug_reporting_address): Define away, now, gnulib's version-etc.h also declares this function. In this package, we choose to include each program's name in the diagnostic. Define away the conflicting declaration. (emit_bug_reporting_address): Also emit home page and "General help..." links, like the new function does. Reported by Bob Proulx. 2009-01-23 Pádraig Brady doc: shred: Correct docs on default number of overwrites. * NEWS: Mention the change to the default number of passes. * doc/Makefile.am: Update constants.texi with the default number of passes shred uses, so that the documentation will automatically reflect any future changes. * doc/coreutils.texi (shred invocation): Update the description of the --iterations option to have the correct default number, while still conveying that there are 25 internal patterns that may be useful. 2009-01-22 Pádraig Brady shred: change default number of overwrites from 25 to 3 * src/shred.c: The concensus is that a default of 3 passes is appropriate for current drive technologies. * src/TODO: Reference Paul Eggert's suggestion of enhancing shred to conform to DoD 5220 rules. 2009-01-21 Jim Meyering m4: don't use AC_REQUIRE([AC_C_BIGENDIAN]) * m4/jm-macros.m4: Use AC_REQUIRE([gl_BIGENDIAN]) instead. This avoids a subtle problem recently documented in autoconf: http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=34e2c8d5484 2009-01-19 Jim Meyering no longer define *_FILENO constants * src/system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Remove definitions. Now guaranteed by gnulib. build: use dist-xz, not dist-lzma, cont'd * README-hacking: mention XZ utils * README-prereq: Add a FIXME comment. tests: tail-2/infloop-1 is racy * tests/tail-2/infloop-1: Add a comment to that effect. 2009-01-18 Jim Meyering build: use dist-xz, not dist-lzma * configure.ac (AM_INIT_AUTOMAKE): s/dist-lzma/dist-xz/. Requires recent "xz" from git://ctrl.tukaani.org/lzma-utils.git 2009-01-16 Jim Meyering maint: remove obsolete sc_author_mark_check rule * maint.mk (sc_author_mark_check): Remove rule. "and" no longer appears in the definition of AUTHORS. Merge branch 'master' of git://git.sv.gnu.org/coreutils maint: enforce existing prohibition: no cvs $keywords$ * maint.mk (sc_prohibit_cvs_keyword): New rule. echo, printf, test: remove unused #include directives * src/echo.c: Don't include "long-options.h". No longer used. * src/printf.c: Likewise. * src/test.c: Likewise. 2009-01-16 Pádraig Brady pathchk: avoid -Wsign-compare warnings * src/pathchk.c: Compare pathconf limits to _signed_ MAX constants, as pathconf returns signed values. pr: avoid -Wsign-compare warnings * src/pr.c: Use unsigned variables in unsigned comparisons. shred: avoid -Wsign-compare warnings * src/shred.c: Use already assigned signed variable sizeof_r, rather than the unsigned sizeof(r). Don't use signed integer overflow check that contemporary compilers may remove anyway. simplify mgetgroups() and avoid -Wsign-compare warnings * gl/lib/mgetgroups.c: Avoid -Wsign-compare warning by using unsigned types for the parameters of the new function realloc_groupbuf(). mgetgroups() was refactored to use this function rather than explicitly allocating and copying from automatic storage itself. * src/group-list.c: Use int rather than size_t as variable is used in signed comparisons. * src/id.c: ditto. 2009-01-14 Eric Blake test, echo, printf: don't accept option abbreviation * src/test.c (main): Directly parse accepted options, thus avoiding abbreviations. * src/echo.c (main): Likewise. * src/printf.c (main): Likewise. 2009-01-14 Kamil Dudka cp/mv: add --no-clobber (-n) option to not overwrite target * src/cp.c (usage): Show new option -n in --help. (main): Handle new option -n. * src/mv.c (usage): Show new option -n in --help. (main): Handle new option -n. * doc/coreutils.texi: Document new cp/mv option -n. * tests/cp/cp-i: Add tests for -f, -i and -n options. * tests/mv/mv-n: New test for mv -n. * tests/Makefile.am: Add test mv/mv-n to the list. * NEWS: Mention the change. 2009-01-08 Eric Blake option handling: make exceptions more consistent * doc/coreutils.texi (Common options): Not all utilities reject option abbreviations. * src/chroot.c (main): Report correct name on failure. * src/echo.c (usage): Clarify long option usage. * src/setuidgid.c (usage): Likewise. * src/hostid.c (usage): Condense. 2009-01-07 Jim Meyering * bootstrap.conf (avoided_gnulib_modules): Add dummy. * maint.mk: align some backslashes 2009-01-05 Pádraig Brady doc: pathchk description enhancements * doc/coreutils.texi (pathchk invocation): Mention pathchk checks validity (for current system) as well as portability. Say messages go to stderr, and reorder description of checks done for the -p option, to match what's done in code. * src/pathchk.c (usage): Mention pathchk checks name validity. Suggested clarifications were from Dan Jacobson. 2009-01-03 Pádraig Brady src/.gitignore: Ignore getlimits utility * src/.gitignore: Ignore getlimits tests: refactor to use the new getlimits utility * tests/Coreutils.pm: Add function to make limits available * tests/test-lib.sh: ditto * tests/misc/join: Check for both SIZE_OFLOW and UINTMAX_OFLOW rather than using arbitrary 2^128 * tests/misc/sort: ditto * tests/misc/uniq: ditto * tests/misc/printf: Check for both INT_OFLOW and INT_UFLOW rather than using arbitrary -2^31 * tests/misc/seq-long-double: Check for INTMAX_OFLOW rather than using arbitrary 2^63 * tests/misc/split-fail: Check --lines --bytes and --line-bytes options limits on all platforms. Note getlimits obviates the need to use expr to check if 32 bit integers are supported, which I think was invalid anyway as expr now supports bignum? * tests/misc/test: Check for UINTMAX_OFLOW rather than using arbitrary 2^64 and 2^128. Check for INTMAX_UFLOW rather than using arbitrary -2^64 * tests/misc/timeout-parameters: Check for UINT_OFLOW rather than using arbitrary 2^32 * tests/misc/truncate-overflow: Don't depend on truncate to determine if we're on a 32 or 64 bit platform and instead use the various OFF_T limits * tests/misc/sort-merge: Check for UINTMAX_OFLOW rather than using arbitrary 2^64+1 * tests/misc/unexpand: ditto 2009-01-03 Michael Meskes stat: print file-system total inode count (%c) as an unsigned number * src/stat.c (print_statfs): Print statfs.f_files, the total inode count of a file system, as an unsigned number. 2009-01-01 Jim Meyering tests: factor ls-misc (no semantic change) * tests/misc/ls-misc: Factor out uses of "\e[0m". update copyright year * doc/coreutils.texi: Likewise. * tests/sample-test: Likewise. 2009-01-01 Jim Meyering improve M4 quoting * configure.ac: Add quotes. * gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise. * m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise. * m4/check-decl.m4 (gl_CHECK_DECLS): Likewise. * m4/gmp.m4 (cu_GMP): Likewise. * m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise. (gl_CHECK_ALL_TYPES): Likewise. * m4/lib-check.m4 (cu_LIB_CHECK): Likewise. * m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise. FYI, I first ran this command: git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \ -e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \ -e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \ -e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g' Then I updated serial numbers and copyright dates manually. Also, I manually added two pairs of quotes in boottime.m4. 2009-01-01 Jim Meyering bootstrap: don't use cmp's -s option when reading from a pipe GNU cmp exits without reading all input when given the -s option, and that can cause termination of the writing process via SIGPIPE. Instead, when reading from a pipe, just redirect output to /dev/null so that all input is read. maint: factor out common code; prohibit use of HAVE_MBRTOWC * maint.mk (_prohibit_regexp): New macro. (sc_avoid_if_before_free, sc_cast_of_argument_to_free): (sc_cast_of_x_alloc_return_value, sc_cast_of_alloca_return_value): (sc_space_tab, sc_prohibit_atoi_atof, sc_prohibit_strcmp): (sc_prohibit_stat_st_blocks, sc_prohibit_S_IS_definition): Use it. (sc_prohibit_HAVE_MBRTOWC): New rule. maint: use more sc_-prefixed names * maint.mk (sc_po_check): Renamed from po-check. (sc_author_mark_check): Renamed from author_mark_check. (sc_copyright_check): Renamed from copyright-check. (sc_makefile_path_separator_check): Renamed from makefile_path_separator_check. (local-checks-available): Remove the old names. * Makefile.am (EXTRA_DIST): Reflect the renaming: .x-sc_po_check * .x-po-check: Rename to... * .x-sc_po_check: ...new file. maint: tighten m4 AC_ quoting check * maint.mk (sc_m4_quote_check): Renamed from m4-check. Also search for AC_DEFINE and AC_DEFINE_UNQUOTED. Also search in configure.ac. * configure.ac: Quote first argument of AC_DEFINE. * jm-macros.m4 (coreutils_MACROS): Quote the first argument to AC_DEFINE. maint: move coreutils-specific syntax check rules into cfg.mk * maint.mk (sc_dd_max_sym_length, sc_prohibit_jm_in_m4): (sc_root_tests, sc_always_defined_macros, sc_system_h_headers): (sc_sun_os_names, sc_tight_scope, sc_no_exec_perl_coreutils): Move rules into cfg.mk. (sc_strftime_check): Renamed from strftime-check, and moved, too. * cfg.mk: Add the above rules. portability: accommodate gnulib's getaddrinfo change * src/Makefile.am (pinky_LDADD, who_LDADD): Append $(GETADDRINFO_LIB) cleanup/modernize: don't test HAVE_MBRTOWC; now gnulib provides it * bootstrap.conf (gnulib_modules): Include mbrtowc explicitly. * src/ls.c (quote_name): Don't test HAVE_MBRTOWC, now that we're guaranteed to have the function. * src/wc.c (wc): Likewise. 2008-12-27 Eric Blake doc: mention long option abbreviation * doc/coreutils.texi (Common options): Give example of abbreviating options. * THANKS: Update. Reported by Adam Jimerson. 2008-12-26 Jim Meyering maint: ensure dd's computation of O_FULLBLOCK uses all O_ symbol names * src/dd.c (O_FULLBLOCK): Use a more uniform initializer, that makes it easier to extract all O_ symbol names. * maint.mk (syntax-check-rules): Also search for sc_ rules in cfg.mk. (sc_root_tests): Ensure that this rule sets $diff. * cfg.mk (sc_dd_O_FLAGS): New rule. 2008-12-26 Matt Harden dd: add support for opening files in Concurrent I/O (CIO) mode * src/dd.c (O_CIO): New flag. * src/dd.c (O_FULLBLOCK): Add O_CIO to the list of flags that O_FULLBLOCK should be greater than. * src/dd.c (flags): Give the name "cio" to the new O_CIO flag, mirroring the treatment of O_DIRECT. * src/dd.c (usage): Add a description of the new flag when it is available. * doc/coreutils.text (dd invocation): Describe the new flag. * NEWS: Mention the new feature. 2008-12-23 Jim Meyering build: do enable $(WERROR_CFLAGS) for src/ files. This reverts the more recent commit (of two) entitled "build: add configure-time --enable-gcc-warnings option; avoid warnings". Pádraig Brady spotted the contradiction between the log message and actual change. This reverts commit 292d68565a34b237cd2bf586ace545b7cd3dbfcf. 2008-12-23 Pádraig Brady doc: stty: Clarification of some input and output settings * doc/coreutils.texi (stty invocation): Clarify any ambiguity in regard to the direction of input and output settings. Add some notes on the case changing settings. Most of the text was supplied by Dan Jacobson. timeout: remove problematic casts * src/timeout.c (apply_time_suffix): Change input parameter from unsigned int to unsigned long, which is the type of the variable it's actually manipulating. This removes the need for the cast which was giving a warning with the gcc options: -fstrict-aliasing -Wstrict-aliasing. Also add a check for overflow possible on 16-bit platforms, and fix indents. (main): Remove a redundant cast in the alarm() call. 2008-12-21 Jim Meyering * .x-sc_require_config_h: Remove obsolete regexps. maint.mk: enforce the "include first" rule * maint.mk (sc_require_config_h_first): New rule. * .x-sc_require_config_h_first: New file. build: add configure-time --enable-gcc-warnings option; avoid warnings * bootstrap.conf (gnulib_modules): Add "warnings" module. * configure.ac: Add --enable-gcc-warnings, derived from code in bison. * src/Makefile.am (AM_CFLAGS): Set to $(WARN_CFLAGS) # $(WERROR_CFLAGS) * lib/Makefile.am (AM_CFLAGS): Change spelling to $(WARN_CFLAGS) Don't use $(WERROR_CFLAGS), yet. * src/system.h (usage): Declare. * src/base64.c (usage): Declare to be global, for consistency. * src/timeout.c (usage): Likewise. * src/truncate.c (usage): Likewise. * src/getlimits.c (usage): Likewise. * src/pinky.c (ttyname): Declare with prototype, rather than an empty argument list. * src/who.c (ttyname): Likewise. * src/su.c (crypt, getusershell, setusershell, endusershell): Likewise. build: turn on $(WERROR_CFLAGS) for src/ build: add configure-time --enable-gcc-warnings option; avoid warnings * bootstrap.conf (gnulib_modules): Add "warnings" module. * configure.ac: Add --enable-gcc-warnings, derived from code in bison. * src/Makefile.am (AM_CFLAGS): Set to $(WARN_CFLAGS) # $(WERROR_CFLAGS) * lib/Makefile.am (AM_CFLAGS): Change spelling to $(WARN_CFLAGS) Don't use $(WERROR_CFLAGS), yet. * src/system.h (usage): Declare. * src/base64.c (usage): Declare to be global, for consistency. * src/timeout.c (usage): Likewise. * src/truncate.c (usage): Likewise. * src/getlimits.c (usage): Likewise. * src/pinky.c (ttyname): Declare with prototype, rather than an empty argument list. * src/who.c (ttyname): Likewise. * src/su.c (crypt, getusershell, setusershell, endusershell): Likewise. 2008-12-17 Pádraig Brady doc: Remove curly quotes from shell examples in man pages Use \(aq rather than a literal ' as groff will convert apostrophe to a right quote (\u2029) in utf8 locales for example. Stepan Kasal details the issue and fix here: http://lists.gnu.org/archive/html/bug-coreutils/2008-12/msg00124.html 2008-12-16 Jim Meyering ChangeLog-2008: say ChangeLog files are no longer manually maintained and point to HACKING's policy. Suggestion from Dan Jacobson. du: -H now does what POSIX requires * src/du.c (usage): Update --help output. (main): Move -H-handling code from the --si block to the one for --dereference-args (-D). * doc/coreutils.texi (du invocation): Update description. * NEWS (Changes in behavior): Mention this. 2008-12-13 Jim Meyering doc: pr: formatting corrections * doc/coreutils.texi (pr invocation): Fix some overzealous uses of @var. Reported by Andreas Schwab. 2008-12-13 Ralf Wildenhues more portable bootstrap procedure * bootstrap (get_version): Fix portability issues in sed script. (check_versions): For buildreq apps, honor the corresponding $APP variable like $AMTAR, $AUTOCONF. (usage): Document this. (update_po_files): Honor $SHA1SUM. (main): Honor $AUTOPOINT, $ACLOCAL, $AUTOCONF, $AUTOHEADER, $AUTOMAKE, $LIBTOOLIZE. 2008-12-03 Jim Meyering tests: ensure that chmod, chgrp and chown honor --silent * tests/chmod/silent: New file, to test all three programs. * tests/Makefile.am (TESTS): Add chmod/silent. * NEWS (Bug fixes): Mention this. The bug was introduced in 96a5d2ce6a53d96cb667af78f13e56fadcdb91e6. 2008-12-03 Ondřej Vašík chmod, chown, chgrp: honor --silent (-f) once again * chmod.c (process_file): Make -f suppress fts-related diagnostics. * chown-core.c (change_file_owner): Likewise. Reported via . 2008-12-02 Jim Meyering wc: read and process --files0-from= input a name at a time, when the file name list is not too large. Before, wc would always read the entire file name list into memory and *then* process each file name. wc does read the list into memory when the list is known not to be too large; this is done in order to be able to align the output numbers, as it does with arguments specified on the command-line * src/wc.c: Include "argv-iter.h". (main): Rewrite to use argv-iter when the input file name list is known to be too large. * NEWS (Bug fixes): Mention it. du: read and process --files0-from= input a name at a time, rather than by reading the entire input into memory and *then* processing each file name. * src/du.c: Include "argv-iter.h", not "readtokens0.h". (main): Rewrite to use argv-iter. Call xfts_open on each argument, rather than on the entire argv list at once. Call print_size here, not from du_files. Diagnose read failure. * NEWS (Bug fixes): Mention it. * THANKS: update. Reported by Barry Kelly. More details in http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/15159/ 2008-12-01 Jim Meyering factor: plug a leak * src/factor.c (emit_ul_factor): Call mpz_clear. avoid warnings about initialization of automatic aggregates * src/system.h (DZA_CONCAT0, DZA_CONCAT): New macros. (DECLARE_ZEROED_AGGREGATE): New macro. * src/ls.c (quote_name): Use it. * src/pathchk.c (portable_chars_only): Use it. * src/shred.c (main): Use it. * src/stty.c (main): Use it. * src/wc.c (SUPPORT_OLD_MBRTOWC): Use it. * bootstrap.conf (gnulib_modules): Add argv-iter. argv-iter: add tests * gl/modules/argv-iter-tests: New module. * gl/tests/test-argv-iter.c: New file. argv-iter: new module * gl/lib/argv-iter.h: New file. * gl/lib/argv-iter.c: New file. * gl/modules/argv-iter: New file. With a suggestion for improved memory management by Pádraig Brady. * src/hostname.c (sethostname) [!HAVE_SETHOSTNAME]: Remove declaration. cp, mv: remove 3-year-deprecated+warned-about --reply option * src/cp.c (reply_args, reply_vals): Remove globals. [REPLY_OPTION]: Remove enum. (long_opts) ["reply"]: Remove initializer. (main): Remove case stmt. * src/mv.c: Likewise. Don't include "argmatch.h". No longer used. * NEWS (Changes in behavior): Mention this. * tests/Makefile.am (TESTS): Remove mv/reply-no. * tests/mv/reply-no: Remove file. * tests/mv/i-link-no: Update, now that --reply= is gone. 2008-12-01 Pádraig Brady doc: Make descriptions of ASCII NUL and --zero-terminated option consistent doc/coretuils.texi: Refactor shuf, sort and uniq --zero-terminated option to use the same text. Also refer to NUL characters as @acronym{ASCII} @sc{nul} consistently. 2008-12-01 Jim Meyering doc: enforce @var{lower} policy * doc/coreutils.texi: Fix remaining violations. * doc/Makefile.am (sc-lower-case-var): New rule. Add some command-suppressing "@" directives so that a successful "make check" run is less noisy. 2008-12-01 Pádraig Brady doc: Tweak info docs to standarise on lower-case @var{file} * doc/coreutils.texi: s/@var{FILE}/@var{file}/ doc: Improve description of --files0-from option * doc/coreutils.texi: Describe the most common usage of --files0-from=- to read names from stdin. * src/du.c: Likewise. * src/sort.c: Likewise. * src/wc.c: Likewise. tests: dd/reblock: Reduce chance of timing related failures * tests/dd/reblock: Change the IPC mechanism to the dd process under test, from pipes to fifos. Also change the delay between data writes to 0.2s for both tests. This should increase the chance that the dd process will read the data chunks separately. 2008-11-30 Jim Meyering m4: avoid a warning from gcc's -Wstrict-prototypes * m4/jm-macros.m4 (ARGMATCH_DIE_DECL): Use proper prototype for usage. tests: df: skip total-verify if df fails * tests/df/total-verify: Skip the test if df fails. build: don't reject definition of STREQ * maint.mk (sc_prohibit_strcmp): Tighten rule: exclude macro definitions like the one in system.h. * .x-sc_prohibit_strcmp: Don't exempt src/system.h. tests: start long-running cp/link-heap earlier * tests/Makefile.am (TESTS): Move cp/link-heap nearer the start of the list, so that its termination doesn't delay a parallel "make check". tests: avoid failure of cp/link-heap on some systems * tests/cp/link-heap: Raise virtual memory limit from 10,000 to 14,000, to avoid failure on Debian/unstable (libc6 2.7-16). remove explicit declaration of putenv, ... * src/date.c: ... now that gnulib guarantees that it's in . * src/env.c: Likewise. tests: dd/reblock: avoid occasional failure * tests/dd/reblock: Sleep longer to avoid a race condition. Reported by Bob Proulx. 2008-11-27 James Youngman pwd: add pwd -P, -L to TODO * TODO: Add to-do entry for -P and -L options of pwd. 2008-11-26 Ondřej Vašík doc: fix typo in units factorization, removed TODO items * doc/coreutils: switch typo (switched gibibytes/gigabytes) * TODO: removed missing chcon and runcon documentation from list 2008-11-26 Jim Meyering doc: factor out list of suffix-to-number (e.g., KB->1000B) mappings * coreutils.texi (multiplierSuffixes, multiplierSuffixesNoBlocks): New macros. (od invocation, head invocation, tail invocation, split invocation): (truncate invocation): Use them. doc: tail: one more s/bytes/n/ change * doc/coreutils.texi (tail invocation): Make one more @var{bytes} -> @var{n} change. 2008-11-26 Pádraig Brady doc: tail: fix description of --bytes=N (-c) * doc/coreutils.texi (tail invocation): Use @var{n} consistently, not a mix of that and @var{bytes}. Reported by anonymous in . 2008-11-23 Karl Berry doc: move @shortcontents and @contents from end to start * doc/coreutils.texi: Move @shortcontents and @contents from the end to the beginning, just after "@end titlepage". 2008-11-23 Jim Meyering doc (stat): clarify: there are two sets of format directives * doc/coreutils.texi (stat invocation): Clarify description of --file-system format directives. 2008-11-23 Karl Berry doc (stat): correct formatting in coreutils.texi * doc/coreutils.texi (stat invocation): Move the list of regular, non-file-system, format directives from the description of --terse, out of the enclosing table. 2008-11-22 Jim Meyering tests: dd: add a test for the required behavior * tests/dd/reblock: New file. Test for the required functionality. Based on an example and discussion from this thread: http://lists.gnu.org/archive/html/bug-coreutils/2008-11/msg00153.html * tests/Makefile.am (TESTS): Add dd/reblock. 2008-11-22 Pádraig Brady Revert part of "dd: avoid unnecessary memory copies" This reverts part of commit fbd87029cfc494a72bb73ade27ef46382c5bc832. Paul Eggert noticed the problem in http://lists.gnu.org/archive/html/bug-coreutils/2008-11/msg00153.html * doc/coreutils.texi (dd invocation): Clarify. 2008-11-21 Pádraig Brady getlimits: A new utility for use in coreutils' tests * src/getlimits.c: A utility to print platform dependent limits in a format suitable for use in shell scripts. * src/Makefile.am: Add getlimits to list of utilities to build but not install. Also add it to the list linked with libiconv * po/POTFILES.in: Add getlimits to translation list. dd: avoid unnecessary memory copies * src/dd.c (scanargs): When not otherwise required (e.g. for conversion), use two-buffer mode only when the input and output buffer sizes differ. Before, some of the most basic invocations of dd, e.g., dd < in > out, would unnecessarily use separate buffers and perform memory copies between them. 2008-11-20 Jim Meyering cp: use far less memory in some cases cp --link was "remembering" many name,dev,inode triples unnecessarily. cp was doing the same, even without --link, for every directory in the source hierarchy, while it can do its job with entries merely for the command-line arguments. Prompted by a report from Patrick Shoenfeld. Details . * src/copy.c (copy_internal): Refrain from remembering name,dev,inode for most files, when invoked via cp --link. Record an infloop-avoidance triple for each directory specified on the command line, not for each directory in the source tree. Don't record a dir-triple when x->hard_link is set. * NEWS (Buf fixes): Mention it. * tests/cp/link-heap: New file. Test for cp's lowered memory usage. * tests/Makefile.am (TESTS): Add link-heap. tests: add a test of cp --preserve=links * tests/cp/link-preserve: Add a case and comments. cp: remove unused code * src/cp-hash.c (remember_created): Remove unused function. Remove thus-obviated headers: , "quote.h", "error.h". * src/cp-hash.h (remember_created): Remove declaration. 2008-11-17 Jim Meyering doc: HACKING: reference http://www.gnu.org/licenses/why-assign.html Suggestion from Patrick Schoenfeld. 2008-11-16 Jim Meyering tests: remove debug code that would try to write into /t/k-env * tests/ls/no-cap: Remove debugging "tee". tests: change misc/printf-surprise so that it doesn't segfault anymore * tests/misc/printf-surprise: Disable MALLOC_PERTURB_, so that "make check" no longer provokes a segfault from printf(1). Before, that would be detected as a known problem and cause the test to be skipped. Adjust the test so that a segfault once again results in test failure. 2008-11-12 Jim Meyering tests: remove df/total * tests/df/total: Remove file. * tests/Makefile.am (TESTS): Remove df/total. It is subsumed by df/total-verify. 2008-11-12 Ondřej Vašík * tests/df/total-verify [VERBOSE]: Run df --version, not ls --version. 2008-11-12 Jim Meyering avoid spurious test failure when df always fails * tests/df/total-verify: Skip upon _df_ failure, not tee failure. Reported by Ondřej Vašík. Details in . 2008-11-11 Eric Blake jm-macros.m4: avoid syntax issue with newer autoconf * jm-macros.m4 (coreutils_MACROS): Make LIB_CAP assignment persistent. 2008-11-11 Jim Meyering Update references to GFDL: 1.2 -> 1.3 * doc/coreutils.texi: Likewise. * doc/perm.texi: Likewise. * old/fileutils/NEWS: Likewise. * old/sh-utils/NEWS: Likewise. * old/textutils/NEWS: Likewise. 2008-11-10 Jim Meyering make --help print "Report PROGRAM translation bugs to <...>." for all but the C/POSIX locale. * src/system.h: Include "hard-locale.h". (emit_bug_reporting_address): Tell where to report translation bugs. don't include "hard-locale.h", now that system.h does * src/comm.c: Likewise. * src/join.c: Likewise. * src/ls.c: Likewise. * src/pinky.c: Likewise. * src/pr.c: Likewise. * src/sort.c: Likewise. * src/uniq.c: Likewise. * src/who.c: Likewise. 2008-11-10 Jim Meyering avoid warnings about discarding "qualifiers from pointer target type" Use the new "bad_cast" function or an actual cast-to-"(char *)" to avoid warnings. * src/system.h (bad_cast): Define. * src/chown.c (main): * src/chroot.c (main): * src/date.c (main): * src/du.c (main): * src/expand.c (stdin_argv): * src/ls.c (decode_switches): * src/md5sum.c (main): * src/paste.c (main): * src/pr.c (col_sep_string, column_separator, line_separator, main): * src/sort.c (main): * src/split.c (main): * src/tail.c (main): * src/unexpand.c (stdin_argv): * src/yes.c (main): avoid a compiler warning (strip_program): Declare to be const. use xfreopen in place of unchecked freopen * bootstrap.conf (modules): Add xfreopen. * src/cat.c (main): Include "xfreopen.h". Use xfreopen. * src/cksum.c (cksum): Likewise. * src/head.c (head_file, main): Likewise. * src/md5sum.c (digest_file): Likewise. * src/od.c (open_next_file): Likewise. * src/split.c (type_undef): Likewise. * src/sum.c (bsd_sum_file, sysv_sum_file): Likewise. * src/tac.c (tac_file, main): Likewise. * src/tail.c (tail_file, main): Likewise. * src/tee.c (tee_files): Likewise. * src/tr.c (main): Likewise. * src/wc.c (wc_file): Likewise. * po/POTFILES.in: Add lib/xfreopen.c xfreopen: new module * gl/lib/xfreopen.c: New file. * gl/lib/xfreopen.h: New file. * gl/modules/xfreopen: New file. 2008-11-09 Jim Meyering Update URL: s!www.iro.umontreal.ca!translationproject.org/team/...! * Makefile.am (THANKS-to-translators): Update URL template. 2008-11-09 James Youngman install: indicate clearly it's not for installing packages * src/install.c (usage): Indicate the program copies files, as opposed to installing packages. 2008-11-08 Jim Meyering emit more precise bug-reporting instructions Hoping that this will decrease the volume of bug reports mistakenly directed to the coreutils mailing list. * src/system.h (emit_bug_reporting_address): Specify the program name in the "Report bugs to <...>." line in each program's --help output and man page. Now, it will say "Report PROGRAM_NAME bugs to <...>." Suggestion from Ondřej Vašík. 2008-11-05 Jim Meyering include gnulib's strdup module explicitly * bootstrap.conf (gnulib_modules): Include strdup explicitly, to keep the latest version of gnulib-tool from omitting this now-marked- as-obsolete module. 2008-10-28 Kamil Dudka ls: --color now highlights hard linked files, too * src/ls.c (print_color_indicator): Colorize hard linked files. * src/dircolors.c: Add color for hard link. * src/dircolors.hin: Add color for hard link. * tests/ls/hardlink: Test for ls - colorize hard linked files. * tests/Makefile.am (TESTS): Add ls/hardlink. * NEWS: Mention the change. 2008-10-28 Jim Meyering tests: ls/stat-failed: don't discard stderr. * tests/ls/stat-failed: Let stderr be recorded, to ease debugging. 2008-10-26 Jim Meyering tests: seq: check for today's extended long double fix * tests/misc/seq-long-double: New file. Test for today's bug fix. * tests/check.mk (TESTS_ENVIRONMENT): Export CC definition. * tests/Makefile.am (TESTS): Add misc/seq-long-double. * NEWS (Bug fixes): Mention it. 2008-10-26 Paul Eggert seq: improve quality of format-checking code * src/seq.c (validate_format): Remove. Migrate its checks into... (long_double_format): Report an error and exit if an error is found, instead of returning NULL. All callers changed. Use a more-consistent format for diagnostics. * tests/misc/seq: Adjust to the more-consistent format for diagnostics. 2008-10-25 Jim Meyering factor: avoid compilation failure without libgmp * src/factor.c (debug) [!HAVE_GMP]: Define. Reported by Bob Proulx. 2008-10-25 Paul Eggert factor: remove --bignum and --no-bignum options Here's a patch to remove the --bignum and --no-bignum options from 'factor'. The case for removing --bignum isn't as strong as that for 'expr', but still, it seems to me that these options are not needed and complicate the documentation unnecessarily. * doc/coreutils.texi (factor invocation): Remove --bignum, --no-bignum. * src/factor.c (algorithm, ALGORITHM_CHOICE, USE_BIGNUM, NO_USE_BIGNUM): Remove; all uses removed. (extract_factors_multi): Remove, replacing with.... (print_factors_multi): New function, with signature similar to that of new signature of print_factors_single. (print_factors_single): Migrate checking code to caller. (print_factors): Use GMP if it's available; don't bother asking user. Improve accuracy of check for "large" numbers. (long_options, main): Remove support for --bignum. 2008-10-25 Jim Meyering tests: df/total: don't fail for an inaccessible mount point * tests/df/total: Ignore nonzero exit status from df. 2008-10-25 Paul Eggert seq: revert Solaris 8 work-around that caused x86 regression * src/seq.c: Don't include , . (abs_rel_diff): Remove. (print_numbers): Test for equality, not for an epsilonish value. This reverts 4827dd27b0c655a685947aaa01426a5ecba179f3, aka v6.10-185-g4827dd2, which broke 'seq' on the x86; for example, it causes "seq 9223372036854775807 9223372036854775808" to incorrectly output 3 numbers instead of 2. It's better to punish obsolescent hosts that have incorrectly-working floating-point than to punish correctly-working hosts. * tests/misc/seq: Use 0.9000000000000, rather than 0.90000000000000000000, to avoid tickling a bug in Solaris 8 strtold, which converts "0.9" and "0.9000000000000" correctly, but incorrectly converts "0.90000000000000000000" to a smaller value. 2008-10-24 Eric Blake group-list: avoid compiler warning * src/group-list.c (print_group_list) [!HAVE_GETGROUPS]: Always return value. 2008-10-23 Jim Meyering ls: use '.' (not +) as SELinux-only alt. access flag in ls -l output * src/ls.c (gobble_file) [long_format]: Map SELinux-only to '.', any other nonempty combination of MAC and ACL to '+', and all else to the usual ' '. Suggested by Michael Stone. * tests/misc/selinux: Adapt: expect '.', not '+'. * doc/coreutils.texi (What information is listed): Document this. * NEWS (Changes in behavior): Mention it. 2008-10-22 Pádraig Brady Remove lzma as a specific build requirement * bootstrap.conf: lzma was added as a build requirement in the recently added build tools requirements check. Remove that as it's quite new and also only required for the make dist stage. 2008-10-22 Paul Eggert * src/ls.c (usage): Describe exit statuses more concisely. 2008-10-22 Pádraig Brady Add better checks and docs for build tools Prompted by a report from Ed Avis: * README-hacking: Organise LZMA and Valgrind as as optional requirements rather than in their own sections. Mention bootstrap will now check tool versions. * README-prereq: Make a start on specific instructions for optaining build tools. Currently we just have notes for Fedora linux. * bootstrap.conf: Add the list of tools and versions required. * bootstrap: Add the logic to check for the required tools, and list all required tools and versions if any are missing. 2008-10-22 Jim Meyering clean up gl/modules/selinux-at * gl/modules/selinux-at: Ensure that LIB_SELINUX is cleared, in case it's set in the environment. m4-quote the first two args to AC_SEARCH_LIBS. Don't violate autoconf's ac_ namespace: s/ac_save/gl_save/ Drop the useless double quotes around a simple assignment RHS. 2008-10-21 Jim Meyering move selinux-h module from gl/ to gnulib * gl/lib/se-context.in.h: Remove file. * gl/lib/se-selinux.in.h: Likewise. * gl/m4/selinux-context-h.m4: Likewise. * gl/m4/selinux-selinux-h.m4: Likewise. * gl/modules/selinux-h: Likewise. prepare to move selinux-h module to gnulib * gl/modules/selinux-h (Makefile.am) [selinux/selinux.h, selinux/context.h]: Remove temporary file and target, in case they're read-only. Use $(MKDIR_P), not mkdir -p. (License): Relax to LGPLv2+. Remove vestigial comments. tests: test today's ls-vs-capability fix Test for this fix: f3f1ccfd871ee395e7fafc051c1b7dedb39fdfc9. * tests/Makefile.am (TESTS): Add ls/no-cap. * tests/ls/no-cap: New file. 2008-10-21 Kamil Dudka ls: make it possible to disable file capabilities checking * ls.c (print_color_indicator): Do not check for file capability if that attribute is not being colored. Since 84f6abfe00b4ab533145623638b417a2221f9c75, ls --color would check each file for "capabilities". In , James Antill reported that ls --color seemed slower with capabilities detection. 2008-10-21 Jim Meyering reflect gnulib's removal of lstat.h * src/copy.h: Don't include "lstat.h". * src/ls.c: Likewise. * src/remove.c: Likewise. * src/rm.c: Likewise. 2008-10-20 Pádraig Brady expr: Fixup authors * src/expr.c: Standardise the format of AUTHORS to that used in other utils with multiple authors. Also add Paul Eggert since he basically rewrote it with his bignum fixes. * AUTHORS (expr): Add Paul Eggert. 2008-10-19 Jim Meyering accommodate gnulib header removals * src/copy.c: Don't include "euidaccess.h" or "lchmod.h". * src/cp.c: Don't include "lchmod.h". * src/ls.c: Don't include "dirfd.h". * src/mkdir.c: Don't include "lchmod.h". * src/pwd.c: Don't include "dirfd.h". * src/remove.c: Don't include "dirfd.h" or "euidaccess.h". * src/test.c: Don't include "euidaccess.h". * gl/modules/getloadavg.diff: Adjust diff for changed context. * src/uptime.c (uptime): Remove declaration. 2008-10-18 Jim Meyering * maint.mk (coreutils-path-check): New definition, now run only if src/true.c exists. Factored out of... (my-distcheck): ...here. 2008-10-17 Jim Meyering maint: avoid warning in ls.c * src/ls.c (has_capability) [!HAVE_CAP]: Add unused attribute. maint: avoid warnings due to attribute warn_unused_result Now that a (void) cast no longer suffices to ignore warnings from gcc about uses of functions marked with the warn_unused_result attribute, we need an alternative. For the record, here's one of the ignorable warnings: "copy.c:233: warning: ignoring return value of 'fchown', declared with attribute warn_unused_result" * bootstrap.conf (gnulib_modules): Import ignore-value. * src/copy.c: Include "ignore-value.h". (set_owner): Use ignore_value in place of "(void)" casts, to ignore lchown and fchown failures. * src/cp.c (re_protect): Likewise, to ignore lchown failure. * src/remove.c (preprocess_dir): Remove unnecessary "(void)" cast. 2008-10-16 Jim Meyering mktemp: diagnose freopen failure * src/mktemp [--quiet]: Don't ignore freopen failure. 2008-10-16 Paul Eggert * src/mktemp.c (main): Add 'const' twice to avoid GCC warning. 2008-10-16 Jim Meyering build: when po-check fails, say why and suggest a fix * maint.mk (po-check): Before, when this check failed, it just spat out a diff mentioning two temporary files. Now, it tells you what's wrong and suggests a fix with a patch using the name of the affected file (rather than temporary file names) in the diff output. 2008-10-16 Eric Blake csplit: prefer sigaction over signal * bootstrap.conf (gnulib_modules): Import sigaction. * src/csplit.c (sigprocmask, siginterrupt) [SA_NOCLDSTOP]: Delete workarounds. (interrupt_handler, main): Drop use of signal. Rely on sigaction to block fatal signal during cleanup, and to restore it to default in case of nested signals. 2008-10-15 Pádraig Brady tests: add option processing tests for 'expr' * tests/misc/expr: Add tests for various combinations of options where the first part of the expression could be confused with an option. 2008-10-15 Paul Eggert expr: remove --bignum and --no-bignum options * doc/coreutils.texi (expr invocation): Remove the --bignum and --no-bignum options. They weren't really needed, and they broke longstanding (albeit nonportable) scripts. * src/expr.c: Don't include . Include "inttostr.h", "long-options.h", "verify.h". Check at compile-time that size_t fits in unsigned long int, as the code assumes this in several places. (HAVE_GMP): Define to 0 if not defined, for convenience. (mpz_t, mpz_clear, mpz_init_set_ui, mpz_init_set_str, mpz_add): (mpz_sub, mpz_mul, mpz_tdiv_q, mpz_tdiv_r, mpz_get_str, mpz_sgn): (mpz_fits_ulong_p, mpz_get_ui, mpz_out_str): Supply substitutes when !HAVE_GMP, which work well enough for expr's purposes. (mp_integer): Remove. All integers are gmp, if gmp is available. (struct valinfo): Remove 'z' member; no longer needed. The 'i' member is always of type mpz_t. (enum arithmetic_mode, MP_NEVER, MP_ALWAYS, MP_AUTO, mode): Remove; no longer needed. (usage): Remove documentation of --bignum and --no-bignum. (integer_overflow): Abort if error misbehaves, to pacify GCC. Restore old message on arithmetic overflow, to be conservative. (die): Omit exit_status parameter; not needed (is always EXPR_FAILURE). (string_too_long, USE_BIGNUM, NO_USE_BIGNUM, long_options): Remove; no longer needed. (main): Don't use getopt_long; this breaks old nonportable scripts. (int_value): Arg is unsigned, in case we have strings whose length exceeds LONG_MAX (!). (int_value, freev, printv, null, tostring, toarith): (eval6, eval4, eval3): Always use mpz_ functions, to simplify the code. (substr_value): Remove; no longer needed. (getsize): Simplify the API: one arg rather than 3. Don't assume unsigned long int fits in size_t. (promote, domult, dodivide, doadd): Remove; no longer needed. * tests/misc/expr: Don't use --bignum to test for bignum support. Instead, use big numbers to test this. 2008-10-15 Jim Meyering expr: don't interpret argv[0] as an operand * src/expr.c (main): Given a first argument like -22 (negative, with two or more digits), expr would decrement optind to 0 and then attempt to evaluate argv[0]. doc: cp, mv: remove mention of deprecated --reply= option * doc/coreutils.texi (cp invocation, mv invocation): Don't mention it. 2008-10-13 Jim Meyering doc: adjust spacing in ls --help output, for better man formatting * src/ls.c (usage): Adjust spacing so the "Exit status:" list renders well in the help2man-generated man page. 2008-10-13 Ondřej Vašík doc: ls: clarify exit status description * src/ls.c (exit_status): Clarify comments. (usage): Clarify exit status description in --help output. * doc/coreutils.texi (ls invocation): Clarify exit status documentation Reported by Greg Metcalfe in . 2008-10-12 Jim Meyering doc: reorder tsort/ptx nodes so body and menu ordering are consistent * doc/coreutils.texi (tsort invocation, tsort background): Move these nodes "down", so that they follow the ptx nodes, thus matching the alphabetized order in the menu. (tsort background): Make this a subsection. Suggested by Karl Berry. tests: move check-misc targets from src/Makefile.am to maint.mk * src/Makefile.am (check): Remove check-misc. (check-misc): Remove target. * maint.mk (sc_prohibit_stat_st_blocks): New target. (sc_prohibit_S_IS_definition): New target. * Makefile.am (EXTRA_DIST): Add .x-sc_prohibit_stat_st_blocks. * .x-sc_prohibit_stat_st_blocks: New file. Andreas Schwab reported that "make check" could fail to detect violation of the no-S_IS*-definition policy. tests: df: avoid test failure when using mawk * tests/df/total-awk: Rewrite to use $PERL, not $AWK. mawk can't even count above 2^31. Reported by Ed Avis. http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14792/focus=14802 * tests/df/total-verify: Rename from total-awk. * tests/Makefile.am (TESTS): Reflect renaming. 2008-10-10 Jim Meyering bootstrap: merge from gnulib 2008-10-07 Ondřej Vašík doc: document runcon and chcon in SELinux context section * doc/coreutils.texi: Document runcon and chcon. Add minimal SELinux context section. 2008-10-06 Ondřej Vašík chcon: remove traces of unimplemented --change (-c) option This option was never supported in upstream coreutils. * chcon.c (usage): Remove --change (-c) from help message. (main): Remove 'c' from getopt string. Remove related and now-unused enums. 2008-10-06 Andreas Dilger stat: add lustre filesystem type * src/stat.c (human_fstype) [S_MAGIC_LUSTRE]: Add case. Make "stat -f" recognize the "Lustre" filesystem type. * NEWS: Mention this feature. 2008-10-06 Jim Meyering remove.c: avoid compile failure on OS/2 * src/remove.c (dirent_inode_sort_may_be_useful): Guard also with "#if defined __linux__". Reported by Elbert Pol. 2008-10-05 Jim Meyering post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update. version 7.0 * NEWS: Record release date. * maint.mk (alpha beta major): Add "-a" to git commit ... command. 2008-10-04 Jim Meyering tests: fix the install/strip-program test * tests/install/strip-program: Use $PREFERABLY_POSIX_SHELL, not POSIX_SHELL. The latter may be empty, and would fail on OpenBSD 3.9. * tests/check.mk (TESTS_ENVIRONMENT): Propagate PREFERABLY_POSIX_SHELL to tests. 2008-10-03 Jim Meyering timeout.c: don't use perror; exit 125 upon failed fork * src/timeout.c (main): Use "error", not perror. Elbert Pol noticed a build failure on OS/2. * src/timeout.c (main): Exit 125 (not errno) upon failed fork. Make the failed fork diagnostic match the one from install.c. 2008-10-03 Kamil Dudka ls and sort: use filevercmp instead of strverscmp * src/ls.c (cmp_version): Use filevercmp instead of strverscmp. * src/sort.c (usage): Remove mna reference to strverscmp(3). (compare_version): Use filevercmp instead of strverscmp. * bootstrap.conf: Add filevercmp to list of gnulib modules. * tests/misc/sort-version: Remove conflicting string and enhance test. * NEWS: Mention the change. 2008-10-02 Jim Meyering tests: skip a root-only test when configured without libcap * tests/ls/capability: Test for HAVE_CAP definition in config.h. 2008-10-02 Eric Blake ignore additional built file remove.c: allow compilation on cygwin * src/remove.c (dirent_inode_sort_may_be_useful) [!HAVE_STRUCT_DIRENT_D_TYPE]: Elide definition when there is no point in trying to use it. 2008-10-02 Jim Meyering bootstrap: merge from gnulib * bootstrap: add submodule support, git-merge-changelog 2008-10-01 Jim Meyering remove.c: combine two helper functions, to avoid sign-extension * src/remove.c (fs_handles_readdir_ordered_dirents_efficiently): Remove function, so as not to have to worry about the type of statfs.f_type and sign extension. (dirent_inode_sort_may_be_useful): Adjust comment. Perform the switch directly on the struct.member here, instead. Andreas Schwab spotted the potential for a sign-extension bug, that happens not to bite for the S_* f_type values currently used. rm: don't preprocess a directory on a file system of type tmpfs or nfs The preprocessing phase is not necessary on tmpfs, and induces a 20% performance decrease when removing a 2M-entry directory. * src/remove.c (fs_handles_readdir_ordered_dirents_efficiently): (dirent_inode_sort_may_be_useful): New functions from gnulib/fts.c. They'll probably become a gnulib module -- eventually. (preprocess_dir): Use dirent_inode_sort_may_be_useful. tests: use our new timeout program * tests/rm/ext3-perf: Also, record set-up duration and FS type. 2008-09-29 Ralf Wildenhues fix make variable quotation error * tests/check.mk (TESTS_ENVIRONMENT): Quote shell variable $tmp__, fix expansion. 2008-09-29 Jim Meyering seq: solve e13188e7ef7bbd609c1586332a335b4194b881aa more cleanly * src/seq.c (print_numbers): Don't switch c_strtold -> strtold in order to accommodate the locale-dependent behavior of our internal asprintf use. Instead, simply set the locale to C before calling asprintf, and then set it back afterwards. 2008-09-28 Jim Meyering build: avoid spurious valgrind warning about uses of touch * .vg-suppressions (utimensat-NULL): Avoid bogus valgrind warning that appears on at least Fedora 9. mktemp: plug an inconsequential leak * src/mktemp.c (main) [lint]: Free template. THANKS: add Erik Auerswald 2008-09-28 Eric Blake remove.c: avoid compiler warning * src/remove.c (compare_ino, dirent_count) [!HAVE_STRUCT_DIRENT_D_TYPE]: Mask declaration when unused. 2008-09-27 Jim Meyering rm -r: avoid O(n^2) performance for a directory with very many entries This enhancement works around a problem that is specific to at least ext3 and ext4 file systems. With them, it would take hours to remove a two-million-entry directory. RAM-backed file systems (tmpfs) are not affected, since there is no seek penalty. * remove.c (rm_malloc, rm_free, compare_ino): New functions. (dirent_count, preprocess_dir): New function. [struct readdir_data]: New struct. (remove_cwd_entries): Call preprocess_dir. * tests/rm/ext3-perf: New file. Test for the performance fix. * NEWS: mention the new feature 2008-09-27 Jim Meyering remove.c: don't use xmalloc; don't let obstack call exit on failure (obstack_chunk_alloc, obstack_chunk_free): Don't define. (top_dir): Param is no longer "const". Use malloc, not xmalloc, and call longjmp upon failed malloc. (obstack_init_minimal): New function. (ds_init): Don't use xmalloc. Instead, use caller-supplied buffer. Use obstack_specify_allocation_with_arg, not obstack_init, so that we control what happens upon allocation failure. Arrange for ds_free not to free uninitialized if/when any obstack_specify_allocation_with_arg allocation fails. (ds_free): Don't free DS, now that it's no longer malloc'd. (rm): Allocate DS on the stack. Arrange to handle ds_init allocation failure. step1 2008-09-27 Jim Meyering * maint.mk (my-distcheck): remove duplicate c99-related test code maint: allow more C99 constructs; stop maintaining c99-to-c89 patch set * cfg.mk (local-checks-to-skip): Add patch-check. With the recent changes to remove.c, I no longer wish to maintain the c99-to-c89 patch set. 2008-09-26 Jim Meyering seq -0.1 0.1 2: print final number when locale's decimal point is "," * src/seq.c (print_numbers): Use strtold, not c_strtold to convert from just-formatted-using-asprintf string back to double, since asprintf may have used something other than "." as the decimal point. Reported by lsof@nodata.co.uk as . Thanks to Ondřej Vašík for discovering that the bug was locale-related. $ LC_ALL=cs_CZ.UTF-8 seq -0.1 0.1 2|grep 2.0 [Exit 1] $ seq -0.1 0.1 2|grep 2.0 2.0 * tests/check.mk (TESTS_ENVIRONMENT): Add LOCALE_FR_UTF8, for... * tests/misc/seq [locale-dec-pt]: New test for the above. * NEWS (bug fix): Mention it. 2008-09-26 Jim Meyering maint: relax a check so "make distcheck" succeeds again * maint.mk (makefile-check): Relax the check, in order to exempt the necessary use of a sole @...@-delimited Makefile.am variable. 2008-09-24 Jim Meyering maint: avoid using find -name Makefile.am; could get false positives * maint.mk (makefile-check): Instead, search for the offending @...@ construct only in version-controlled files. 2008-09-24 Benno Schulenberg pinky: gettextize two missed strings Additionally differentiate the strings for unknown idle time and unknown real name so they can be translated differently. 2008-09-24 Jim Meyering cp.c: adjust a comment to make it consistent with documentation '-a' is equivalent to -dpR, so s/-dpPR/-dpR/; the -P is redundant, since -d already implies -P, and both --help and "info cp" say -dpR: Corresponding doc changes: 080ac7785071c7f135711a39e57c71d9057d9bd7 b7c2db676635518c06add0dd570543ae83e21f2e. 2008-09-22 Ralf Wildenhues fix installation with ./ginstall in src * src/Makefile.am (cu_install_program): New variable, set to either ./ginstall or @INSTALL_PROGRAM@ (for cross compilation). (INSTALL_PROGRAM): Override AC_SUBST unconditionally, to avoid warning, and wrong initialization order. 2008-09-22 Benno Schulenberg doc: alphabetize 'who's option descriptions * doc/coreutils.texi (who invocation): Alphabetize. 2008-09-19 Benno Schulenberg who --help: add a general description uptime --help: put together message parts that belong together tr --help: gettextize a single paragraph as a single string Breaking a paragraph into several strings is awkward for translators. tail: gettextize the string, "standard input" tail --help: move the --retry entry into alphabetical order * src/tail.c (usage): Also simplify --retry description, split a long string in two, remove a stray period, and add the usual indent. shred --help: lowercase a stray capital stty --help: correct the alignment of an entry * src/stty.c (usage): Also remove a stray period, and ungettextize a debugging message. sort --help: sort the options better alphabetically Take the opportunity to split the long message into three parts. rmdir --help: use lower case in option description; adjust indentation remove.c: move comment to right before string, so gettext will pick it up pr --help: elide arguments after short options that allow a space * src/pr.c (usage): Also, put the -S option with its description. od: ungettextize debugging messages nohup, remove, tr: also gettextize the alternative messages od --help: avoid concatening two messages without a newline src/od.c (usage): Better: make them into two separate paragraphs. mkfifo, mknod --help: put -Z option in its alphabetical position Options are normally sorted by their short form, not their long form. Also line up their descriptions. 2008-09-19 Jim Meyering doc: coreutils.texi (csplit invocation): Add an example. 2008-09-14 Ralf Wildenhues various VPATH-related fixes * maint.mk (VC_LIST): Prepend '$(srcdir)/'. (patch-check): Fix to make it work with a VPATH build. * src/Makefile.am (sc_tight_scope): Likewise. * man/Makefile.am (.x.1): Do not make outputs unwritable. 2008-09-14 Jim Meyering stat: remove obsolete and undocumented option, --filesystem * src/stat.c: Remove obsolete and undocumented --filesystem. 2008-09-13 Jim Meyering tests: reenable disabled test, now that automake can handle it This reverts the change in ae1c205fc473589d028ef63785926263843555cd. 2008-09-11 Jim Meyering tests: temporarily disable part of "make distcheck" * maint.mk (install-transform-check): Temporarily disable. tweak wording and check to avoid failure * doc/coreutils.texi (printf invocation): Tweak wording. * doc/Makefile.am (check-texinfo): Allow "search path". 2008-09-10 Jim Meyering doc: mention which commands may be built-in functions * doc/coreutils.texi (mayConflictWithShellBuiltIn): New macro. (mknod invocation, stat invocation, echo invocation) (printf invocation, test invocation, pwd invocation) (nice invocation, kill invocation, sleep invocation): Use it. (printf invocation): Invoke via "env" rather than using a literal /usr/local/bin/ prefix in examples. 2008-09-10 Ralf Wildenhues simplify installation rules, using new Automake This relies on development Automake to provide multi-file installation, and avoids relying on undocumented Automake interfaces. It also removes special-casing for `['. * configure.ac (AM_INIT_AUTOMAKE): Depend on 1.10a. (CROSS_COMPILING): New Automake conditional. * src/Makefile.am (install-exec-am, filtered_PROGS) (d_bindir, cu-install-binPROGRAMS): Remove. (INSTALL_PROGRAM) [!CROSS_COMPILING]: Set to `./ginstall'. fix minor shell issues in test suite * tests/misc/help-version: Fix bad quoting. * tests/cp/same-file: Fix unportable shell quoting. * tests/mv/part-symlink: Likewise. 2008-09-10 Jim Meyering tests: don't use "local" in bourne shell scripts * tests/test-lib.sh (remove_tmp_, skip_if_mcstransd_is_running_): Avoid failure on Solaris 11, since their /bin/sh passes the tests in posix-shell.m4, yet does not support "local" (which is not POSIX). 2008-09-10 Jim Meyering tests: use "Exit $fail", not (exit $fail); exit $fail * tests/test-lib.sh (Exit): New function by Ralf Wildenhues in automake http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=20594c08f63 * tests/**: Convert all uses: This restrictive change converted the vast majority: git grep -l '^(exit \$fail); exit \$fail$' \ | xargs perl -pi -e 's/'^\(exit \$fail\); exit \$fail$/Exit \$fail/' And this did the rest, plus a few undesirable ones, so I manually backed out the changes to ChangeLog-* and build-aux/check.mk: git grep -l -E '\(exit [^)]+\); exit ' \ | xargs perl -pi -e 's/\(exit (.+?)\); exit \1/Exit $1/' 2008-09-08 Jim Meyering tests: move input-tty into a test-lib.sh function * tests/test-lib.sh (require_controlling_input_terminal_): New function, from * tests/input-tty: ...here. Remove file. * tests/Makefile.am (EXTRA_DIST): Remove input-tty. * tests/mv/i-3: Use the function, not the file. * tests/misc/stty: Likewise. * tests/misc/stty-row-col: Likewise. * tests/misc/stty-invalid: Likewise. 2008-09-07 Jim Meyering tests: work around Solaris 11 bug * tests/misc/printf-surprise: Accept bogus prefix on stderr output. tests: don't let rounding-to-1KB blocks provoke a failure * tests/df/total-awk: Use df's --block-size=512 option. tests: don't fail due to built-in sleep from Solaris 11's /bin/sh * tests/misc/help-version (id_args): Invoke via env to ensure we run the just-built version of sleep. 2008-09-06 Kamil Dudka install: new option: --strip-program, ...to specify the program used to strip binaries * src/install.c (main): Handle new option --strip-program. (strip): Use strip program from global variable strip_program. (usage): Mention new option --strip-program in --help. * tests/tests/strip-program: Test case for new option --strip-program. * tests/Makefile.am: Add new test case to test set. * doc/coreutils.texi: Mention new option --strip-program. * NEWS: Mention the change. * TODO: Remove completed task. 2008-09-03 Kamil Dudka df: new option: --total to print grand totals * src/df.c (add_uint_with_neg_flag): New function to add two integral values with separate negation flag. (show_dev): New parameter force_fsu to display numbers directly. Collect summary statistics on each printed device. (usage): Mention new option --total in --help. (main): Initialize summary on program start. Handle new option --total. * tests/df/total: Dummy test case for new --total option. * tests/df/total-awk: Better test case for new --total option (requires awk). * doc/coreutils.texi: Mention new parameter --total. * NEWS: Mention the change. * TODO: Removed completed task. 2008-09-03 Jim Meyering TODO: add an item for a chmod optimization 2008-08-31 Jerry Snitselaar env, groups: remove duplicate inclusion of * src/env.c: Remove redundant #include. * src/groups.c: Likewise. Tiny change. 2008-08-26 Jim Meyering generate version.c and version.h * src/Makefile.am (version.c, version.h): New rules. Generate. (nodist_libver_a_SOURCES): Define * .gitignore: Add src/version.c and src/version.h. (DISTCLEANFILES): Add version.c and version.h. use new global, "Version", rather than macro, VERSION With this change, a version-string update no longer forces recompilation of 100+ src/*.o files. * src/version.c (Version): New global. New file. * src/version.h: Declare it. * src/Makefile.am: Put it in a library that everyone links to. (noinst_LIBRARIES, libver_a_SOURCES): Define. (LDADD): Add libver.a. (sc_tight_scope): Use perl (was sed), and a more relaxed regexp to build the global-variable-name-recognizing regexp list. * src/system.h: Include "version.h". (case_GETOPT_VERSION_CHAR): Use Version rather than VERSION. * src/basename.c (main): Use Version rather than VERSION. * src/chroot.c (main): Likewise. * src/cksum.c (main): Likewise. * src/dd.c (main): Likewise. * src/dirname.c (main): Likewise. * src/echo.c (main): Likewise. * src/hostid.c (main): Likewise. * src/hostname.c (main): Likewise. * src/link.c (main): Likewise. * src/logname.c (main): Likewise. * src/nice.c (main): Likewise. * src/nohup.c (main): Likewise. * src/printenv.c (main): Likewise. * src/printf.c (main): Likewise. * src/pwd.c (main): Likewise. * src/setuidgid.c (main): Likewise. * src/sleep.c (main): Likewise. * src/sync.c (main): Likewise. * src/test.c (main): Likewise. * src/timeout.c (main): Likewise. * src/true.c (main): Likewise. * src/tsort.c (main): Likewise. * src/unlink.c (main): Likewise. * src/uptime.c (main): Likewise. * src/users.c (main): Likewise. * src/whoami.c (main): Likewise. * src/yes.c (main): Likewise. bootstrap: preserve permissions of more copied files * bootstrap (cp_mark_as_generated): Preserve perms of copied files. Remove a kludge, now that this is fixed. 2008-08-23 Bruno Haible doc: clarify wc -L documentation * doc/coreutils.texi (wc invocation): Explain what the -L option measures. 2008-08-20 Eric Blake ls: adjust to gnulib change * src/ls.c (includes): "strverscmp.h" no longer exists. 2008-08-19 Eric Blake .gitignore: ignore more files * .gitignore: Ignore directories created by gnulib. .gitattributes: generalize * .gitattributes: Relax the glob pattern, so it matches *.texinfo, too. Suggest a POSIX BRE, rather than one that uses the GNU extension, \\+. sort: improve usage wording * src/sort.c (usage): Mention that -k defaults to end of line if POS2 omitted. * THANKS: Update. Reported by Tim Ryan. 2008-08-15 Jim Meyering adjust 2008-08-15 Bruce Korb sort: new option, --sort=version, for version number ordering * src/sort.c [struct keyfield] (version): New member. (usage): Describe --version-sort. (sort_options): Add 'V'. (long_options): Add "version-sort". (CHECK_TABLE, _ct_, SORT_TABLE, _st_): Define new macros. (check_args, sort_args, sort_types): Use these new macros in declarations. (ARGMATCH_VERIFY): Remove use. No longer needed. (compare_version): New function. (key_compare): Add a case. (check_ordering_compatibility): Handle new type. (main): Likewise. Reformat two expressions for readability. * tests/misc/sort-version: new test file * tests/Makefile.am: add it to the list * doc/coreutils.texi (sort invocation): Document it. * NEWS: Mention the new feature. 2008-08-14 Jim Meyering set envvars via "env" to avoid spurious set -x output from bad shells * tests/dd/misc: Set LC_ALL=C via env. * tests/cp/thru-dangling: Set POSIXLY_CORRECT via env. This is necessary at least on AIX 5.3. Reported by Jeph Cowan and Ralf Wildenhues. Details here: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14235/focus=14257 "expr --bignum 1" now fails when expr is built without libgmp * src/expr.c (main): When --bignum is requested, yet expr was built without libgmp, exit nonzero (3) in addition to giving a diagnostic. mktemp, sort, tac: don't use undefined after mkstemp failure When mkstemp fails, the template buffer may have undefined contents, so we must not print it. * src/sort.c (create_temp_file): Use temp_dir, not "file" when diagnosing failed mkstemp, because "file" may be undefined. * tests/misc/sort-merge: Adjust for new expected output. Jeph Cowan and Ralf Wildenhues reported the test failure: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14235/focus=14257 * src/tac.c (copy_to_temp): Don't use template buffer after failed mkstemp call, since its contents may be undefined. * tests/misc/tac (pipe-bad-tmpdir): New test for the above. * src/mktemp.c (main): Save a copy of the template string, solely for use in case mkstemp fails. * tests/misc/mktemp (pipe-bad-tmpdir): New test for the above. 2008-08-12 Benno Schulenberg kill: micro grammar nit in description of SIGNAL groups: let synopsis show that the command allows multiple usernames Also make the docstring say so. id: remove superfluous condition test; it is caught at -Z above id: gettextize a few missed tiny strings fmt: remove the 'no file' sentence; the standard phrase is given below Replace the sentence with a more useful explanation of -DIGITS. 2008-08-11 Benno Schulenberg echo: correct description of \c * src/echo.c (usage): Correct description of \c. * coreutils.texi (echo invocation): Likewise. * src/echo.c: Remove --help-duplicating comment. doc: the quote operator for expr is '+', not 'quote' factor: remove duplicate docstring; use the more detailed one echo: gettextize the alternative option description too dd: clarify meaning of multiplication factors; put xM in order doc: remove stray word from date's field width description date: remove confusing and unneeded sentence from --help It makes it unclear what 'sequences' refers to, and the -u option already says enough. printenv: say what it does when variables are specified doc: put the exitstatus paragraph in a better place * doc/coreutils.texi (tsort invocation): move two lines cp: move a newline to make second message identical to others who: Gettextize two forgotten strings 2008-08-10 Jim Meyering sort: remove unnecessary declaration of strtod * src/sort.c (STDC_HEADERS): Remove declaration of strtod. sort: avoid erroneous cast * src/sort.c (OPEN_MAX): Define if not already defined. (MAX_NMERGE): Remove definition. (specify_nmerge): Don't cast MAX_NMERGE (of type size_t) to unsigned int. Instead, use OPEN_MAX as the fall-back value. sort: don't print uninitialized in diagnostic * src/sort.c (specify_nmerge): Do use uinttostr value. Provoke with e.g., sort -m --batch-size=18446744073709551617 Omit quotes around known-numeric value in diagnostic. * tests/misc/sort-merge [nmerge-big]: Tighten ERR_SUBST regexp to require a numeric value in that diagnostic, so this particular failure cannot reappear. 2008-08-09 Jim Meyering * .gitattributes: Better diff output for texinfo sources. dd.c: reduce duplication in new O_FULLBLOCK-defining code * src/dd.c (MULTIPLE_BITS_SET): New macro, extracted from... (multiple_bits_set): ...this function. Use a single-line, and far simpler expression (no need to list all O_* symbols again) to validate the derived O_FULLBLOCK value. * coreutils.texi (factor invocation, expr invocation): Adjust wording. expr: avoid compiler warnings * src/expr.c (die): New "noreturn" function to wrap one-arg use of error (string_too_long): Use die rather than error. (toint): Remove definition of now-unused function. (eval6): Remove a little duplication. Use die rather than error. (dodivide): Remove declaration of now-unused variable. * tests/misc/expr: Add tests of the new GMP-based code. 2008-08-06 James Youngman expr: support arbitrary-precision arithmetic * src/Makefile.am (expr_LDADD): Link expr against GNU MP. * doc/coreutils.texi (expr invocation): Describe --bignum, --no-bignum. Explain the new arbitrary-precision functionality. * NEWS: Indicate that arbitrary-precision arithmetic is now supported in expr. * src/expr.c (enum valtype): Added mp_integer, signifying a GNU MP number. (usage): Document the new options --bignum and --no-bignum which force and prohibit the use of arbitrary-precision arithmetic, respectively. (long_options): data structure for getopt_long, which we need to use to parse the options mentioned above. (main): parse these options with getopt_long instead of parse_long_options. (valinfo): Downgrade the numeric member of the union from intmax_t to signed long, since MP lacks functions for promoting an intmax_t to an arbitrary-precision quantity. (enum arithmetic_mode): Represents the current choice between --bignum, --no-bignum and the default (automatically switch from one to the other if needed). (integer_overflow): issue a more explicit error message indicating that MP is not available. (string_too_long): new function, emits a fatal error message for the case where an argument to the 'index' expression is too long for a string offset to be represented. (int_value): With --bignum, create the value as mp_integer rather than plain integer. (substr_value): factored out of eval6; implements "substr". (freev): also destroy mp_integer values. Check that no mp_integer values exist if --no-bignum was specified. (printv, null, tostring): support mp_integer. (toint): new funtion for converting from string or mp_integer to integer. (getsize): extracts a size_t value from a VALUE object; used to implement substr. (promote): promotes a value from integer to mp_integer. (domult, dodivide): functions for multiplication and division, factored out of eval4. (doadd): addition/subraction function, factpred out of eval3. (eval3): support mp_integer types; call doadd. (eval4): support mp_integer types; call domult, dodivide. (eval6): support mp_integer offsets and lengths for "substr" and "index". * TODO: Mention that expr supports arbitrary-precision arithmetic, and suggest that this might also be a good idea for seq. * AUTHORS (expr): Add James Youngman. doc: mv,cp: undocument the --reply option * doc/coreutils.texi (mv invocation): Remove documentation for mv --reply. (cp invocation): Likewise. * NEWS: mention this. document the supported baud rates beyond 38400 * doc/coreutils.texi (Special): Document the supported baud rates beyond 38400. 2008-08-05 John David Anglin ls: ignore spurious getfilecon failure due to lack of SELinux support * src/ls.c (gobble_file): Upon failed getfilecon, treat an errno value of EOPNOTSUPP just like ENOTSUP. See . 2008-08-05 James Youngman Document uptime. * doc/coreutils.texi (uptime invocation): document uptime. * TODO: uptime is documented now. * src/uptime.c (print_uptime): Use fprintftime to print the time, rather than printf. This should make the situation better for translations. 2008-08-04 Benno Schulenberg doc: correct and normalize --help output of several tools * src/chroot.c (usage): Add "[ARG]" to synopsis. * src/cut.c (usage): Remove an inconsistent period in an option description. * src/du.c (usage): Remove superfluous argument after short option -X. Also remove inconsistent uppercase and final period. Use a single indent level for prettiness. * src/shred.c (usage): Normalize the synopsis. * src/stty.c (usage): Options -F and --file are alternatives, cannot both be used. * src/sum.c (usage): -r does not overrule -s; the last one counts. * src/uptime.c (usage): Remove inconsistent space from the synopsis. * src/users.c: Likewise. 2008-08-04 Jim Meyering false: mark "false" description for translation * src/true.c (usage): Mark both strings with N_, so that the one for "false" is also extracted for translation. For consistency, mark both, although only the latter one needed it. Inspired by a patch from Benno Schulenberg. 2008-08-04 James Youngman factor: credit Torbjörn Granlund * src/factor.c: Credit Torbjörn Granlund as the author of the arbitrary-precision factorization code. 2008-08-03 Jim Meyering doc: make it clear we're talking about the Linux kernel * doc/coreutils.texi (mv invocation): tweak wording 2008-08-02 Ralf Wildenhues tests: fix build-aux/check.mk for non-GNU make * build-aux/check.mk ($(TEST_LOGS)) [!GNU_MAKE]: Check for a $(TESTS) test in the build dir, before one in srcdir. For details, see . * bootstrap: Fix unportable expr usage. 2008-08-01 Kamil Dudka ls: --color now highlights files with capabilities, too * src/ls.c: [HAVE_CAP] Include . (has_capability): New function for capability detection. (print_color_indicator): Colorize file with capability. * m4/jm-macro.m4: New configure option: --disable-libcap. Check for libcap usability. * src/Makefile.am (dir_LDADD, ls_LDADD, ...): Append $(LIB_CAP). * src/dircolors.c: Update color lists. * src/dircolors.hin: Mention new CAPABILITY color attribute. * tests/ls/capability: Test for ls - colorize file with capability. * tests/Makefile.am (root_tests): Add ls/capability. * NEWS: Mention the change. 2008-08-01 James Youngman factor arbitrarily large numbers * m4/gmp.m4: New file; adds cu_GMP, which detects GNU MP. * configure.ac: Use cu_GMP. * src/Makefile.am: Link factor against libgmp if available. * src/factor.c: Use GNU MP if it is available. (emit_factor, emit_ul_factor, factor_using_division, factor_using_pollard_rho, extract_factors_multi, sort_and_print_factors, free_factors): new functions for the arbitrary-precision implementation, taken from an example in GNU MP. (factor_wheel): Renamed; was called factor. (print_factors_single): Renamed; was called print_factors. (print_factors): New function, chooses between the single- and arbitrary-precision algorithms according to availability of GNU MP and the length of the number to be factored. (usage, main): New options --bignum and --no-bignum. * coreutils.texi (factor invocation): Document new command-line options for the MP implementation and update the performance numbers to take into account the asymptotically faster algorithm. * TODO: Remove item about factoring large primes (it's done). * m4/gmp.m4: Add support for --without-gmp. * NEWS: Mention the new feature. 2008-08-01 Kamil Dudka ls -U1 now uses constant memory When printing one name per line and not sorting, ls now uses constant memory per directory, no matter how many files are in the directory. * ls.c (print_dir): Print each file name immediately, when possible. * NEWS: Mention the improvement. 2008-07-30 Jim Meyering * timeout.c: Fix grammar in a comment. Normalize comment syntax. 2008-07-28 Jim Meyering bootstrap: work also when there are no .po files in po/ * bootstrap (update_po_files): Complete the change that I began in 7ba2dd808232cff3ee76aaceb97f4381c3c9cde4. 2008-07-27 Jim Meyering * NEWS: Move shuf --zero-terminated item into bug-fixes section. 2008-07-27 Mikael Magnusson shuf: correctly document --head-count * src/shuf.c (usage): Correct --help output. * doc/coreutils.texi: Correct option listing. * NEWS: Mention correction. 2008-07-27 Jim Meyering shuf: honor --zero-terminated option even with --input-range=LO-HI * src/shuf.c (write_permuted_output): Add EOLBYTE parameter and use it rather than hard-coding "\n". (main): Adjust sole caller. * tests/misc/shuf: Add a test to exercise this bug fix. * NEWS: Mention it. 2008-07-23 Jim Meyering dd: minor fullblock changes * src/dd.c (O_FULLBLOCK): Define using an enum, not #define. Derive the value, rather than hard-coding to one that might conflict. (usage): Mention iflag=fullblock in --help output. (scanargs): Reset the O_FULLBLOCK bit, so that we don't try to set an undefined attribute via fcntl (fd, F_SETFL, ... * tests/dd/misc: Signal framework_failure when necessary. Use "compare actual expected", so any diffs look "right". * NEWS (dd): Alphabetize and reword. * coreutils.texi (dd invocation): Adjust wording. 2008-07-23 Kamil Dudka dd: new option: iflag=fullblock to accumulate full input blocks * src/dd.c (iread_fullblock): New function for reading full blocks. (scanargs): Check for new parameter iflag=fullblock. (skip): Use iread_fnc pointer instead of iread function. (dd_copy): Use iread_fnc pointer instead of iread function. * tests/dd/misc: Add test for dd - read full blocks. * doc/coretuils.texi: Mention new parameter iflag=fullblock. * NEWS: Mentioned the change. 2008-07-23 Jim Meyering dd: adjust --help output so help2man formats the man page properly * src/dd.c (usage): Use two spaces (not one) to separate "directory" from its description, so help2man formats the derived man page properly. 2008-07-23 Reuben Thomas doc: add example .bashrc code for a ~/.dircolors file * coreutils.texi: Add tip for .bashrc use from Jim Meyering. 2008-07-22 Jim Meyering tests: do not run chmod on a prefix of space-embedded tmpdir * TESTS/test-lib.sh (remove_tmp_): New function. (trap 0): Use it instead of open-coded (and misquoted) version. tests: ensure "make check" w/tainted build dir no longer impacts $HOME * maint.mk (taint-distcheck): New rule. (maintainer-distcheck): Make it. 2008-07-22 Ralf Wildenhues tests: again, do not change the mode of all directories below $HOME * tests/CuTmpdir.pm (chmod_tree): Do not run chmod on undefined argument, can happen when the build path contains spaces. 2008-07-19 Jim Meyering * THANKS: Update, now that I have a name for jemm4jemm. 2008-07-18 Andreas Schwab mknod: correct misplaced -Z description in --help output * src/mknod.c (usage): Put it after the "Mandatory arguments..." line. 2008-07-16 Jim Meyering dircolors.hin: add Ogg/Theora-related extensions * dircolors.hin: Add extensions from http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions Suggestion from jemm4jemm@yahoo.com. * HACKING: describe how to find a misplaced change-set 2008-07-15 Jim Meyering fix two bugs in ptx * src/ptx.c (fix_output_parameters): Don't let before_max_width go negative -- that would cause an infloop in define_all_fields. (main): Don't clobber name[0] with lists of two or more input files. * tests/misc/ptx: New file. Test for the above. * tests/Makefile.am (TESTS): Add misc/ptx. 2008-07-11 Pádraig Brady tests: expand: test for lines starting with both spaces and tabs The expand released in current distributions (Fedora Core 4 - Fedora 9 at least), doesn't expand --initial tabs if spaces are present. tests/misc/expand: Add test to verify --initial works correctly with lines starting with both spaces and tabs. 2008-07-10 Jim Meyering make check: accommodate stricter POSIX-conforming shells Without this, test-related variable settings were not exported to the shell_or_perl_ function when using dash or Solaris 11's /bin/sh. * tests/check.mk (TESTS_ENVIRONMENT): Use an explicit "export", so as not to rely on non-POSIX behavior of some /bin/sh (e.g., bash-based ones). 2008-07-06 Jim Meyering * bootstrap: Remove $bt and $bt2 also when not using gettext. 2008-07-04 Jim Meyering who -r: don't print "last=" when the corresponding byte is unprintable * src/who.c (print_runlevel): Print last=%c only when the "preceding run-level" byte is printable. Reported by Gian Piero De Lolliis in . 2008-07-04 Ondřej Vašík doc: describe who's -p, -r, and -t options * doc/coreutils.texi (who invocation): 2008-07-04 Jim Meyering install with just-built ./ginstall only when not cross-compiling * src/Makefile.am (install-exec-am): ...otherwise, use the default value, $(INSTALL_PROGRAM). Reported by Brian Silverman. * README-hacking: Update the section on LZMA. 2008-06-30 Pádraig Brady truncate: ignore whitespace in --size parameters Without this, `truncate -s '> -1' F` would truncate F to length 0, and `truncate -s " +1" F` would truncate F to 1 byte. Now, the first elicits a diagnostic, and the second works properly. * src/truncate.c: Skip leading white space in the --size option argument and any white space after one of the relative modifiers, so that the presence of a +/- modifier can be detected reliably. * tests/misc/truncate-parameters: Add tests for the above. 2008-06-28 Jim Meyering doc: add "..." to Usage, to indicate there may be multiple OPTIONs * src/base64.c (usage): Likewise. * src/cat.c (usage): Likewise. * src/md5sum.c (usage): Likewise. * src/mkdir.c (usage): Likewise. * src/mkfifo.c (usage): Likewise. * src/split.c (usage): Likewise. * src/stat.c (usage): Likewise. Heiko Marr reported the problem with mkdir. mkfifo: correct misplaced -Z description in --help output * src/mkfifo.c (usage): Put it *after* the "Mandatory arguments..." line. uniq: remove redundant test * src/uniq.c (find_field): Remove redundant test in outer loop- termination expression. Also, add a "const" attribute. 2008-06-27 Pádraig Brady timeout: fix invalid argument tests * tests/misc/timeout-parameters: Remove test for invalid signal number (we don't know what signal numbers are invalid on all systems). Also tweak the other invalid signal check so that the rest of the arguments are correct. 2008-06-27 Jim Meyering avoid a -Wsign-compare warning * src/tee.c (tee_files): Swap fwrite's size/n_elem args and compare the return value against "1". base64: don't rely on feof returning 0/1 * src/base64.c (do_decode): feof is specified to return nonzero, not 0/1, so use "k < 1 + !!feof(in)" as the loop termination test. 2008-06-27 Pádraig Brady truncate: silence -Wsign-compare warnings * src/truncate.c: Cast signed to unsigned to confirm intent which will silence -Wsign-compare warnings 2008-06-27 Jim Meyering factor out time_t-to-string conversion idiom * src/system.h: Include "inttostr.h". (timetostr): New function, factored out of... * src/date.c (show_date): Use timetostr. * src/du.c (show_date): Likewise. * src/ls.c (print_long_format): Likewise. * src/pinky.c (time_string): Likewise. * src/stat.c (human_time): Likewise. * src/*.c: Don't include inttostr.h, since system.h does. * src/c99-to-c89.diff: Adjust offsets. 2008-06-27 Pádraig Brady truncate: Fix integer portability issues * src/truncate.c: Explicitly convert from off_t to intmax_t when printing numbers as they may be different types. Also don't mix size_t and off_t types in operations as the latter will be promoted to unsigned when these types are the same size. 2008-06-26 Jim Meyering tests: adjust c99-to-c89 patch as well as the code to generate it * maint.mk (patch-check) [REGEN_PATCH]: Trim some trailing blanks. * src/c99-to-c89.diff: Adjust shred.c offsets. tests: fix make distcheck failure due to TODO change * maint.mk (po-check): Limit check for e.g., _(...)-marked messages to files matching *.? and *.??, thus excluding TODO and *.diff. * TODO: Add item: remove uses of imaxtostr. 2008-06-26 Peter O'Gorman tests: accommodate difference in an AIX 5.3 diagnostic * tests/mkdir/selinux: Handle different strerror (ENOTSUP) spelling. 2008-06-26 Jim Meyering shred: also ignore EISDIR upon failed fsync/fdatasync on HP-UX * src/shred.c (ignorable_sync_errno): New function. (dosync): Use it. Based on a patch from Peter O'Gorman. * HACKING: use shorter "-1" (over HEAD~1) with git format-patch bootstrap.conf: don't list "open" specifically It is no longer necessary to list it specifically, now that several gnulib modules depend on the "open" module. This reverts commit 3ea1fe588e20f196cc9b9907d5943bd620c6b944. truncate: handle the case in which off_t != intmax_t * src/truncate.c (parse_len): Use a temporary of type intmax_t, rather than off_t; detect out of range [OFF_T_MIN..OFF_T_MAX]. (main) [IF_LINT]: Initialize, to avoid an unwarranted "may be used uninitialized" warning. Reported by Michael Geng. 2008-06-23 Jim Meyering basename: List David MacKenzie as the author. * src/basename.c (AUTHORS): List David as the author. * AUTHORS: Update here, too. 2008-06-23 Ondřej Vašík echo: use AUTHORS from bash's built-in echo * AUTHORS,src/echo.c: Use bash builtin echo authors instead of FIXME unknown 2008-06-22 Jim Meyering use gnulib's "open" module * bootstrap.conf (gnulib_modules): Add open. This is required at least for Solaris 9 and HP-UX 11, to avoid a truncate test failure. For details, see this thread: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13755 stat: warn that the --context (-Z) option (a no-op) is obsolete * src/stat.c (main): It will be removed in a couple years. * NEWS (Change in behavior): Mention this. 2008-06-20 Jim Meyering make "make syntax-check" quieter * maint.mk (po-check, makefile-check, sc_proper_name_utf8_requires_ICONV): Add "@" prefix. 2008-06-20 Bo Borgerson sort: Fix bug where --batch-size option shrank SORT_SIZE. * src/sort.c (specify_nmerge, main): Only adjust SORT_SIZE if it's already set. * tests/misc/sort-merge: Test bug fix. 2008-06-19 Jim Meyering tests: avoid test failure when root's primary group-ID is not 0 * tests/cp/preserve-gid: Expect a cp-without-`-p'-created file to have a group ID of $(id -g). Reported by Jarod Wilson. Details in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13803/focus=13837 tests: avoid root-only test failure when run in a chroot * tests/misc/runcon-no-reorder: Accept the diagnostic that is produced when running in a chroot without /selinux/context. Reported by Jarod Wilson. Details in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13803/focus=13837 2008-06-18 Jim Meyering * tests/check.mk: Fix a typo in a comment. 2008-06-17 Jim Meyering doc: fix a syntax error * coreutils.texi (du invocation): Add missing comma. 2008-06-17 Bo Borgerson sort: accept new option --batch-size=NMERGE * src/sort.c: (static unsigned int nmerge) Replace constant NMERGE. (specify_nmerge) Validate and apply new option. (mergefps) Replace some arrays with pointers to xnmalloc'd storage. * tests/misc/sort-merge: Test new option. * doc/coreutils.texi: Describe new option. * NEWS: Advertise new option. sort: add new option --files0-from=F * src/sort.c: Support new option. * tests/misc/sort-files0-from: Test new option. * tests/misc/Makefile.am: Indicate new test. * docs/coreutils.texi: Explain new option. * NEWS: Advertise new option. HACKING: Add section for tips on reducing translator workload. * HACKING (Be nice to translators): New section. Add Jim's suggestion to avoid changing translatable strings if possible. 2008-06-17 Jim Meyering * THANKS: Add name and email for Carl Roth. 2008-06-17 Eric Blake ls, od: avoid redundant const * src/ls.c (long_time_format, sort_functions): Avoid redundant const. * src/od.c (charname): Likewise. * maint.mk (sc_redundant_const): Add rule to detect this. 2008-06-17 Bo Borgerson join: improve memory management * src/join.c (struct seq): Use a (struct line **) for `lines' rather than one long (struct line *). This allows individual lines to be swapped out if necessary. (reset_line): Get a line ready for new input. (init_linep): Create a new line and assign it to the the pointer passed in. (spareline[2]): Hold a spare line for each input file. (free_spareline): Clean up. (get_line): Take a (struct line **) instead of a (struct line *). If the line to be overwritten is the previous line for the current file then swap it out for the spare. (join): Accomodate new structure of SEQs and new parameters to get_line; Don't free stale lines until the end -- they're re-usable now. (dup_line): Remove function. * NEWS: Mention the performance improvement. 2008-06-16 Ralf Wildenhues * doc/coreutils.texi (join invocation): Drop leading blanks. 2008-06-16 Jim Meyering remove redundant const directives In 1463824d8e7f72c31f1d803d7cfe2b608ccafc5c, I added some missing "const" directives, as well as some new, redundant ones. This removes the redundant ones. Pointed out by Eric Blake. * base64.c, cat.c, chcon.c, chgrp.c, chmod.c, chown.c, comm.c: * cp.c, csplit.c, cut.c, date.c, dd.c, df.c, dircolors.c, du.c: * env.c, expand.c, fmt.c, fold.c, groups.c, head.c, id.c: * install.c, join.c, kill.c, ln.c, ls.c, md5sum.c, mkdir.c: * mkfifo.c, mknod.c, mktemp.c, mv.c, nice.c, nl.c, od.c: * paste.c, pathchk.c, pinky.c, pr.c, ptx.c, readlink.c, rm.c: * rmdir.c, runcon.c, seq.c, shred.c, shuf.c, sort.c, split.c: * stat.c, stty.c, su.c, sum.c, tac.c, tail.c, tee.c, timeout.c: * touch.c, tr.c, truncate.c, tty.c, uname.c, unexpand.c, uniq.c: * wc.c, who.c: Remove redundant const directives. * maint.mk (sc_const_long_option): Don't require redundant "const". chcon: correct --verbose output to include newlines * src/chcon.c (process_file): Append "\n" to --verbose diagnostic. * tests/misc/chcon: Add a test for the above. * NEWS: mention the bug fix Reported by Carl D. Roth in http://bugzilla.redhat.com/451478. 2008-06-15 Jim Meyering address root cause of compilation failures: The affected code wasn't even being compiled on my system, because HAVE_NL_LANGINFO was not defined. On other systems, where vasnprintf.m4 determines it needs %A or %a replacement support, it _would_ check for nl_langinfo, and expose the compilation failure. * m4/jm-macros.m4: Check for nl_langinfo, required by sort.c. fix the compilation failure for real * src/sort.c (monthtab): Neither "const" may be added. fix a const-related compilation failure in sort.c * src/sort.c (monthtab): Remove overzealous "const". Table entries are modified in an #if HAVE_NL_LANGINFO block. Introduced by 1463824d8e7f72c31f1d803d7cfe2b608ccafc5c. update HACKING guidelines * HACKING: Don't suggest --signoff; it's redundant. (log requirements): Specify preferred forms. Mention preference for "<" over ">". Mention the "const placement" preference. 2008-06-14 Jim Meyering run gnulib-tests in parallel * tests/Makefile.am: Define AUTOMAKE_OPTIONS, so check.mk can append. * tests/check.mk: Define SUFFIXES, so check.mk can append. * build-aux/check.mk (SUFFIXES): Append, so as not to evoke automake warning the prior definition in gnulib-tests/gnulib.mk. (AUTOMAKE_OPTIONS): Likewise. * gnulib-tests/Makefile.am (TEST_LOGS): Define. Include build-aux/check.mk * maint.mk (sc_proper_name_utf8_requires_ICONV) Fix typo in diagnostic. add "const" attribute, where possible * maint.mk (sc_const_long_option): New rule. Enforce global change. * src/base64.c (long_options): Use "const" where possible. * src/cat.c (main): Likewise. * src/chcon.c (long_options): Likewise. * src/chgrp.c (long_options): Likewise. * src/chmod.c (long_options): Likewise. * src/chown.c (long_options): Likewise. * src/comm.c (long_options, OUTPUT_DELIMITER_OPTION): Likewise. * src/cp.c (long_opts): Likewise. * src/csplit.c (longopts): Likewise. * src/cut.c (longopts): Likewise. * src/date.c (long_options): Likewise. * src/dd.c (conversions, flags, statuses): Likewise. * src/df.c (long_options): Likewise. * src/dircolors.c (long_options): Likewise. * src/du.c (long_options): Likewise. * src/env.c (longopts): Likewise. * src/expand.c (longopts): Likewise. * src/fmt.c (long_options): Likewise. * src/fold.c (longopts): Likewise. * src/groups.c (longopts): Likewise. * src/head.c (long_options): Likewise. * src/id.c (longopts): Likewise. * src/install.c (long_options): Likewise. * src/join.c (longopts): Likewise. * src/kill.c (long_options): Likewise. * src/ln.c (long_options): Likewise. * src/ls.c (long_time_format, long_options, sort_functions): Likewise. * src/md5sum.c (long_options): Likewise. * src/mkdir.c (longopts): Likewise. * src/mkfifo.c (longopts): Likewise. * src/mknod.c (longopts): Likewise. * src/mktemp.c (longopts): Likewise. * src/mv.c (long_options): Likewise. * src/nice.c (longopts): Likewise. * src/nl.c (longopts): Likewise. * src/od.c (charname, long_options): Likewise. * src/paste.c (longopts): Likewise. * src/pathchk.c (longopts): Likewise. * src/pinky.c (longopts): Likewise. * src/pr.c (long_options): Likewise. * src/ptx.c (long_options): Likewise. * src/readlink.c (longopts): Likewise. * src/rm.c (long_opts): Likewise. * src/rmdir.c (longopts): Likewise. * src/runcon.c (long_options): Likewise. * src/seq.c (long_options): Likewise. * src/shred.c (long_opts): Likewise. * src/shuf.c (long_opts): Likewise. * src/sort.c (monthtab, long_options): Likewise. * src/split.c (longopts): Likewise. * src/stat.c (long_options): Likewise. * src/stty.c (mode_info, control_info, longopts, set_mode) Likewise. (set_control_char, speeds): Likewise. * src/su.c (longopts): Likewise. * src/sum.c (longopts): Likewise. * src/tac.c (longopts): Likewise. * src/tail.c (long_options): Likewise. * src/tee.c (long_options): Likewise. * src/timeout.c (long_options): Likewise. * src/touch.c (longopts): Likewise. * src/tr.c (long_options): Likewise. * src/truncate.c (longopts): Likewise. * src/tty.c (longopts): Likewise. * src/uname.c (uname_long_options, arch_long_options): Likewise. * src/unexpand.c (longopts): Likewise. * src/uniq.c (longopts): Likewise. * src/wc.c (longopts): Likewise. * src/who.c (longopts): Likewise. revert previous change, "don't use "const" with scalar types" * src/truncate.c: There is nothing wrong with that construct. This reverts commit d7d80c5b7b122377fe250357a3ab182e8fbde20a. don't use "const" with scalar types * src/truncate.c: Several vendor compilers reject that. See http://article.gmane.org/gmane.comp.lib.gnulib.bugs/13876 2008-06-13 Eric Blake od: improve handling of padding * src/od.c (decode_one_format): Alter the format, again. (FMT_BYTES_ALLOCATED): Reduce size by adjusting to new format. (MAX_INTEGRAL_TYPE_SIZE): Move earlier in the file. (charname): Turn it into a 2D array, since there's no need for pointers now. (PRINT_TYPE, print_named_ascii, print_ascii): Add a width parameter. (write_block): Account for width parameter. Using ideas from Paul Eggert. od: align multiple -t specs * src/od.c (struct tspec): Add pad_width field, and adjust print_function prototype. (decode_one_format): Rewrite all fmt_string values to account for pad width. (FMT_BYTES_ALLOCATED): Adjust to new format style. (main): Compute pad width per spec. (write_block): Account for pad width. (dump): Don't print padding-only fields. (PRINT_TYPE, print_named_ascii, print_ascii): All print functions adjusted to use variable pad width. * tests/Makefile.am (TESTS): Add test. * tests/misc/od-multiple-t: New file. * THANKS: Update. * NEWS: Mention the improvement. Reported by Gary Johnson. od: use gnulib printf replacement as necessary * src/od.c (includes): Add xprintf.h. (PRINT_TYPE): New macro, using xprintf instead of printf. (print_s_char, print_char, print_s_short, print_short, print_int) (print_long, print_long_long, print_float, print_double) (print_long_double): Factor into PRINT_TYPE macro. (print_named_ascii, print_ascii): Use xprintf. * NEWS: Mention this as a bug fix. od: simplify long double support * m4/jm-macros.m4 (gl_CHECK_ALL_TYPES): Remove obsolete check for AC_C_LONG_DOUBLE. * src/od.c (LONG_DOUBLE): Delete. (width_bytes, MAX_FP_TYPE_SIZE, decode_one_format, main): Just use 'long double' directly. (print_long_double): No longer protect by HAVE_LONG_DOUBLE. doc: od defaults to -toS, not -td2 * src/od.c (usage): Correct description of default. 2008-06-13 Jim Meyering skip (don't fail) root-only tests for common set-up failures Address 2 of 4 failures reported by Jarod Wilson in http://bugzilla.redhat.com/442352. More details here: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13803 * tests/cp/cp-a-selinux: Skip the test if "mkfs -t ext2" fails. * tests/rm/fail-2eperm: Skip the test if "rm" is not accessible. 2008-06-12 Jim Meyering tweak to conform with syntax policy Use "<" or "<=" rather than ">" or ">=". Use "Type const *", rather than "const Type *". 2008-06-12 Bo Borgerson comm: accept new option: --output-delimiter=STR * src/comm.c (delimiter): New global. (writeline): Use delimiter string instead of single TAB character. (main): Initialize delimiter. * tests/misc/comm: Add tests for comm output delimiter specification. * doc/coreutils.texi: Document new option. * NEWS: Advertise new option. * TODO: Remove associated item. comm: ensure that input files are sorted * NEWS: List new behavior. * doc/coreutils.texi (checkOrderOption) New macro for describing `--check-order' and `--nocheck-order', used in both join and comm. * src/comm.c (main): Initialize new options. (usage): Describe new options. (compare_files): Keep an extra pair of buffers for the previous line from each file to check the internal order. (check_order): If an order-check is required, compare and handle the result appropriately. (copylinebuffer): Copy a linebuffer; used for copy before read. * tests/misc/Makefile.am: List new test. * tests/misc/comm: Tests for the comm program, including the new order-checking functionality and attendant command-line options. 2008-06-11 Jim Meyering fix another unportable use of 'tr' * configure.ac [EXTRA_PROGRAMS]: Add omitted space in tr's STRING2. Spotted by Denis Excoffier, upon Solaris 8 build failure. tests: skip a chown test on FreeBSD 6.x * tests/chown/separator: Skip this test if is likely to fail due to the combination of a bogus group name and a broken getgrnam function. tests: remove duplicate mention of misc/selinux * tests/Makefile.am (TESTS): Remove misc/selinux, since it's already listed in $(root_tests). 2008-06-11 Bruno Haible fix build failure on AIX 4 * configure.ac: Fix unportable invocation of 'tr', introduced on 2008-04-22. Affects tr from at least AIX 4.3.2. 2008-06-10 Pádraig Brady remove test for specific diagnostic when truncating missing directory Solaris 10 returns ENOTDIR when truncating a nonexistent directory, whereas Linux returns EISDIR (because it has a trailing /). * tests/misc/truncate-fail-diag: Remove the test for the specific error. timeout: use system-independent exit values Change exit values from ETIMEDOUT and ECANCELED, the values of which are system dependent, to 124 and 125 respectively. * src/timeout.c (EXIT_TIMEDOUT, EXIT_CANCELED): Define. (usage, main): Adjust. * coreutils.texi (timeout invocation): Update. * tests/misc/timeout: Adjust. 2008-06-09 Jim Meyering enforce the proper_name_utf8-requires-ICONV link rule * maint.mk (sc_proper_name_utf8_requires_ICONV): New rule. * src/Makefile.am (timeout_LDADD, truncate_LDADD): Add $(LIBICONV). 2008-06-09 Bruno Haible * NEWS (Improvements): Mention improved (via gnulib) ACL support. 2008-06-08 Jim Meyering maint.mk: my-distcheck runs $(MAKE) syntax-check once again * maint.mk (my-distcheck): Run $(MAKE) syntax-check once again. Run "$(MAKE) check" _after_ the less expensive syntax-check. 2008-06-08 Bo Borgerson standardize some error messages * maint.mk: (sc_error_message_warn_fatal, sc_error_message_uppercase): (sc_error_message_period): Add automatic checks for non-standard error messages. * .x-sc_error_message_uppercase: explicit exclusion for this check * src/cp.c: Standardize some error messages. * src/date.c: Likewise. * src/dircolors.c: Likewise. * src/du.c: Likewise. * src/expr.c: Likewise. * src/install.c: Likewise. * src/join.c: Likewise. * src/ln.c: Likewise. * src/mv.c: Likewise. * src/od.c: Likewise. * src/pr.c: Likewise. * src/split.c: Likewise. * src/truncate.c: Likewise. * src/wc.c: Likewise. * tests/du/files0-from: Expect new error message. * tests/misc/join: Likewise. * tests/misc/split-a: Likewise. * tests/misc/wc-files0-from: Likewise. * tests/misc/xstrtol: Likewise. * lib/xmemxfrm.c: Likewise. 2008-06-08 Jim Meyering syntax-check: detect anachronistic Perl-based tests * maint.mk (sc_no_exec_perl_coreutils): Rename and rewrite. 2008-06-06 Pádraig Brady Add new program: truncate * AUTHORS: Register as the author * NEWS: Mention this change * README: Add truncate command to list * src/truncate.c: New command * src/Makefile.am: Add truncate command to list to build * src/.gitignore: Add truncate binary to list to ignore * doc/coreutils.texi (truncate invocation): Add truncate info * man/Makefile.am: Add truncate man page to list to build * man/truncate.x: Add truncate man page template * po/POTFILES.in: Add truncate to list to translate * tests/Makefile.am: Add truncate tests * tests/misc/help-version: Add support for new truncate command * tests/misc/truncate-dangling-symlink: check dangling link ok * tests/misc/truncate-dir-fail: ensure dirs fail * tests/misc/truncate-fail-diag: validate messages for missing paths * tests/misc/truncate-fifo: ensure fifos ignored * tests/misc/truncate-no-create-missing: ensure -c option honoured * tests/misc/truncate-overflow: check signed integer overflows * tests/misc/truncate-owned-by-other: root permissions check * tests/misc/truncate-parameters: check invalid parameter combinations * tests/misc/truncate-relative: check invalid relative sizes 2008-06-06 Eric Blake improve 'date +%C' documentation * src/date.c (usage): Use 20, not 21, for current century. * THANKS: Update. Reported by Dameon G. Rogers, fix suggested by Philip Rowlands. 2008-06-03 Jim Meyering nice.c: avoid a cast * src/nice.c (main): Use argv[0], rather than "program_name with a cast". Suggestion from Eric Blake. adjust c99-to-c89 patch as well as the code to generate it * maint.mk (patch-check) [REGEN_PATCH]: Eliminate date-related differences in generated diffs. * src/c99-to-c89.diff: Adjust offsets. use gnulib's progname module * bootstrap.conf (gnulib_modules): Add progname. * src/*.c (program_name): Remove declaration. * (main): Call set_program_name rather than setting program_name. * src/nice.c (main): Cast program_name to "(char *)". * src/prog-fprintf.c: Include "system.h" * src/system.h: Include "progname.h". * maint.mk (sc_program_name): Adjust rule. Suggestion from Eric Blake. remove duplicate definition of matchpathcon_init_prefix * gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Remove definition. It is already defined there. Reported by Eric Blake. 2008-06-02 Jim Meyering fix cpp indentation policy violations * src/copy.c (mkfifo): Indent nested "# define". * src/timeout.c (ECANCELED): Likewise. accommodate older SELinux which lacks matchpathcon_init_prefix * m4/jm-macros.m4: Check for matchpathcon_init_prefix. * src/install.c [!HAVE_MATCHPATHCON_INIT_PREFIX] (matchpathcon_init_prefix): Define away. * gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Define. Reported by Ilya N. Golubev in . each file with a "main" must also declare program_name * maint.mk (sc_program_name): New rule. * .x-sc_program_name: New file. * Makefile.am (EXTRA_DIST): Add .x-sc_program_name. declare program_name consistently * src/base64.c: Likewise. * src/basename.c: Likewise. * src/cat.c: Likewise. * src/chcon.c: Likewise. * src/chgrp.c: Likewise. * src/chmod.c: Likewise. * src/chown.c: Likewise. * src/chroot.c: Likewise. * src/cksum.c: Likewise. * src/comm.c: Likewise. * src/cp.c: Likewise. * src/csplit.c: Likewise. * src/cut.c: Likewise. * src/date.c: Likewise. * src/dd.c: Likewise. * src/df.c: Likewise. * src/dircolors.c: Likewise. * src/dirname.c: Likewise. * src/du.c: Likewise. * src/echo.c: Likewise. * src/env.c: Likewise. * src/expand.c: Likewise. * src/expr.c: Likewise. * src/factor.c: Likewise. * src/fmt.c: Likewise. * src/fold.c: Likewise. * src/groups.c: Likewise. * src/head.c: Likewise. * src/hostid.c: Likewise. * src/hostname.c: Likewise. * src/id.c: Likewise. * src/install.c: Likewise. * src/join.c: Likewise. * src/kill.c: Likewise. * src/link.c: Likewise. * src/ln.c: Likewise. * src/logname.c: Likewise. * src/ls.c: Likewise. * src/md5sum.c: Likewise. * src/mkdir.c: Likewise. * src/mkfifo.c: Likewise. * src/mknod.c: Likewise. * src/mktemp.c: Likewise. * src/mv.c: Likewise. * src/nice.c: Likewise. * src/nl.c: Likewise. * src/nohup.c: Likewise. * src/od.c: Likewise. * src/paste.c: Likewise. * src/pathchk.c: Likewise. * src/pinky.c: Likewise. * src/pr.c: Likewise. * src/printenv.c: Likewise. * src/printf.c: Likewise. * src/ptx.c: Likewise. * src/pwd.c: Likewise. * src/readlink.c: Likewise. * src/rm.c: Likewise. * src/rmdir.c: Likewise. * src/runcon.c: Likewise. * src/seq.c: Likewise. * src/setuidgid.c: Likewise. * src/shuf.c: Likewise. * src/sleep.c: Likewise. * src/sort.c: Likewise. * src/split.c: Likewise. * src/stat.c: Likewise. * src/stty.c: Likewise. * src/su.c: Likewise. * src/sum.c: Likewise. * src/sync.c: Likewise. * src/tac.c: Likewise. * src/tail.c: Likewise. * src/tee.c: Likewise. * src/test.c: Likewise. * src/timeout.c: Likewise. * src/touch.c: Likewise. * src/tr.c: Likewise. * src/true.c: Likewise. * src/tsort.c: Likewise. * src/tty.c: Likewise. * src/uname.c: Likewise. * src/unexpand.c: Likewise. * src/uniq.c: Likewise. * src/unlink.c: Likewise. * src/uptime.c: Likewise. * src/users.c: Likewise. * src/wc.c: Likewise. * src/who.c: Likewise. * src/whoami.c: Likewise. * src/yes.c: Likewise. 2008-06-02 Eric Blake export program_name, required by gnulib * src/timeout.c (program_name): Export. 2008-06-02 Jim Meyering revert inadvertent change in last patch * configure.ac (AM_INIT_AUTOMAKE): Restore accidentally-modified options. Spotted by Eric Blake. 2008-06-02 Pádraig Brady new program: timeout * AUTHORS: Register as the author. * NEWS: Mention this change. * README: Add timeout command to list. * src/timeout.c: New file. * src/kill.c (operand2sig): Move function to its own file, now that timeout.c will also use it. * src/operand2sig.c (operand2sig): New file, extracted from kill.c. * src/operand2sig.h (operand2sig): Declare. * src/Makefile.am (EXTRA_PROGRAMS): Add timeout. * src/.gitignore: Add timeout binary to list to ignore. * doc/coreutils.texi (timeout invocation): Add timeout info. (Signal specifications): New section, also referenced by kill. * man/Makefile.am (timeout.1): Add dependency. * man/timeout.x: New file. * po/POTFILES.in: Add timeout.c and operand2sig.c to list to translate. * tests/Makefile.am (TESTS): Add the two new tests. * tests/misc/help-version: Add support for new timeout command. * tests/misc/invalid-opt: Add support for new timeout command. * tests/misc/timeout: New file: check basic timeout operation. * tests/misc/timeout-parameters: New file: check invalid parameter combinations. 2008-06-02 Jim Meyering spell author names consistently * src/comm.c (AUTHORS): Use RMS' middle initial. * src/ls.c (AUTHORS): Likewise. * src/rm.c (AUTHORS): Likewise. * src/uniq.c (AUTHORS): Likewise. * src/cut.c (AUTHORS): Use David M. Ihnat's middle initial. * AUTHORS: Update to match. Reported by Michael Piefel. 2008-06-01 Simon Josefsson doc: adjust base64 documentation * coreutils.texi (base64 invocation): Use RFC 4648 as the specification. Move the URL down a bit in the text. 2008-06-01 Erik Auerswald md5sum: new option, --quiet, to suppress OK messages sha1sum, sha224sum, sha384sum, and sha512sum accept it, too. * src/md5sum.c: add option --quiet to suppress OK messages * doc/coreutils.texi: document option --quiet * tests/misc/md5sum: add test for option --quiet * NEWS: mention new option --quiet for md5sum+sha*sum in "New features" section 2008-06-01 Jim Meyering add rules to commit three post-release changes automatically * maint.mk (noteworthy): Define. (emit-commit-log): Define. (alpha beta major): Also update NEWS and cfg.mk automatically, and commit all three changes at once. update old_NEWS_hash * cfg.mk (old_NEWS_hash): Update by running "make update-NEWS-hash". Reported by Erik Auerswald. 2008-06-01 Simon Josefsson src/base64.c: Improve comments. 2008-06-01 Jim Meyering * NEWS: add header line for next release adjust format of .prev-version commit message * maint.mk (alpha beta major): Start with "*", omit version number. * .prev-version: Record previous version. 2008-05-31 Jim Meyering Version 6.12. * NEWS: Record release date. install: reenable matchpathcon-related code The underlying performance problem is being dealt with in Automake by limiting the number of install invocations, and in SELinux with incremental changes as well as a potential new implementation. * src/Makefile.am (ginstall_CPPFLAGS) [ENABLE_MATCHPATHCON]: Define. * src/install.c [ENABLE_WHEN_MATCHPATHCON_IS_MORE_EFFICIENT]: Rename to ENABLE_MATCHPATHCON. * NEWS: mention this change 2008-05-30 Jim Meyering configure.ac: remove explicit use of AB_INIT * configure.ac: Don't invoke AB_INIT directly, now that it's done automatically via gl_INIT. tests: ignore known failure on all Darwin 8.x / Mac OS X v10.4.x * tests/chgrp/basic: Update comment and host_triplet version test. tests: avoid failure with older version of Perl's File::Temp * tests/CuTmpdir.pm (import): Use &File::Temp::cleanup only if it is defined. Reported by Bruno Haible in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13652 NEWS: mention that cp -p copies permissions more portably Based on wording suggested by Bruno Haible. 2008-05-29 Jim Meyering improve description of du's--separate-dirs option * coreutils.texi (du invocation): Prompted by Volker Badziong's report in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13646 du.c: tiny cleanup (no semantic change) * src/du.c (process_file): Use "file", rather than equivalent "ent->fts_path". 2008-05-27 Jim Meyering in 280+ tests/* files, use $srcdir, not $top_srcdir/tests prefer abs_srcdir over abs_top_srcdir, ... so that e.g., tests/* may refer to absolute names without hard-coding the name of the containing directory (tests/, here). * tests/check.mk (TESTS_ENVIRONMENT): Define abs_srcdir. * tests/pr/pr-tests: Use $abs_srcdir/pr not $abs_top_srcdir/tests/pr. * tests/chmod/c-option: Use $abs_srcdir, not $abs_top_srcdir/tests. * tests/cp/cp-parents: Likewise. * tests/mkdir/parents: Likewise. * tests/mkdir/perm: Likewise. * tests/mv/acl: Likewise. * tests/mv/backup-is-src: Likewise. * tests/mv/hard-link-1: Likewise. * tests/mv/into-self-2: Likewise. * tests/mv/leak-fd: Likewise. * tests/mv/mv-special-1: Likewise. * tests/mv/part-fail: Likewise. * tests/mv/part-hardlink: Likewise. * tests/mv/part-rename: Likewise. * tests/mv/part-symlink: Likewise. * tests/mv/partition-perm: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/mv/to-symlink: Likewise. * tests/rm/one-file-system: Likewise. * tests/sample-test: Likewise. tests: generalize my-distcheck * maint.mk (my-distcheck): Accommodate missing gnulib-tests. 2008-05-26 Jim Meyering reflect renaming of acl.c in gnulib * POTFILES.in: s/acl.c/set-mode-acl.c/ test installation results more thoroughly * maint.mk (my-distcheck): Ensure that properly-named binaries are installed. Also check all man pages, except [.1. Move configure-time --prefix= to install-time prefix=. (my-instcheck, install-transform-check): Define. install many binaries at once, when possible * src/Makefile.am (install-exec-am): Override the standard automake-generated target, so we can decide whether to use the usual install-one-by-one rule, or whether we can use the new install-many-at-once rule: (cu-install-binPROGRAMS): New rule. * src/runcon.c: Add copyright comment. adjust AUTHORS and check-AUTHORS rule to accommodate * AUTHORS: Add coding: utf-8 comment at end. Spell François' and Torbjörn's names properly. * src/Makefile.am: Parse AUTHORS file more carefully. Use perl to join now-split lines. Use en_US.UTF-8 to generate --version output. * src/c99-to-c89.diff: Adjust offsets. adjust copyright dates convert the rest to use proper_name -- manually * src/base64.c (AUTHORS): Rename from AUTHOR, for consistency. convert 3-author programs to use proper_name g grep -E -l 'define AUTHORS "[^,]+", "[^,]+", "[^,]+"$'|xargs perl -pi -e \ 's/(define AUTHORS) ("[^,]+"), ("[^,]+"), ("[^,]+")$/$1 \\\n proper_name ($2), \\\n proper_name ($3), \\\n proper_name ($4)/' convert 2-author programs to use proper_name g grep -E -l 'define AUTHORS "[^,]+", "[^,]+"$'|xargs perl -pi -e \ 's/(define AUTHORS) ("[^,]+"), ("[^,]+")$/$1 \\\n proper_name ($2), \\\n proper_name ($3)/' convert single-author programs to use proper_name g grep -E -l 'define AUTHORS "[^,]+"$'|xargs perl -pi -e \ 's/(define AUTHORS) ("[^,]+")$/$1 proper_name ($2)/' use gnulib's proper_name_utf8 function, but *not* proper_name * bootstrap.conf (gnulib_modules): Add propername. (XGETTEXT_OPTIONS): Add options to tell xgettext about the functions. * src/cat.c, src/cp.c, src/df.c, src/du.c, src/split.c: Mark Torbjörn Granlund's name. * src/ptx.c: Mark François Pinard's name. Use "TRANSLATORS:" comment marker, rather than "Note to translators:". * src/system.h: Include propername.h. (proper_name): Define away. * src/Makefile.am (cat_LDADD, df_LDADD, du_LDADD, ptx_LDADD, split_LDADD): Initialize, so we can... (cat_LDADD, cp_LDADD, df_LDADD, du_LDADD, ptx_LDADD, split_LDADD): ...Use "+=" to append $(LIBICONV) for each program that uses proper_name_utf8. 2008-05-24 Jim Meyering * POTFILES.in: Add lib/copy-acl.c. 2008-05-20 Jim Meyering install: avoid a leak in currently-ifdef'd-out code * src/install.c (setdefaultfilecon) [ENABLE_WHEN_MATCHPATHCON_IS_MORE_EFFICIENT]: Call matchpathcon_init_prefix only once. Suggestion from Stephen Smalley. Reported by Ben Webb in . 2008-05-19 Jim Meyering use gnulib's base64 module, now that it's sync'd to match this one * gl/lib/base64.c: Remove file. * gl/lib/base64.h: Remove file. 2008-05-19 Pádraig Brady doc: clarify field delimiter description in uniq --help output * src/uniq.c: Clarify in help output that field delimiters are blanks and not the larger set of whitespace characters. 2008-05-17 Jim Meyering tests: skip when a debian libc6-2.7-11 bug makes printf segfault * tests/misc/printf-surprise: Detect case of a low-memory-provoked segfault and skip the test (this is actually a bug in snprintf). For details, see http://bugs.debian.org/481543 tests: sync and update wc and du --files0-from tests * tests/du/files0-from: Sync from tests/misc/wc-files0-from. (minus-in-minus): New test. Adjust for new diagnostics. * tests/misc/wc-files0-from: Adjust for new diagnostics. du, wc: merge improved --files0-from=F-related diagnostics du gave a better diagnostic for one unusual case, and wc gave a better diagnostic for a different one. Now each diagnoses both unusual cases. * src/du.c (main): Disallow '-' as file name when reading from stdin. * src/wc.c (main): Give a better diagnostic for a zero-length file name. test invalid-option handling in all programs * tests/Makefile.am (TESTS): Add misc/invalid-opt. * tests/misc/invalid-opt: New file. 2008-05-17 Jim Meyering tests: remove ugly /bin/sh wrapper around each perl-based test script * tests/check.mk (TESTS_ENVIRONMENT): Save and restore TMPDIR around envvar-check, so that the few scripts that require $TMPDIR don't fail. This is also good to let a user's default TMPDIR setting be used e.g., in the search for an 'other-partition'. FIXME: this is pretty ugly. maybe undo it and find a better way. (TESTS_ENVIRONMENT): Invoke perl scripts with $(PERL), and use -T if the script requires that. Otherwise, use $(SHELL). * tests/misc/md5sum-newline: Create a file whose name contains a newline in Perl (resort to using "system", since open refuses). Fix old brokenness exposed by this change: * tests/du/files0-from: Correct test not to rely on stdin being attached to a non-tty. * tests/misc/sort (3g, 3h, 3i): Likewise: add explicit empty input file. Avoid warnings about using qw()-around-commas. * tests/rm/fail-eperm: Now that this test is run from a temporary subdirectory, adjust the full name of the "rm" program we're going to run. Change #!/bin/sh to #!/usr/bin/perl, and factor out the few lines of boilerplate code to invoke perl. Do not "require 5.00x"; a configure-time Perl test handles that * tests/dd/skip-seek: * tests/misc/base64: * tests/misc/basename: * tests/misc/cut: * tests/misc/date: * tests/misc/dircolors: * tests/misc/dirname: * tests/misc/expand: * tests/misc/expr: * tests/misc/factor: * tests/misc/fmt: * tests/misc/fold: * tests/misc/head: * tests/misc/head-elide-tail: * tests/misc/join: * tests/misc/ls-misc: * tests/misc/md5sum: * tests/misc/md5sum-newline: * tests/misc/mktemp: * tests/misc/od: * tests/misc/paste: * tests/misc/pr: * tests/misc/printf-cov: * tests/misc/seq: * tests/misc/sha1sum: * tests/misc/sha1sum-vec: * tests/misc/sha224sum: * tests/misc/sha256sum: * tests/misc/sha384sum: * tests/misc/sha512sum: * tests/misc/sort-merge: * tests/misc/stat-printf: * tests/misc/sum: * tests/misc/tac: * tests/misc/tail: * tests/misc/test: * tests/misc/test-diag: * tests/misc/tr: * tests/misc/tsort: * tests/misc/tty-eof: * tests/misc/unexpand: * tests/misc/uniq: * tests/misc/wc: * tests/misc/wc-files0-from: * tests/misc/xstrtol: * tests/mv/i-1: * tests/pr/pr-tests: * tests/rm/empty-name: * tests/rm/fail-eperm: * tests/rm/unreadable: 2008-05-16 Jim Meyering tests: allow to run Perl tests more cleanly Before this change, perl tests were run via a #!/bin/sh script in which perl was invoked via $(PERL) ... -- - <<\EOF. That made some stty tests fail due to the way stdin was usurped. * build-aux/check.mk (am__check_pre): Don't append $(SHELL) to this nominally automake-internal variable. * tests/check.mk (TESTS_ENVIRONMENT): Instead, define a shell function here, and append it to the more user-visible $(TESTS_ENVIRONMENT). tests: env-related clean up * tests/Coreutils.pm: tiny clean-up: s/env/env --/ * tests/misc/help-version: Use "env" rather than an absolute file name prefix. * tests/misc/printf-surprise: Likewise. tests: improve coverage of printf.c * tests/misc/printf-cov: New file. * tests/Makefile.am (TESTS): Add misc/printf-cov. * tests/misc/help-version: Use env rather than abs file name prefix. make HACKING slightly more generic * HACKING: remove some uses of "coreutils" Point to git's own SubmittingPatches URL. 2008-05-15 Bruno Haible doc: some Unicode characters cannot be specified via \u or \U * doc/coreutils.texi (printf invocation): Clarify invalid ranges for Unicode character escape syntax. 2008-05-11 Jim Meyering move sha256 and sha512 modules to gnulib * bootstrap.conf (gnulib_modules) [sha256, sha512]: Add "crypto/" prefix to module name, now that they come from gnulib. * gl/lib/sha256.c: Remove file. * gl/lib/sha256.h: Likewise. * gl/lib/sha512.c: Likewise. * gl/lib/sha512.h: Likewise. * gl/lib/u64.h: Likewise. * gl/m4/sha256.m4: Likewise. * gl/m4/sha512.m4: Likewise. * gl/modules/sha256: Likewise. * gl/modules/sha512: Likewise. 2008-05-10 Jim Meyering now that the last of the mk-script-using tests is gone... * tests/Makefile.am (EXTRA_DIST): Remove Makefile.am.in and mk-script. Move/adjust SUBDIRS-related comments. * tests/Makefile.am.in: Remove file, no longer used. * tests/mk-script: Likewise. * bootstrap: Remove coreutils-specific SUBDIRS-related code. tests: remove directory, tests/join/ * configure.ac (AC_CONFIG_FILES): Remove tests/join/Makefile. * tests/misc/join: New file, with tests from... * tests/join/Test.pm: ...here. Remove file. * tests/Makefile.am (SUBDIRS): Remove definition. * tests/misc/tac: Also perform stdin and piped tests. tests: convert pr tests * configure.ac (AC_CONFIG_FILES): Remove tests/pr/Makefile. * tests/Makefile.am (SUBDIRS): Remove pr. * tests/pr/pr-tests: New file, with tests from... * tests/pr/Test.pm: ...here. Remove file. * tests/Makefile.am (EXTRA_DIST): Add $(pr_data). (pr_data): List all of the pr's test-related data files. tests: remove directory, tests/tail/ * configure.ac (AC_CONFIG_FILES): Remove tests/tail/Makefile. * tests/Makefile.am (SUBDIRS): Remove tail. * tests/misc/tail: New file, with tests from... * tests/tail/Test.pm: ...here. Remove file. 2008-05-09 Bernhard Marx doc: improve description of "niceness" values * doc/coreutils.texi (nice invocation): 2008-05-09 Jim Meyering tests: remove directory, tests/sort/ * configure.ac (AC_CONFIG_FILES): Remove tests/sort/Makefile. * tests/Makefile.am (SUBDIRS): Remove sort. * tests/misc/sort: New file, with tests from... * tests/sort/Test.pm: ...here. Remove file. 2008-05-08 Bruno Haible Speed up "wc -m" and "wc -w" in multibyte case. * src/wc.c: Include mbchar.h. (wc): New variable in_shift. Use it to avoid calling mbrtowc for most ASCII characters. Reported via Jan Engelhardt in http://bugzilla.novell.com/381873 with discussion here http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13520 2008-05-08 Jim Meyering tests: remove directory, tests/tac/ * configure.ac (AC_CONFIG_FILES): Remove tests/tac/Makefile. * tests/Makefile.am (SUBDIRS): Remove tac. * tests/misc/tac: Many new tests, from... * tests/tac/Test.pm: ...here. Remove file. tests: remove directory, tests/test/ * configure.ac (AC_CONFIG_FILES): Remove tests/test/Makefile. * tests/Makefile.am (SUBDIRS): Remove test. * tests/misc/test: Many new tests, from... * tests/test/Test.pm: ...here. Remove file. tests: Coreutils.pm: support running a program that is a shell built-in * tests/Coreutils.pm (run_tests): Add support for running a program like 'test', that is a shell built-in. 2008-05-06 Jim Meyering * TODO: Bo Borgerson is rewriting support for cp --recursive tests: remove directory, tests/tr/ * configure.ac (AC_CONFIG_FILES): Remove tests/tr/Makefile. * tests/Makefile.am (SUBDIRS): Remove tr. * tests/misc/tr: Many new tests, from... * tests/tr/Test.pm: ...here. Remove file. * tests/tr/failures: Remove file. * tests/tr/TODO: Remove file. tests: skip another test if mcstransd is running * tests/test-lib.sh (skip_if_mcstransd_is_running_): New function, extracted from... * tests/misc/chcon: ...here. Use function, not open-coded test. * tests/misc/selinux: Use the function here, too. Require root, not non-root. * tests/Makefile.am (root_tests): Add misc/selinux. tests: translate uniq-z-test-adding code to new framework * tests/misc/uniq (add-z-variants): New function. Use it. tests: remove directory, tests/uniq/ * configure.ac (AC_CONFIG_FILES): Remove tests/uniq/Makefile. * tests/Makefile.am (SUBDIRS): Remove uniq. * tests/misc/uniq: Many new tests, from... * tests/uniq/Test.pm: ...here. Remove file. tests: remove directory, tests/cut/ * configure.ac (AC_CONFIG_FILES): Remove tests/cut/Makefile. * tests/Makefile.am (SUBDIRS): Remove cut. * tests/misc/cut: Many new tests, from... * tests/cut/Test.pm: ...here. Remove file. tests: remove directory, tests/head/ * configure.ac (AC_CONFIG_FILES): Remove tests/head/Makefile. * tests/Makefile.am (SUBDIRS): Remove head. * tests/misc/head: New file, derived from ... * tests/head/Test.pm: ...this. Remove file. * tests/head/in: Remove file. * tests/head/in-1024: Remove file. * tests/Coreutils.pm (triple_test): New function. 2008-05-06 Jim Meyering tests: Coreutils.pm improvements * tests/Coreutils.pm: Allow test names longer than 12. Print a useful diagnostic for bogus spec entry. Handle the combination of IN_PIPE and ENV properly. * tests/Coreutils.pm (run_tests): Put ENV right before command, not before the "cat INPUT_FILE |" prefix. 2008-05-06 Jim Meyering tests: move "sparse-file" into test-lib.sh * tests/sparse-file: Remove file Move contents into ... * tests/test-lib.sh (require_sparse_support_): ...here. New function. * tests/cp/sparse: Use the function, not the file. * tests/du/8gb: Likewise. * tests/Makefile.am (EXTRA_DIST): Remove sparse-file. tests: move "group-names" into test-lib.sh * tests/group-names: Remove file Move contents into ... * tests/test-lib.sh (require_membership_in_two_groups_): ...here. New function. * tests/chgrp/basic: Use the function, not the file. * tests/chgrp/default-no-deref: Likewise. * tests/chgrp/deref: Likewise. * tests/chgrp/no-x: Likewise. * tests/chgrp/posix-H: Likewise. * tests/chgrp/recurse: Likewise. * tests/cp/existing-perm-race: Likewise. * tests/Makefile.am (EXTRA_DIST): Remove group-names. tests: use printf+sed rather than yes+head+tr * tests/misc/fmt-long-line: Minor clean-up. Using "yes" like that has caused trouble in the past. tests: save and restore TERM around use of TESTS_ENVIRONMENT, now that TESTS_ENVIRONMENT unsets it. * check.mk (am__check_pre): Save $TERM. (am__check_post): Restore saved value of TERM and export. tests: hoist the sourcing of "lang-default" * tests/check.mk (TESTS_ENVIRONMENT): Source lang-default here, ... ... rather than in each of 100+ test scripts. * tests/chgrp/basic: * tests/chgrp/no-x: * tests/chmod/c-option: * tests/chmod/no-x: * tests/chmod/setgid: * tests/chmod/thru-dangling: * tests/chmod/umask-x: * tests/chmod/usage: * tests/chown/basic: * tests/chown/deref: * tests/chown/preserve-root: * tests/cp/abuse: * tests/cp/acl: * tests/cp/backup-is-src: * tests/cp/cp-a-selinux: * tests/cp/cp-i: * tests/cp/cp-mv-backup: * tests/cp/deref-slink: * tests/cp/fail-perm: * tests/cp/into-self: * tests/cp/link-preserve: * tests/cp/preserve-gid: * tests/cp/same-file: * tests/cp/slink-2-slink: * tests/cp/special-f: * tests/cp/symlink-slash: * tests/cp/thru-dangling: * tests/du/basic: * tests/du/hard-link: * tests/du/inacc-dest: * tests/du/long-sloop: * tests/du/no-x: * tests/install/basic-1: * tests/ln/hard-backup: * tests/ln/sf-1: * tests/ls/file-type: * tests/ls/infloop: * tests/ls/nameless-uid: * tests/ls/rt-1: * tests/ls/stat-failed: * tests/ls/symlink-slash: * tests/ls/x-option: * tests/misc/chcon: * tests/misc/chcon-fail: * tests/misc/csplit: * tests/misc/df-P: * tests/misc/groups-dash: * tests/misc/groups-version: * tests/misc/nohup: * tests/misc/printf-surprise: * tests/misc/runcon-no-reorder: * tests/misc/selinux: * tests/misc/split-a: * tests/misc/split-fail: * tests/misc/tac-continue: * tests/misc/wc-files0: * tests/mkdir/p-v: * tests/mkdir/selinux: * tests/mv/acl: * tests/mv/backup-dir: * tests/mv/backup-is-src: * tests/mv/childproof: * tests/mv/diag: * tests/mv/dir2dir: * tests/mv/dup-source: * tests/mv/force: * tests/mv/hard-link-1: * tests/mv/hard-verbose: * tests/mv/i-2: * tests/mv/i-3: * tests/mv/i-4: * tests/mv/i-5: * tests/mv/i-link-no: * tests/mv/into-self: * tests/mv/into-self-2: * tests/mv/into-self-3: * tests/mv/mv-special-1: * tests/mv/part-fail: * tests/mv/part-symlink: * tests/mv/partition-perm: * tests/mv/perm-1: * tests/mv/reply-no: * tests/mv/sticky-to-xpart: * tests/mv/update: * tests/rm/cycle: * tests/rm/dir-no-w: * tests/rm/dir-nonrecur: * tests/rm/fail-2eperm: * tests/rm/fail-eacces: * tests/rm/inaccessible: * tests/rm/interactive-always: * tests/rm/interactive-once: * tests/rm/isatty: * tests/rm/one-file-system: * tests/rm/r-1: * tests/rm/r-2: * tests/rm/rm1: * tests/rm/rm2: * tests/rm/rm3: * tests/rm/rm4: * tests/rm/rm5: * tests/rm/unread2: * tests/rm/v-slash: * tests/touch/fail-diag: * tests/touch/not-owner: tests: hoist envvar-check so it is run for every test I.e., also for Perl-based tests; not just the ones using test-lib.sh. * tests/check.mk (TESTS_ENVIRONMENT): Source envvar-check here, ... * tests/test-lib.sh: ...not here. fix typo in comments: s/ouput/output/ adjust spelling in that same comment: s/localisation/localization/ * tests/touch/Makefile.am: Remove now-unused file. tests: test split more thoroughly * tests/misc/split-a: Clean up. Catch more failures. * tests/misc/wc: Remove an unused variable. tests: detect and check more uses of strcmp * maint.mk (sc_prohibit_strcmp): Relax regexp to recognize other formatting styles. 2008-05-06 Jim Meyering avoid problems with sign-extended "char" operand to is* functions * src/cut.c (set_fields): Apply to_uchar to isblank operands. * src/uniq.c (find_field): Likewise. * src/seq.c (scan_arg): Likewise, for isblank. * tests/misc/uniq: New file. Test for the above, but only when isspace(0240). * tests/Makefile.am (TESTS): Add misc/uniq. * configure.ac: Use gt_LOCALE_FR. * tests/check.mk (TESTS_ENVIRONMENT): Propagate LOCALE_FR to scripts. * NEWS: Mention the bug fixes. Before this patch, on FreeBSD 6: $ printf 'x y z\nx \xa0 y z\n' > in $ LC_ALL=fr_FR.UTF-8 uniq -f2 in|tr ' ' . x.y.z x. .y.z With the patch: $ LC_ALL=fr_FR.UTF-8 uniq -f2 in|tr ' ' . x.y.z This also affected many other locales: for i in $(locale -a); do test $(LC_ALL=$i ./uniq -f1 in|wc -l) = $(LC_ALL=$i uniq -f1 in|wc -l) || echo $i ; done ... en_GB.ISO8859-1 en_GB.ISO8859-15 en_GB.UTF-8 en_IE.UTF-8 en_NZ.ISO8859-1 en_NZ.ISO8859-15 en_NZ.UTF-8 en_US.ISO8859-1 en_US.ISO8859-15 en_US.UTF-8 ... 2008-05-06 Bo Borgerson base64: remove some unused/redundant getopt code * src/base64.c (struct option long_option): Remove redundant help/version option items. (main): Remove unused 'q' from short options. 2008-05-06 Jim Meyering help2man: fix perl 5.10 problem properly * man/help2man: Do pull LC_ALL via "use POSIX". Instead, limit the importing of gettext-related symbols to just those two we'll use: gettext and textdomain. 2008-05-05 Jim Meyering help2man: avoid failure with Debian unstable's Perl 5.10.0 Avoid failure that produced this diagnostic: Constant subroutine main::LC_ALL redefined at /.../Exporter.pm * man/help2man: Don't include LC_ALL in the "use POSIX" list, since Locale::gettext->import will get it. 2008-05-05 Bo Borgerson base64 module: adjust API so it's compatible with gnulib's * gl/lib/base64.c (base64_decode_ctx): If no context structure was passed in, treat newlines as garbage (this is the historical behavior). Formerly base64_decode. (base64_decode_alloc_ctx): Formerly base64_decode_alloc. * gl/lib/base64.h (base64_decode): Macro for four-argument calls. (base64_decode_alloc): Likewise. * src/base64.c (do_decode): Call base64_decode_ctx instead of base64_decode. 2008-05-05 Jim Meyering * tests/misc/tac: Set execute bit. tac: avoid segfault for e.g., "echo > x; tac -r x x" * src/tac.c (tac_seekable): Move local "regs" declaration out to file scope, so its values aren't clobbered between calls. Discovered by Cristian Cadar, Daniel Dunbar and Dawson Engler, reported in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13501 * NEWS: Mention the bug fix. * tests/Makefile.am (TESTS): Add misc/tac. * tests/misc/tac: New file. Test for the above. 2008-04-30 Jim Meyering tests: avoid a "make check-root" failure when mcstransd is running * tests/misc/chcon: Skip this test if mcstransd seems to be running. tests: avoid spurious "make check-root" failure * README (Running tests as root): Also set PATH in suggested "sudo" command. This avoids failure of at least tests/cp/cp-a-selinux when the default PATH does not contain /sbin. * tests/cp/cp-a-selinux: Don't redirect stderr to /dev/null. "mkfs" was failing due to /sbin not being in PATH. 2008-04-30 Bo Borgerson Add Daniel Dunbar's lcov instructions to HACKING * HACKING: New section `Finding things to do', points to TODO file and gives instructions on generating an html coverage report as provided by Daniel Dunbar. * TODO: Add item for improving test coverage. Point back to HACKING. 2008-04-29 Jim Meyering chcon, runcon: make --help print the bug-reporting address * src/chcon.c (usage): Use emit_bug_reporting_address. * src/runcon.c (usage): Likewise. * tests/misc/help-version: Don't exempt chcon and runcon. * NEWS: Mention this. 2008-04-28 Jim Meyering tests: don't hard-code coreutils list of tests/ SUBDIRS in bootstrap * bootstrap: Extract the list from tests/Makefile.am, and die when it is empty -- it will be, eventually. 2008-04-28 Bo Borgerson tests: remove references to tests/wc from bootstrap * bootstrap: Don't try to initialize anything in tests/wc. 2008-04-28 Jim Meyering tests: slightly relax sc_cast_of_argument_to_free syntax check * maint.mk (sc_cast_of_argument_to_free): Relax regexp slightly. (sc_no_have_config_h): Add a comment. 2008-04-28 Bo Borgerson tests: don't chmod after a failed chdir in cleanup * tests/CuTmpdir.pm (chmod_tree): Don't chmod if chdir failed. Only cleanup test dirs from the process that created them. * tests/CuTmpdir.pm (import): Use closure around current PID to avoid cleanup races. 2008-04-27 Jim Meyering move wc tests from own subdir into a single script * configure.ac (AC_CONFIG_FILES): Remove wc/Makefile from the list. * tests/Makefile.am (SUBDIRS): Remove wc from the list. (TESTS): Add misc/wc. * tests/misc/wc: New file, derived from tests/wc/Tests.pm. * tests/wc/Test.pm: Remove file. tests: remove temporary log file upon catchable signal * check.mk (am__check_pre): Add signal handler to remove $@-t. tests: don't source envvar-check manually, test-lib.sh does it * tests/cp/abuse: Remove ". $top_srcdir/tests/envvar-check". * tests/cp/parent-perm: Likewise. * tests/cp/special-f: Likewise. * tests/ls/proc-selinux-segfault: Likewise. * tests/misc/help-version: Likewise. * tests/mkdir/selinux: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/touch/now-owned-by-other: Likewise. * tests/sample-test: Remove commented out suggestion. tests: ensure at least one failure when $built_programs is empty Before, this test and others would pass with empty $built_programs. * tests/misc/help-version: Fail if built_programs is empty. tests: improve perl-based tempdir handling Before, upon interrupt, directories would be left behind. * tests/CuTmpdir.pm: Remove temporary directory on interrupt. tests: reorder some tests in the long list * tests/Makefile.am (TESTS): Move some tests that use sleep "up" in the list so that they don't delay even a little the completion of "make check". Also run a chmod test early. tests: put root-only (usually skipped) tests at the end * tests/Makefile.am (TESTS): Don't list root-only tests explicitly. Instead, just use $(root_tests). * tests/check.mk (vc_exe_in_TESTS): Now that root_tests are separate, parse out the union of $(TESTS) and $(root_tests). tests: move another file (expensive) into test-lib.sh * tests/expensive: Remove file. Move contents into ... * tests/test-lib.sh (expensive_): ...here. New function. * tests/du/fd-leak: Update caller to use the new function. * tests/mv/leak-fd: Likewise. * tests/rm/hash: Likewise. * tests/tail-2/big-4gb: Likewise. * tests/Makefile.am (EXTRA_DIST): Remove its name. tests: cp/perm (usually not run) was failing on systems with SELinux * tests/cp/perm: Use stat to get the permission string, not ls. This test was run only when RUN_VERY_EXPENSIVE_TESTS=yes was set in the environment. It would fail on SELinux-enable systems because ls-generated permission strings would not match, e.g., "test _-rw-r--r--+ = _-rw-r--r--" would fail. tweak HACKING advice 2008-04-24 Jim Meyering tests: do define built_programs * tests/check.mk (built_programs): Define here, where it's used. This definition was in now-removed tests/misc/Makefile.am. 2008-04-23 Jim Meyering tests: update commented-out examples in sample-test, too * tests/sample-test: Use $top_srcdir/tests/SCRIPT_NAME, not $top_srcdir/../SCRIPT_NAME here, too. 2008-04-23 Ondřej Vašík tests: don't fail in a non-English locale * tests/chmod/thru-dangling: Source lang-default. * tests/cp/thru-dangling: Likewise. * tests/misc/printf-surprise: Likewise. 2008-04-23 Jim Meyering tests: remove now-unused Makefile.am * tests/misc/Makefile.am: Remove file. 2008-04-23 Ondřej Vašík id: do not print SELinux context when invoked with a USERNAME argument * NEWS: Mention new behaviour. * src/id.c (main): Do not print SELinux context when user is specified. * tests/Makefile.am: Add the new test. * tests/misc/id-context: New file. Test for the fix. Problem reported by Ronny Buchmann in http://bugzilla.redhat.com/443485. 2008-04-23 Jim Meyering id: do print the AFS-specific nameless group ID (called a PAG) In 6.11, we mistakenly suppressed the printing of certain group IDs, thinking they were useless AFS-specific artifacts. This change reverts that, so now they are printed once again. http://thread.gmane.org/gmane.org.fsf.announce/867/focus=13345 This also reverts the bug-fix that applied solely to the new code used to avoid printing those IDs Revert "id bug fix: don't point to potentially clobbered static storage" This reverts commit f7d1c59c224f81a8bab5fa2afcaf815988f50467. Revert "Work around AFS bug: id and groups would print invalid group number." This reverts commit b7a836c0a3524cda8ef79c30c3fe7ea759ae4656. Revert "* src/c99-to-c89.diff: Accommodate a C99-ism in id.c." This reverts commit d44893c5dba4150b4ded9cf6aad316c1ef620c9f. 2008-04-22 Jim Meyering build: move a project-specific definition to cfg.mk * cfg.mk (old_NEWS_hash): Define here, ... * maint.mk: ... not here. (update-NEWS-hash): Update comment. Suggestion from Eric Blake. Accommodate building on OS/2 (www.ecomstation.com Ecs v2 rc4) * configure.ac: Filter out carriage returns in more places. Reported by Elbert Pol, details here: http://thread.gmane.org/gmane.org.fsf.announce/867/focus=13332 guard against inserting a NEWS entry into a block for a prior release Without a guard like this, it is far too easy to apply a patch prepared against a preceding release, and not notice that a NEWS entry is inserted into the wrong block. * maint.mk (sc_immutable_NEWS): New rule. (update-NEWS-hash): New rule to update the hard-coded hash. tests: ensure that all exec-$PERL lines are the same * maint.mk (sc_perl_coreutils_test): New rule. 2008-04-21 Jim Meyering tests: skip (don't fail) rm/one-file-system when mount --bind fails * tests/rm/one-file-system: Reported by Allen Hewes. tests: convert umask-check to a function * tests/test-lib.sh (working_umask_or_skip_): New function, from... * tests/umask-check: ...here. Remove file. * tests/Makefile.am (EXTRA_DIST): Remove umask-check. * tests/mkdir/perm: Use the function rather than sourcing the file. * tests/cp/cp-parents: Likewise. * tests/cp/parent-perm: Likewise. Bruno Haible reported that parent-perm was failing to run umask-check. tests: adjust perl -I to use $top_srcdir/tests, not $srcdir/.. tests: clean up root tests; adapt to new layout * tests/Makefile.am (root_tests): New list. (check-root): Add 'SUBDIRS='. (root-hint): Point to README. * Makefile.am (check-root): Add 'SUBDIRS=' here, too. * maint.mk (sc_root_tests): Adapt rule to new syntax used in tests/Makefile.am. 2008-04-21 Jim Meyering Revamp test-related Makefiles. One side-effect of this change is that "make check" now works even if you put "." early in your shell's search PATH (don't do that!). Remove all test-related Makefile.am files, except those generated by mk-script. Instead, tests/Makefile.am now lists not only the tests directly under tests/, but also those in tests/*/ that are not generated by mk-script, e.g., cp/abuse, cp/acl, mv/i-1, etc. A lot of these changes are like this: -. $srcdir/../lang-default +. $top_srcdir/tests/lang-default -. $srcdir/../test-lib.sh +. $top_srcdir/tests/test-lib.sh * configure.ac (AC_CONFIG_FILES): Remove corresponding Makefiles. * tests/check.mk (vc_exe_in_TESTS): Relax syntax requirements. * tests/rwx-to-mode: Remove file. Rewritten as... * tests/test-lib.sh (rwx_to_mode_): ...this new function. * tests/Makefile.am (EXTRA_DIST): Remove rwx-to-mode. (SUBDIRS): Remove each dir with a removed Makefile.am. (EXTRA_DIST): Add $(TESTS). (TESTS): Add over 300 entries. 2008-04-20 Jim Meyering * tests/misc/Makefile.am (built_programs): Remove. Unused. Use "env" to invoke potential built-ins. * tests/misc/pwd-unreadable-parent: Invoke pwd via "env -- pwd", rather than via an absolute name. * tests/touch/not-owner: Likewise for test. * tests/chmod/setgid: Likewise. 2008-04-19 Jim Meyering * .prev-version: Record previous version: 6.11. Version 6.11. * NEWS: Record release date. * maint.mk (writable-files): Fix syntax error. * doc/.gitignore: Add texinfo-related outputs. 2008-04-19 Sven Joachim * THANKS: Update my address, correct encoding for a name. 2008-04-19 Jim Meyering pr -e, with a mix of backspaces and TABs, could corrupt the heap * tests/pr/Test.pm: New tests for the above. * src/pr.c (char_to_clump): Ensure that "input_position" never goes below 0. Also, elide any backspace encountered when input_position is 0, to be compatible at least with /bin/pr from Solaris 10. This bug is present in the original version: b25038ce9a234ea0906ddcbd8a0012e917e6c661 * NEWS [Bug fixes]: Mention this. Report and diagnosis by Cristian Cadar, Daniel Dunbar and Dawson Engler in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13272 2008-04-19 Mike Frysinger * src/dircolors.hin: Add .flv. Move .svgz to "image formats". 2008-04-19 Jim Meyering md5sum -c: ignore a line with a NUL byte among checksum hex digits * src/md5sum.c (hex_digits): Require that all "digest_hex_bytes" be hexadecimal digits, not just those before the first NUL byte. This bug dates back to the original version: 3763a4f24eb21be40674d13ff7b04e078f473e85 * tests/misc/md5sum (nul-in-cksum): Test for the above. * NEWS [Bug fixes]: Mention this. Prompted by a report from Flóki Pálsson in http://bugzilla.redhat.com/439531 2008-04-16 Matthew Woehlke tests: accommodate built-in mknod more cleanly still * tests/mkdir/selinux: Use "env" rather than "nice". 2008-04-16 Jim Meyering tests: accommodate built-in mknod more cleanly * tests/mkdir/selinux: Undo most of previous change, bc22dbbf844f31ddaf2e68b167d0128a985d73ab, and instead invoke the command via "nice". Using "exec" should be enough, but isn't with OpenBSD's PD KSH v5.2.14 99/07/13.2. Eric Blake suggested using nice. mknod --help: note that this command may be a shell built-in * src/mknod.c (usage): Print USAGE_BUILTIN_WARNING. Suggestion from Eric Blake. avoid "may be used uninitialized" warning from newer gcc * src/md5sum.c (digest_check) [lint]: Initialize local, "filename". tests: add a comment explaining the potential failure tests: avoid mkdir/selinux failure when mknod is a shell built-in * tests/mkdir/selinux: Skip the mknod test if it's a built-in. 2008-04-15 Jim Meyering md5sum, sha1sum, etc: handle invalid input (i.e., don't segfault) * src/md5sum.c (bsd_split_3): Return right away if s_len == 0. * tests/misc/md5sum (bsd-segv): New test for the above. * tests/misc/sha1sum (bsd-segv): Likewise. * NEWS: Mention the bug fix. Reported by Cristian Cadar, Daniel Dunbar and Dawson Engler. 2008-04-14 Jim Meyering tests: don't fail on systems without a "stat" syscall * tests/test-lib.sh (require_strace_): Add a syscall parameter. * tests/ls/stat-free-symlinks: Update caller. * tests/mv/atomic: Likewise. * tests/mv/atomic2: Likewise. Reported by Mike Frysinger in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13222 tests: accommodate a different errno string on Irix 6.5 * tests/mkdir/selinux: Also handle "Not supported". Reported by Peter Fales. seq: work around floating point inaccuracies on more systems * src/seq.c: Include for fabs. Include for DBL_EPSILON. (abs_rel_diff): New function. (print_numbers): Use abs_rel_diff rather than a strict equality test. Without this change, Solaris 8 and Irix 6.2 would fail the float-6 test. Reported by Peter Fales in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13183 * src/c99-to-c89.diff: Adjust seq.c offsets. doc: fix typo * coreutils.texi (sort invocation): s/Whitespace/White space/ 2008-04-12 Jim Meyering tests: Accommodate a different errno value on OSF/1 4.0F. * tests/mkdir/selinux: Also handle "Function not implemented". Avoid link failure when using mkstemp replacement. * src/Makefile.am (tac_LDADD): Add $(LIB_CLOCK_GETTIME). This is necessary at least on a DEC Alpha OSF/1 4.0F. tests: always enable VERBOSE output, now that test framework works better * cfg.mk: Set VERBOSE=yes. * tests/check.mk: Likewise. 2008-04-11 Jim Meyering doc: avoid "make pdf" failure (due to texi2dvi bug?) * doc/coreutils.texi (filesZeroFromOption): Comment out @cindex-in-@macro use. doc: use a valid texinfo macro name * doc/coreutils.texi (filesZeroFromOption): s/0/Zero/ 2008-04-08 Jim Meyering tests: accommodate a different errno value on HPUX-10.20 * tests/mkdir/selinux: Also handle "Unknown system error". Reported by Peter Fales. 2008-04-06 Jim Meyering doc: factor out --files0-from duplication * coreutils.texi (wc invocation) [files0fromOption]: New macro. Use it. (du invocation): Use it here, too. * src/c99-to-c89.diff: Adjust remove.c diffs. 2008-04-06 Jim Meyering remove.c: accommodate systems with negative errno values This is required at least on Haiku and BeOS. * src/remove.c (write_protected_non_symlink): Return 1 for a write- protected non-symlink, 0 if we determine it's not, and -1 upon error (setting errno accordingly only in this final case). (prompt): Deal with the changed semantics of the above function. Based on this patch from Axel Dörfler: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13071 2008-04-05 Jim Meyering Accommodate building on OS/2 (www.ecomstation.com Ecs v2 rc4) * configure.in: Also filter out carriage returns from the value of $no_install_progs_default. Reported by Elbert Pol. 2008-04-02 Jim Meyering "touch E; mkfifo F; cp -fR F E" no longer fails due to existing E * src/copy.c (copy_internal): Revert change of 2005-03-01, 4303f0454592421eea48be87777d32a49e1d5e5b Prompted by Michael Stone, who pointed me to an old bug report from Ian Jackson: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/7504 * tests/cp/special-f: New file. Test for the above. * tests/cp/Makefile.am (TESTS): Add special-f. * NEWS: mention this bug fix. copy.c: remove an in-function #ifdef * src/copy.c (rpl_mkfifo) [! HAVE_MKFIFO]: New function. (mkfifo) [! HAVE_MKFIFO]: Define to rpl_mkfifo. (copy_internal): Remove #ifdef. HACKING: rename README-contribution-guidelines README-contribution-guidelines: Rename to .. HACKING: ...this. 2008-04-01 Jim Meyering bootstrap: remove dangling *.[ch] symlinks from lib * bootstrap [dangling symlink removal]: Match *.[ch] files, too. Suggestion from Eric Blake. bootstrap: make find's -depth option be the first. * bootstrap [dangling symlink removal]: Move find's -depth option to precede all others, to avoid a warning. * bootstrap: Remove dangling symlinks from lib (aka $source_base), too. Avoid root-only SELinux-related test failures w/o mcstransd. When mcstransd is not running (i.e., after service mcstrans stop), "make check" as root would provoke two test failures. * tests/cp/cp-a-selinux: Use the context, root:object_r:tmp_t:s0, that works both with and without mcstransd. Thanks to Eric Paris for the tip and to Ondřej Vašík for alerting me to the problem. Reported by Robert Scheck in . root tests: Set NON_ROOT_USERNAME if not set already. * tests/test-lib.sh (require_root_): This avoids failure of a couple of root-only tests that require a value for that envvar. texinfo formatting tweaks * coreutils.texi: Avoid some overfull hbox warnings. (Treating / specially): Use @file{/} rather than a bare /. printf doc: xref print(3) and libc's "Output Conversion Syntax" node * coreutils.texi (printf invocation): Add xref. Use "The GNU C Library Reference Manual" as the name of the 'libc' document consistently. * man/printf.x: Add See also: printf(3). Suggested by A. Costa in http://bugs.debian.org/465522 2008-03-31 Jim Meyering Emit "#line 1" right after the two 'read-only/GENERATED' lines. * bootstrap (cp_mark_as_generated): This preserves line numbering e.g., in assertions, which is important when correlating between coreutils test failures and the original files in gnulib/tests. Suggested by Eric Blake. * README-contribution-guidelines: Mention how to amend a commit. Suggestion from Pádraig Brady. Begin documenting contribution guidelines. * README-contribution-guidelines: New file. For now, not distributed. "rm -r DIR" would mistakenly prompt about very long names * src/remove.c (write_protected_non_symlink): Return 0(-1) when euidaccess_stat pronounces a writable(not-writable) file, not -1(0). * tests/rm/deep-2: New file. Test for the above-fixed bug. * tests/rm/Makefile.am (TESTS): Add deep-2. Discovered while reviewing this change: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13071 * NEWS: Note the dd bug fix. The bug was introduced over 8 years ago: 9fca49f67c16c8b42c32e185808fe187cedb0fa7 2008-03-31 Paul Eggert dd bug fix: accept e.g., if=/dev/stdin and of=/dev/stdout * lib/fd-reopen.c: Work even if FILE is "/dev/stdin". Problem reported by Geoffrey Lee in . * tests/dd/misc: Check for this bug. 2008-03-29 Jim Meyering avoid failure of new test on kernel without SELinux support * tests/mkdir/selinux: Also accept ENOENT. Reported by Sven Joachim. tests: accept ENOTSUP message as well as the EINVAL one This test would fail on most non-Linux systems because the original expected an "Invalid argument" diagnostic, yet they all produced "Operation not supported". * tests/mkdir/selinux: Accept both strings. Factor out duplication. Work around a recent glibc/getopt.c diagnostic change. * tests/misc/factor: Map new "-- '1'" to expected "-- 1". 2008-03-28 Jim Meyering mknod, mkfifo: don't segfault when diagnosing invalid SELinux context Identical to the bug fixed by 72d052896a9092b811961a8f3e6ca5d151a59be5. * src/mkfifo.c (main): Use "scontext", not NULL optarg in diagnostic. * src/mknod.c (main): Likewise. Reported by Cristian Cadar, Daniel Dunbar and Dawson Engler. * tests/mkdir/selinux: Test for the above fixes. * NEWS: Mention the fixes. Fix typo in old NEWS and ChangeLog: s/commmand/command/. * ChangeLog-2007: Likewise. * NEWS: Likewise. Prompted by http://bugzilla.redhat.com/439410 2008-03-28 Pádraig Brady tests: Factor out code that's going to be reused. * tests/test-lib.sh (mkfifo_or_skip_): New function, factored out of... * tests/touch/fifo: ...here. 2008-03-28 Jim Meyering Require that "(exit $fail); exit $fail" be last line of each test. * maint.mk (sc_require_test_exit_idiom): New rule to enforce policy. * tests/cp/acl: Adhere to the new policy. * tests/cp/preserve-gid: Likewise. * tests/dd/misc: * tests/install/create-leading: * tests/ln/sf-1: * tests/ls/symlink-slash: * tests/misc/help-version: * tests/misc/ls-time: * tests/misc/nice: * tests/misc/shred-remove: * tests/misc/stty: * tests/misc/stty-row-col: * tests/mkdir/p-1: * tests/mkdir/p-2: * tests/mkdir/p-3: * tests/mkdir/p-v: * tests/mkdir/special-1: * tests/mkdir/writable-under-readonly: * tests/mv/acl: * tests/mv/backup-is-src: * tests/mv/diag: * tests/mv/dir-file: * tests/mv/force: * tests/mv/hard-link-1: * tests/mv/i-2: * tests/mv/i-4: * tests/mv/into-self: * tests/mv/into-self-2: * tests/mv/into-self-3: * tests/mv/partition-perm: * tests/mv/to-symlink: * tests/rmdir/ignore: * tests/tail-2/assert: * tests/tail-2/assert-2: * tests/touch/dangling-symlink: * tests/touch/dir-1: * tests/touch/empty-file: * tests/touch/fifo: * tests/touch/no-rights: Likewise. Perform explicit exit-nonzero if the embedded Perl script fails. * tests/misc/pwd-long: Add canonical '(exit $fail); exit $fail'. 2008-03-27 Jim Meyering paste -d\\: avoid heap overrun for backslash at end of delim list * src/paste.c: Include "quotearg.h". (collapse_escapes): Handle backslash-escaped backslash explicitly. Handle unescaped backslash at end of string by returning nonzero, rather than by overrunning memory. (main): Diagnose an invalid delimiter list -- carefully. Reported by Cristian Cadar, Daniel Dunbar and Dawson Engler. * tests/misc/paste-no-nl (delim-bs): Add a test to demonstrate the heap-smashing capability. (delim-bs2): Prior to coreutils-5.1.2, this bug was a little harder to demonstrate: it would corrupt a first-argument containing e.g., \b * NEWS: Mention the bug fix. * tests/misc/Makefile.am (TESTS): Reflect renaming. * tests/misc/paste: Rename from paste-no-nl. 2008-03-26 Jim Meyering * src/join.c (keycmp): Document new parameters. Test for mkdir bug fix. * tests/mkdir/selinux: New file: test for today's fix. * tests/mkdir/Makefile.am (TESTS): Add selinux. 2008-03-26 Daniel Dunbar mkdir -Z x d: don't segfault when diagnosing invalid context "x" (tiny change) * src/mkdir.c (main): Use "scontext", not NULL optarg in diagnostic. Reported by Cristian Cadar, Daniel Dunbar and Dawson Engler. * NEWS: Mention the bug fix. 2008-03-25 Peter Fales id bug fix: don't point to potentially clobbered static storage On at least Mac OS, when calling getpwuid twice with the same UID, the static storage containing results from the first call is invalidated by the second call. * src/id.c (main): Point to a copy of the user name string. 2008-03-25 Eric Blake Use new gnulib gnumakefile module. * bootstrap.conf (gnulib_modules): Pull in new module. * GNUmakefile: Remove from version control. * .gitignore: Update. * configure.ac (AC_CONFIG_LINKS): Delete; rely on gnulib to do this now. * Makefile.am (EXTRA_DIST, distclean-local): Likewise. 2008-03-25 Jim Meyering join bug fix: adapt keycmp to work with new order-checking feature * src/join.c (keycmp): Add two join-field parameters. (check_order, join): Update callers. Reported by Dmitry V. Levin in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12731/focus=13017 * tests/join/Test.pm (chkodr-7): New test for this fix. 2008-03-23 Jim Meyering join.c: syntax/style tweaks * src/join.c (check_order): Rename from checkorder. Move definition to precede first use and remove prototype. Use EXIT_FAILURE, rather than "1". (key_cmp): Move definition to precede first use. 2008-03-22 Jim Meyering portability: work around a "busybox sed" limitation * configure.ac: While every other sed tested supports usage like '/\(re\)/{s//\1/;...}', and POSIX appears to requires this, busybox's sed does not support it. So duplicate the regexp: '/\(re\)/{s/\(re\)/\1/;...}'. Reported by Vincent Lefevre: . 2008-03-21 Jim Meyering * src/c99-to-c89.diff: Adjust seq.c offsets. ptx: avoid heap overrun for backslash at end of optarg string * src/ptx.c (copy_unescaped_string): Ignore a lone backslash at end of string. Reported by Cristian Cadar, Daniel Dunbar and Dawson Engler. Details here: . * tests/misc/Makefile.am (TESTS): Add ptx-overrun. * tests/misc/ptx-overrun: New file. Test for the above fix. * NEWS: Mention the fix. ptx.c readability * src/ptx.c (copy_unescaped_string): Add braces around 80+-line single-stmt while-loop body. Write NEWS and update c99-to-c89 patch for today's rm improvement. * NEWS: call this a "portability improvement" ;-) * src/c99-to-c89.diff: Adjust remove.c offsets. 2008-03-21 Ingo Weinhold remove.c: Accommodate systems with negative errno values. * src/remove.c (cache_fstatat): Store errno value directly in the st_ino field, rather than trying to shoehorn it into st_size. This is required at least on BeOS and Haiku. 2008-03-21 Jim Meyering * src/seq.c (long_double_format): Add a comment. * GNUmakefile: Update from gnulib. 2008-03-20 Jim Meyering Remove today's automake kludge, altogether. Fix properly. * man/Makefile.am: Use dist_man1_MANS instead of dist_man_MANS. Suggestion from Ralf Wildenhues. Add a check to detect this problem, in case it reappears. * maint.mk (my-distcheck): Run "make install", and then ensure that ls.1 is installed. Kludge to make automake generate install-man rules * man/Makefile.am (dist_man_MANS): Add a literal, rm.1. Without this, "make install" would not install man pages. However, with this kludge, the rm.1 man page is installed even when you configure with --enable-no-install-program=rm. Revert recent man/Makefile.am change. Revert 4b544e447eb78fd1f031a026a499f6aed177808a. * man/Makefile.am: That change was only a band-aid. It solved the stated problem, but not a deeper one: that "make install" would no longer man pages. Reported by Dmitry V. Levin. The latter problem arose in 167b8025aca487de001da2448c1aebc2747bc1d3 with the removal of the sole literal from the definition of dist_man_MANS. When automake perceives dist_man_MANS as empty, it no longer emits the install-man* rules. 2008-03-20 Eric Blake Sync GNUmakefile with gnulib. * GNUmakefile (Makefile.cfg): Rename... (cfg.mk): ...to this, and make optional. (GNUmakefile.cfg): Delete, redundant with cfg.mk. (Makefile.maint): Rename... (maint.mk): ...to this. (all) [!_have-Makefile]: Rename... (abort-due-to-no-makefile): ...to this, and invoke via .DEFAULT_GOAL to pick up all targets. * Makefile.cfg: Rename... * cfg.mk: ...to this. * Makefile.maint: Rename... * maint.mk ...to this. (ME): Reflect rename. (makefile-check, m4-check, author_mark_check, msg): Use $(ME) rather than hard-coded name. * Makefile.am (EXTRA_DIST): Distribute renamed files. * .x-sc_file_system: Remove Makefile.maint along with others. No longer needed. * .x-sc_obsolete_symbols: Likewise. * .x-sc_prohibit_atoi_atof: Reflect renaming and remove no-longer-VC'd names. * TODO: Likewise. 2008-03-19 Bob Proulx make check: Remove /tmp/ls-creating debug code. * tests/misc/ls-misc: Remove debug code creating /tmp/ls. 2008-03-19 Jim Meyering bootstrap: restore kludge removed on 2008-03-12: it's still necessary. * bootstrap: Make the gnulib-tests/test-*.sh scripts executable. This restores code removed by dec8bb25bb6da2fe9fe6dd63c0fbbd593a0e94cb. Reported by Bob Proulx. Check for -- and remove -- some unnecessarily included header files. * Makefile.maint: Add checks for a handful of additional header files. * src/mktemp.c: Don't include "long-options.h". Not used. * src/pr.c: Don't include "inttostr.h". Not used. * src/printenv.c: Don't include "error.h". Not used. * src/test.c: Don't include "error.h". Not used. * src/touch.c: Don't include "safe-read.h". Not used. Remove more vestiges of CVS. * Makefile.maint (VC_LIST): Rename from CVS_LIST. (VC_LIST_EXCEPT): Rename from CVS_LIST_EXCEPT. mv: never unlink a destination file before calling rename While cp --preserve=links must unlink certain destination files, mv must never do that. * src/copy.c (copy_internal): Pull the '! x->move_mode' test "up", so it affects the entire condition, and not just DEREF_NEVER mode. Reported by James Ralston in . * tests/mv/atomic2: New file. Test for the above fix. * tests/mv/Makefile.am (TESTS): Add atomic2. * NEWS: Mention the bug-fix. [Bug introduced in 367719ba5f1dbd5e2f7fa2466c441f23f66a7c9e] "make" would not always update man/*.1 files (but "make dist" would) * man/Makefile.am (BUILT_SOURCES): Define, so that "make" always updates man/*.1 files. Reported by Bob Proulx. 2008-03-18 Jim Meyering syntax-check: Make the space-before-open-paren optional. * Makefile.maint (sc_prohibit_assert_without_use): Match also when there is no space before the opening parenthesis. (sc_prohibit_getopt_without_use): Likewise. (sc_prohibit_quotearg_without_use): Likewise. (sc_prohibit_quote_without_use): Likewise. * Makefile.maint (sc_no_have_config_h): Use a more precise regexp. * Makefile.maint (CVS): Remove now-unused definition. Factor out duplication in sc_prohibit_*_without_use rules. * Makefile.maint (_header_without_use): New "command", factored out of four sc_prohibit_HEADER_without_use rules. (sc_prohibit_assert_without_use): Rewrite using $(_header_without_use). (sc_prohibit_getopt_without_use): Likewise. (sc_prohibit_quotearg_without_use): Likewise. (sc_prohibit_quote_without_use): Likewise. 2008-03-18 Dmitry V. Levin Correct typo in "make syntax-check" diagnostic. * Makefile.maint (sc_prohibit_getopt_without_use): s/assert.h/getopt.h/ 2008-03-16 Jim Meyering Prohibit inclusion of getopt.h without use. * Makefile.maint (sc_prohibit_getopt_without_use): New rule. Include only if used. * src/group-list.c: Don't include . * src/printf.c: Likewise. 2008-03-16 J. Scott Edwards sha512_process_bytes: fix a bug in processing a buffer where length&64 != 0 * gl/lib/sha512.c (sha512_process_bytes): s/63/127/. 2008-03-12 Jim Meyering Generalize GNUmakefile, ... ...so that it can be used unmodified by autoconf. * GNUmakefile: Include optional file, GNUmakefile.cfg. Autoconf will use this to override _autoreconf and to export PATH. (_autoreconf): Define. (_dummy): cd to $(srcdir) before removing autom4te.cache. * bootstrap: Sync from gnulib and remove part of a local kludge. 2008-03-10 Ondřej Vašík install, rmdir: write --verbose output to stdout, not to stderr. * src/install.c (announce_mkdir): Write verbose output to stdout, not to stderr. * src/mkdir.c (announce mkdir): Use prog_fprintf for verbose output. * src/prog-fprintf.c (prog_fprintf): New function and file. * src/prog-fprintf.h: New file. * src/rmdir.c (main): Write verbose output to stdout, not to stderr. Quote directory name in a diagnostic. * src/rmdir.c (remove_parents): Write verbose output to stdout, not to stderr. * doc/coreutils.texi: Mention that shred verbose output is to stderr. * NEWS: Mention the changes. 2008-03-10 Jim Meyering make syntax-check: also check src/*.h files for extern functions, * src/Makefile.am (sc_tight_scope): ... now that there is one. 2008-03-07 Jim Meyering dd: avoid unnecessary, but harmless close_stdout call. * src/dd.c (close_stdout_required): New global. (maybe_close_stdout): New function. (main): Set the global. Reported by Ulrich Drepper in http://bugzilla.redhat.com/436368 2008-03-06 Jim Meyering Now that ChangeLog is no longer under version control, ... * Makefile.maint (alpha beta major): Don't make changelog-check. (changelog-version-check): Rename from changelog-check. 2008-03-05 Jim Meyering * src/c99-to-c89.diff: Accommodate a C99-ism in id.c. 2008-03-05 ribalba Work around AFS bug: id and groups would print invalid group number. * src/id.c (main): Call print_group_list with a user name, if possible. * src/groups.c (main): Likewise. * NEWS: Mention this. For details, see http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12852 http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12875 2008-03-05 Jim Meyering Now that Makefile.maint is used in VPATH builds, too... * Makefile.maint (prev_version_file): Prefix with $(srcdir)/. (syntax-check-rules): Prefix $(ME) with $(srcdir)/. Avoid new "make distcheck" failure, now that VPATH has GNUmakefile. * GNUmakefile: Remove commands to create ".version". They were unnecessary, and caused creation of a newer .version file in a VPATH build, which in turn caused creation of updated man/*.1 files reflecting the newer time stamp on .version. Those *.1 files were not removed (since they're distributed), and the fact that they remained after "distclean" triggered the failure. 2008-03-04 Eric Blake Reinstate GNUmakefile patch, but with workaround for automake. * configure.ac (AC_CONFIG_LINKS): Use shell variable to bypass automake distclean rules. * Makefile.am (distclean-local): Clean GNUmakefile in VPATH builds, since we are bypassing automake. * GNUmakefile (_is-dist-target): 'distclean' is not a dist target. 2008-03-04 Jim Meyering Clarify comment and attribute preceding change: Reported by Ralf Wildenhues. Comment out yesterday's VPATH-friendly addition, for now. * configure.ac: ...while we wait for a fixed version of automake. 2008-03-03 Eric Blake Use m4_PACKAGE_VERSION, not AC_AUTOCONF_VERSION. * configure.ac: The latter is only in post-2.61 autoconf. GNUmakefile build tweaks. * GNUmakefile: When Makefile is not present, make common targets depend on "all" in order to trigger nicer error message. * configure.ac: If autoconf is new enough, link GNUmakefile into VPATH builds. For more details, see . 2008-03-03 Simon Josefsson Define SHA*_DIGEST_SIZE symbols. * gl/lib/sha256.h (SHA224_DIGEST_SIZE, SHA256_DIGEST_SIZE): Define. * gl/lib/sha512.h (SHA384_DIGEST_SIZE, SHA512_DIGEST_SIZE): Define. 2008-03-02 Ralf Wildenhues Fix so that out-of-tree VPATH "make dist" works, too. * GNUmakefile: Add $(srcdir)/ prefix to git-version-gen and argument. 2008-03-02 Jim Meyering One more for non-srcdir "make dist". * GNUmakefile: Also cd $(srcdir) before running autoreconf. Adjust so that non-srcdir "make dist" works, too. * GNUmakefile: Add $(srcdir)/ prefix to git-version-gen and argument. Don't infringe namespace of "sub"-Makefiles. * GNUmakefile (_dummy, _have-Makefile): Add "_" prefix. Create sha256 and sha512 modules and move files into gl/. * bootstrap.conf (gnulib_modules): Add sha256 and sha512. * m4/prereq.m4: Don't require gl_SHA256 or gl_SHA512. * gl/modules/sha512: New file. * gl/modules/sha256: New file. * m4/sha256.m4: Move to ... * gl/m4/sha256.m4: ...here, removing use of AC_SOURCES. * m4/sha512.m4: Move to ... * gl/m4/sha512.m4: ...here, removing use of AC_SOURCES. * lib/sha256.c, lib/sha256.h: Move to ... * gl/lib/sha256.c, gl/lib/sha256.h: ...here. * lib/sha512.c, lib/sha512.h: Move to ... * gl/lib/sha512.c, gl/lib/sha512.h: ...here. * lib/u64.h: Move to ... * gl/lib/u64.h: ...here. * bootstrap: Remove only *.m4, and only from $m4_base/. Rewrite the comment. * bootstrap: Sync from gnulib. 2008-03-01 Jim Meyering Don't skip the groups-version test. * tests/Makefile.am (built_programs): Remove unused definition. * src/Makefile.am (built_programs.list): Print a space-separated list of program names, not NL-separated, since all clients now expect a space-separated list. Don't exempt "groups" from write-failure test, now that it's a C program. * tests/misc/help-version: Since groups is no longer a shell script, a buggy bourne shell can't cause trouble. * configure.ac (AC_INIT): Use .tarball-version, not .version. Don't depend on gnulib's deprecated "free" module. * bootstrap.conf (obsolete_gnulib_modules): Remove free. * gl/modules/mgetgroups (Depends-on): Remove free. 2008-02-29 Jim Meyering Merge bootstrap changes from gnulib. * bootstrap (MSGID_BUGS_ADDRESS): Define and use. (version_controlled_file): Use "git rm", not "git-rm". Use "git tag", not "git-tag", in preparation for git-1.6.0. * Makefile.maint (VC-tag): Remove '-': s/git-tag/git tag/ 2008-02-28 Jim Meyering Make copyright comments consistent. * src/mktemp.c: Update copyright to use newer form. Make first copyright lines consistent. Some did not end in ", Inc.". Due to that missing ", Inc" at end of line, emacs' copyright-updating code missed some opportunities. This corrects most of those, and adds some mistakenly omitted years. * src/chown-core.c: Adjust. * src/chown-core.h: Likewise. * src/copy.c: Likewise. * src/copy.h: Likewise. * src/cp-hash.c: Likewise. * src/cp.c: Likewise. * src/group-list.h: Likewise. * src/mktemp.c: Likewise. * src/stat.c: Likewise. * tests/chmod/equal-x: Likewise. * tests/dd/skip-seek: Likewise. * tests/envvar-check: Likewise. * tests/mv/into-self-2: Likewise. 2008-02-25 Bob Proulx Fix test failure where rm would appear to succeed incorrectly. * tests/rm/fail-eperm: Ignore files that were opportunistically chosen to test permission failures but disappear before we can finish the test. 2008-02-24 Jim Meyering * gl/lib/mgetgroups.c (mgetgroups): Parenthesize correctly. * gl/lib/mgetgroups.c: Include . 2008-02-23 Jim Meyering Avoid test failures when root (/) is not readable. * tests/test-lib.sh (require_readable_root_): New function. * tests/misc/pwd-long: Skip this test when / is unreadable. * tests/du/slash: Likewise. This is required at least for Mandrake/Mandriva in "secure" mode. Reported by Theodoros V. Kalamatianos in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12800 2008-02-22 Jim Meyering id: avoid race when a group is added between getgrouplist calls * gl/lib/mgetgroups.c (mgetgroups) [N_GROUPS_INIT]: Rename enum. Use a larger value. Update *groups only upon success. Iterate upon failed getgrouplist. 2008-02-21 James Youngman id: use getgrouplist when possible * gl/m4/mgetgroups.m4: Check for getgrouplist. * gl/lib/mgetgroups.c (mgetgroups): Use getgrouplist, if available. * TODO: Remove the item about switching to getgrouplist. * NEWS: mention this 2008-02-21 Paul Eggert du vs. hard links and argument order: improve documentation * doc/coreutils.texi (du invocation): Document default behavior on hard links, and why argument order matters. 2008-02-20 James Youngman join: avoid new leaks * src/join.c (prevline): Make prevline module-level static, so that the allocated items can be freed at exit. (free_prevline): new atexit function; frees items in prevline[]. Use ARRAY_CARDINALITY, so include "argmatch.h" to get that. (main): Arrange for free_prevline to be called during exit. (get_line): Free prevline[which - 1] also, as that will have been allocated by dup_line. 2008-02-20 Jim Meyering Remove xdelta support, clean up distcheck process. * Makefile.maint (writable-files): Don't create $(release_archive_dir). (my-distcheck): Don't depend on prev-tgz. Remove xdelta-related variables and uses. (alpha beta major): Skip steps if $(release_archive_dir) doesn't exist. * bootstrap: Remove dangling symlinks before invoking aclocal. 2008-02-20 Andreas Schwab sort: add --sort=... option. * src/sort.c (SORT_OPTION): New enum. (sort_args, sort_types): Define. (usage, long_options, main): New option --sort. * tests/sort/Test.pm: Test it. * doc/coreutils.texi (sort invocation): Document --sort option. * NEWS: Mention this. 2008-02-19 Jim Meyering 2008-02-19 Jim Meyering * TODO: Remove final seq-related item. * src/c99-to-c89.diff: Adjust seq.c offsets. Accommodate a new C99-ism. 2008-02-19 Steven Schubiger seq: give better diagnostics for invalid formats. * src/seq.c: (validate_format): New function. (main): Use it. * tests/misc/seq (fmt-d, fmt-e): Test for expected diagnostics with invalid formats. * NEWS: Mention this change. * TODO: Remove this item. [jm: src/seq.c: make diagnostics more consistent tests/misc/seq (fmt-eos1): adjust the expected diagnostic ] 2008-02-19 James Youngman join: new options: --check-order and --nocheck-order. * src/join.c: Support --check-order and --nocheck-order. New variables check_input_order, seen_unpairable and issued_disorder_warning[]. For --check-order, verify that the input files are in sorted order. For the default case, check the order only if there are unpairable lines. (join): Perform ordering checks after reaching EOF on either input. (usage): Mention --check-order and --nocheck-order. (dupline): Save a copy of the previously-read input line so that we can detect disorder on the input. (get_line): Temporarily save a copy of the previous line (by calling dupline) and check relative ordering (by calling checkorder) before returning the newly-read line. (getseq, join): Tell get_line which file we are reading from. (advance_seq): New function, factoring out some of the code commonly surrounding calls to getseq. (checkorder): New function. Verifies that a pair of consecutive input lines are in sorted order. * doc/coreutils.texi (join invocation): Document the new options --check-order and --nocheck-order. * tests/join/Test.pm (tv): Added tests for --check-order and --nocheck-order. * NEWS: Mention this new feature. Fix non-srcdir "make distcheck" failure. * Makefile.am (check-ls-dircolors): Look for sources under $(srcdir), not under ".". 2008-02-18 Jim Meyering seq: give a proper diagnostic for an invalid --format=% option * src/seq.c (long_double_format): Handle '%' at end of string. * tests/misc/seq [fmt-eos1, fmt-eos2]: New tests for the bug. * NEWS: Mention this. Reported by Pádraig Brady. 2008-02-17 Jim Meyering .gitignore, src/.gitignore: ignore more Clean up Makefile.maint. * Makefile.maint: Remove obsolete comments. (local-checks-available): Remove changelog-check. Clean up ls.c. * src/ls.c (put_indicator): Use fwrite, not a loop. Ensure that dircolors.c and ls.c remain in sync. * Makefile.am (check-ls-dircolors): New rule. (distcheck-hook): Depend on it. 2008-02-17 Jim Meyering Expand "ls --color" tests to also use the dircolors defaults. * tests/misc/ls-misc: Adjust this test so each is run twice. First, as usual, and the second time with LS_COLORS set using the default settings produced by running dircolors. * tests/Coreutils.pm: See below. This required some changes: - save and restore $ENV{LS_COLORS} for each individual test that requires a specific value. - Since this is the first test to call the run_tests command more than once, it has exposed that that function erroneously modifies the \@Tests array. Fix that in tests/Coreutils.pm. 2008-02-17 Jim Meyering Adjust dircolors to match ls.c. * src/dircolors.hin: comment out NORMAL and FILE, define RESET. * src/dircolors.c (slack_codes) Add "RESET". (ls_codes): Add "rs". 2008-02-17 Ed Avis ls --color no longer outputs unnecessary escape sequences In --color mode, plain files do not get any color, not even white. When no highlighting is required, ls outputs no escape sequence at all. * src/ls.c (print_with_color): (used_color): New global. (indicator_no) [C_RESET]: New enum value. (indicator_name) ["rs"]: Corresponding new string. (color_indicator): Make the 'normal' and 'file' markers be NULL. Use "rs" (C_RESET) to reset to ordinary colors. (process_signals): Restore default colors only if necessary. (main): Don't call prep_non_filename_text here. (print_name_with_quoting): Call it here, instead. (prep_non_filename_text): Use C_RESET, not C_NORM. (print_color_indicator): Return bool, not void. Print nothing, when possible. (put_indicator): Call prep_non_filename_text the first time. * tests/misc/ls-misc: Test for above. * tests/ls/color-dtype-dir: Adapt: no escapes around regular file name. * TODO: Remove item. * NEWS: Mention this. 2008-02-17 Dan Jacobson ls: Improve description of --group-directories-first. * src/ls.c (usage) [--group-directories-first]: Improve description. * doc/coreutils.texi (Which files are listed): Likewise. 2008-02-16 Jim Meyering Avoid tests/cp/acl test failure. * tests/check.mk (TESTS_ENVIRONMENT) [CONFIG_HEADER]: Define to an absolute name, so it can be used from any point in the test hierarchy. Reported by James Youngman. 2008-02-16 James Youngman Use the gettime module in ls.c. Implement TODO list item to make ls.c use the gettime module. * TODO (ls): Now that we use gettime, remove the TODO entry. * src/ls.c: Use timespec.h and the gettime module. (current_time): Change type from time_t to struct timespec. (current_time_ns): Removed. (get_current_time): Removed. (print_long_format): Remove when and when_ns, since we have when_timespec anyway. Change type of variable six_months_ago from time_t to struct timespec. 2008-02-14 Jim Meyering groups: don't test printf and putchar calls for failure They are unnecessary, since we use gnulib's closeout module. * src/group-list.c (print_group): Remove explicit error tests. * src/groups.c (main): Likewise. (write_error): Remove function. 2008-02-13 James Youngman Replace groups.sh with groups.c. * src/groups.c (main): New file, replacing groups.sh. * src/group-list.c, src/group-list.h: New files, factored out of id.c, implementing the functionality that "id" and "groups" have in common. * src/id.c (print_full_info): Avoid a segfault when trying to print an error message if getgroups fails. (print_group_list): Move to group-list.c. (print_group): Likewise. * man/Makefile.am: When building groups.1, obtain the help text from src/groups.c, not src/groups.sh. (noinst_HEADERS): Add group-list.h. (group): Remove rule. (dist_man_MANS): Remove groups.1. * doc/coreutils.texi (groups: Print group names a user is in): Explain why "groups" and "groups $(id -un)" give different results in existing login sessions after you change the group database. (id: Print user identity): Likewise for "id". * po/POTFILES.in: Add src/group-list.c and src/groups.c. * NEWS: mention this. * AUTHORS: Update. 2008-02-12 Jim Meyering Move more test_skip_-using code to follow ". test-lib.sh". * tests/mv/acl: Likewise. * tests/cp/acl: Likewise. 2008-02-12 Peter Fales tests/touch/not-owner: Source test-lib.sh before using skip_test_. 2008-02-12 Jim Meyering * tests/Makefile.am (EXTRA_DIST): Remove strace. 2008-02-11 Jim Meyering tests: Migrate sourced strace file into a function, require_strace_. * tests/strace: Remove file. * tests/test-lib.sh (require_strace_): New function. * tests/mv/atomic: Use require_strace_, rather than ". strace". * tests/ls/stat-free-symlinks: Likewise. Peter Fales reported that stat-free-symlinks failed without strace. * tests/rm/inaccessible: Source test-lib.sh *before* using skip_test_. Reported by Peter Fales. 2008-02-10 Jim Meyering Ensure there are no removable (useless) if-before-free tests. * bootstrap.conf (gnulib_modules): Add useless-if-before-free. * Makefile.maint (sc_avoid_if_before_free): New rule. Use a better dirname emulation. * build-aux/check.mk (_dirname): Define. (am__check_pre): Use it. Avoid test failure when run with risky PATH ("." before /usr/bin). * build-aux/check.mk (approx_dirname_filter): Define. (am__check_pre): Emulate dirname using sed. Report and suggested fix from Bruno Haible in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12587/focus=12590 * build-aux/.gitignore: Remove file from version control. It's generated. Generate ChangeLog from git log. * bootstrap.conf (gnulib_modules): Add gitlog-to-changelog. Ensure that ChangeLog exists, for automake. * Makefile.am (gen-ChangeLog): New rule. (dist-hook): Depend on it. (EXTRA_DIST): Add ChangeLog-2006, ChangeLog-2007, ChangeLog-2008. Remove ChangeLog, dividing its content into ChangeLog-200? * ChangeLog: Remove file. * ChangeLog-2005: Prepend the 2005 entries. * ChangeLog-2006: New file. * ChangeLog-2007: New file. * ChangeLog-2008: New file. * ChangeLog: Manually update copyright notice at *bottom*. 2008-02-09 Jim Meyering tests: rm/fail-eperm: require-non-root in perl, not sh Since it creates no temporaries and since it requires non-root, do the require-non-root bit in perl, rather than using test-lib.sh. tests: Remove priv-check. Use new require_root_ function instead. * tests/priv-check: Remove file. * tests/Makefile.am (EXTRA_DIST): Remove priv-check. * tests/test-lib.sh (require_root_): New function. Use this function rather than sourcing the priv-check file. * tests/sample-test: Use require_root_ rather than priv-check. * tests/chown/basic: Likewise. * tests/cp/cp-a-selinux: Likewise. * tests/cp/preserve-gid: Likewise. * tests/cp/special-bits: Likewise. * tests/ls/nameless-uid: Likewise. * tests/misc/chcon: Likewise. * tests/mkdir/writable-under-readonly: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/rm/fail-2eperm: Likewise. * tests/rm/no-give-up: Likewise. * tests/rm/one-file-system: Likewise. * tests/tail-2/append-only: Likewise. * tests/touch/now-owned-by-other: Likewise. * tests/rm/fail-eperm: Use skip_if_root_ rather than priv-check. * Makefile.maint (sc_root_tests): Reflect this change: search for the new function name. 2008-02-09 Jim Meyering tests: factor out the perl-requiring code in many test scripts * tests/require-perl: New file. * tests/Makefile.am (EXTRA_DIST): Add require-perl. * tests/dd/skip-seek: Use it, and remove manual tests. * tests/du/files0-from: Likewise. * tests/ls/nameless-uid: Likewise. * tests/misc/base64: Likewise. * tests/misc/basename: Likewise. * tests/misc/cut: Likewise. * tests/misc/date: Likewise. * tests/misc/dircolors: Likewise. * tests/misc/dirname: Likewise. * tests/misc/expand: Likewise. * tests/misc/expr: Likewise. * tests/misc/factor: Likewise. * tests/misc/fmt: Likewise. * tests/misc/fold: Likewise. * tests/misc/head-elide-tail: Likewise. * tests/misc/ls-misc: Likewise. * tests/misc/md5sum: Likewise. * tests/misc/md5sum-newline: Likewise. * tests/misc/mktemp: Likewise. * tests/misc/od: Likewise. * tests/misc/paste-no-nl: Likewise. * tests/misc/pr: Likewise. * tests/misc/pwd-long: Likewise. * tests/misc/seq: Likewise. * tests/misc/sha1sum: Likewise. * tests/misc/sha1sum-vec: Likewise. * tests/misc/sha224sum: Likewise. * tests/misc/sha256sum: Likewise. * tests/misc/sha384sum: Likewise. * tests/misc/sha512sum: Likewise. * tests/misc/sort-merge: Likewise. * tests/misc/stat-printf: Likewise. * tests/misc/sum: Likewise. * tests/misc/sum-sysv: Likewise. * tests/misc/test-diag: Likewise. * tests/misc/tsort: Likewise. * tests/misc/tty-eof: Likewise. * tests/misc/unexpand: Likewise. * tests/misc/wc-files0-from: Likewise. * tests/misc/xstrtol: Likewise. * tests/mv/i-1: Likewise. * tests/rm/empty-name: Likewise. * tests/rm/fail-eperm: Likewise. * tests/rm/unreadable: Likewise. (EXTRA_DIST): *do* require require-perl as a stand-alone, 'source'able script. 2008-02-09 Jim Meyering tests: call skip_test_ in place of echo+exit 77 * tests/mv/no-target-dir: Likewise. * tests/other-fs-tmpdir: Likewise. * tests/rm/empty-name: Likewise. * tests/rm/fail-eperm: Likewise. * tests/rm/inaccessible: Likewise. * tests/rm/isatty: Likewise. * tests/rm/unreadable: Likewise. * tests/setgid-check: Likewise. * tests/sparse-file: Likewise. * tests/strace: Likewise. * tests/tail-2/append-only: Likewise. * tests/tail-2/big-4gb: Likewise. * tests/tail-2/tail-n0f: Likewise. * tests/touch/dangling-symlink: Likewise. * tests/touch/fifo: Likewise. * tests/touch/not-owner: Likewise. * tests/mv/i-3: Likewise. * tests/umask-check: Likewise. * tests/mv/acl: Likewise. * tests/cp/acl: Likewise. * tests/chgrp/deref: Likewise. * tests/chmod/setgid: Likewise. * tests/cp/existing-perm-race: Likewise. * tests/cp/file-perm-race: Likewise. * tests/cp/parent-perm-race: Likewise. * tests/du/2g: Likewise. * tests/du/8gb: Likewise. * tests/du/long-from-unreadable: Likewise. * tests/du/long-sloop: Likewise. * tests/du/slink: Likewise. * tests/ls/nameless-uid: Likewise. * tests/ls/stat-dtype: Likewise. * tests/misc/cat-proc: Likewise. * tests/misc/md5sum-newline: Likewise. * tests/misc/nice: Likewise. * tests/misc/od-x8: Likewise. * tests/misc/pwd-unreadable-parent: Likewise. * tests/misc/selinux: Likewise. * tests/misc/stty-row-col: Likewise. * tests/misc/tac-continue: Likewise. * tests/misc/arch: Likewise, and source $srcdir/../test-lib.sh *before* the use of skip_test_. tests: move the very-expensive file into test-lib.sh * tests/very-expensive: Remove file. * tests/test-lib.sh (very_expensive_): New function. * tests/Makefile.am (EXTRA_DIST): Remove very-expensive. * tests/cp/perm: Call the new function, rather than sourcing the file. * tests/tail-2/assert: Likewise. * tests/tail-2/assert-2: Likewise. * tests/du/2g: Likewise. tests: start migrating sourced-file function-like tests into test-lib.sh. * tests/acl: Remove file. * tests/test-lib.sh (require_acl_): New function. * tests/cp/acl: Use require_acl_ instead. * tests/mv/acl: Likewise. * tests/Makefile.am (EXTRA_DIST): Remove acl. tests: mv/acl: Don't mention "yes" as a partition name in diagnostic.