Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
4023 lines (3153 sloc) 155 KB
2007-12-31 Jim Meyering <>
* doc/coreutils.texi (Block size): Put braces around multi-digit
exponents. Reported by Darrel Francis.
Add a syntax check, so this doesn't recur. Reorganize existing checks.
* doc/ (sc-exponent-grouping):
(syntax_checks): New variable.
(sc-avoid-io, sc-avoid-non-zero, sc-avoid-timezone):
(sc-avoid-zeroes, sc-use-small-caps-NUL): New rules, extracted
from check-texinfo.
(check-texinfo): Depend on $(syntax_checks).
2007-12-30 Mike Frysinger <>
* src/dircolors.hin (TERM): Add gnome-256color.
2007-12-21 Ralf Wildenhues <>
* doc/coreutils.texi: Fix a typo. Avoid the term `relationals'.
2007-12-20 Jim Meyering <>
Use comma-separated list in ./configure --help output.
* Map commas to spaces in excluded-program list.
Use a comma-separated list, not a space-separated one.
* m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG):
Expect list of program names to be comma-separated.
Reported by Jan Bauke Douma.
Avoid another "make check" failure due to omitted programs.
* tests/ (require_built_): New function.
* tests/misc/groups-version: Use it to skip this test if
either groups or id is not built.
Avoid spurious "make check" failures due to omitted programs.
* man/ (distcheck-hook): Make check rules dependents of
this target, not of check-local, so that people aren't distracted by
failures due to programs omitted via --enable-no-install-program=...
2007-12-19 Paul Eggert <>
* src/uniq.c (usage): Improve wording in --help "Note".
2007-12-18 Jim Meyering <>
* src/uniq.c (usage): Note that sorting uniq's input is often useful.
Suggested by Eric Blake.
(usage): Say "key-selection", not "field-selection".
Quote example commands consistently.
2007-12-15 Jim Meyering <>
Version 6.9.91.
* Makefile.cfg (gpg_key_ID): Use new, longer signing subkey.
2007-12-12 Jim Meyering <>
* tests/mv/part-symlink: Redirect diff output to stderr.
2007-12-11 Jim Meyering <>
Add a test to exercise today's bug fix.
* tests/misc/selinux: Test for today's bug fix.
* NEWS: Mention the SELinux "ls -l" fix.
2007-12-11 Paul Eggert <>
"ls -l" wouldn't output "+" on SELinux hosts unless -Z was also given.
* src/ls.c (gobble_file): Also get the file context if -l is specified.
Treat getfilecon failures like file_has_acl failures.
(clear_files): Don't free it.
(gobble_file): Set unknown security contexts to it; that way, we
don't have to have special cases for unknown contexts.
(print_long_format, print_file_name_and_frills): Don't worry
about scontext being null, since it's always some string now.
2007-12-11 Jim Meyering <>
* NEWS: Add the "Bug fixes" heading.
2007-12-09 Jim Meyering <>
"rm" as root would fail to unlink a non-directory on OS X 10.4.x
* src/remove.c (remove_entry) ["can unlink directories"]: Fix a
mistakenly reversed condition.
* NEWS: Mention this bug fix.
Reported by Pieter Bowman.
2007-12-08 Jim Meyering <>
* src/c99-to-c89.diff: Adjust shred.c offsets.
2007-12-04 Jim Meyering <>
Reflect change in gnulib: don't include getpagesize.h,
now that it's provided by unistd.h.
* src/cat.c: Don't include getpagesize.h.
* src/copy.c: Likewise.
* src/dd.c: Likewise.
* src/shred.c: Likewise.
* src/split.c: Likewise.
2007-12-02 Jim Meyering <>
Copy a .po file into place also when the target doesn't exist.
* bootstrap (gnulib_tool): ... not just when the checksum differs.
So now, if I manually remove po/xx.po, rerunning bootstrap will
copy the latest into place.
Make my-distcheck depend on "check".
* Makefile.maint (my-distcheck): Also depend on "check", so I can't tag
and release something that fails "make check" (however harmless) when
run in a checked-out-from-git dir, but not in the distributed tarball.
* NEWS: Add the usual "Noteworthy changes in release 6.9.91..." line.
Remove just-installed su, if unable to make it set-UID root.
Normally, su isn't even installed. However, if you configure with
--enable-install-program=su, and then install with insufficient
privileges, we now make sure to remove the just-installed binary.
* src/ (install-exec-hook): Rename from install-exec-local,
so that this rule is guaranteed to be run *after* installation.
If unable to chown and chmod the installed "su" program, remove it.
Reported by Greg Schaefer.
2007-12-01 Bob Proulx <>
Make existing-perm-race executable.
* tests/cp/existing-perm-race: Update file mode.
2007-12-01 Jim Meyering <>
Version 6.9.90.
* NEWS: Remove the now-untrue statement about cp vs. dangling symlinks
Change release procedure: tag *before* running e.g., "make stable".
* Makefile.maint (vc-dist): Don't tag. Now, you must apply the tag
before running "make beta", "make stable", etc.
(vc-tag-check): Remove rule. No longer makes sense.
* Makefile.maint (vc-tag-check): Correct check for existing git tag.
Defer NEWS and ChangeLog checks until after the version-changing tag.
* Makefile.maint (alpha beta major): Don't depend on the
news-date-check changelog-check targets. They must fail before
applying the version-changing tag. Instead, run them after "vc-dist".
* NEWS: Record release date and new version number.
Mention some of the SELinux changes.
* src/stat.c (main): Adjust a comment.
* TODO: Add some entries (documentation needed),
and remove the one for mktemp.
Add "extern" keyword to declaration of cp_options_default.
* src/copy.c (cp_options_default): Mark as "extern", so the
"sc_tight_scope" part of "make distcheck" passes.
2007-12-01 Jim Meyering <>
Change comments: say bug present up to coreutils-6.9, not fixed in 6.10.
* tests/cut/ Adjust comment.
* tests/misc/cut: Likewise.
* tests/misc/ls-misc: Likewise.
* tests/misc/od: Likewise.
* tests/misc/stty-invalid: Likewise.
* tests/tr/ Likewise.
2007-11-29 Paul Eggert <>
Add a test for cp -p and existing file permissions.
* tests/cp/ (TESTS): Add existing-perm-race.
* tests/cp/existing-perm-race: New test. It isn't much of a
test yet, since it's hard to catch the race, but it has a FIXME
that will let us do a better test later.
2007-11-28 Paul Eggert <>
Fix a security race with "cp -p A B" when B already exists.
* src/copy.h (struct cp_options): New member owner_privileges.
* src/copy.c (USE_ACL): Define to 0 if not defined, for convenience.
(owner_failure_ok): New function.
(set_owner): Avoid a security-related race by doing an extra chmod
first if it looks like there might be trouble right after a chown.
Accept a source struct stat rather than a uid and gid, and
accept a boolean NEW_DST and destination struct stat.
All callers changed.
* src/copy.h (cp_options_default): New function, replacing the
old chown_privileges.
* src/copy.c (cp_options_default): Likewise.
* src/cp.c (cp_option_init): Use it.
* src/install.c (cp_option_init): Likewise.
* src/mv.c (cp_option_init): Likewise.
2007-11-30 Jim Meyering <>
Move the very-expensive file into
* tests/very-expensive: Remove file.
* tests/ (very_expensive_): New function.
* tests/ (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.
Avoid a spurious test failure when build directory is set-GID.
* tests/cp/fail-perm: Ensure that '.'s set-GID bit is off.
Be extra careful to quote $abs_top_builddir-derived names.
* tests/misc/ls-misc (shell_quote): New function.
Use it to quote file names derived from $abs_top_builddir,
in case it contains shell meta-characters. This is not currently
needed, since CuTmpdir detects the fishy name and skips the test.
But it's important enough to add the extra protection.
Reported by Ralf Wildenhues.
Include test name in the "unsafe working directory name" diagnostic.
* tests/ (import): If $ME is '-', use $prefix.
2007-11-30 Ralf Wildenhues <>
Add quotes to protect against white space in build dir name.
* tests/ (TESTS_ENVIRONMENT): Quote $(abs_srcdir).
* tests/chmod/setgid: Quote absolute names.
* tests/misc/help-version: Likewise.
* tests/misc/pwd-unreadable-parent: Likewise.
* tests/rmdir/ignore: Likewise.
* tests/ Likewise.
Define `tst', for CU_TEST_NAME.
* build-aux/ (am__check_pre): Set `tst', for
CU_TEST_NAME in tests/
* tests/ (END): Do not do the cleanup if $dir is not
defined, because it then goes wild and changes the mode of all
directories below $HOME. Undefined $dir can happen if the test
is to be skipped because of an unsafe working directory name.
2007-11-28 Paul Eggert <>
Close a file descriptor leak when cp --preserve=context fails.
* src/copy.c (copy_reg): Close dest_desc too, if getfscreatecon
or fsetfilecon fail.
2007-11-28 Jim Meyering <>
* README: Document the known problem with gettext <= 0.17.
2007-11-28 Paul Eggert <>
* gl/modules/randread (Depends-on): Remove nonexistent rand-isaac.
2007-11-27 Jim Meyering <>
Don't block use of 'cat' or 'wc' in "make check".
* Makefile.maint (my-distcheck): Add "cat" and "wc" to the list
of programs that we can't blacklist.
Fix md5sum+sha*sum on sparc: regenerate files with latest autoconf.
* configure et al: Regenerate with very latest version of autoconf
(v2.61a-312-gb524b0f), to fix md5sum and sha*sum miscompilation
on big-endian systems (like sparc) due to lack of the required
definition in of WORDS_BIGENDIAN in lib/config.h.
2007-11-26 Jim Meyering <>
setuidgid.c: more cleanup
* src/setuidgid.c: Include "mgetgroups.h".
(main): Don't presume there's a fixed limit on the maximum number
of group IDs. Don't use NGROUPS; it's artificially low.
Change the name of a local: s/gids_count/n_gids/.
Remove non-portable "const": s/const int tmp =.../int tmp =.../
2007-11-25 Jim Meyering <>
Document install's -D option.
* doc/coreutils.texi (install invocation): Document -D.
Reported by Akim Demialle.
setuidgid: Update --help output.
* src/setuidgid.c (usage): Describe -g GID[,GID1...] option.
Mention that USER may be a numeric ID or a user name.
2007-11-24 Jim Meyering <>
Tweak new test.
* tests/cp/preserve-gid: Split some long lines.
Prepend "+" to numeric uid and gid chown arguments, on principle.
Use skip_test_.
setuidgid: minor clean-up.
* setuidgid.c: Include "xstrtoul.h".
(main): Detect overflow in string-to-gid_t and -to-uid_t conversions.
Improve diagnostics.
* src/setuidgid.c: Normalize leading white space: no more TABs.
Test the new feature: cp -p preserves the GID whenever possible.
* tests/cp/preserve-gid: New file. Test for today's change.
* tests/cp/ (TESTS): Add preserve-gid.
* tests/ (all_t): Add tc.
(tc): New target.
setuidgid: accept numeric UID, and new option -g GID,GID1,GID2,...
* src/setuidgid.c: Add functionality for the new test above.
"cp -p" tries to preserve GID even if preserving the UID fails.
* NEWS: Mention this new feature.
* src/copy.c (set_owner): Try to preserve just the GID,
when initial fchown/lchown fails.
* src/cp.c (re_protect): Likewise.
2007-11-23 Jim Meyering <>
* src/runcon.c (main): Remove unused parameter, "envp".
Add tests to show new class of strings accepted by date -d.
* tests/misc/date (rel-1day, rel-plus1): New tests for the recent
change in gnulib's getdate.y.
* NEWS: Mention the fix.
2007-11-22 Jim Meyering <>
Quiet warnings about unused parameters.
* src/copy.c (set_author) [!HAVE_STRUCT_STAT_ST_AUTHOR]:
"Use" each of the parameters.
* GNUmakefile: Correct the "rerunning..." diagnostic.
Make it easier to diagnose PATH-induced "make distcheck" failures.
* Makefile.maint (write_loser): Define.
(my-distcheck): Use an always-failing wrapper script, that gives
a diagnostic, not "false".
Run only "make -C tests check" with the restrictive PATH.
Run the new gnulib-tests/ with the usual PATH.
cp: by default, refuse to copy through a dangling destination symlink
* NEWS: Mention this change.
* doc/coreutils.texi (cp invocation): Describe the new behavior.
* src/copy.c: No longer include "canonicalize.h".
(copy_reg): Upon failure to open a dangling destination symlink,
don't canonicalize the name, but rather fail (default) or, with
POSIXLY_CORRECT, repeat the open call without O_EXCL (potentially
* src/copy.h (struct cp_options) [open_dangling_dest_symlink]:
New member. Reorder the others, grouping "bool" and "enum"
members together.
* tests/cp/thru-dangling: Test for changed and new behavior.
* src/cp.c (cp_option_init): Initialize new member.
* src/install.c (cp_option_init): Likewise.
* src/mv.c (cp_option_init): Likewise.
2007-11-21 Pádraig Brady <>
* doc/coreutils.texi (split invocation): Improve the
descriptions of the split command options.
2007-11-21 Jim Meyering <>
* src/c99-to-c89.diff: Adjust seq.c offsets.
2007-11-18 Paul Eggert <>
* src/seq.c (print_numbers): Rewrite in an attempt to avoid the
more-general rounding issues exposed by the previous patch.
2007-11-18 Jim Meyering <>
* src/c99-to-c89.diff: Adjust seq.c offsets.
Remove unused parameter in remove.c.
* src/remove.c (fd_to_subdirp): Remove unused parameter.
(remove_cwd_entries, remove_dir): Update callers.
bootstrap: work also with 4-argument variant of AC_INIT (from gnulib)
2007-11-18 Sergey Poznyakoff <>
* bootstrap (gnulib_extra_files): Adjust sed command.
2007-11-17 Jim Meyering <>
Correct preceding patch.
* src/seq.c (print_numbers): Also handle first < last && step < 0.
* tests/misc/seq [empty-rev]: New test for this case.
"seq .1 .1" would mistakenly generate no output on some systems
* NEWS: Say this.
* src/seq.c (print_numbers): Handle another floating point corner case.
This avoids failure of seq's eq-wid-7 test on FreeBSD 6.1.
2007-11-16 Paul Eggert <>
Port tests/rmdir/ignore away from GNU/Linux.
* tests/rmdir/ignore: Don't assume that rmdir($PWD) will fail
with errno==ENOTEMPTY when $PWD is not empty; Posix also allows
rmdir to fail with errno==EBUSY.
2007-11-16 Jim Meyering <>
Avoid an obscure new "make distcheck" failure.
* Makefile.maint (my-distcheck): Also allow 'mv', for its use
in gnulib-tests/Makefile.
2007-11-16 Paul Eggert <>
Port readlink-fp-loop to Solaris.
* tests/misc/readlink-fp-loop (symlink_loop_msg): New var,
which records the symlink-loop message, whose wording is
not standardized by Posix. Do not rely on "echo x > p/1"
to work when p/1 has a lot of indirect symlinks. (I'm surprised
that it works on Linux. Perhaps a Linux bug?)
2007-11-15 Paul Eggert <>
Port to Solaris 'make' and use a Posixish shell on Solaris.
* bootstrap.conf (gnulib_modules): Add gnu-make, posix-shell.
* build-aux/ (SHELL): Set to $(PREFERABLY_POSIX_SHELL),
so that commands can assume Posix syntax.
(ENABLE_HARD_ERRORS, TEST_LOGS): Don't use GNU Make's "?=" syntax.
(SH_E_WORKAROUND): New macro.
(am__check_pre, $(TEST_SUITE_LOG)): Use it.
(am__check_pre): Fail if "mkdir" fails. Use $(SHELL)
rather than relying on the "#!/bin/sh" in the file, so that tests
can use Posix syntax.
(am__check_pre, am__tty_colors): Use $$src rather than $$<, to
support the Posix-make $(TEST_LOGS) rule.
(%.log: %.test, %.log: %$(EXEEXT)): Remove unused inference rules
that rely on a GNU Make extension and cause Solaris 'make' to fail.
(SUFFIXES): New macro, so that we can use Posix style inference rules.
(%.log: %): Use this rule only if GNU_MAKE.
Set $$src so that macros can use $$src rather than $$<.
(CHECK-FORCE, DEPENDENCY, $(TEST_LOGS)): New macros and rules,
which rely only on Posix 'make' semantics, and are used only with
non-GNU 'make' implementations. $(TEST_LOGS) invokes 'make'
recursively (and a bit inefficiently) to simulate the GNU 'make'
(.log.html): Renamed from "%.html: %.log", so that it relies only
on Posix 'make' semantics.
(check-clean, .PHONY): Do not depend on check-clean-local, since
Solaris 'make' complains about nonexistent rules like that.
* src/ (SUFFIXES): Remove; no longer needed.
(groups): Use a specific rule rather than an inference rule that
is only instantiated once. The inference-rule approach does not
work with Solaris 'make', which gets confused by the "groups:
Makefile" line. It's not clear from the Posix spec that Solaris
'make' is buggy here, so instead of worrying about it, rewrite
the makefile so that it clearly conforms to Posix.
GNU 'make' does this automatically for us, but Solaris 'make'
2007-11-15 Paul Eggert <>
Port to Solaris 8 perl, which does not support "use warnings;".
* tests/dd/skip-seek: Skip test if "use warnings;" fails.
* tests/du/files0-from: 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/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/test-diag: Likewise.
* tests/misc/tsort: 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/unreadable: Likewise.
2007-11-15 Andreas Schwab <>
* m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix syntax error.
Remove trailing space from result.
2007-11-15 Jim Meyering <>
Avoid misbehavior of a cross-device "mv" or "install".
Those programs must not dereference a destination symlink.
* src/copy.c (copy_reg): Don't treat a dangling destination symlink
differently in move mode. In move mode, the only way the added
O_EXCL can cause failure is when some other process has recreated
the file this code unlinked a few instructions before.
2007-11-14 Jim Meyering <>
Another bootstrap kludge.
* bootstrap: Ensure gnulib-tests/test-*.sh are executable
#ifdef-out matchpathcon-related code, for now.
* src/install.c (setdefaultfilecon): #ifdef-out all of the
matchpathcon-related code, until it's more efficient.
(setdefaultfilecon): Instead of the above, stub-out the entire function.
Use gnulib's stpncpy module, now required by install.c
* bootstrap.conf (gnulib_modules): Add stpncpy.
Enable gnulib-tool's --with-tests option.
* bootstrap: After all is done, transform the generated
* bootstrap.conf (gnulib_tool_option_extras): Set it here.
* gnulib-tests/ New file.
* (SUBDIRS): Add gnulib-tests.
* (AC_CONFIG_FILES): Add gnulib-tests/Makefile.
* m4/jm-macros.m4 (coreutils_MACROS) [ARGMATCH_DIE_DECL]: Omit the
"extern " prefix to "void usage ()", so that the macro string value can
be used to construct a function definition in gnulib's test-argmatch.c.
2007-11-12 Benno Schulenberg <>
Clarify description of cp's -a option.
* src/cp.c (usage) [-a]: Remove unnecessary 'P'.
Since option -d of 'cp' includes the function of -P, mentioning the
latter in the description of option -a is redundant and therefore
slightly confusing, as the reader tries to figure out what it adds.
* doc/coreutils.texi (cp invocation): Likewise: s/-dpPR/-dpR/.
2007-11-09 Jim Meyering <>
bootstrap: fix typo to enable use of $gnulib_tool_option_extras.
* bootstrap (gnulib_tool_options): Add a space before the use
of $gnulib_tool_option_extras, so that it's separated from the
preceding argument.
install+SELinux: reduce a 12x performance hit to ~1.5x
* src/install.c (setdefaultfilecon): Call matchpathcon_init_prefix,
to mitigate what would otherwise be a large performance hit due to
the use of matchpathcon.
Dan Walsh suggested the use of matchpathcon_init_prefix.
* gl/lib/ (matchpathcon_init_prefix): Define.
2007-11-08 Jim Meyering <>
Adapt to gnulib's s/jm_/gl_/ cache variable renaming.
* Change the cache variable name prefix "jm_" to "gl_",
to match today's change in gnulib.
2007-11-05 Jim Meyering <>
Fix bootstrap failure to handle files like lib/uniwidth/cjk.h.
* bootstrap (cp_mark_as_generated): Create any required parent
destination directories before copying a file into place.
* src/c99-to-c89.diff: Adjust offsets.
Don't use GNU-sed-specific \< \> operators here, either.
* m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Use a loop, as below.
Use tighter regexps when performing name substitution.
* man/ (mapped_name): Add ^ and $$ anchors.
Don't use GNU-sed-specific \< \> operators.
* (MAN): Transform ginstall.1 to install.1 using
a loop, rather than sed with \<...\>.
Problem reported by Bruno Haible.
Andreas Schwab reminded me that \< and \> are not portable.
Get git-version-gen from gnulib.
* build-aux/git-version-gen: Remove file.
* build-aux/.gitignore: Add git-version-gen.
* bootstrap.conf (gnulib_modules): Add git-version-gen.
2007-11-03 Jim Meyering <>
git-version-gen: Sync from autoconf's version.
* build-aux/git-version-gen: Run git-status
Sync copyright and scriptversion bits from gnulib.
* build-aux/git-version-gen: No semantic change.
Change the first '-' to '.' in the snapshot version string,
e.g., 6.9-377-08144 -> 6.9.377-08144
* build-aux/git-version-gen: ... and add comments.
seq: add another test for the %% bug.
* tests/misc/seq (fmt-c): Test the other fixed case, too.
2007-11-03 Paul Eggert <>
Fix bug with "seq 10.8 0.1 10.95", plus another bug with %% in format.
* NEWS: Mention the %%-in-format bug fix.
* src/seq.c (struct layout): New type.
(long_double_format): New arg LAYOUT. Fill it in. Fix mishandling
of %% in formats.
(print_numbers): New arg LAYOUT. Don't convert LAST to output format
when deciding whether to go slightly past LAST. Instead, convert
X to output format and back. This fixes a bug reported by
Andreas Schwab in
where "seq 10.8 0.1 10.95" would output 11.0 on platforms where
10.95 rounds to a value that prints as 11.0 when only one digit
past the decimal point is asked for.
(main): Compute layout, for benefit of print_numbers.
* tests/misc/seq (float-3): Undo previous change, since the bug
should be fixed now.
(fmt-b): New test, for the %% bug.
2007-11-01 Jim Meyering <>
* tests/misc/printf-surprise: Correct sed transform.
Reported by Bob Proulx.
Add example inspired by "make dist" running gzip and lzma in sequence.
* doc/coreutils.texi (tee invocation): Show how to run tar just
once, compressing the tee'd output streams in parallel.
Say that the first process substitution example is contrived.
* doc/coreutils.texi (tee invocation): ... and show how to do
it properly. Pointed out by James Antill.
Use mktemp, not mkdtemp, to create test directories.
* tests/ Use the mktemp binary we've just built,
not the mkdtemp script.
* tests/mkdtemp: Remove file.
* tests/ (EXTRA_DIST): Remove mkdtemp.
Adjust a seq subtest not to depend on the vagaries of floating point.
* tests/misc/seq (float-3): Use 10.94 as the endpoint, not 10.95,
since 10.95 was precisely in the middle of the interval, and with
a %.1f format could map to either 10.9 or 11.0.
Reported by Mike Frysinger
Make the new printf-surprise test more precise.
* tests/ (require_ulimit_): New function.
* tests/misc/printf-surprise: Use ulimit -v to trigger the fixed bug,
and rather than checking printf's exit status (which would go wrong
on FreeBSD 6.1, since their printf(3) function doesn't require
lots of memory in this case) simply test whether it outputs
the first 10 bytes.
Accommodate FreeBSD 6.1 hard-link-to-symlink differences.
* tests/cp/same-file: Detect when linking to a symlink links to
the target of the symlink (FreeBSD 6.1 does this, Linux does not),
and skip the few tests that would otherwise fail.
Redirect output of final comparison to stderr, since all stdout
is already redirected.
2007-10-31 Jim Meyering <>
Fix a "make distcheck" failure.
* Makefile.maint (my-distcheck): Don't stub-out dirname,
since build-aux/ now uses it.
* bootstrap.conf (gnulib_modules): Add xprintf-posix.
2007-10-30 Jim Meyering <>
Avoid seq floating-point test failure on FreeBSD 6.1.
* tests/misc/seq (float-4): Also accept -0.0.
2007-10-29 Jim Meyering <>
Change a "make dist" diagnostic.
* GNUmakefile: Don't imply that $(_curr-ver) is the new version string.
2007-10-29 Bob Proulx <>
Improve color terminal escape usage.
* build-aux/ (am__tty_colors): Use 'tput' to deduce
terminal color capabilities.
2007-10-29 Jim Meyering <>
Don't try to colorize a dumb terminal.
* build-aux/ (am__tty_colors): Skip colors if $TERM is "dumb".
Thanks to Bob Proulx.
Remove gnulib's printf-posix module, for now.
* bootstrap.conf (gnulib_modules): It caused too many test failures.
Remove spurious semicolon after "else".
* build-aux/ (am__tty_colors): Fix syntax error.
If $TERM is empty, don't use colors. This helps the buildbot,
since it produces its result in an environment with a tty, but
we don't want color codes in that case.
* build-aux/ (am__tty_colors): Test for nonempty $TERM.
Suggestion from Bob Proulx.
Always initialize terminal colorization string variables.
* build-aux/ (am__tty_colors): Always initialize red, grn, etc.,
In case they're defined in the environment.
Avoid test failure in non-srcdir build vs. the git tree.
* tests/ (vc_exe_in_TESTS): Run this test only in a
srcdir build directory. Reported by Andreas Schwab.
2007-10-28 Jim Meyering <>
Define ENOTSUP, not ENOSYS. Needed on OpenBSD 3.9.
* gl/lib/ (ENOTSUP): Define if missing.
* gl/lib/ Likewise.
Define ENODATA, for FreeBSD 5.0 and 6.1.
* src/system.h (ENODATA): Define, if missing.
Run autoreconf, not just autoconf, to avoid warnings.
* GNUmakefile (dummy): Otherwise, we'd sometimes get a warning
about autoconf version mismatch between what was used to generate
aclocal.m4 and the currently-running autoconf.
Require gnulib's printf-posix module, to support Interix.
* bootstrap.conf (gnulib_modules): Add printf-posix.
Help xgettext recognize more printf-style format strings.
* bootstrap.conf (XGETTEXT_OPTIONS): Add directives for
error, error_at_line, xasprintf, xfprintf and xprintf.
2007-10-27 Jim Meyering <>
Adjust format string so msgfmt doesn't object.
* src/df.c (main): Use "%s%s" (not %smsg) to print "msg" with or
without a "Warning: " prefix. Reported by Clytie Siddall.
Clean up tests/
* tests/ (EXTRA_DIST): Remove $(TESTS). No longer defined.
(TESTS_ENVIRONMENT): Remove definition.
2007-10-26 Jim Meyering <>
* build-aux/ Merge with latest from Akim.
Add a test for the printf fix of 2007-10-21.
* tests/misc/printf-surprise: New file. Test for 2007-10-21's fix.
* tests/misc/ (TESTS): Add printf-surprise.
2007-10-24 Micah Cowan <>
Remove vestiges of cvs-gnulib-checkout process. Now we use git.
* bootstrap: Remove support for now-unnecessary option, --cvs-user,
and envvars CVS_USER, CVS_RSH.
2007-10-24 Micah Cowan <>
Tell xgettext that "ARG1 % ARG2" is not a C format string.
* src/expr.c (usage): Add a comment to override xgettext's default
behavior, which would classify "ARG1 % ARG2" as a fprintf-style
format string. Reported by Clytie Siddall.
2007-10-24 Jim Meyering <>
Avoid diagnostics from sha1sum when there is no cached checksum.
* bootstrap (update_po_files): Skip the sha1sum check if the po.s1
file hasn't been created yet.
Get gnulib from the git repository, not from an obsolete cvs one.
* bootstrap: Suggestion from Micah Cowan.
Doc improvements.
* README-hacking: Prefer the no-hyphen variant of git commands,
e.g., use "git pull" not "git-pull".
Don't presume that the only way to read this document is via a
prior git clone: provide instructions for cloning coreutils, too.
* README-hacking: Add "cd automake" in build instructions.
From Bob Proulx.
Don't fail part 2 of tests/rm/unreadable when run as root.
* tests/rm/unreadable: With UID == 0, expect different results.
Reported by Mike Frysinger.
2007-10-23 Jim Meyering <>
* README-hacking: Refer to LZMA Utils <>.
2007-10-22 Paul Eggert <>
* README-hacking: Describe how to build with LZMA.
2007-10-22 Jim Meyering <>
Remove git-version-gen's first parameter.
* build-aux/git-version-gen: Add comments.
Remove first command-line parameter.
* Remove corresponding first argument.
* GNUmakefile (_curr-ver): Likewise.
2007-10-21 Jim Meyering <>
* NEWS: Mention the printf fix.
Reorder tests to run more basic ones earlier.
* tests/misc/ (TESTS): Reorder.
* tests/ (SUBDIRS): Reorder.
tr: do not reject an unmatched [:lower:] or [:upper:] in SET1.
* NEWS: Mention this.
* src/tr.c (get_next) [RE_CHAR_CLASS]: Don't skip the loop when
processing [:lower:] and [:upper:].
(main): Require [:lower:] or [:upper:] in SET1 only when
when one of those is specified in SET2.
* tests/tr/ Add tests for this fix.
Reported by Per Starbäck.
2007-10-20 Jim Meyering <>
* tests/misc/help-version: Add a comment.
Detect printf(3) failure due to ENOMEM.
* src/printf.c: Include "xprintf.h"
(print_direc): Use xprintf, rather than printf.
* bootstrap.conf (gnulib_modules): Add xprintf.
* po/ Add lib/xprintf.c.
Reported by Bruno Haible.
Put always-failing programs first in PATH, so tests cannot mistakenly
run installed versions.
* Makefile.maint (my-distcheck): Set up a bogus bin/ dir, to be used
for "make check".
* doc/coreutils.texi (tee invocation): Fix typo. Add a little.
Add a cross-reference to bashref's Process Substitution node.
Adjust tests to pass, now that ones use
* tests/ (vc_exe_in_TESTS): Adjust regexp not to match the
"TESTS = $x-tests" line in each file.
* tests/sort/main: Remove this unused file.
Ensure that tests use the right $PATH.
* tests/ Include $(top_srcdir)/tests/
2007-10-20 Bob Proulx <>
Prevent "make check" from leaving mktemp /tmp/tmp.* files behind.
* tests/misc/help-version (mktemp_args): Tell mktemp to create
its temporary file in the current directory.
2007-10-16 Jim Meyering <>
Show how to make tee redirect to multiple processes.
* doc/coreutils.texi (tee invocation): Tee can redirect output
to multiple _processes_, too.
2007-10-14 Jim Meyering <>
Pull all TESTS_ENVIRONMENT settings "up" into tests/
* tests/ (TESTS_ENVIRONMENT): Remove definition.
* tests/chgrp/ Likewise.
* tests/chmod/ Likewise.
* tests/chown/ Likewise.
* tests/cp/ Likewise.
* tests/dd/ Likewise.
* tests/du/ Likewise.
* tests/install/ Likewise.
* tests/ln/ Likewise.
* tests/ls/ Likewise.
* tests/misc/ Likewise.
* tests/mkdir/ Likewise.
* tests/mv/ Likewise.
* tests/readlink/ Likewise.
* tests/rm/ Likewise.
* tests/rmdir/ Likewise.
* tests/tail-2/ Likewise.
* tests/touch/ Likewise.
[CONFIG_HEADER, build_programs, host_os, host_triplet, PATH]:
[REPLACE_GETCWD, CU_TEST_NAME]: Add definitions here.
* tests/misc/pwd-long: Use $abs_top_builddir/src, not $BUILD_SRC_DIR.
* tests/dd/skip-seek: Don't use $ENV{PROG}.
* tests/rm/empty-name: Likewise.
* tests/rm/unreadable: Likewise.
* tests/mv/i-1: Likewise.
Fix a minor typo.
* (AC_INIT): Fix a typo (s/9.6/6.9/) that makes a
difference only when running "make dist" without a .git/ subdir.
2007-10-09 Jim Meyering <>
Move the help-version test into misc/.
* tests/help-version: Move to...
* tests/misc/help-version:
Source, as usual.
Use $abs_top_builddir, rather than ".." and "../..".
Make the runcon-no-reorder test slightly more general.
* tests/misc/runcon-no-reorder: Don't hard-code "unconstrained_t".
Use slightly more general "runcon $(id -Z)".
Suggestion from Stephen Smalley.
Skip the chcon test on a system with no SELinux support.
* tests/ (require_selinux_): New function.
* tests/misc/chcon: Use it.
* tests/misc/selinux: Use it here, too.
* tests/cp/cp-a-selinux: and here.
* tests/selinux: Remove file.
* tests/ (EXTRA_DIST): Remove selinux.
Reported by Mike Frysinger and Bauke Jan Douma.
* src/dircolors.hin: Recognize .lzma as a compressed-file suffix.
* (AM_INIT_AUTOMAKE): Use dist-lzma, rather than dist-bzip2.
Now that we don't install su, don't make misleading suggestions.
* src/ (install-exec-local) [$(INSTALL_SU) != yes]:
Don't suggest running "make install-root".
(uninstall-local) [$(INSTALL_SU) != yes]: Don't even check
the installed binary.
2007-10-08 Jim Meyering <>
When forming a truncated name, use the "[...]" prefix even for
an extremely long name in the current directory
* src/remove.c (full_filename_): Rename a local variable.
Use two separate "truncated" variables, in case the second
call to right_justify does not indicate any truncation -- which
would happen only if the single component FILENAME were longer
than 511 bytes and DIR_NAME were empty.
rm could malfunction under unusual circumstances:
When operating on a relative name longer than 511 bytes,
and (when either processing a directory that is neither writable
nor readable (but still searchable) or when determining whether
to prompt), and encountering an ENOMEM error while forming the
file name, rm would operate on a truncated-to-511-byte name
starting with "[...]" rather than the intended one.
* NEWS: Describe the bugs.
* src/remove.c: Correct two misuses of full_filename:
(full_filename0, xfull_filename): New functions.
(full_filename_): Rewrite to use full_filename0.
(AD_pop_and_chdir): Use xfull_filename, not full_filename.
(write_protected_non_symlink): Likewise.
2007-10-07 Jim Meyering <>
Don't let a helper function modify errno.
* src/remove.c (full_filename_): Save and restore errno.
Spotted by Bruno Haible.
Reflect 2->3 GPL copyright version update in gnulib.
* gl/lib/tempname.h: Update copyright from gnulib.
* gl/lib/tempname.c: Likewise.
* .x-sc_GPL_version: Don't make an exception for those two files.
* (AM_INIT_AUTOMAKE): Don't use dist-lzma just yet.
New program: mktemp.
* NEWS: Mention this.
* README: Add mktemp to the list.
* AUTHORS: Add this: mktemp: Jim Meyering
* src/mktemp.c: New file.
* src/ (bin_PROGRAMS): Add mktemp.
(mktemp_LDADD): Add $(LIB_GETHRXTIME).
* man/mktemp.x: New file.
* man/ (dist_man_MANS): Add mktemp.1.
(mktemp.1): New dependency.
* man/.cvsignore: Add mktemp.1.
* man/.gitignore: New file.
* src/.cvsignore, src/.gitignore: Add mktemp.
* tests/misc/mktemp: New file.
* tests/misc/ (TESTS): Add mktemp.
* tests/ (run_tests): Give the POST-test function
access to stdout and stderr contents, so it can verify that
the named-on-stdout file/dir does indeed exist and has proper
permissions, etc.
* Add src/mktemp.c.
Make tempname more random, via the randint module.
* gl/modules/tempname (Depends-on): Add randint and stdbool.
* gl/lib/tempname.c: Include randint.h and stdbool.h.
(uint64_t): Remove definition. Not needed.
[_LIBC] (RANDOM_BITS): Remove this block, now that we have proper
random bits.
(check_x_suffix): New function.
(gen_tempname_len): Rename from __gen_tempname.
Add a parameter, x_suffix_len, telling how many X's there must be at
the end of the template.
Use pseudo-random numbers all the way, rather than adding 7777
from one iteration to the next.
(__gen_tempname): New function, to call gen_tempname_len, requiring a
suffix length of 6.
* gl/lib/tempname.h: Add prototype for gen_tempname_len.
Convert coreutils' rand*.{c,h,m4} into modules.
First step: move these files to gl/lib:
* lib/rand-isaac.c, lib/rand-isaac.h
* lib/randint.c, lib/randint.h
* lib/randperm.c, lib/randperm.h
* lib/randread.c, lib/randread.h
Step 2: add modules/rand* and remove now-unneeded .m4 files.
* gl/modules/randint: New file.
* gl/modules/randperm: New file.
* gl/modules/randread: New file.
* m4/randint.m4: Remove file.
* m4/randperm.m4: Remove file.
* m4/randread.m4: Remove file.
Step 3: use the new modules
* bootstrap.conf (gnulib_modules): Add randint and randperm.
* m4/prereq.m4 (gl_RANDINT, gl_RANDREAD, gl_RANDPERM): Don't require;
These have been removed.
(gl_ROOT_DEV_INO): Don't require; already handled via bootstrap.conf.
Copy from gnulib the parts of tempname that we'll modify.
* gl/lib/tempname.c: Copy from gnulib.
* gl/lib/tempname.h: Likewise.
* gl/modules/tempname: Likewise.
Allow GPLv2 on temporarily(?)-imported file from gnulib/libc.
* .x-sc_GPL_version: New file.
* (EXTRA_DIST): Add .x-sc_GPL_version
2007-10-07 Jim Meyering <>
Avoid a pseudo-leak in sort.
* src/sort.c (main) [lint]: Avoid a nominal leak.
Use puts, rather than printf ("%s\n". Slightly cleaner.
* src/tsort.c (tsort): ...and more efficient.
Avoid seq malfunction on non-POSIX systems: mingw, BeOS, Interix.
* bootstrap.conf (gnulib_modules): Add vasprintf-posix.
Suggestion from Bruno Haible.
Avoid a used-uninitialized error.
* src/copy.c (copy_internal): Don't overload "use_stat".
2007-10-05 Jim Meyering <>
Make a failing cross-partition mv give a sensible diagnostic.
A cross-partition move of a file in a sticky tmpdir and owned by
another user would evoke an invalid diagnostic after copying it:
mv: cannot remove `x': Operation not permitted
Either of the following (mv.c, remove.c) changes would fix the bug by
itself. I think it's slightly better to use both; the added cost is
minimal: mv: an extra lstat-per-mv-cmdline-arg-that-goes-cross-partition,
rm: an extra lstat-per-unlink-that-fails-w/EPERM.
* src/remove.c (remove_entry): Also lstat the file upon EPERM.
* src/mv.c (rm_option_init): Initialize root_dev_ino just as is done
in rm, so that a cross-partition invoked remove.c:rm call works the
same way as one invoked from the command-line use of "rm". That
setting of root_dev_ino makes rm() do the equivalent of an additional
lstat for each argument, which in turn gives rm enough information to
issue the right diagnostic.
* tests/mv/sticky-to-xpart (version): New file. Test for the above.
* tests/mv/ (TESTS): Add sticky-to-xpart.
Arrange for "make check-root" to run the new root-only test.
* tests/ (tb): New target, to run the new root-only test.
(all_t): Add tb.
* src/c99-to-c89.diff: Adjust offsets.
rather than in every that needs it.
* tests/misc/ (TESTS_ENVIRONMENT): Likewise.
2007-10-04 Jim Meyering <>
Adapt to new gnulib naming scheme.
* gl/lib/ Rename from gl/lib/se-context_.h.
* gl/lib/ Rename from gl/lib/se-selinux_.h.
* gl/m4/selinux-context-h.m4: Remove use of AC_LIBSOURCES.
* gl/m4/selinux-selinux-h.m4: Likewise.
* gl/modules/selinux-h (Files, Reflect renaming.
( [lib_SOURCES]: Add and
* lib/search_.h: Remove unused file.
* bootstrap (slurp): Adapt to _.h -> .in.h name change.
(update_po_files): Work also when there are no .po files in po/.
Remove test program: lib/t-fpending.c.
* lib/t-fpending.c: Remove file. Now, this test is in gnulib.
* lib/ Remove associated rules.
* .gitignore: Remove lib/t-fpending.
2007-10-03 Jim Meyering <>
* tests/misc/selinux: Skip this test if the initial chcon fails.
2007-10-02 Jim Meyering <>
Never copy through a symlink that cp has just created.
* src/copy.c (copy_internal): When same-file detection requires
'stat'ing the destination file, also 'lstat' it and ensure that
it wasn't the destination of a preceding copy operation.
This bug was introduced on 2007-06-18.
* tests/cp/abuse: New test for the above.
* tests/cp/ (TESTS): Add abuse.
2007-09-30 Jim Meyering <>
cp: do not abbreviate in --help output.
* src/cp.c (usage): Don't abbreviate: s/=link/=links/.
Reported by Géraud Meyer in <>.
2007-09-29 Eric Blake <>
Test previous patch.
* tests/misc/groups-dash: New test.
* tests/misc/ (TESTS): Add it.
2007-09-28 Eric Blake <>
* src/ Don't ignore first argument if later argument is --.
2007-09-27 Jim Meyering <>
Avoid spurious test failure when SELinux stats "selinux/class".
* tests/ls/stat-free-symlinks: Grep for more precise /^stat("x"/.
Move file-set and hash-triple modules to gnulib.
* bootstrap.conf (gnulib_modules): Remove file-set, now that
it's in gnulib, and the canonicalize module requires it there.
* gl/lib/file-set.c, gl/lib/file-set.h, gl/modules/hash-triple: Remove.
* gl/lib/hash-triple.c, gl/lib/hash-triple.h, gl/modules/file-set:
Add a test to exercise a readlink bug.
* tests/misc/readlink-fp-loop: New file. Test for the readlink bug
fixed through today's change to Gnulib's canonicalize module.
* tests/misc/ (TESTS): Add readlink-fp-loop.
Bug report and a test case from
2007-09-25 Pádraig Brady <>
* doc/coreutils.texi (date invocation):
Make "Date input formats" easier to navigate to.
2007-09-25 Jim Meyering <>
Use XOR, not OR to combine bits.
* gl/lib/hash-triple.c (triple_hash): Use XOR (^), not OR (|), to
combine the bits from hashing the name and those of the inode number.
Add a few comments and remove out-of-context ones.
2007-09-24 Jim Meyering <>
* NEWS: The recent rm-diagnostic fix also affects cross-partition "mv".
copy.c: Remove definitions of factored-out functions.
* src/copy.c: Include "file-set.h".
(seen_file, record_file): Remove functions that I factored
out on 2007-08-23.
2007-09-22 Jim Meyering <>
Don't print the commands of a 10-line script that's run in each subdir.
* tests/ (vc_exe_in_TESTS): Add a leading "@", to reduce noise.
rm: give a sensible diagnostic when failing to remove a symlink
On some systems (those with openat et al), when rm would fail to
remove a symlink, it would fail with the misleading diagnostic,
"Too many levels of symbolic links".
* NEWS: Mention the bug fix.
* src/remove.c (is_nondir_lstat): New function.
(remove_entry): Use it to catch failed-to-remove symlink (and any
other non-dir) here so that we don't fall through and try to treat
it as directory, which -- with a symlink -- would provoke the bogus
ELOOP failure.
* tests/rm/fail-eacces: Add a test for the above.
* src/c99-to-c89.diff: Adjust offsets.
rm: fix a tiny, nearly inconsequential bug.
Don't perform a "."-relative lstat, when the file in question
may well not be in ".". Although this is a bug, a few attempts
to exercise it on a linux-2.6.22 system failed. You probably need
a pre-openat system to trigger the failure. The consequence of this
bug would be a lower-quality diagnostic upon failed dir removal.
* src/remove.c (is_dir_lstat): Add a parameter, fd_cwd.
Use it instead of hard-coding AT_FDCWD.
(remove_entry): Call is_dir_lstat with fd_cwd.
2007-09-22 Karl Berry <>
* TODO: It'd be nice to add renice.
2007-09-21 Jim Meyering <>
Avoid test failure due to now-parallelized tests.
* tests/du/two-args: Run "du .." from a sub-directory one level deeper.
2007-09-16 Jim Meyering <>
* tests/misc/tac-continue: Arrange to remove a temporary file.
* tests/ (vc_exe_in_TESTS): Don't rely on the value of
$(TESTS), so that "make check TESTS=test-name" works once again.
* tests/ Use File::Find + chmod syscall, not chmod -R.
Revamp most test scripts.
* tests/rm/v-slash: Avoid test failure with non-C locale.
Reported by Michael Stone.
Enable some previously omitted test scripts. Add a test cross-check.
* tests/rm/ (TESTS): Add empty-name and unreadable.
* tests/rm/empty-name: Likewise.
* tests/rm/unreadable: Reenable this test. Adjust for new rm.
* tests/mkdir/ Add writable-under-readonly.
* tests/mkdir/writable-under-readonly: Add some comments.
This test is always skipped, for now.
* tests/ (ta): Hook up the new root-only script.
* tests/tail-2/infloop-1: Make this test pass.
* tests/tail-2/ (TESTS): Add infloop-1.
* tests/tail-2/fflush: Remove unused file.
* tests/ (vc_executable_is_in_TESTS): More portable.
* tests/ (check): Depend on the above.
* build-aux/ Remove comment mentioning AUTHORS file.
Factor out definitions in TESTS_ENVIRONMENT of srcdir, top_srcdir, etc.
tests/ (top_srcdir): Define.
tests/*/ Remove definitions of $(srcdir), $(top_srcdir),
$(abs_top_srcdir), and $(abs_top_builddir), since they're
defined via the included tests/
tests/general: Remove from VC, this long-unused directory and contents.
Adapt tests/tail-2/ to use
Adapt tests/readlink/ to use
Move the sole test in tests/ls-2/ to tests/misc/.
* tests/ls-2/basic-1: Move this file to ...
* tests/misc/ls-misc: Don't rely on $PROG in env.
* tests/misc/ (TESTS): Add ls-misc.
* tests/ (SUBDIRS): Remove ls-2.
* tests/ls-2: Remove the directory.
* (AC_CONFIG_FILES): Remove tests/ls-2/Makefile.
More misc, test-related changes. (some to allow running tests as root)
Move all tests from test/{od,sha1sum,shred,stty} to tests/misc/.
Reflect these renamings:
od/od-N misc/od-N
od/x8 misc/od-x8
sha1sum/basic-1 misc/sha1sum
sha1sum/sample-vec misc/sha1sum-vec
shred/exact misc/shred-exact
shred/remove misc/shred-remove
stty/basic-1 misc/stty
stty/invalid misc/stty-invalid
stty/row-col-1 misc/stty-row-col
* tests/misc/ (TESTS): Add the new files.
* tests/ (SUBDIRS): Remove the dir names.
* tests/od, tests/sha1sum, tests/shred, tests/stty: Remove the
* (AC_CONFIG_FILES): Remove the corresponding Makefile
Move the two tests in tests/tee to tests/misc/.
* tests/tee/basic: Move this file to ...
* tests/misc/tee: Don't rely on $PROG in env.
* tests/tee/dash: Move this file to ...
* tests/misc/tee-dash: Don't rely on $PROG in env.
* tests/misc/ (TESTS): Add tee.
* tests/ (SUBDIRS): Remove tee.
* tests/tee: Remove the directory.
* (AC_CONFIG_FILES): Remove tests/tee/Makefile
Move the two tests in tests/sum/ to tests/misc/.
* tests/sum/basic-1: Move this file to ...
* tests/misc/sum: Don't rely on $PROG in env.
* tests/sum/sysv: Move this file to ...
* tests/misc/sum-sysv: Adapt it to use
* tests/misc/ (TESTS): Add sum and sum-sysv.
* tests/ (SUBDIRS): Remove sum.
* tests/sum: Remove the directory.
* (AC_CONFIG_FILES): Remove tests/sum/Makefile.
Move the sole test in tests/tsort/ to tests/misc/tsort.
* tests/tsort/basic-1: Move this file to ...
* tests/misc/tsort: Don't rely on $PROG in env.
* tests/misc/ (TESTS): Add tsort.
* tests/ (SUBDIRS): Remove tsort.
* tests/tsort: Remove the directory.
* (AC_CONFIG_FILES): Remove tests/tsort/Makefile.
Move the sole test in tests/unexpand to tests/misc/unexpand.
* tests/unexpand/basic-1: Move this file to ...
* tests/misc/unexpand: Don't rely on $PROG in env.
* tests/misc/ (TESTS): Add unexpand.
* tests/ (SUBDIRS): Remove unexpand.
* tests/unexpand: Remove the directory.
* (AC_CONFIG_FILES): Remove tests/unexpand/Makefile.
Move the sole test in tests/seq to tests/misc/seq.
* tests/seq/basic: Move this file to ...
* tests/misc/seq: Don't rely on $PROG in env.
* tests/misc/ (TESTS): Add seq.
* tests/ (SUBDIRS): Remove seq.
* tests/seq: Remove the directory.
* (AC_CONFIG_FILES): Remove tests/seq/Makefile
Convert tests/mkdir/ to use
Move the two tests in tests/md5sum to tests/misc/md5sum.
* tests/md5sum/basic-1: Move this file to ...
* tests/misc/md5sum: Don't rely on $PROG in env.
* tests/md5sum/newline-1: Move this file to ...
* tests/misc/md5sum-newline: Don't rely on $PROG in env.
* tests/misc/ (TESTS): Add md5sum.
* tests/ (SUBDIRS): Remove md5sum.
* tests/md5sum: Remove the directory.
* (AC_CONFIG_FILES): Remove tests/md5sum/Makefile
tests/sample-test: Update to use
Convert tests/misc/ to use, too.
Convert tests/ls/, too.
Convert tests/ln/, too.
Convert tests/install/, too.
Move the two tests in tests/fmt to tests/misc/fmt.
* tests/fmt/basic: Move this file to ...
* tests/misc/fmt: Don't rely on $PROG in env.
* tests/fmt/long-line: Move this file to ...
* tests/misc/fmt-long-line:
* tests/misc/ (TESTS): Add fmt.
* tests/ (SUBDIRS): Remove fmt.
* tests/fmt: Remove the directory.
* (AC_CONFIG_FILES): Remove tests/fmt/Makefile
Move the sole test in tests/factor to tests/misc/factor.
* tests/factor/basic: Move this file to ...
* tests/misc/factor: Don't rely on $PROG in env.
* tests/misc/ (TESTS): Add factor.
* tests/ (SUBDIRS): Remove factor.
* tests/factor: Remove the directory.
* (AC_CONFIG_FILES): Remove tests/factor/Makefile
Move the sole test in tests/expr to tests/misc/expr.
* tests/expr/basic: Move this file to ...
* tests/misc/expr: Don't rely on $PROG in env.
* tests/misc/ (TESTS): Add expr.
* tests/ (SUBDIRS): Remove expr.
* tests/expr: Remove the directory.
* (AC_CONFIG_FILES): Remove tests/expr/Makefile
Convert tests/du/*, too.
Move the sole test in tests/dircolors to tests/misc/dircolors.
* tests/dircolors/simple: Move this file to...
* tests/misc/dircolors: Don't rely on $PROG in env.
* tests/misc/ (TESTS): Add dircolors.
* tests/ (SUBDIRS): Remove dircolors.
* tests/dircolors: Remove the directory.
* (AC_CONFIG_FILES): Remove tests/dircolors/Makefile
Convert tests/dd/*, too.
Convert tests/mv, too.
* tests/other-fs-tmpdir: Before, all callers would exit 77 upon
failure to find the required dir. Now, exit 77 in this script so
callers don't have to. Adjust callers.
Adjust chgrp, chmod, chown, cp tests to use
* tests/ Also define abs_top_builddir.
Parallel "make check" support.
* build-aux/ New file, from The Vaucanson Group.
* .x-sc_GPL_version: New file, to allow "version 2 or later"
in build-aux/
* (EXTRA_DIST): Add .x-sc_GPL_version.
* tests/ New file.
* tests/ (EXTRA_DIST): Add, mkdtemp and
Begin factoring "sample-test" out of test scripts.
* tests/ New file, to be sourced by all tests that
were previously derived from the "sample-test" template.
* tests/mkdtemp: New file.
* tests/touch/dir-1: Use
* tests/touch/empty-file: Likewise.
* tests/touch/fail-diag: Likewise.
* tests/touch/fifo: Likewise.
* tests/touch/no-create-missing: Likewise.
* tests/touch/no-rights: Likewise. Also, don't sleep.
* tests/touch/not-owner: Likewise.
* tests/touch/obsolescent: Likewise.
* tests/touch/read-only: Likewise.
* tests/touch/relative: Likewise.
* tests/touch/ Include $(top_srcdir)/tests/,
to get the parallel-"make check" bits.
Move a slow test into tests/misc.
* tests/ Wrapper.
* tests/ls/time-1: Move this file to tests/misc/ls-time.
* tests/misc/ls-time: New file. From tests/ls/time-1.
* tests/ls/ (TESTS): Remove time-1.
* tests/misc/ (TESTS): Add ls-time.
Add support for parallel "make check" (in tests/misc, for now)
2007-09-08 Jim Meyering <>
Accommodate gnulib's renaming: __fpending.h -> fpending.h.
* lib/t-fpending.c: Include "fpending.h", not "__fpending.h".
2007-09-07 Jim Meyering <>
chmod: don't ignore a dangling symlink
* NEWS: Mention the bug fix.
* src/chmod.c (process_file): Handle the case of FTS_SLNONE,
i.e., give a diagnostic saying we cannot operate on such a file.
* tests/chmod/thru-dangling: Compare new stderr output with expected.
2007-09-07 Bob Proulx <>
Add a test: demonstrate that chmod ignores a dangling symlink
* tests/chmod/thru-dangling: New test. Fails.
* tests/chmod/ (TESTS): Add thru-dangling.
2007-09-05 Jim Meyering <>
Adapt to new SELinux behavior: "?" vs. new "unlabeled"
* src/ls.c (gobble_file): Interpret the new "unlabeled" indicator
from getfilecon/lgetfilecon the same way we interpret a negative
return value: no security context. So we don't print the "+".
* tests/selinux: Recognize that "unlabeled" means insufficient
support for SELinux, just like "?".
2007-09-03 Jim Meyering <>
Invoke $(AUTOCONF) manually, if needed to get an updated version string.
* GNUmakefile: Don't actually touch
That would make git-version-gen always print "...-dirty".
Don't change '-'s to '.'s in the string from git-describe.
* build-aux/git-version-gen: Leave '-'s in the string from git-describe.
Otherwise, s/-/./g would make it too hard to distinguish the base
version number from the appended .DD suffixes.
2007-09-03 Jim Meyering <>
* README-hacking: Require rsync, rather than wget.
2007-09-02 Jim Meyering <>
* bootstrap (WGET_COMMAND): Remove code to set this variable.
Ensure that $(VERSION) is up to date for dist-related targets.
* GNUmakefile: Arrange to rerun autoconf, if the version reported by
git-version-gen doesn't match $(VERSION), but only for dist targets.
bootstrap: uses rsync to download the .po files
* bootstrap (po_download_command_format): New global.
(download_po_files): Use rsync.
(update_po_files): Don't remove .po files after download,
so future rsync runs can take advantage of the copies.
2007-09-01 Jim Meyering <>
* bootstrap (gnulib_tool): Make sha1sum check quietly.
Ensure that snapshot version changes make it to groups, too.
* src/ (groups): Depend on Makefile.
Make groups-version executable,
* tests/misc/groups-version: ... as it was in the patch.
2007-08-31 Eric Blake <>
Test yesterday's change to groups.
* tests/misc/groups-version: New test.
* tests/misc/ (TESTS): Add groups-version.
2007-08-31 Jim Meyering <>
Solve the unnecessary-.po-file-regeneration problem once and for all.
* bootstrap (download_po_files): New function, renamed from
get_translations. Now, downloads, but doesn't update LINGUAS.
(update_po_files): New function.
2007-08-30 Jim Meyering <>
Shorten the snapshot version string by removing the "g".
* build-aux/git-version-gen: Remove git-describe's "g" that would
always precede the abbreviated SHA1. Suggestion from Dmitry V. Levin.
Perform the s,rm,/bin/rm, fix-up properly. No more kludge.
* (EXTRA_DIST): Remove .kludge-stamp.
(.kludge-stamp): Remove rule. Instead, ...
(dist-hook): Do the job here, operating on the file in $(distdir).
(rm_subst): Adjust regexp to match "rm -f rm$(EXEEXT)", not "rm -f rm".
(MAINTAINERCLEANFILES): s/+=/=/, now that this is the sole use.
(dist-hook): Remove the legacy-from-cvs install-sh is-executable check.
* .gitignore: Remove .kludge-stamp.
Make inter-release --version output more useful.
Now, each snapshot has a version "number" like 6.9-219-g58ddd,
which indicates that it is built using the 219th change set
(in _some_ repository) following the "v6.9" tag, and that 58ddd
is a prefix of the commit SHA1.
* build-aux/git-version-gen: New file.
* Run it to set the version.
* (dist-hook): Arrange so that .version appears only
in distribution tarballs, never in a checked-out repository.
* .gitignore: Add .version here, too. Just in case.
2007-08-30 Eric Blake <>
* src/.gitignore: Ignore *.exe for platforms with non-empty $(EXEEXT).
2007-08-30 Eric Blake <>
* src/ (.sh, uninstall-local): Adjust all users of
hand-rolled GNU_PACKAGE to instead use autoconf-provided
* src/basename.c (main): Likewise.
* src/chroot.c (main): Likewise.
* src/dirname.c (main): Likewise.
* src/echo.c (main): Likewise.
* src/expr.c (main): Likewise.
* src/factor.c (main): Likewise.
* src/ (version): Likewise. Also, reflect change in
--version output due to GPLv3.
* 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/system.h (case_GETOPT_VERSION_CHAR): Likewise.
* src/test.c (main): Likewise.
* src/true.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.
* (AC_CHECK_DECLS): No need to check strtoimax,
strtoumax, since gnulib does this.
2007-08-30 Jim Meyering <>
Ensure that TMPDIR is valid. Otherwise, it would cause test failures.
* tests/misc/tty-eof: Set TMPDIR=.
* tests/misc/sort-compress: Likewise.
Use EXIT_FAILURE, not EXIT_FAIL, now that EXIT_FAILURE is always 1.
* src/system.h (EXIT_FAIL): Remove definition.
* src/chroot.c (main): EXIT_FAIL -> EXIT_FAILURE.
* src/env.c (main): Likewise.
* src/nice.c (main): Likewise.
* src/su.c (change_identity, main): Likewise.
* src/tty.c (main): Likewise.
Suggestion from Eric Blake.
2007-08-28 Jim Meyering <>
* src/test.c (usage): Note that [ honors --help and --version,
but that test does not. Suggestion from Dan Jacobson.
By default, do not install hostname anymore; no kidding, this time.
* src/ (EXTRA_PROGRAMS): Remove hostname from this list,
now that it's no longer being installed by default. This should
have been part of the 2007-08-21 change.
(check-duplicate-no-install): New rule to ensure this doesn't
happen again.
(check): Depend on it.
Reflect renaming: mreadlink-with-size -> areadlink-with-size.
* bootstrap.conf: Update module name.
* src/copy.c (copy_internal): Update header and function names.
* src/ls.c (get_link_name): Likewise.
* src/readlink.c (main): Likewise.
* src/stat.c (print_stat): Likewise.
Add file system type names and magic numbers from "man 2 statfs".
* src/stat.c (human_fstype): Also handle BEFS, BFS, BINFMT_MISC,
2007-08-27 Jim Meyering <>
Add some file system type names and magic numbers from glibc.
* src/stat.c (human_fstype): Add any file system names and values
present in glibc's linux_fsinfo.h but not in this list.
Alphabetize the S_* names and capitalize the hexadecimal constants.
2007-08-26 Jim Meyering <>
* tests/misc/fold: Fix a typo: missing \ in a diagnostic
no one is likely ever to see.
2007-08-25 Jim Meyering <>
* src/dircolors.hin: Add .dz and .svgz as archive suffixes.
Remove all .cvsignore files from version control.
2007-08-24 Jim Meyering <>
bootstrap: Ignore more.
* bootstrap (symlink_to_dir): Add a directory name like
uniwidth to e.g., lib/.gitignore.
(slurp): Handle the sys_stat_.h -> sys mapping, too.
* .hgignore: Remove this file, too.
* (EXTRA_DIST): Remove .gitignore and .hgignore.
No longer version-control .???ignore files in lib/, m4/, and po/.
* .gitignore: Ignore a few files in lib/, m4/, and po/ that are not
picked up automatically.
* lib/.gitignore, lib/.cvsignore: Remove files.
* m4/.gitignore, m4/.cvsignore: Remove files.
* po/.gitignore, po/.cvsignore: Remove files.
bootstrap: when fetching .po files, do not remove .gmo files.
* bootstrap (get_translations): Don't remove *.gmo files!
They can be expensive to regenerate.
Create .gitignore and/or .cvsignore from scratch, if absent.
This is in preparation for my removing those files from version
control in the directories managed by gnulib-tool.
* bootstrap: New setting: vc_ignore.
(insert_sorted_if_absent): Create $file if absent.
Adapt to new, possibly empty, list: $vc_ignore.
* src/system.h (fseeko, ftello): Remove now-unneeded definitions.
* src/od.c (LDBL_DIG): Remove now-unneeded definition.
Arrange to use tag names like vM.N, rather than COREUTILS-M_N.
* Makefile.maint (this-vc-tag) [git]: Simply use v$(VERSION).
(this-vc-tag-regexp): New variable.
(vc-tag-check): Use it, rather than $(this-vc-tag).
2007-08-23 Jim Meyering <>
* src/dircolors.hin: Add xterm-16color, xterm-88color and eterm-color.
Suggestion from Dan Nicolaescu.
Don't let ln be a party to destroying user data.
* src/ln.c: Include "file-set.h", "hash.h" and "hash-triple.h".
(dest_set, DEST_INFO_INITIAL_CAPACITY): New globals.
(do_link): Refuse to remove a just-created link.
Record a name,dev,ino triple for each link we create.
(main): Initialize dest_set, if needed.
* tests/mv/childproof: Test for the above fix.
* NEWS: Document this.
Reported by Eric Blake.
Move functions from copy.c into new modules, since ln needs them, too.
* bootstrap.conf (gnulib_modules): Add file-set.
* gl/lib/file-set.c (record_file, seen_file): Functions from copy.c.
* gl/lib/file-set.h: Add prototypes.
* gl/lib/hash-triple.c (triple_hash, triple_hash_no_name):
(triple_compare, triple_free): Functions from copy.c.
* gl/lib/hash-triple.h (struct F_triple): Define. From copy.c.
Add prototypes.
* gl/modules/file-set: New module.
* gl/modules/hash-triple: New module.
* src/ (copy_sources): New variable.
(ginstall_SOURCES, cp_SOURCES, mv_SOURCES): Use it.
* src/copy.c: Include hash-triple.h.
No longer include hash-pjw.h.
(copy_internal): Don't pass a NULL third argument to record_file,
since that function no longer accepts that.
(record_file): Move this function to file-set.c.
Along the way, remove the code to allow a NULL stat-buffer pointer.
Adjust sole caller.
(seen_file): Move this function to file-set.c.
(struct F_triple): Move declaration to hash-triple.h.
(triple_compare, triple_free, triple_hash, triple_hash_no_name):
Move these functions to hash-triple.c.
bootstrap: generate more ignorable names
* bootstrap (slurp): When generating ignorable names, also map
.sin to .sed, .gperf to .c, and .y to .c.
* Makefile.maint (patch-check): Don't remove temporaries upon failure.
2007-08-22 Jim Meyering <>
* src/c99-to-c89.diff: Adjust offsets.
Change "rm --verbose -r a//" not to print extra slashes in a///b
* src/remove.c (push_dir): Don't copy trailing slashes onto the stack.
Reported by François Pinard.
* tests/rm/v-slash: New file. Test for the above change.
* tests/rm/ (TESTS): Add v-slash.
* src/date.c: Don't include "getline.h", now removed from gnulib;
its declarations are now in <stdio.h>.
* src/md5sum.c: Likewise.
* src/dircolors.c: Likewise.
* src/copy.c (DEST_INFO_INITIAL_CAPACITY): Correct a comment.
2007-08-21 Jim Meyering <>
By default, do not install hostname anymore.
* Add "hostname" to the list of not-installed programs.
* src/ (no_install__progs): Add "hostname" here, too.
* NEWS: Mention this.
2007-08-20 Bob Proulx <>
Clarify touch documentation of file arguments.
* src/touch.c (usage): Improve wording of documentation regarding
file argument handling and special handling of - argument.
* doc/coreutils.texi (touch invocation): Likewise.
Documentation problem reported by Vincent Lefevre.
2007-08-20 Paul Eggert <>
* NEWS: The old cp -p bug affected coreutils releases before 6.0.
Problem reported by Soren Spies in
To be conservative, just say the bug was in all versions through 6.6.
2007-08-19 Eric Blake <>
Avoid consuming too much seekable input when yesno is used.
* bootstrap.conf (gnulib_modules): Add closein.
* src/system.h (includes): Also include closein.h.
* src/mv.c (main): Use close_stdin, not close_stdout.
* src/cp.c (main): Likewise.
* src/ln.c (main): Likewise.
* src/rm.c (main): Likewise.
* src/install.c (main): Likewise.
* NEWS: Document the fix.
2007-08-20 Jim Meyering <>
Parallel "make check" support.
* build-aux/ New file, from The Vaucanson Group.
* .x-sc_GPL_version: New file, to allow "version 2 or later"
in build-aux/
* (EXTRA_DIST): Add .x-sc_GPL_version.
* tests/ New file.
* tests/ (EXTRA_DIST): Add, mkdtemp and
Begin factoring "sample-test" out of test scripts.
* tests/ New file, to be sourced by all tests that
were previously derived from the "sample-test" template.
* tests/mkdtemp: New file.
* tests/touch/dir-1: Use
* tests/touch/empty-file: Likewise.
* tests/touch/fail-diag: Likewise.
* tests/touch/fifo: Likewise.
* tests/touch/no-create-missing: Likewise.
* tests/touch/no-rights: Likewise. Also, don't sleep.
* tests/touch/not-owner: Likewise.
* tests/touch/obsolescent: Likewise.
* tests/touch/read-only: Likewise.
* tests/touch/relative: Likewise.
* tests/touch/ Include $(top_srcdir)/tests/,
to get the parallel-"make check" bits.
2007-08-18 Jim Meyering <>
Use new "idcache.h" header.
* src/ls.c: Remove ancient declarations of getuser and getgroup.
Include "idcache.h", instead.
Run each test in its own subdirectory.
* tests/ New file.
* tests/ (EXTRA_DIST): Add
* tests/misc/od, tests/misc/base64, tests/misc/basename:
* tests/misc/cut, tests/misc/date, tests/misc/dirname:
* tests/misc/expand, tests/misc/fold, tests/misc/head-elide-tail:
* tests/misc/paste-no-nl, tests/misc/pr, tests/misc/sha224sum:
* tests/misc/sha256sum, tests/misc/sha384sum, tests/misc/sha512sum:
* tests/misc/sort-merge, tests/misc/stat-printf, tests/misc/test-diag:
* tests/misc/wc-files0-from, tests/misc/xstrtol:
* tests/dd/skip-seek, tests/dircolors/simple, tests/du/files0-from:
* tests/expr/basic, tests/factor/basic, tests/fmt/basic:
* tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
* tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
* tests/sum/basic-1, tests/tsort/basic-1, tests/unexpand/basic-1:
* tests/mv/i-1, tests/rm/empty-name, tests/rm/unreadable: Use it.
* tests/misc/test-diag: Use "$ENV{abs_top_builddir}/src/test",
not "../../src/test", so it works when run from a subdirectory.
* tests/ls-2/tests: Create temp files and dirs from within the perl
script, so that they're removed, when run from a subdirectory.
* tests/ls-2/ (TESTS_ENVIRONMENT): Define abs_top_builddir,
so we can use "$ENV{abs_top_builddir}/src/test" in a test script.
2007-08-16 Jim Meyering <>
Consolidate od tests.
* tests/misc/od: Perform od-zero-len's test here.
Include boilerplate code, so tests run in a subdirectory.
* tests/misc/od-zero-len: Remove this file.
* tests/ls/time-1: Include sample-test boilerplate code.
Remove the then-unnecessary, hard-coded envvar "unset" commands.
2007-08-15 Jim Meyering <>
Move a slow test into tests/misc.
* tests/ls/time-1: Move this file to tests/misc/ls-time.
* tests/misc/ls-time: New file. From tests/ls/time-1.
* tests/ls/ (TESTS): Remove time-1.
* tests/misc/ (TESTS): Add ls-time.
od --skip (-j) works even on files in /proc, when the kernel lies
* src/od.c (skip): Don't let kernel misinformation (nonempty files
in /proc with stat.st_size == 0) make "od -j N" misbehave.
Patch by Paul Eggert.
* NEWS: Document this work-around.
* tests/misc/od-zero-len: New file, test for the above.
* src/printf.c (usage): Adjust summary to also mention OPTIONs.
From Karl Berry.
2007-08-14 Jim Meyering <>
od: fix a bug that arises when skipping exact length of file
* NEWS: Document the bug fix.
* src/od.c (skip): Call fseek even when n_skip is exactly the
same as the length of the current file. Otherwise, the next
iteration would use unadjusted input stream pointer, thus ignoring
the desired "skip". Report and patch by Paul GHALEB.
* tests/misc/od: New file, test for the above.
* tests/misc/ (TESTS): Add od.
2007-08-10 Paul Eggert <>
Accommodate more xstrtol changes.
* src/df.c (long_options): Don't bother prepending "--" to long
options that OPT_STR might decode, as that hack is no longer needed.
(main): Invoke xstrtol_fatal rather than STRTOL_FATAL_ERROR.
* src/du.c (long_options, main): Likewise.
* src/ls.c (decode_switches): Likewise.
* src/od.c (long_options, main): Likewise.
* src/pr.c (first_last_page, main): Likewise.
* src/sort.c (long_options, specify_sort_size): Likewise.
* src/pr.c (first_last_page): Accept option index and option char
instead of an assembled option string. All callers changed.
* src/sort.c (specify_sort_size): Likewise.
* src/system.h (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
2007-08-05 Jim Meyering <>
Encapsulate a static variable.
* src/system.h (opt_str_storage): Move static var into...
(short_opt_str): ... new static inline function.
(OPT_STR): Use the new function.
2007-08-04 Jim Meyering <>
Exercise xstrtol's diagnostics via pr's --pages option.
* tests/misc/xstrtol: New file.
* tests/misc/ (TESTS): Add xstrtol.
2007-08-04 Paul Eggert <>
Adapt to new human and xstrtol API.
* src/df.c (long_options): Prepend "--" to long options that
OPT_STR might decode.
* src/du.c (long_options): Likewise.
* src/od.c (long_options): Likewise.
* src/sort.c (long_options): Likewise.
* src/df.c (main): Adjust to new human and xstrtol API.
* src/du.c (main): Likewise.
* src/ls.c (decode_switches): Likewise.
* src/od.c (main): Likewise.
* src/pr.c (first_last_page): Likewise. New argument OPTION.
All callers changed.
* src/sort.c (specify_sort_size): New arg OPTION. All callers
changed. Adjust to new xstrtol API.
* src/system.h (opt_str_storage): New static var.
2007-08-02 Jim Meyering <>
Adjust one more test to accommodate the recent fts change.
This matters only on systems with insufficient openat support.
* tests/du/inacc-dest: Adjust expected diagnostic.
Adjust the other two "no-x" tests and unify all three.
* tests/du/no-x: Factor out du-specific bits.
* tests/chmod/no-x: Use the same code.
* tests/chgrp/no-x: Use the same code.
Adapt du's no-x test not to fail on older Linux systems.
* tests/du/no-x: Accept a third variant of the diagnostic.
2007-07-31 Jim Meyering <>
du: print size (probably incomplete) of each inaccessible directory
* src/du.c (process_file): Print what we know of the size of a
directory even when it is inaccessible. What we print is just the
size of the directory itself, not counting any of its contents.
* tests/du/inacc-dir: Test for this.
* NEWS: Mention this change.
Add a test for du not counting size of inaccessible directories.
* tests/du/inacc-dir: New file. Test for fts.c bug fixed yesterday.
* tests/du/ (TESTS): Add inacc-dir.
* NEWS: Mention the bug fix.
2007-07-28 Jim Meyering <>
Attempt to copy a regular file, even if stat says it is empty.
* NEWS: Document this bug fix.
* src/copy.c (copy_reg): Read from a regular file, even if it
appears (stat.st_size == 0) to be empty. This reverts an
optimization introduced on 2005-11-23 for coreutils-6.0.
Otherwise, "cp /proc/cpuinfo /tmp" creates an empty file,
on e.g., linux-2.6.20.
* tests/cp/proc-zero-len: New file. Test for the above.
* tests/cp/ (TESTS): Add proc-zero-len.
Reported by Dan Berrangé.
2007-07-26 Bob Proulx <>
sort: Improve sort --random-sort test.
* tests/misc/sort-rand: If "locale" is available pick a random
non-C locale and check "sort --random-sort" behavior using it.
2007-07-24 Jim Meyering <>
sort: add a test to exercise the affected code.
* tests/sort/ (realloc-buf): Exercise the code that changed
yesterday. No other test in all of "make check" does this.
* NEWS: Mention the fix.
2007-07-23 Paul Eggert <>
sort: avoid unaligned access.
* src/sort.c (fillbuf): When enlarging the line buffer, ensure that
the new size is a multiple of "sizeof (struct line)". This avoids
alignment problems when indexing from the end of the buffer.
Problem reported by Andreas Schwab in
2007-07-23 Jim Meyering <>
Update all copyright notices to use the newer form (e.g., remove
the postal address, and add the 'licenses' URL).
* COPYING: Update to Version 3.
Update c99/c89 patch for new, copyright-change-induced offsets.
* Makefile.maint (patch-check): Filter out '^Only in...' lines.
* src/c99-to-c89.diff: Handle new c99'isms in seq.c.
2007-07-22 Jim Meyering <>
* Arrange to rerun configure whenever src/
changes. That file contains the list of program names that must be
substituted into files like man/Makefile.
Add quotes around AC_SUBST arguments.
2007-07-21 Paul Eggert <>
* bootstrap (slurp): Work even in environments where "ls" defaults
to "ls -A". Put in a FIXME, though, since the current code does
not slurp files whose names start with ".", and this looks like
it might be a troublesome area.
2007-07-20 Jim Meyering <>
Document and add a test for today's sort bug fix.
* NEWS: Describe the bug fix.
* tests/sort/ (obs-inval): Add a test for today's fix.
2007-07-20 Andreas Schwab <>
* src/sort.c (main): Don't free a pointer to non-malloc'd memory.
2007-07-19 Jim Meyering <>
Fix a portability bug in the new ls-color test.
* tests/ls/stat-free-symlinks: Don't rely on the ability of
a built-in printf to interpolate '\e'. Use '\033' instead.
2007-07-18 Jim Meyering <>
"cp -i --update older newer" no longer prompts; same for mv
* src/copy.c (copy_internal): Perform "update" check before the
possible interactive prompt. Reported by zeno_AT_biyg_DOT_org
in <>
* tests/mv/update: Add tests for the above.
* NEWS: Mention the bug fix.
2007-07-15 Jim Meyering <>
ls --color: Don't stat symlinks when neither ORPHAN nor MISSING
attribute has a color.
* src/ls.c (main): Don't set check_symlink_color when C_EXEC is
colored, unless ln=target (aka color_symlink_as_referent) is set.
(gobble_file): Set f->linkok = true also when !check_symlink_color.
Reported by Jeremy Maitin-Shepard.
* tests/strace: New file, contents extracted from...
* tests/mv/atomic: Source strace.
* tests/ls/stat-free-symlinks: New file. Test for the above.
Use strace to ensure that in this corner case, ls does not call stat.
* tests/ls/ (TESTS): Add stat-free-symlinks.
* tests/ (EXTRA_DIST): Add strace.
2007-07-14 Jim Meyering <>
Remove long-deprecated options.
* NEWS: Mention this.
* src/df.c, src/ls.c: Remove --kilobytes option.
* src/du.c: Remove --kilobytes and --megabytes options.
* src/who.c: Remove -i and --idle options.
* src/ptx.c: Remove --copyright option.
Change interface: make 2nd param _space_-separated, not comma-separated
* m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG): Remove now-
unnecessary use of tr.
Improve comments.
* Adjust caller, as well as the code that ensures the
2nd parameter stays in sync with the list in src/
2007-07-14 Karel Zak <>
* m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix typo: s/$2/$1/.
(gl_INCLUDE_EXCLUDE_PROG): Quote first use of $2 parameter.
Don't mix comma- and space-separated lists.
Patch from Karel Zak.
2007-07-13 Jim Meyering <>
Warn about non-portable use of unescaped backslash at end of string,
and treat it as if it were escaped.
* src/tr.c (unquote): Considering that such usage would make GNU tr
from coreutils-5.2.1 and earlier *fail*, the least we can do now is
to warn about it. Solaris' tr ignores it.
* NEWS: Mention this.
Use proper backslash-quoting inside backticks.
* Otherwise we run afoul of strict GNU tr:
a string ending in a lone backslash would provoke a failure.
2007-07-12 Jim Meyering <>
Expand default-no-install prog list in ./configure --help output,
and fix some []-quoting bugs in sed expressions.
* Hard-code the list, "arch,su" here as well
as in src/, and ensure the two stay in sync.
* m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG): Use $2,
rather than the nearly-equivalent shell variable.
Karel Zak reported that ./configure --help's output included
the literal string, $gl_no_install_progs_default.
Clean up include-exclude-prog.m4.
* m4/include-exclude-prog.m4 (gl_ADD_PROG): Don't modify MAN.
(gl_REMOVE_PROG): Likewise.
Add omitted "\>" in sed regexp.
Remove any leading or trailing spaces.
(gl_ADD_PROG): Remove any leading space.
* Instead, derive $MAN from $optional_bin_progs.
Append $(EXEEXT) to *all* names, not just the first one.
2007-07-11 Jim Meyering <>
If there's a GPL vN copyright comment, require that N == 3.
* Makefile.maint (sc_GPL_version): New rule.
* tests/misc/arch: Fix the sole violation.
2007-07-10 Jim Meyering <>
Skip "arch" test if it's not built.
* tests/misc/ (built_programs): Define.
(TESTS_ENVIRONMENT): Add $(built_programs), for...
* tests/misc/arch: ...this: skip the test if arch is not built.
* src/ (built_programs.list): New rule.
* tests/ (built_programs): Rename from all_programs.
(TESTS_ENVIRONMENT): Use built_programs, not all_programs.
* tests/help-version: Likewise.
* NEWS: Mention that using --enable-no-install-program=X may
cause "make check" to fail.
Add support for enabling/disabling installation of specified programs.
* NEWS: Mention new configure-time options.
Mention that neither arch nor su is built/installed, by default.
* m4/include-exclude-prog.m4: New file.
* Use new macro, gl_ADD_PROG, rather than
manually appending to OPTIONAL_BIN_PROGS and MAN.
Move the code that adds "df" to the list of programs to build from
m4/jm-macros into this file.
Use gl_INCLUDE_EXCLUDE_PROG, then handle special cases: ginstall, [.
* man/ (dist_man_MANS): Remove from this list all man pages
corresponding to "bin" programs. Add $(MAN) instead.
(optional_mans): Remove all uses.
(check-x-vs-1): Adapt to work even though arch and su are typically
no longer built (and neither are their .1 files).
* src/ (install_su): Rename from INSTALL_SU, now that
INSTALL_SU has a different meaning. Use the new $(INSTALL_SU) value.
2007-07-10 Karel Zak <>
New program: arch
* NEWS: Mention arch.
* README: Add arch to the list of programs.
* AUTHORS: Add arch.
* src/uname.c: Include "uname.h".
(PROGRAM_NAME): Handle arch, too.
(uname_long_options, arch_long_options): Renamed and new globals.
(usage): Handle arch-mode as well as uname-mode.
(decode_switches): New function, extracted from main,
to handle arch-mode as well as uname-mode.
(main): Handle both modes.
* src/uname-arch.c: New program, alias for "uname -m".
* src/uname-uname.c: New file, default uname mode.
* src/uname.h: New file, uname modes.
* src/ (EXTRA_PROGRAMS): Add arch.
(uname_SOURCES, arch_SOURCES): Define.
* man/arch.x: New file.
* man/ (dist_man_MANS): Add arch.1.
(arch.1): New dependency.
* tests/misc/arch: New test, compare "arch" with "uname -m"
(MAN): Add arch.1.
* .x-sc_require_config_h: Exempt uname-arch.c and uname-uname.c
from the always-include-<config.h> rule.
2007-07-10 Jim Meyering <>
Change "version 2" to "version 3" in all copyright notices.
2007-07-09 Jim Meyering <>
Compensate for new c99'isms in seq.c.
* Makefile.maint (patch-check): Use -p1, not -p2, so a patch
generated via "make patch-check REGEN=1" actually works.
* src/c99-to-c89.diff: Handle new c99'isms in seq.c.
2007-07-09 Pádraig Brady <>
Fix the automatic number width formatting in seq.
* src/seq.c: Fix the -w logic. Ignore spaces and '+'
characters of input numbers when determining width.
Set format correctly for input numbers in scientific notation.
* tests/seq/basic: Add various number width tests.
Details: <>
2007-07-08 Jim Meyering <>
Run the coreutils-specific code only if tests/ exists.
* bootstrap (mam_template): Move definition out of loop.
Create symlinks for gl/{lib,m4}/*, just as for gnulib/{lib,m4}/*.
* bootstrap (symlink_to_dir): Rename function from symlink_to_gnulib.
Add a directory parameter. Update all callers.
(cp_mark_as_generated): Also check for -- and link to -- files in gl/.
* THANKS: Add Pádraig Brady.
2007-07-08 Jim Meyering <>
Adapt to deeper hierarchy in gnulib.
* bootstrap (symlink_to_dir): If the destination directory doesn't
exist, create it. This is required at least for "lib/uniwidth/cjk.h".
Use <wchar.h>, not "wcwidth.h".
* src/wc.c: Now that gnulib provides the POSIX-specified <wchar.h>,
include it and <wctype.h>, rather than "wcwidth.h".
* src/ls.c: Include <wchar.h>, rather than "wcwidth.h".
2007-07-05 Jim Meyering <>
setuidgid: set all groups, not just the primary one.
I wanted to use the xgetgroups function from id.c, so factored
it out and made it into a non-exiting function (hence the "m"
prefix rather than "x").
* src/setuidgid.c (main): Use mgetgroups.
Include "mgetgroups.h".
* src/id.c (xgetgroups): Remove function.
Include "mgetgroups.h".
(print_group_list): Use mgetgroups, not xgetgroups.
* gl/modules/mgetgroups: New module.
* gl/lib/mgetgroups.c: New file. mgetgroups is derived from
id.c's xgetgroups function.
* bootstrap.conf (gnulib_modules): Add mgetgroups.
* gl/m4/mgetgroups.m4: New file.
* gl/lib/mgetgroups.h: New file.
* bootstrap: Merge in changes from gnulib.
* src/id.c: Include "getugroups.h" rather than declaring manually.
2007-07-04 Paul Eggert <>
* NEWS: pr -F no longer suppresses the footer or the first two blank
lines in the header.
* doc/coreutils.texi (pr invocation): Likewise. Also, a too-short
page length implies -t, not -T.
* src/pr.c (lines_per_header, lines_per_footer): Now constants.
(init_parameters): Don't try to change them.
(print_header): Use the same header and footer format regardless of
wither form feeds are being used.
(usage): Adjust to above change when describing too-short page length.
Too-short page length impliesy -t, not -T.
* tests/pr/2-S_f-t_notab: Adjust to the fact that -F now affects
only formfeed handling; it does not change the header.
* tests/pr/2-Sf-t_notab: Likewise.
* tests/pr/2f-t_notab: Likewise.
* tests/pr/2s_f-t_notab: Likewise.
* tests/pr/2s_w60f-t_nota: Likewise.
* tests/pr/2sf-t_notab: Likewise.
* tests/pr/2sw60f-t_notab: Likewise.
* tests/pr/2w60f-t_notab: Likewise.
* tests/pr/3a3f-0F: Likewise.
* tests/pr/3b3f-0F: Likewise.
* tests/pr/3b3f-0FF: Likewise.
* tests/pr/3b3f-FF: Likewise.
* tests/pr/3f-0F: Likewise.
* tests/pr/3f-FF: Likewise.
* tests/pr/ Likewise.
* tests/pr/a3f-0F: Likewise.
* tests/pr/a3f-0FF: Likewise.
* tests/pr/a3f-FF: Likewise.
* tests/pr/b3f-0F: Likewise.
* tests/pr/b3f-0FF: Likewise.
* tests/pr/b3f-FF: Likewise.
* tests/pr/3-5l17f-t: Remove, since it's been renamed to another
file whose name has a line count 7 larger,
reflecting the new line count needed for this behavior.
* tests/pr/3a3l8f-t: Likewise.
* tests/pr/3b3l8f-t: Likewise.
* tests/pr/3l17f-t: Likewise.
* tests/pr/3ml17f-t: Likewise.
* tests/pr/Ja3l17f-lm: Likewise.
* tests/pr/Jb3l17f-lm: Likewise.
* tests/pr/Jml17f-lm-lo: Likewise.
* tests/pr/W-72l17f-ll: Likewise.
* tests/pr/W20l17f-ll: Likewise.
* tests/pr/W26l17f-ll: Likewise.
* tests/pr/W27l17f-ll: Likewise.
* tests/pr/W28l17f-ll: Likewise.
* tests/pr/W35Ja3l17f-lm: Likewise.
* tests/pr/W35Jb3l17f-lm: Likewise.
* tests/pr/W35Jml17f-lmlo: Likewise.
* tests/pr/W35a3l17f-lm: Likewise.
* tests/pr/W35b3l17f-lm: Likewise.
* tests/pr/W35ml17f-lm-lo: Likewise.
* tests/pr/W72Jl17f-ll: Likewise.
* tests/pr/a3l17f-lm: Likewise.
* tests/pr/a3l8f-t: Likewise.
* tests/pr/b3l17f-lm: Likewise.
* tests/pr/b3l8f-t: Likewise.
* tests/pr/l17f-t: Likewise.
* tests/pr/ml17f-0F: Likewise.
* tests/pr/ml17f-lm-lo: Likewise.
* tests/pr/ml17f-t: Likewise.
* tests/pr/ml17f-t-0F: Likewise.
* tests/pr/n+2-5l17f-0FF: Likewise.
* tests/pr/n+2l17f-0FF: Likewise.
* tests/pr/n+2l17f-bl: Likewise.
* tests/pr/n+3l17f-0FF: Likewise.
* tests/pr/n+3l17f-bl: Likewise.
* tests/pr/n+3ml13f-bl-FF: Likewise.
* tests/pr/n+3ml17f-bl-tn: Likewise.
* tests/pr/n+3ml17f-tn-bl: Likewise.
* tests/pr/n+4b2l10f-0FF: Likewise.
* tests/pr/n+5-8b3l10f-FF: Likewise.
* tests/pr/n+5a3l6f-0FF: Likewise.
* tests/pr/n+6b3l6f-FF: Likewise.
* tests/pr/nJml17f-lmlmlo: Likewise.
* tests/pr/nJml17f-lmlolm: Likewise.
* tests/pr/nN1+3l17f-bl: Likewise.
* tests/pr/nN15l17f-bl: Likewise.
* tests/pr/nSml13-bl-FF: Likewise.
* tests/pr/nSml13-t-t-FF: Likewise.
* tests/pr/nSml13-t-tFFFF: Likewise.
* tests/pr/nSml17-bl-FF: Likewise.
* tests/pr/nSml17-t-t-FF: Likewise.
* tests/pr/nSml17-t-tFFFF: Likewise.
* tests/pr/nl17f-bl: Likewise.
* tests/pr/o3Jml17f-lm-lo: Likewise.
* tests/pr/o3a3Sl17f-tn: Likewise.
* tests/pr/o3a3Snl17f-tn: Likewise.
* tests/pr/o3a3l17f-tn: Likewise.
* tests/pr/o3b3Sl17f-tn: Likewise.
* tests/pr/o3b3Snl17f-tn: Likewise.
* tests/pr/o3b3l17f-tn: Likewise.
* tests/pr/o3mSl17f-bl-tn: Likewise.
* tests/pr/o3mSnl17fbltn: Likewise.
* tests/pr/o3ml17f-bl-tn: Likewise.
* tests/pr/w72l17f-ll: Likewise.
* tests/pr/3-5l24f-t: New file, containing the contents of the
file with the same name but with the line count smaller by 7,
reflecting the new behavior with -F.
* tests/pr/3a3l15f-t: Likewise.
* tests/pr/3b3l15f-t: Likewise.
* tests/pr/3l24f-t: Likewise.
* tests/pr/3ml24f-t: Likewise.
* tests/pr/Ja3l24f-lm: Likewise.
* tests/pr/Jb3l24f-lm: Likewise.
* tests/pr/Jml24f-lm-lo: Likewise.
* tests/pr/W-72l24f-ll: Likewise.
* tests/pr/W20l24f-ll: Likewise.
* tests/pr/W26l24f-ll: Likewise.
* tests/pr/W27l24f-ll: Likewise.
* tests/pr/W28l24f-ll: Likewise.
* tests/pr/W35Ja3l24f-lm: Likewise.
* tests/pr/W35Jb3l24f-lm: Likewise.
* tests/pr/W35Jml24f-lmlo: Likewise.
* tests/pr/W35a3l24f-lm: Likewise.
* tests/pr/W35b3l24f-lm: Likewise.
* tests/pr/W35ml24f-lm-lo: Likewise.
* tests/pr/W72Jl24f-ll: Likewise.
* tests/pr/a3l15f-t: Likewise.
* tests/pr/a3l24f-lm: Likewise.
* tests/pr/b3l15f-t: Likewise.
* tests/pr/b3l24f-lm: Likewise.
* tests/pr/l24f-t: Likewise.
* tests/pr/ml24f-0F: Likewise.
* tests/pr/ml24f-lm-lo: Likewise.
* tests/pr/ml24f-t: Likewise.
* tests/pr/ml24f-t-0F: Likewise.
* tests/pr/n+2-5l24f-0FF: Likewise.
* tests/pr/n+2l24f-0FF: Likewise.
* tests/pr/n+2l24f-bl: Likewise.
* tests/pr/n+3l24f-0FF: Likewise.
* tests/pr/n+3l24f-bl: Likewise.
* tests/pr/n+3ml20f-bl-FF: Likewise.
* tests/pr/n+3ml24f-bl-tn: Likewise.
* tests/pr/n+3ml24f-tn-bl: Likewise.
* tests/pr/n+4b2l17f-0FF: Likewise.
* tests/pr/n+5-8b3l17f-FF: Likewise.
* tests/pr/n+5a3l13f-0FF: Likewise.
* tests/pr/n+6b3l13f-FF: Likewise.
* tests/pr/nJml24f-lmlmlo: Likewise.
* tests/pr/nJml24f-lmlolm: Likewise.
* tests/pr/nN1+3l24f-bl: Likewise.
* tests/pr/nN15l24f-bl: Likewise.
* tests/pr/nSml20-bl-FF: Likewise.
* tests/pr/nSml20-t-t-FF: Likewise.
* tests/pr/nSml20-t-tFFFF: Likewise.
* tests/pr/nSml24-bl-FF: Likewise.
* tests/pr/nSml24-t-t-FF: Likewise.
* tests/pr/nSml24-t-tFFFF: Likewise.
* tests/pr/nl24f-bl: Likewise.
* tests/pr/o3Jml24f-lm-lo: Likewise.
* 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.
* tests/pr/w72l24f-ll: Likewise.
2007-06-23 Jim Meyering <>
Prefer "STREQ (a, b)" over "strcmp (a, b) == 0"; similar for != 0.
* src/base64.c (main): Likewise.
* src/install.c (setdefaultfilecon): Likewise.
* src/sort.c (main): Likewise.
* Makefile.maint (sc_prohibit_strcmp): New rule.
* .x-sc_prohibit_strcmp: New file, to list the few exceptions.
* (EXTRA_DIST): Add .x-sc_prohibit_strcmp.
2007-06-22 Paul Eggert <>
* NEWS: seq no longer mishandles obvious cases like
"seq 0 0.000001 0.000003" by omitting the last output number.
* doc/coreutils.texi (seq invocation): Remove advice about workaround
for seq off-by-one problem, since the bug is fixed now. Replace
it with more-generic advice about rounding errors.
* src/seq.c (long_double_format, print_numbers):
New arg NUMERIC_FORMAT. All uses changed.
2007-06-22 Pádraig Brady <> (trivial change)
* tests/seq/basic: Add test cases for seq off-by-one problem.
2007-06-22 Jim Meyering <>
* src/stat.c (long_options): Add a FIXME comment to help ensure
that the deprecated and undocumented "--filesystem" option is
removed someday.
2007-06-18 Paul Eggert <>
A few more symlink-related fixes. Fix a bug triggered by cp
--parents and symlinks. Close some race conditions possible when
the destination replaces a newly-created file with a symlink.
* NEWS: Document that 'cp --parents' no longer mishandles
symlinks in file name components of source.
* src/copy.c (HAVE_LCHOWN): Default to false.
(lchown) [!defined HAVE_LCHOWN]: Define to chown, for convenience.
* src/cp.c (lchown) [!HAVE_LCHOWN]: Likewise.
* src/install.c (lchown [!HAVE_LCHOWN]: Likewise.
* src/copy.c (set_owner): Use lchown instead of chown, for safety
in case the file got replaced by a symlink in the meantime.
* src/cp.c (re_protect): Likewise.
* src/install.c (change_attributes): Likewise.
* src/copy.c (copy_internal): Use ordinary C rather than an #if.
* src/cp.c (lchown) [!HAVE_LCHOWN]: Define to chown, for convenience.
(struct dir_attr): Cache the entire struct stat of the directory,
rather than just its mode, so that we needn't stat the directory
twice (which can lead to races).
(re_protect): Don't use XSTAT as that's not appropriate in
this context (symlinks should be followed here). Instead, use
the cached stat value.
(make_dir_parents_private): Save dir's entire struct stat, not
just its mode.
* tests/cp/cp-parents: Add test to check against bug with
cp --parents and symlinks.
2007-06-18 Jim Meyering <>
Use mreadlink_with_size (doesn't exit), not xreadlink_with_size.
* bootstrap.conf (gnulib_modules): Add readlink-with-size.
Remove xreadlink and xreadlink-with-size.
* src/copy.c (copy_internal): Use mreadlink_with_size,
not xreadlink_with_size.
* src/ls.c (get_link_name): Likewise.
* src/readlink.c (main): Likewise.
* src/stat.c (print_stat): Likewise.
* README-hacking: Don't mention Gzip 1.2.4, now that 1.3.12 is out.
2007-06-16 Jim Meyering <>
Make chgrp and chown diagnostics consistent.
* src/chown.c (main): Emit the diagnostic before the file name,
not after it, to be consistent with chgrp's diagnostic.
* src/chgrp.c (parse_group): Emit a ":" between the diagnostic
and the file name.
Reported by Egmont Koblinger.
* THANKS: Add Egmont Koblinger.
2007-06-15 Paul Eggert <>
Correct cp's handling of destination symlinks in some cases.
* NEWS: "cp" no longer considers a destination symlink to be the
same as the referenced file when copying links or making backups.
* src/copy.c (copy_reg): When following a symlink, use the
followed name in later chown etc. requests, so that the created
file is affected, rather than the symlink. Use O_NOFOLLOW on
source when not dereferencing symlinks; this avoids a race.
Preserve errno correctly when doing multiple open attempts on the
(copy_internal): Follow destination symlinks only when copying a
regular file and only when we don't intend to remove or rename the
destination first, regardless of whether following source
symlinks; this is because since POSIX and tradition (e.g.,
FreeBSD) say we should ordinarily follow destination symlinks if
the system calls would ordinarily do so.
* src/copy.h (struct cp_options): Add comment that 'dereference'
is only for source files.
* src/cp.c (usage): Note that --derereference etc. are only for
source files.
(make_dir_parents_private): Follow symlinks, regardless of whether
--dereference is specified, because these are destination symlinks.
* tests/cp/same-file: Adjust tests to match revised behavior.
Filter out perror output since it might vary from host to host.
Use sed alone instead of also using echo.
* doc/coreutils.texi (cp invocation): Document the behavior better when
the destination is a symlink. Clarify source versus destination
symlinks. Describe the new behavior for destination symlinks.
2007-06-15 Jim Meyering <>
* src/copy.c: Include "canonicalize.h".
(copy_reg): Use canonicalize_filename_mode to follow the symlink,
so that we can always open with O_EXCL and avoid a race.
2007-06-15 Jim Meyering <>
Don't include "quote.h" when it is not used.
* src/md5sum.c: Remove unnecessary inclusion of "quote.h".
* src/expr.c: Likewise.
* src/shred.c: Likewise.
* Makefile.maint (sc_prohibit_quote_without_use): New rule.
* src/c99-to-c89.diff: Adjust offsets.
2007-06-14 Paul Eggert <>
Clarify what "cat" documentation means by "blank" lines.
* doc/coreutils.texi (cat invocation): "Blank" lines actually mean
empty lines.
* src/cat.c (usage): Say that "nonblank" means nonempty. Clarify
2007-06-13 Jim Meyering <>
rmdir: give better diagnostics
* src/rmdir.c (remove_parents): Give a more descriptive/consistent
diagnostic upon failure.
(main): Likewise.
Suggestion from Joey Hess.
* THANKS: Add Joey Hess.
Don't include "quotearg.h" when it is not used.
* Makefile.maint (sc_prohibit_quotearg_without_use): New rule.
* src/cp.c: Don't include "quotearg.h". It wasn't used.
* README-hacking: List Gperf as a build-requirement, too.
Reported by Steve Ward.
2007-06-11 Jim Meyering <>
* README: Mention README-hacking, for whose who start from
cloned/checked-out sources rather than from a distribution tarball.
Reported by Steve Ward.
* THANKS: Add Steve Ward.
2007-06-10 Jim Meyering <>
bug-fix: cp would fail to write through a dangling symlink
* NEWS: Mention the bug fix.
* src/copy.c (copy_reg): When open fails with EEXIST, the destination
is lstat'able, and a symlink, call open again, but now without O_EXCL.
* tests/cp/thru-dangling: New file, to test for the above fix.
* tests/cp/ (TESTS): Add thru-dangling.
* THANKS: Add Michael McLagan.
Bug report from Michael McLagan in <>.
2007-06-04 Paul Eggert <>
* doc/coreutils.texi (Common options): Mention that -h and
--human-readable are equivalent to --block-size=human-readable.
Documentation problem reported by Steve Ward in
(du invocation): Use optSi rather than duplicating the macro's
contents (incorrectly, since we claimed a "B" was output).
2007-05-31 Jim Meyering <>
Pull printf-related code from gnulib, rather than using forked copy.
* bootstrap.conf (gnulib_modules): Don't avoid size_max and xsize
modules. While I dislike xsize-style overflow avoidance, maintaining
a forked version of e.g., vasnprintf.c was too much work.
2007-05-29 Jim Meyering <>
* src/dircolors.hin: Add screen-256color.
Suggested by in <>.
2007-05-26 Jim Meyering <>
* TODO: Add an entry for comm --output-delimiter=STR
2007-05-25 James Youngman <>
wc: ignore multibyte-character decoding errors
* src/wc.c (wc): Don't issue an error message when mbrtowc
indicates that we have seen an invalid byte sequence. This
makes "wc /bin/sh" bearable (though the word and line counts
are likely not to be useful).
* NEWS: Mention the change.
2007-05-22 Jim Meyering <>
Check for an up-to-date copyright year in coreutils.texi.
* Makefile.maint (copyright-check): Also check for an up-to-date
copyright year in doc/$().texi, if that file exists.
* doc/coreutils.texi: Add 2007 to list of Copyright years.
Reported by Karl Berry.
cut: diagnose a range starting with 0 (-f 0-2) as invalid, and
give a better diagnostic for a field-number/offset of 0.
* NEWS: Mention the fix.
* src/cut.c (ADD_RANGE_PAIR): Add an explicit check.
Based on a patch from James Youngman.
* tests/misc/cut: Add tests for the above.
"cut -f 2-0" now fails; before, it was equivalent to "cut -f 2-"
Also, diagnose the '-' in "cut -f -" as an invalid range, rather
than interpreting it as the unlimited range, "1-".
* NEWS: Mention these changes.
* src/cut.c (set_fields): Don't interpret an accumulator "value"
of 0 as an unspecified range endpoint.
Give better diagnostics.
Adjust a comment so that it is true also for 64-bit size_t.
* tests/cut/ Add tests for the above.
stty: fix a harmless syntax nit
* src/stty.c (visible): Use ";" as the statement terminator
between two assignments, not ",".
(integer_arg): Join an unnecessarily wrapped line.
2007-05-20 Jim Meyering <>
stty: diagnose an invalid hex value in 35-colon command-line argument
* NEWS: Mention this.
* src/stty.c (strtoul_tcflag_t, strtoul_cc_t): New functions.
(recover_mode): Use those functions (not sscanf), to parse the
string robustly.
* tests/stty/invalid: New file. Test for the above.
* tests/stty/ (TESTS): Add invalid.
* .x-sc_prohibit_atoi_atof: Don't exempt stty.c from this check.
Add tests/stty/invalid so we don't have to obfuscate the comment
about sscanf therein.
* Makefile.maint (sc_prohibit_atoi_atof): Mention sscanf in the
diagnostic, too.
* TODO: Remove some now-completed or no longer relevant items.
2007-05-19 Jim Meyering <>
Rename uses of futimens -> gl_futimens; glibc now declares the former.
* src/copy.c (copy_reg): Reflect renaming: futimens -> gl_futimens.
* src/touch.c (touch): Likewise.
2007-05-18 Jim Meyering <>
* Makefile.maint (my-distcheck): Remove -pedantic from $(CFLAGS)
for now, to avoid c89-check failure due to use of #include_next.
2007-05-15 Jim Meyering <>
Generate a dozen test-related files at bootstrap-time.
* README-hacking: Build-from-checkout now require Perl, too.
* bootstrap: Now that these generated files are no longer
under version control, they must be created at bootstrap time.
2007-05-14 Paul Eggert <>
* man/chmod.x: Document chmod's behavior with setuid and setgid bits.
Remove misleading implication about leading zero. Problem
reported by Jan Engelhardt in
2007-05-13 Jim Meyering <>
Remove the generated tests/*/ files from version control.
* tests/cut/ git-remove this generated file.
* tests/head/ Likewise.
* tests/join/ Likewise.
* tests/pr/ Likewise.
* tests/sort/ Likewise.
* tests/tac/ Likewise.
* tests/tail/ Likewise.
* tests/test/ Likewise.
* tests/tr/ Likewise.
* tests/uniq/ Likewise.
* tests/wc/ Likewise.
* .cvsignore, .gitignore: Ignore these generated files.
* src/.cvsignore, src/.gitignore: Add chcon here, ...
* .cvsignore, .gitignore: ... not here.
Test uniq's new --zero-terminated (-z) option.
* tests/uniq/ When possible, create a "-z"-testing variant
of each existing test.
(2z, 3z, 4z, 5z, 20z, 122, 123): New tests from James Youngman.
2007-05-12 James Youngman <>
Add -z option to uniq. Originally proposed by Egmont Koblinger.
* NEWS: Mention uniq's new option: --zero-terminated (-z).
* src/uniq.c: Add new option, --zero-terminated (-z), to make
uniq use the NUL byte as separator/delimiter rather than newline.
(check_file): Add a parameter: delimiter. Update caller.
Use readlinebuffer_delim in place of readlinebuffer everywhere.
(main): Handle the new option.
(usage): Describe new option the same way sort does.
* doc/coreutils.texi (uniq invocation): Describe the new option.
2007-05-07 Jim Meyering <>
* NEWS: Mention that last week's tr bug dates back to 1992.
2007-05-04 Jim Meyering <>
Avoid test failure when run with an unusual umask.
* tests/ls/color-dtype-dir: Set umask to 022.
Suggestion from AIDA Shinra.
Avoid failure of root-only test when run with a restrictive umask.
* tests/rm/no-give-up: Ensure that non-root can access "d/" through
root-owned ".". Reported by AIDA Shinra.
tr -c: don't abort when translating with S2 larger than complement of S1
* src/tr.c (main): Remove invalid assertion triggered by e.g.,
tr -c a '[b*256]'. There's nothing wrong with having Set2 larger
than Set1. Reported by Guntram Blohm.
* tests/tr/ (no-abort-1): Test for the above.
* NEWS: Mention this bug fix.
* THANKS: Add Guntram Blohm.
2007-05-03 Jim Meyering <>
Avoid test failure when run with a permissive umask.
* tests/rm/no-give-up: Set permissions of test directory properly,
i.e., not depending on umask prohibiting go=w.
Reported by AIDA Shinra.
2007-05-02 Paul Eggert <>
The following commands and options now support the standard size
suffixes kB, M, MB, G, GB, and so on for T, P, Y, Z, and Y:
head -c, head -n, od -j, od -N, od -S, split -b, split -C,
tail -c, tail -n.
* doc/coreutils.texi (od invocation, head invocation, tail invocation):
Document support for new size suffixes.
(head invocation, tail invocation):
Document that -n uses the same suffixes as -c.
(tail invocation): More-clearly document what leading "+" does.
* src/head.c (usage, string_to_integer): Support new suffixes.
* src/od.c (usage, main): Likewise.
* src/split.c (usage, main): Likewise.
* src/tail.c (usage, parse_options): Likewise.
Prompted by a patch from Evan Hunt.
2007-05-02 Jim Meyering <>
* src/du.c (usage): Tweak description of --dereference-args (-D) again.
Prompted by another request for clarification from Justin Pryzby.
Invoke rm via 'setuidgid ... env PATH="$PATH" ...', as in fail-eperm.
* tests/rm/fail-2eperm: Patch from AIDA Shinra.
Reported by Peter Dyballa.
* THANKS: Add AIDA Shinra and Peter Dyballa.
2007-04-28 Paul Eggert <>
* src/nohup.c (usage): Describe how standard input and output
are redirected.
2007-04-25 Jim Meyering <>
* src/du.c (usage): Clarify description of --dereference-args (-D).
Prompted by a report from Justin Pryzby.
* bootstrap.conf (gnulib_modules): Add fseeko and ftello.
(gnulib_modules): Add autobuild.
2007-04-24 Jim Meyering <>
* THANKS: Add Andreas Frische.
* NEWS: Mention today's ls --color fix.
* tests/ls-2/tests (sl-dangle): Add a test for today's fix.
2007-04-24 Eric Blake <>
ls --color once again colors dangling symlinks correctly
* src/ls.c (gobble_file): Much like the 2007-04-07 fix,
add a term to the expression that decides whether we need
stat and/or lstat calls. Reported by Andreas Frische.
2007-04-16 Jim Meyering <>
* src/cut.c (usage): Adjust synopsis to show that an OPTION is required.
Reported by Rudolf Kastl.
* THANKS: Add Rudolf Kastl.
2007-04-11 Paul Eggert <>
split --line-bytes=N (-C N): don't create an empty file.
* src/split.c (line_bytes_split): Don't create an empty line
afterwards if the last buffer happens to be exactly full.
* tests/misc/split-fail: Add a test case for this.
* NEWS: mention this.
2007-04-10 Jim Meyering <>
ls: don't form or compute the length of strings that won't be used.
* src/ls.c (gobble_file): Form and compute length of strings for
block size, owner, group, author, major+minor numbers and file size
only if they'll actually be used. I.e., don't form most of them
when not producing long format output.
2007-04-07 Jim Meyering <>
Add a test for, and document, today's fix.
* NEWS: Mention today's ls --color fix.
* tests/ls-2/tests (sl-target): Add a test for today's fix.
* THANKS: Add Kirk Kelsey.
2007-04-07 Eric Blake <>
Fix a bug in how the LS_COLORS ln=target attribute is handled.
* src/ls.c (gobble_file): Use "stat" (not lstat) also when the
ln=target attribute applies. Reported by Kirk Kelsey.
2007-04-02 Jim Meyering <>
* src/copy.c (copy_reg): Initialize local "con", before calling
getfscreatecon, in case that function (or its inline stub) does
not set it.
2007-04-01 Paul Eggert <>
* src/ls.c (print_horizontal): Fix bug reported by Mike Frysinger:
ls -x DIR would sometimes output the wrong string in place of the
first entry.
* NEWS: Mention the bug fix.
* tests/ls/x-option: New file.
* tests/ls/ (TESTS): Add x-option.
gnulib moved md5 and sha1 modules into a new crypt/ directory; adapt
* bootstrap.conf (gnulib_modules): Adjust to gnulib's renaming of
md5 to crypt/md5 and sha1 to crypt/sha1.
2007-03-30 Jim Meyering <>
* NEWS: Mention these SELinux changes.
* ChangeLog-selinux: Remove file.
Move its contents into this file, removing old dates.
* src/runcon.c (main): Don't reorder arguments. Reported by
Ulrich Drepper in <>.
* tests/misc/runcon-no-reorder: New file. Test for the above.
* tests/misc/ (TESTS): Add runcon-no-reorder.
* src/runcon.c (main): Remove "." at end of a diagnostic.
* src/runcon.c: New program.
* src/ (bin_PROGRAMS): Add runcon.
(runcon_LDADD): Define.
* README: Add runcon to the list of programs.
* AUTHORS: Add this: runcon: Russell Coker
* tests/help-version: Add runcon as an exception.
* man/ (dist_man_MANS): Add runcon.1.
(runcon.1): New dependency.
mkfifo, mknod: Accept new "-Z, --context=C" option.
* src/mkfifo.c, src/mknod.c: Include <selinux/selinux.h>.
(main): Honor it.
* src/ (mkfifo_LDADD, mknod_LDADD): Use $(LIB_SELINUX).
mkdir: Accept new "-Z, --context=C" option.
* src/mkdir.c: Include <selinux/selinux.h>.
(main): Honor it.
* src/ (mkdir_LDADD): Use $(LIB_SELINUX).
* tests/cp/cp-a-selinux: New file. Test for the bug reported in
* tests/cp/ (TESTS): Add cp-a-selinux.
* tests/selinux: New file.
* tests/ (EXTRA_DIST): Add selinux.
* tests/misc/selinux: Source the new script, rather than open coding it.
Change how "cp -a" and "cp --preserve=context" work with SELinux.
Now, cp -a attempts to preserve context, but failure to do so does
not change cp's exit status. However "cp --preserve=context" is
similar, but failure *does* cause cp to exit with nonzero status.
* src/copy.h (struct cp_options) [require_preserve_context]: New member.
* src/copy.c (copy_reg, copy_internal): Implement the above.
* src/mv.c (cp_option_init): Initialize the new member.
* src/install.c (cp_option_init): Likewise.
* src/cp.c (cp_option_init): Likewise.
(decode_preserve_arg): Set it or reset it.
cp, mv, install: add SELinux support, but unlike with the Red Hat
patch, mv and cp do not provide the "-Z context" option.
* src/copy.c: Include <selinux/selinux.h>.
(restore_default_fscreatecon): New function.
(copy_reg): Make cp --preserve=context work for existing destination.
(copy_internal): Likewise for new destinations.
* src/copy.h (cp_options) [preserve_security_context]: New member.
* src/cp.c: Include <selinux/selinux.h>.
(selinux_enabled): New global.
(usage): Mention new --preserve=context option.
(decode_preserve_arg): Handle PRESERVE_CONTEXT.
(main): Remove an obsolete comment.
If --preserve=context is specified on a system without SELinux
enabled, give a diagnostic and fail.
* src/mv.c: Include <selinux/selinux.h>.
Set x->preserve_security_context if SELinux is enabled.
* src/install.c: Accept new "-Z, --context=C" option.
Accept --preserve-context option (but not -P option).
Accept alternate spelling: --preserve_context, for now.
Include <selinux/selinux.h> and "quotearg.h".
(selinux_enabled, use_default_selinux_context): New globals.
(cp_option_init): Default: do not preserve security context.
(setdefaultfilecon): New function.
(main): Honor new options.
* src/ (mv_LDADD, cp_LDADD, ginstall_LDADD):
* tests/misc/selinux [VERBOSE]: Print version info for each
of the tested tools, not just ls.
* src/c99-to-c89.diff: Remove the ls.c patch, now that I've
temporarily removed the offending c99'ism.
* src/chcon.c (usage): Split a string literal that was longer than 509.
* src/ls.c (gobble_file): Don't call getfilecon unless print_scontext.
Upon failed getfilecon, accept not just ENOTSUP, but also ENODATA.
* src/c99-to-c89.diff: Adjust offsets.
* AUTHORS: Add chcon.
* src/c99-to-c89.diff: Remove trailing blanks.
* src/chcon.c: Don't include "dirname.h". system.h already includes it.
* gl/lib/selinux-at.c: Remove a use of HAVE_CONFIG_H.
* src/c99-to-c89.diff: Handle a new c99'ism in ls.c.
* src/id.c (main): Tweak id -Z diagnostic.
id: Add SELinux support: -Z option.
* src/id.c (main): Apply patches from Fedora, with these changes:
Remove #ifdef WITH_SELINUX.
Use error (EXIT_FAILURE, not fprintf+exit(1).
* src/ (id_LDADD): Define, so as to add $(LIB_SELINUX).
stat: Add support for SELinux in the form of a %C format directive.
* src/stat.c (follow_links): Make this variable file-global.
(out_file_context): New function.
(print_statfs): Honor %C.
(print_stat): Honor %C.
(do_stat): Remove follow_links parameter.
(usage): Document the two %C directives.
(main): Accept -Z (though it's a no-op).
* src/ (stat_LDADD): Define.
ls: Add support for SELinux and a slightly modified -Z option.
I started with the patches from Red Hat.
The entries below tell how the code evolved.
* src/ls.c (print_long_format, print_file_name_and_frills): When
there is no security context (due to getfilecon/lgetfilecon failing
with e.g. ENOTSUP), print it as "?", not "".
* src/ls.c (print_file_name_and_frills): Make -Z work without -l.
(length_of_file_name_and_frills): Likewise.
* src/ls.c: Remove the --lcontext and --scontext options.
Change the way -Z, --context work so that it no longer implies -l.
Thus, -Z -l will work like -lcontext and -Z without -l will work
like --scontext.
Adjust tests to reflect new 'ls -l' syntax -- affects only
systems with SELinux when operating on a file with no ACL.
These tests assumed that everything before the first space on
each line is the 10-byte mode string. But there may also be a "+"
in the 11th column, just before the space. However, note that this
is not new. The same thing would have happened even without the
change below, when listing a file with an ACL.
* tests/chmod/equals, tests/cp/cp-parents, tests/cp/fail-perm:
* tests/cp/link-preserve, tests/install/basic-1, tests/misc/mknod:
* tests/mkdir/parents, tests/mkdir/special-1, tests/mv/partition-perm:
Don't make compilation depend on USE_ACL. An SELinux security
context counts as an "alternate access control method", so ls
must output a "+" for each file with a security context.
* src/ls.c [struct fileinfo] (have_acl): Declare unconditionally.
(FILE_HAS_ACL): Remove macro definition. Use f->have_acl directly.
(gobble_file): Record whether a file has a security context, and
update the condition used to determine whether to print the "+".
(gobble_file): Call getfilecon/lgetfilecon also when
format == long_format, so that we get the "+".
* src/ls.c (gobble_file): Add a comment explaining why (with a
security context option) ls doesn't exit nonzero due to e.g.,
getfilecon failing with errno == ENOTSUP.
* src/ls.c (gobble_file): Ignore failure of getfilecon if it's due
* src/ls.c (gobble_file): Factor out three small blocks using
getfilecon and lgetfilecon.
Don't ignore return value from getfilecon and lgetfilecon.
* src/ls.c (print_long_format): Don't use ?: (empty 2nd arg with C
ternary operator).
(print_scontext_format): Likewise.
(print_scontext): Declare to be "bool", not int. Adjust uses.
* src/ (dir_LDADD, ls_LDADD, vdir_LDADD): Add $(LIB_SELINUX).
* tests/misc/chcon: New file.
* tests/misc/chcon-fail: New file.
* tests/ (check-root): Run new, root-only misc/chcon test.
* tests/misc/ (TESTS): Add chcon and chcon-fail.
* tests/misc/ (TESTS): Add selinux.
* tests/misc/selinux: New file.
* tests/help-version: Skip chcon.
* man/chcon.x: New file.
* man/ Build chcon.1.
New program: chcon
* gl/modules/selinux-at: New module. Check for libselinux and set
LIB_SELINUX here, unconditionally, rather than depending on
the configure-time --enable-selinux option.
* gl/modules/selinux-h: New module.
* bootstrap.conf (gnulib_modules): Add selinux-at.
* gl/lib/selinux-at.c, gl/lib/selinux-at.h: New files.
* gl/lib/se-selinux_.h: New file.
* gl/lib/se-context_.h: New file.
* gl/m4/selinux-selinux-h.m4: New file.
* gl/m4/selinux-context-h.m4: New file.
* src/ (bin_PROGRAMS): Add chcon.
(chcon_LDADD): Define.
* README: Add chcon to the list of programs.
* src/chcon.c: Rewrite the original (Red Hat) chcon to use fts.
2007-03-29 Jim Meyering <>
* .vg-suppressions: Add libc-getpwuid-leak.
2007-03-28 Jim Meyering <>
Help translators include translation team's web or email address.
* src/system.h (emit_bug_reporting_address): New function.
* src/base64.c: Use it rather than a literal printf.
* src/basename.c, src/cat.c, src/chgrp.c, src/chmod.c:
* src/chown.c, src/chroot.c, src/cksum.c, src/comm.c, src/cp.c:
* src/csplit.c, src/cut.c, src/date.c, src/dd.c, src/df.c:
* src/dircolors.c, src/dirname.c, src/du.c, src/echo.c, src/env.c:
* src/expand.c, src/expr.c, src/factor.c, src/fmt.c, src/fold.c:
* src/head.c, src/hostid.c, src/hostname.c, src/id.c, src/install.c:
* src/join.c, src/kill.c, src/link.c, src/ln.c, src/logname.c:
* src/ls.c, src/md5sum.c, src/mkdir.c, src/mkfifo.c, src/mknod.c:
* src/mv.c, src/nice.c, src/nl.c, src/nohup.c, src/od.c:
* src/paste.c, src/pathchk.c, src/pinky.c, src/pr.c, src/printenv.c:
* src/printf.c, src/ptx.c, src/pwd.c, src/readlink.c, src/rm.c:
* src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c, src/shuf.c:
* src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c:
* src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac.c:
* src/tail.c, src/tee.c, src/test.c, src/touch.c, src/tr.c:
* src/true.c, src/tsort.c, src/tty.c, src/uname.c, src/unexpand.c:
* src/uniq.c, src/unlink.c, src/uptime.c, src/users.c, src/wc.c:
* src/who.c, src/whoami.c, src/yes.c: Likewise.
* src/stty.c: Don't include "vasprintf.h", now that its
declarations are guaranteed to be in gnulib's stdio.h.
* src/who.c: Likewise.
2007-03-27 Jim Meyering <>
* README: Use "install", not "ginstall" in the list of program names.
* src/ (check-README): Substitute s/ginstall/install/.
2007-03-25 Jim Meyering <>
* src/c99-to-c89.diff: Regenerate.
2007-03-25 Paul Eggert <>
Avoid the need for euidaccess and/or lstat on every directory entry
with 'rm -r dir' (without -f), if we are root, or if we are removing
a directory tree that is full of symbolic links.
* bootstrap.conf (gnulib_modules): Add write-any-file.
* src/copy.c: Include write-any-file.h.
(UNWRITABLE): Remove macro, replacing with....
(writable_destination): New function, which uses can_write_any_file
to avoid the need for euidaccess when we are privileged.
(overwrite_prompt, abandon_move): Use it.
* src/remove.c: Include write-any-file.h.
(D_TYPE): New macro.
(write_protected_non_symlink): Don't bother to stat if we can write
any file.
(prompt): New arg PDIRENT_TYPE. All callers changed.
Use readdir dirent type to avoid the need for 'lstat' on each directory
entry in cases like 'rm -r dir', if we are root, or if the tree is
full of symbolic links.
(remove_entry): New arg DIRENT_TYPE_ARG. All callers changed.
2007-03-24 Jim Meyering <>
If strace malfunctions, skip the test rather than failing it.
* tests/mv/atomic: Required on a mips-unknown-linux-gnu system
running the aging linux-2.4.27-mipscvs-20040814.
2007-03-23 Paul Eggert <>
* src/pathchk.c: Don't include euidaccess.h, as we don't call
2007-03-23 Jim Meyering <>
* README-package-renamed-to-coreutils: Add a URL for the FAQ,
and a couple more archive links.
2007-03-22 Jim Meyering <>
Post-release version change.
* NEWS: Add a line for 6.9+.
* (AC_INIT): Set new version string.
Version 6.9.
* NEWS: Record release date and new version number.
* (AC_INIT): New version number.
* tests/mv/hard-3: Correct the preceding change: $3 -> $2.
2007-03-22 Paul Eggert <>
Improve a test script.
* tests/mv/hard-3: Check for 'ls' failure, too.
Generate more-useful debugging output when 'ls' fails.
2007-03-21 Jim Meyering <>
Fix a test script not to claim an ext2 file system is of type xfs.
* tests/du/slink: When using df --local and df --type=TYPE,
test only the exit code. Don't bother with stdout.
Prompted by a report by Thomas Schwinge of an inaccurate diagnostic.
* gl/lib/savewd.c: Remove this file, since the savewd_save change
is now in gnulib. The other wasn't useful.
2007-03-20 Jim Meyering <>
* gl/lib/acl.c: Remove this file, now that gnulib's version subsumes it.
Skip part of this test when "." is not a local file system.
* tests/install/basic-1: Otherwise, it would fail on some NFS
file systems.
* tests/mkdir/p-3: Likewise.
2007-03-19 Paul Eggert <>
* src/ (dir_LDADD, ls_LDADD, vdir_LDADD):
2007-03-18 Jim Meyering <>
Fix a generic NFS-related test failure.
* tests/mkdir/p-3: When setting up an unreadable "." in an
inaccessible parent, make the parent inaccessible *after* making "."
unreadable. Otherwise, running "chmod a-r ." in an already-
inaccessible parent would fail on NFS with "Stale NFS file handle".
Fix a bug in how pr -m -s works.
* NEWS: Describe how the fix affects pr.
* src/pr.c (init_parameters): The --merge (-m) option does
not imply --expand-tabs (-e), so don't set "untabify_input".
Reported by Wis Macomson.
* tests/misc/pr: New file. Test for the above fix.
* tests/misc/ (TESTS): Add pr.
* THANKS: Update.
2007-03-17 Jim Meyering <>
Detect use of AC_CONFIG_AUX_DIR also when its argument is quoted.
* bootstrap: Put ""s around use of $build_aux, in case
someone uses a name containing shell meta-characters.
Reported by Alfred M. Szmidt.
* tests/misc/tty-eof: Add shuf to the list of tested commands.
Avoid test failure on NFS-mounted Solaris ZFS file system.
* tests/du/basic: Skip a test if "." is on a non-local file system.
Avoid an obscure build failure, prefer waitpid over wait.
* src/install.c (strip): Use waitpid, not wait. It's equivalent,
but feels less obsolescent.
* bootstrap: Don't use \> in grep regexp. For HP-UX.
2007-03-16 Jim Meyering <>
Begin adding support for Solaris ZFS (4 entries per trivial ACL)
* gl/lib/acl.c (ACL_NOT_WELL_SUPPORTED): New macro.
(file_has_acl, copy_acl): Use it, rather than enumerating errno values.
(is_trivial_acl): New function. Incomplete, for now.
(file_has_acl, copy_acl): Use the new function, rather than
counting the number of entries in an ACL.
* bootstrap: Update from gnulib.
* .x-sc_prohibit_atoi_atof: Add TODO here, too.
2007-03-16 Paul Eggert <>
* src/copy.c: Include filemode.h.
(overwrite_prompt): Say "try to overwrite", not "overwrite", to
make it clearer that the attempt may fail. Problem reported by
Dan Jacobson in:
Output symbolic mode as well as numeric.
* tests/mv/i-2 (fail): Adjust to new prompt format.
2007-03-15 Jim Meyering <>
Enforce policy: don't use *scanf functions.
* Makefile.maint (sc_prohibit_atoi_atof): Add to regexp and diagnostic.
* .x-sc_prohibit_atoi_atof: Give stty a temporary pass.
* TODO: note that stty.c needs this small clean-up.
2007-03-13 Jim Meyering <>
Prepare to work on ACL-related failure when using Solaris ZFS.
* gl/lib/acl.c: New file, copied from gnulib.
Work around a failing test due to an NFS-based race condition.
* tests/cp/sparse: Accept a report that the copy is *smaller*.
2007-03-12 Jim Meyering <>
Make bootstrap.conf a tiny bit more generic.
* bootstrap.conf (XGETTEXT_OPTIONS): Exclude gettext-related .m4
files when e.g., AM_GNU_GETTEXT([external] appears in
2007-03-10 Jim Meyering <>
Try to fix today's NFS-related failure: Treat ESTALE like EACCES.
* gl/lib/savewd.c: Copy this file from gnulib, then change
"errno != EACCES" to (errno != EACCES && errno != ESTALE).
The symptom was this failure in tests/install/basic-1:
ginstall: cannot create directory `rel/a': Stale NFS file handle
The preceding change solved part of the problem. Now ginstall fails.
* tests/install/basic-1: Temporarily, don't redirect ginstall's
stderr to /dev/null, so I can see why the NFS autobuilder's NFS test
is failing.
* tests/install/basic-1: When setting up an unreadable "." in an
inaccessible parent, make the parent inaccessible *after* making "."
unreadable. Otherwise, running "chmod a-r ." in an already-
inaccessible parent would fail on NFS with "Stale NFS file handle".
Reported by Bob Proulx.
* Makefile.maint (po-check): Exclude c99-to-c89.diff.
2007-03-09 Jim Meyering <>
Avoid test failures on Darwin 7.9.0 (MacOS X 10.3.9)
* tests/chgrp/basic: Don't let failure by chgrp to set the
group of a symlink make this test fail. Do give a diagnostic.
In the chgrp-no-change-ctime test, add darwin7.9.0 as another
known-failing system.
When failing on some other system, print $host_triplet, too.
Also avoid test failures on Darwin 8.8.x (MacOS X 10.4).
Reported by Peter Fales.
2007-03-08 Jim Meyering <>
* src/c99-to-c89.diff: Reflect the new c99'ism, update offsets.
2007-03-08 Paul Eggert <>
rm without -f: give a better diagnostic when euidaccess fails.
* src/remove.c (write_protected_non_symlink): Return int, not bool,
so that we can indicate failure too (as a postive error number).
(prompt): If write_protected_non_symlink fails, report that error
number and fail rather than charging ahead and removing the dubious
entry. Redo the logic of printing a diagnostic so that we need to
invoke quote (full_filename (...)) only once. More details at:
2007-03-08 Jim Meyering <>
Generalize a few more cvs-isms.
* bootstrap (checkout_only_file): Rename from CVS_only_file.
Change comments and diagnostics not to say "CVS".
* bootstrap: Run libtool, if necessary.
Make bootstrap a little more general.
* bootstrap (build_aux): Factor out/use this definition.
Formally require a "AC_CONFIG_AUX_DIR($build_aux)" line in
(insert_sorted_if_absent): Move function definition "up", to
precede new first use.
If $build_aux/ doesn't exist initially, create it, and
mark it as ignored.
2007-03-03 Andrew Church <> (tiny change)
Paul Eggert <>
Fix a bug: cp -x would fail to set mount point permissions.
* NEWS: mention cp -x bug fix
* src/copy.c (copy_internal): Don't return immediately after
copying a mount point that we do not intend to recurse under.
Based on a patch by Andrew Church.
2007-03-03 Jim Meyering <>
pwd-unreadable-parent: Skip test on ia64/Linux, too.
* tests/misc/pwd-unreadable-parent: Also skip when $REPLACE_GETCWD.
Reported by Bob Proulx.
2007-03-02 Jim Meyering <>
pwd-unreadable-parent: Skip test on non-Linux/GNU systems.
* tests/misc/pwd-unreadable-parent: Rather than trying to decide
whether this test has a chance of succeeding, run it only when
$(host_os) is linux-gnu. It was failing on powerpc-apple-darwin8.8.0
* tests/misc/ (TESTS_ENVIRONMENT): Add host_os=$(host_os).
* tests/misc/pwd-long: Also allow "+" in $PWD.
Remove another coreutils-ism. Formatting cleanup.
* Makefile.maint (my-distcheck): Update an outdated comment.
(emit_upload_commands): Use $(PACKAGE) rather than "coreutils".
(my-distcheck): Skip the c99/c89 check if there's no such .diff file.
2007-03-01 Jim Meyering <>
* Makefile.maint (warn_cflags): Hoist, adding "-Dlint -O".
(my-distcheck): Use the new variable, instead of too-long literal.
Make "make syntax-check" rules less coreutils-specific.
* Makefile.maint (sc_cast_of_x_alloc_return_value): Use CVS_LIST_EXCEPT.
(sc_cast_of_alloca_return_value): Likewise.
(sc_root_tests): Do nothing if there is no check-root target
in tests/
Run the writable-files check only for release-building targets.
* Makefile.maint (local-checks-available): Remove writable-files.
(alpha beta major): Put it here, instead.
"make syntax-check" now runs only Makefile.cfg-selected tests
* Makefile.maint (syntax-check-rules): Hoist this definition so that
it precedes the indirect use in the definition of $(local-check).
(local-check): Use :=, not just "=".
(syntax-check): Depend on $(local-check), not $(syntax-check-rules).
2007-02-28 Bruno Haible <>
* bootstrap.conf (gnulib_modules): Replace xreadlink with
xreadlink-with-size. Add xreadlink.
* src/copy.c (copy_internal): Update.
* src/ls.c (is_directory): Update.
* src/stat.c (print_stat): Update.
* src/readlink.c (main): Use the one-argument xreadlink function.
2007-02-28 Paul Eggert <>
* doc/coreutils.texi (Common options): --si outputs "M", not "MB".
Problem reported by Philip Rowlands in
2007-02-28 Jim Meyering <>
* .x-sc_file_system: Add the new test, tests/misc/df-P, to this
list of exceptions, for the "make distcheck" sc_file_system rule.
* Makefile.maint (gnulib_snapshot_date): Remove now-unused definition.
2007-02-27 Paul Eggert <>
Make df -P immune to effects of e.g., the BLOCK_SIZE envvar.
* NEWS: With -P, the default block size and output format is not
* src/df.c (main): Implement this.
2007-02-27 Jim Meyering <>
Add a test for the above.
* tests/misc/df-P: New file.
* tests/misc/ (TESTS): Add df-P.
2007-02-25 Jim Meyering <>
* Makefile.maint (announcement): Adjust so that it works with
announce-gen's --gnulib-snapshot-time-stamp option.
Indent one of the command lines using TAB, not 8 spaces.
Post-release version change.
* NEWS: Add a line for 6.8+.
* (AC_INIT): Set new version string.
2007-02-24 Jim Meyering <>
Version 6.8.
* NEWS: Record release date and new version number.
* (AC_INIT): New version number.
Don't skip this test on new-enough Linux/GNU systems.
* tests/misc/pwd-unreadable-parent: Test $REPLACE_GETCWD = 0,
rather than for __GETCWD_PREFIX in config.h (the latter is no
longer defined, ever, due to gnulib changes).
Remove the "gnits" option; it prohibits my using "+" as a version
string suffix, and all it does (beyond the default "gnu" option)
is to _require_ the THANKS file.
* (AM_INIT_AUTOMAKE): Remove it.
Remove all AUTOMAKE_OPTIONS settings in files.
* tests/chgrp/, tests/chmod/
* tests/chown/, tests/cp/
* tests/du/, tests/expr/
* tests/factor/, tests/general/
* tests/install/, tests/ln/
* tests/ls/, tests/mkdir/
* tests/mv/, tests/readlink/
* tests/rm/, tests/rmdir/
* tests/seq/, tests/stty/
* tests/tee/, tests/touch/
* README: Document the OSF/1 4.0d build failure and work-around.
Reported by Bruno Haible.
* NEWS: Use a simple "+" suffix to denote pre-release, not "-dirty".
Nicer connotations.
* Use 6.7+, not 6.7-dirty.
2007-02-24 Paul Eggert <>
* NEWS: sort no longer compresses temporaries by default.
* bootstrap.conf: Remove findprog.
* doc/coreutils.texi (sort invocation): The default is to not
compress. Don't treat "" specially.
* src/sort.c: Don't include findprog.h.
(create_temp): Compress only if the user specified --compress-program.
* tests/misc/sort-compress: Adjusts tests to match new behavior.
2007-02-24 Jim Meyering <>
Avoid a shell syntax error, when building with an inadequate Perl.
* man/ (.x.1): Add quotes around $(PERL) in case, since
it can expand to "/.../missing perl".
* man/ (.x.1): Warn when unable to update a man page.
Suggestion from Bruno Haible.
2007-02-23 Bruno Haible <>
Handle better the combination of old Perl and a pre-c99 compiler.
* man/ (.x.1): If the autoconf test has determined that
perl is missing or not a sufficient version, do nothing.
* tests/readlink/can-e: Put the closing double-quote at the end of a
backquoted word, not in the middle. Works around a bug in sh on
OSF/1 4.0d.
* tests/readlink/can-f: Likewise.
* tests/readlink/can-m: Likewise.
* tests/du/slink: Skip the test if executing on an nfsv3 file system.
This avoids a test failure at least on OSF/1 4.0d.
2007-02-23 Jim Meyering <>
* src/date.c (usage): Split a diagnostic that had grown to be
longer than the C89 maximum of 509 bytes.
2007-02-23 Ed Santiago <>
* src/date.c (usage): Mention that --rfc-3339 uses space, not 'T',
for a separator. Include sample RFC 2822 and 3339 output.
2007-02-23 Jim Meyering <>
With -Dlint, make shuf free all heap-allocated storage.
* src/shuf.c (main): Move declaration of input_lines to
function scope, and initialize to NULL, so we can free it.
[lint]: Free all malloc'd memory.
* tests/misc/shuf: Also test shuf's -e and -i options.
2007-02-22 Jim Meyering <>
Merge in a change from some other incarnation of this file (gzip?)
* bootstrap (gnulib_tool): Skip get_translations if there is no po/ dir.
Adjust preceding change not to perform an unaligned access.
* src/copy.c (copy_reg): Undo previous change. Instead, make
it clearer that we're using a single-byte sentinel, and
[lint]: Initialize sizeof (uintptr_t) - 1 bytes after the sentinel.
Reported by Andreas Schwab.
Placate valgrind, wrt ./cp --sparse=always
* src/copy.c (copy_reg): Place the sentinel by setting a
full word's worth of bits, not just a single byte's worth.
This avoids a harmless (but distracting) case of memory being
2007-02-21 Paul Eggert <>
Honor dd's noatime flag if possible, even if not supported on build fs
* doc/coreutils.texi (dd invocation): Warn that noatime might not be
* src/dd.c (flags, usage): Look at O_NOATIME, not
HAVE_WORKING_O_NOATIME, to decide whether to support the noatime
flag, so that dd attempts O_NOATIME even if the build file system
does not support it. Problem reported by Jim Meyering today in
* tests/dd/misc: Generate a warning, not a failure, if noatime
exists but fails.
2007-02-21 Jim Meyering <>
* tests/misc/date: Remove vestigial use of Data::Dumper.
2007-02-20 Paul Eggert <>
* src/copy.c (cached_umask): Cast -1 to mode_t to avoid a warning
about out-of-range initializer with Sun C 5.8.
2007-02-20 Jim Meyering <>
* bootstrap (CVS_only_file): Use README-hacking.
Now that we use GIT, not cvs, rename README-cvs.
* README-hacking: Renamed from...
Update to reflect that we now use git.
* README-cvs: ...this.
* src/env.c (main): When invoked with no arguments (i.e. when printing
the environment), use a local variable to iterate through the global
"environ" array, rather than "environ" itself. This is solely to
avoid changing the environment for an LD_PRELOAD-substituted "puts"
or "exit" function. Tiny patch by Harvey Eneman. See
* THANKS: Update.
* bootstrap: Move definitions of temporary directory names and the
new bt_regex "up" to precede all uses, so it's clearer what their
scope is. Also, use [.], rather than \\., since the former works
even if eval'd.
* bootstrap: Remove occurrences of $bt (._bootmp) from lib/Makefile.
Based on the bison 2007-02-19 change by Joel E. Denny.
2007-02-19 Paul Eggert <>
* NEWS: sort now uses a --compress-program option rather than
an environment variable.
* doc/coreutils.texi (sort invocation): Document this.
* src/sort.c (usage): Likewise.
(long_options, create_temp, main): Support new option.
* tests/misc/sort-compress: Test it.
2007-02-19 Jim Meyering <>
* bootstrap: Fix typo s/dowloading/downloading/ in --help output.
2007-02-18 Jim Meyering <>
* src/system.h: Don't include exit.h, now that it's subsumed
by the gnulib-generated stdlib.h.
* tests/rm/fail-eacces: Skip this test when running as root.
Reported by Matthew Woehlke.
* bootstrap: Use "._bootmp" as the temporary directory name,
not ".#bootmp". The latter's "#" caused trouble with the new,
gnulib-added "LINK_WARNING_H = $(top_srcdir)/.#bootmp/..." line.
2007-02-14 Paul Eggert <>
* bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
* src/dircolors.c: Include c-strcase.h.
(dc_parse_stream): Use c_strcasecmp rather than
strcasecmp to avoid unreliable results in locales like Turkish
where strcasecmp is incompatible with the C locale.
2007-02-13 Jim Meyering <>
Also check for and print stderr output, in case a program fails.
* tests/misc/tty-eof: Occasionally (not reproducible), this
test would fail, with one or more programs exiting nonzero, e.g.,
tty-eof: sha224sum exited with status 1 (expected 0)
Now, maybe we'll get a clue, the next time that happens.
2007-02-12 Jim Meyering <>
* .x-sc_useless_cpp_parens: Ignore a false-positive in a shell script.
* tests/misc/pwd-unreadable-parent: Skip the test if we're
definitely using the replacement.
2007-02-10 Jim Meyering <>
Remove excess leading spaces that would make help2man misbehave.
* src/printf.c (usage): Remove excess spaces on 2nd line of %b desc.
* src/nl.c (usage): Remove excess spaces on 2nd line of pBRE desc.
* src/dd.c (usage): Remove excess spaces on 2nd line of sync desc.
* src/date.c (usage): Use two spaces after each optional flag, not one.
Reported by Thomas Huriaux in <>.
* Makefile.maint (longopt_re): Relax the regexp, making square
brackets optional, so it matches the newly reported violations, too.
* src/csplit.c (usage): Use two spaces (not one) to separate
each option string from its description, so help2man formats
the derived man page properly. Reported by Thomas Huriaux in
* src/df.c (usage): Likewise.
* src/du.c (usage): Likewise.
* src/install.c (usage): Likewise.
* src/ls.c (usage): Likewise.
2007-02-03 Jim Meyering <>
Test for today's gnulib/lib/getcwd.c fix affecting pwd and readlink
* NEWS: Mention the bug fix.
* tests/misc/pwd-unreadable-parent: New file.
* tests/misc/ (TESTS): Ad pwd-unreadable-parent.
2007-02-02 Paul Eggert <>
* NEWS: Document fix for cp --preserve=mode.
* src/copy.c (copy_internal): Omit the group- or other-writeable
permissions when creating a directory, to avoid a race condition
if the special mode bits aren't right just after the directory is
* src/cp.c (make_dir_parents_private): Likewise.
* tests/cp/parent-perm-race: Test for the "cp --preserve=mode"
race fix in copy.c.
* NEWS: Document fix for cp --parents.
* src/cp.c (make_dir_parents_private): Report the error sooner with
"cp --parents DIR/FILE DEST" when DIR is a non-directory, thus not
creating the directory, DEST/DIR.
* tests/cp/cp-parents: Test for the non-race-condition bug fixed
by the above change.
2007-02-02 Jim Meyering <>
* src/nl.c (proc_text): Use "NULL", not "(struct re_registers *) 0".
* src/c99-to-c89.diff: Make shred.c Index: and a/b prefixes
consistent, so this can be applied with patch -p0.
Reported by Matthew Woehlke.
Arrange for "make check-root" to run the new root-only test.
* tests/ (t9): New target, to run tests/cp/cp-a-selinux.
(all_t): Add t9.
* Makefile.maint (patch-check): Use patch with its -p2 option,
since that makes this check slightly more strict.
Use a directory on a loopback device mounted with -o context=...
* tests/cp/cp-a-selinux: Since this test now runs mount and umount,
it is a root-only one.
2007-01-29 Jim Meyering <>
Plug a leak in ls.
* src/ls.c (print_dir): Don't leak a "DIR"+fd upon failure to
determine dev/inode or upon detecting a symlink loop.
* src/ls.c: Rename three global variables.
(cwd_file): Rename from 'files'.
(cwd_n_alloc): Rename from 'nfiles'.
(cwd_n_used): Rename from 'files_index'.
Shave 8 bytes off the size of "struct fileinfo".
* src/ls.c (fileinfo): Put all members of type "bool" together.
2007-01-28 Paul Eggert <>
Modify "ls" to sort its data faster, using the new gnulib mpsort
module rather than qsort. This is particularly a win in
environments where strcoll is slow, since mpsort typically calls
strcoll less often than qsort does.
* bootstrap.conf (gnulib_modules): Add mpsort.
* src/ls.c: Include mpsort.h.
(sorted_file, sorted_file_alloc): New vars, for a new vector of
pointers to the file info, for speed.
(clear_files, extract_dirs_from_files, sort_files, print_current_files):
(print_many_per_line, print_horizontal, print_with_commas):
(calculate_columns): Set and use new vector.
(initialize_ordering_vector): New function.
2007-01-26 Paul Eggert <>
Adjust to today's change to gnulib, which added a module for
string.h to replace the little include files like strcase.h.
* src/dircolors.c: Don't include strcase.h.
* src/system.h: Don't include mempcpy.h, memrchr.h, stpcpy.h, strpbrk.h.
2007-01-26 Jim Meyering <>
* src/dd.c (advance_input_after_read_error): Change diagnostic to
say "invalid file offset" rather than "screwy file offset".
* .x-sc_cast_of_argument_to_free: Remove this file.
* (EXTRA_DIST): Likewise.
2007-01-25 Dan Hipschman <>
* src/sort.c (create_temp): Remove superfluous access-X_OK
check. find_in_path does this for us.
2007-01-24 Jim Meyering <>
Remove usually-skipped test.
* tests/cp/open-perm-race: Remove this file. It is subsumed
by parent-perm-race.
* tests/cp/ (TESTS): Remove open-perm-race.
* tests/sort/ Regenerate.
Pass "make distcheck" again.
* src/sort.c (usage): Split a diagnostic that had grown to be
longer than the C89 maximum of 509 bytes.
* .x-sc_cast_of_argument_to_free: New file. Allow a cast in sort.c.
FIXME: this is just temporary, while we wait to remove the offending
access-calling code.
* (EXTRA_DIST): Add .x-sc_cast_of_argument_to_free.
* Makefile.maint (sc_cast_of_argument_to_free): Use the
canonical, $$($(CVS_LIST_EXCEPT)).
* m4/.gitignore, m4/.cvsignore, lib/.gitignore, lib/.cvsignore: Update.
2007-01-24 Paul Eggert <>
* NEWS: New option sort -C, proposed by XCU ERN 127, which looks
like it will be approved. Also add --check=quiet, --check=silent
as long aliases, and --check=diagnose-first as an alias for -c.
* doc/coreutils.texi (sort invocation): Document this.
Also, mention that sort -c can take at most one file.
* src/sort.c: Implement this.
Include argmatch.h.
(usage): Document the change.
(CHECK_OPTION): New constant.
(long_options): --check now takes an optional argument, and is now
treated differently from 'c'.
(check_args, check_types): New constant arrays.
(check): New arg CHECKONLY, which suppresses diagnostic if -C.
(main): Parse the new options.
* tests/sort/ (02d, 02d, incompat5, incompat6):
New tests for -C.
2007-01-24 Jim Meyering <>
Fix a typo.
* tests/misc/sort-compress: Use $abs_top_builddir, not $top_builddir.
* tests/misc/ (TESTS_ENVIRONMENT): Likewise.
Don't depend on "which".
* tests/misc/sort-compress (SORT): Use $abs_builddir, now which.
* tests/misc/ (TESTS_ENVIRONMENT): Export top_builddir.
2007-01-24 Dan Hipschman <>
Test sort compression.
* tests/misc/ Add the test.
* tests/misc/sort-compress: New file containing the tests.
2007-01-24 Jim Meyering <>
* NEWS: sort temp file compression: tweak wording.
* src/sort.c (struct sortfile) [name]: Declare member to be const.
2007-01-21 Jim Meyering <>
In pipe_fork callers, use these named constants, not "2" and "8".
(proctab, nprocs): Declare to be "static".
(pipe_fork) [lint]: Initialize local, pid,
to avoid unwarranted may-be-used-uninitialized warning.
(create_temp): Use the active voice. Describe parameters, too.
2007-01-21 James Youngman <>
Centralize all the uses of sigprocmask(). Don't restore an invalid
saved mask.
* src/sort.c (enter_cs, leave_cs): New functions for protecting
code sequences against signal delivery.
* (exit_cleanup): Use enter_cs and leave_cs instead of
calling sigprocmask directly.
(create_temp_file, pipe_fork, zaptemp): Likewise
2007-01-21 Dan Hipschman <>
Add compression of temp files to sort.
* NEWS: Mention this.
* bootstrap.conf: Import findprog.
* doc/coreutils.texi: Document GNUSORT_COMPRESSOR environment
* src/sort.c (compress_program): New global, holds the name of the
external compression program.
(struct sortfile): New type used by mergepfs and friends instead
of filenames to hold PIDs of compressor processes.
(proctab): New global, holds compressor PIDs on which to wait.
(enum procstate, struct procnode): New types used by proctab.
(proctab_hasher, proctab_comparator): New functions for proctab.
(nprocs): New global, number of forked but unreaped children.
(reap, reap_some): New function, wait for/cleanup forked processes.
(register_proc, update_proc, wait_proc): New functions for adding,
modifying and removing proctab entries.
(create_temp_file): Change parameter type to pointer to file
descriptor, and return type to pointer to struct tempnode.
(dup2_or_die): New function used in create_temp and open_temp.
(pipe_fork): New function, creates a pipe and child process.
(create_temp): Creates a temp file and possibly a compression
program to which we filter output.
(open_temp): Opens a compressed temp file and creates a
decompression process through which to filter the input.
(mergefps): Change FILES parameter type to struct sortfile array
and update access accordingly. Use open_temp and reap_some.
(avoid_trashing_input, merge): Change FILES parameter like
mergefps and call create_temp instead of create_temp_file.
(sort): Call create_temp instead of create_temp_file.
Use reap_some.
(avoid_trashing_input, merge, sort, main): Adapt to mergefps.
The idea of compressing sorts temporary files was first
suggested/implemented by Jay Soffian in 1998, and again
by Charles Randall in 2001.
2007-01-20 Jim Meyering <>
* tests/misc/pwd-long: Work properly even when run from the
wrong one of two or more bind-mounted sibling directories.
Suggestion from Mike Stone in <>.
2007-01-20 Paul Eggert <>
Standardize on list of signals when an app catches signals.
* src/csplit.c (main): Also catch SIGALRM, SIGPIPE, SIGPOLL,
* src/ls.c (main): Likewise (except SIGPIPE was already caught).
Note that ls.c is special, as it also catches SIGTSTP.
* src/sort.c (main): Likewise. Also catch SIGQUIT. More details in
2007-01-19 Dan Hipschman <>
and Paul Eggert <>
* src/sort.c (cleanup): Clear temphead at the end.
(exit_cleanup): New function.
(main): Don't invoke atexit until we're ready.
Invoke it with exit_cleanup, not with cleanup and close_stdout,
to avoid a race condition with cleanup and signal handling. More
2007-01-18 Jim Meyering <>
* src/c99-to-c89.diff: Adjust remove.c offsets.
2007-01-17 Jim Meyering <>
Make "rm --interactive=never ..." never prompt.
* NEWS: Mention this.
* src/remove.h (enum rm_interactive): New ternary type.
(struct rm_options) [interactive]: Use it, here -- rather than bool.
* src/remove.c (prompt): Reflect type change.
* src/mv.c (rm_option_init): Initialize to RMI_NEVER now.
* src/rm.c (main): Add a FIXME comment for '-d' option.
Adapt to type change of rm_options.interactive.
* tests/rm/i-never: New file. Test for the above fix.
* tests/rm/ (TESTS): Add i-never.
2007-01-15 Jim Meyering <>
* bootstrap (gnulib_tool): When adding to .cvsignore and .gitignore,
emit foo.h, for each foo_.h. This yields one false-positive, fts.h,
but that's ok, since fts_.h will eventually be renamed.
* src/remove.c (remove_dir): Don't use errno in diagnostic.
Root-only test failure reported by Alex van Hout and Jon Grosshart in
* bootstrap.conf (avoided_gnulib_modules): Fix my typo:
2007-01-14 Bruno Haible <>
Enable use of gnulib's new fchdir module.
* bootstrap.conf (avoided_gnulib_modules): Avoid canonicalize-lgpl,
since we use canonicalize.
(gnulib_modules): Add fchdir.
* m4/jm-macros.m4 (coreutils_MACROS): Remove fchdir-stub.
2007-01-13 Jim Meyering <>
* tests/cp/open-perm-race: Remove gdb-based test.
It would run only when compiled with -g, and besides is now
subsumed by file-perm-race.
* tests/cp/ (TESTS): Remove open-perm-race.
* Transform all files so that when running "make check",
CU_TEST_NAME is set to the name of the test. This is so that when I
run valgrind-enabled (--log-file-qualifier=CU_TEST_NAME) "make check"
on the entire package it is more convenient to map a leak or error
found in a valgrind log file back to the offending test.
Use this command:
(echo tests/; find tests -name \
|xargs perl -pi -e '/^(\s*)PATH=...VG_PATH_PREFIX/ and ' \
-e 'print $1,q|CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst |,"\\\n"'
2007-01-11 Jim Meyering <>
Avoid a leak in expr's implementation of the ":" (match) operator.
* src/expr.c (docolon): Free the regexp buffer using regfree, rather
than doing it manually, being careful to set fastmap to NULL first.
Free any re_regs.start and .end members, if necessary.
* tests/misc/test-diag: Work also when libc's error function
reports the entire program name ("../../src/test"), rather than
just the final component.
2007-01-10 Jim Meyering <>
Don't use fts_statp uninitialized for "chown -RLh --preserve-root ...".
* src/chown-core.c (FTSENT_IS_DIRECTORY): New macro.
(change_file_owner): Perform the ROOT_DEV_INO_CHECK only for a
directory. Non-directory entries lack fts_statp data when using
the FTS_NOSTAT option.
2007-01-07 Jim Meyering <>
* tests/sample-test: Update copyright date to 2007.
* Makefile.maint (copyright-check): Also check the copyright date
in tests/sample-test.
2007-01-06 Jim Meyering <>
* tests/fmt/basic (pfx-only, pfx-of-pfx): New tests,
based on examples from G.P. Halkes in
2007-01-06 G.P. Halkes <>
* src/fmt.c (copy_rest): Correct prefix handling.
Don't elide a line with the prefix followed by only white space.
(get_line): Move EOF-check to loop-termination condition.
* tests/fmt/basic (pfx-1): Adjust test to expect desired result.
(pfx-2): Remove test; its premise was contrary to the documentation.
2007-01-05 Jim Meyering <>
Avoid a used-uninitialized bug for invalid input, i.e., when the size
of the input, not counting newlines, is 1 % 4.
* gl/lib/base64.c (base64_decode): Don't hard-code inlen==4.
It may be smaller when flushing.
2007-01-05 Mike Frysinger <>
* src/dircolors.hin: Add a TERM directive for cons25.
2007-01-04 Jim Meyering <>
* Makefile.cfg (local-checks-to-skip): Skip strftime-check, in
case you don't have convenient access to glibc info documentation.
Use the release year, not the current year.
* src/ (version): Use a better name: @RELEASE_YEAR@.
* src/ (RELEASE_YEAR): Define it.
(.sh): Use it.
Thanks to a prod from Eric Blake.
Ensure that "group --version" always prints the current year.
* src/ (version): Use @CURRENT_YEAR@, rather than 2006.
* src/ (.sh): Also substitute for @CURRENT_YEAR@.
Suggestion from Eric Blake.
When decoding, always allow newlines in input, with almost no
performance impact.
* src/base64.c (do_decode): Initialize decode context.
Call base64_decode one more time, after all input is processed.
(usage): When decoding, newlines are always accepted.
* tests/misc/base64: Add a bunch of tests, for the above.
* gl/lib/base64.c: Include <string.h>.
(base64_decode_ctx_init, get_4, decode_4): New functions.
(base64_decode): Efficiently handle interspersed newlines.
(base64_decode_alloc): Update signature.
* gl/lib/base64.h (struct base64_decode_context): Define.
(base64_decode_ctx_init): Add prototype.
(base64_decode, base64_decode_alloc): Update prototypes.
* gl/lib/base64.c: Copied from gnulib.
* gl/lib/base64.h: Likewise.
2007-01-03 Jim Meyering <>
* THANKS: Add Evan Hunt.
2007-01-03 Bruno Haible <>
Avoid spurious test failures on MacOS X 10.3.9, in a German locale.
* tests/chown/deref: Apply lang-default.
* tests/misc/split-a: Likewise.
* tests/mv/reply-no: Likewise.
* src/copy.c (copy_internal): Use mkfifo as a fallback if mknod fails.
Needed on MacOS X.
2007-01-02 Paul Eggert <>
Now, "ls -FRL" always follows symbolic links on Linux.
* NEWS: Mention this bug fix.
* src/ls.c (gobble_file): Fix bug reported by
Nobuyuki Tsuchimura in
where "ls -FRL" didn't follow a symbolic link in some cases on Linux.
* tests/ls/follow-slink: Add a test for this case.
2007-01-01 Jim Meyering <>
* tests/rm/fail-eperm: Revert last change. The PATH=... setting
is not honored at least on HP-UX 11.23 systems.
Instead, simply transform the actual output diagnostic.
Test failure reported by Bob Proulx.
Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
Copying and distribution of this file, with or without
modification, are permitted provided the copyright notice
and this notice are preserved.
Something went wrong with that request. Please try again.