Jim Meyering [Sat, 18 Nov 2006 19:00:39 +0000 (20:00 +0100)]
"ln --backup f f" produces a misleading diagnostic:
ln: creating hard link `f' => `f': No such file or directory
* src/ln.c (do_link): Give a better diagnostic in this unusual case.
(do_link): Rename local: s/lstat_ok/dest_lstat_ok/.
* tests/ln/Makefile.am (TESTS): Add hard-backup.
* tests/ln/hard-backup: New test for the above.
Jim Meyering [Thu, 16 Nov 2006 09:05:36 +0000 (10:05 +0100)]
* tests/tail-2/append-only: If chattr +a fails, exit 77 (to tell
automake we're skipping this test), and give a diagnostic to tell
the user the same thing. Reported by Mike Grayson.
Ralf Wildenhues [Thu, 16 Nov 2006 08:57:34 +0000 (09:57 +0100)]
Arrange to install manpages only for tools that are installed.
* man/Makefile.am (dist_man_MANS): Replace all optional manpages
with `$(MAN)', computed at configure time; also, list them ...
(optional_mans): ... in this new variable.
(max_aux, EXTRA_DIST): Ensure that we distribute all manpages.
Jim Meyering [Thu, 16 Nov 2006 08:15:47 +0000 (09:15 +0100)]
Help valgrind see that there is no leak in dd.c.
* src/dd.c (dd_copy): Declare real_buf and real_obuf to be static,
so we need not free them at all. This is easier than freeing
both buffers at each of the early "return"s.
Jim Meyering [Tue, 14 Nov 2006 13:02:18 +0000 (14:02 +0100)]
Adapt to new version of gnulib-tool.
* gl/modules/root-dev-ino: New file.
* lib/root-dev-ino.c, lib/root-dev-ino.h: Move these files ...
* gl/lib/root-dev-ino.c, gl/lib/root-dev-ino.h: ... to here.
* m4/root-dev-ino.m4: Move this file ...
* gl/m4/root-dev-ino.m4: ... to here.
* bootstrap.conf (gnulib_modules): Add root-dev-ino.
Jim Meyering [Mon, 13 Nov 2006 14:19:22 +0000 (15:19 +0100)]
Plug another technically-unimportant leak in sort.
* src/sort.c (main): Don't allocate memory for each new key here.
(insertkey): Allocate memory for each key here, instead.
(key_init): Rename from new_key. Don't allocate.
Jim Meyering [Sun, 12 Nov 2006 17:42:24 +0000 (18:42 +0100)]
du would exit early, when encountering an inaccessible directory
Reported by Mike Frysinger, in
http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8831
* tests/du/inacc-dest: New test, based on an example from Mike Frysinger.
* tests/chgrp/no-x: Remove the "fts_read failed: ..."
diagnostic from the expected output when using native fdopendir.
* tests/chmod/no-x: Likewise.
* tests/du/no-x: Likewise.
Jim Meyering [Sun, 12 Nov 2006 07:22:46 +0000 (08:22 +0100)]
Avoid false-positive when testing via valgrind.
* tests/mv/atomic: Grep strace output for a more specific pattern
than just "unlink", since that got a false positive when testing
under valgrind: unlink("/tmp/valgrind_proc_9657_cmdline_A51E9991") = 0
* tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define EGREP.
Jim Meyering [Sat, 28 Oct 2006 16:23:30 +0000 (18:23 +0200)]
* Makefile.maint (patch-check): Make it easier to regenerate
the src/c99-to-c89.diff file. E.g., I do this:
make patch-check REGEN_PATCH=1; ediff src/c99-to-c89.diff new-diff
Jim Meyering [Sat, 28 Oct 2006 16:19:05 +0000 (18:19 +0200)]
* coreutils.texi (wc invocation): When giving the order in which
the various "counts" are listed, also mention "maximum line length".
Prompted by a report from Vincent LeFevre.
Jim Meyering [Thu, 26 Oct 2006 13:16:41 +0000 (15:16 +0200)]
* src/system.h (ftello): Add a compile-time check for the highly
unlikely condition of off_t narrower than long int, rather than
handling it at run time. Based on a patch from Paul Eggert.
Jim Meyering [Thu, 26 Oct 2006 09:03:30 +0000 (11:03 +0200)]
Avoid a shell bug in Tru64 4.0 sh's handling of double-quoted strings.
[patch by Paul Eggert]
* tests/chmod/c-option: When double-quoting part of a word, prefer
to double-quote the whole word. This is a bit easier to read (at
least for me), and in some cases it avoids a shell bug with Tru64
4.0 sh reported by Nelson H. F. Beebe. For example, instead of
"$abs_srcdir"/../setgid-check we now write
"$abs_srcdir/../setgid-check".
Jim Meyering [Wed, 25 Oct 2006 09:47:06 +0000 (11:47 +0200)]
Portability to Tru64 V4.0.
* src/system.h (ftello) [!HAVE_FSEEKO && !defined ftello]:
Define inline replacement function.
This (along with a yesterday's fix for autoconf's
_AC_SYS_LARGEFILE_MACRO_VALUE macro) makes it so coreutils
now builds once more on Tru64 V4.0. Reported by Nelson Beebe.
Jim Meyering [Tue, 24 Oct 2006 22:01:33 +0000 (00:01 +0200)]
new feature: rm accepts new option: --one-file-system
Suggested by Steve McIntyre in <http://bugs.debian.org/392925>.
* src/remove.h (struct rm_options) [one_file_system]: New member.
* src/rm.c (rm_option_init): Initialize it.
(usage): Document the option.
* src/mv.c (rm_option_init): Likewise.
* src/remove.c (remove_dir): With --one-file-system and --recursive,
for each directory command line argument, do not affect a file system
different from that of the starting directory. And give a diagnostic.
* src/rm.c (ONE_FILE_SYSTEM): New enum.
(main): Handle new option.
* tests/rm/one-file-system: Test the above.
* tests/rm/Makefile.am (TESTS): Add one-file-system.
* tests/Makefile.am (check-root): Add the rm/one-file-system
test to the list.
(EXTRA_DIST): Add other-fs-tmpdir.
Jim Meyering [Tue, 24 Oct 2006 06:43:58 +0000 (08:43 +0200)]
Don't let a failure in one test stop "make -k".
* tests/Makefile.am (t1 t2 t3 t4 t5): New targets.
(check-root): Depend on them, rather than executing the five
commands in a single rule. Reported by Greg Schafer.
Jim Meyering [Mon, 23 Oct 2006 09:52:48 +0000 (11:52 +0200)]
* tests/misc/pwd-long: Undo last change, since it made Perl invoke
pwd via a shell. Instead, ensure that the absolute name of the
pwd binary consists solely of reasonable characters.
Jim Meyering [Sat, 21 Oct 2006 19:50:47 +0000 (19:50 +0000)]
* .gitignore: Remove some references to files in subdirectories.
* build-aux/.gitignore, doc/.gitignore, lib/.gitignore: New files.
* m4/.gitignore, po/.gitignore, src/.gitignore: Likewise.
Jim Meyering [Fri, 20 Oct 2006 23:01:59 +0000 (23:01 +0000)]
Enable an fts optimization (call lstat only for directories,
on some file system types) also with the --preserve-root option
of chown or chgrp.
* src/chown-core.c (change_file_owner): Compare fts_statp-based
dev/ino against root dev/ino only for directories.
(chown_files): Don't let the root_dev_ino setting influence whether
we use FTS_NOSTAT: fts always sets *fts_statp for a directory.
Jim Meyering [Thu, 19 Oct 2006 08:51:27 +0000 (08:51 +0000)]
* Makefile.maint (po-check): This rule didn't detect the new use
of "gettext" (as opposed to the use of "_" everywhere else) in
lib/xstrtol.h. Adjust the grep regexp so that now it does.
Paul Eggert [Thu, 19 Oct 2006 05:22:54 +0000 (05:22 +0000)]
* src/copy.c (copy_reg): Rewrite slightly to avoid duplicte code
when opening dst_name.
(copy_reg, copy_internal): Use (SYSCALL != 0) rather than plain
(SYSCALL) to test for failure in a system call.
Paul Eggert [Wed, 18 Oct 2006 22:33:06 +0000 (22:33 +0000)]
* src/copy.c (copy_internal): Use mknod rather than mkfifo to copy
a fifo. This preserves the special mode bits on Solaris 10, which
is compatible with what Solaris 10 cp -R does.
Paul Eggert [Wed, 18 Oct 2006 20:56:38 +0000 (20:56 +0000)]
* src/copy.c (copy_internal): Don't pass mkdir a mode greater than
7777. This matches historical 'cp' behavior and avoids some
(though not all) implementation-defined behavior of mkdir.
* src/cp.c (make_dir_parents_private): Likewise.
* src/copy.c (copy_internal): Don't pass 'open' a mode greater
than 777. This is required by POSIX. It doesn't make any difference
in actual behavior on any host that I know of.
Jim Meyering [Tue, 17 Oct 2006 13:51:47 +0000 (13:51 +0000)]
* src/dd.c (usage): Use two spaces (not one) to separate the
"fdatasync" option string from its description, so help2man formats
the derived man page properly. Reported by Samuel Thibault
in <http://bugs.debian.org/393649>.
Paul Eggert [Sun, 15 Oct 2006 06:17:45 +0000 (06:17 +0000)]
[m4/ChangeLog]
* sha512.m4 (gl_SHA512): Add u64.h to AC_LIBSOURCES.
[lib/ChangeLog]
Port sha512sum to hosts where uintmax_t is only 32 bits, e.g.,
HP/Tandom NonStop OSS circa 2005 has 32-bit uintmax_t, 64-bit intmax_t.
* u64.h: New file.
* sha512.c (SWAP, sha512_init_ctx, sha384_init_ctx, sha512_read_ctx):
(sha384_read_ctx, sha512_conclude_ctx, sha512_process_bytes):
(sha512_round_constants, F2, F1, sha512_process_block):
(S0, S1, SS0, SS1, M, R):
Rewrite to use u64.h instead of assuming uint64_t.
* sha512.h: Include u64.h rather than stdint.h.
(rol64): Remove; moved to u64.h and renamed to u64rol.
Jim Meyering [Sat, 14 Oct 2006 12:12:44 +0000 (12:12 +0000)]
* src/system.h (EXIT_FAILURE, EXIT_SUCCESS): Remove definitions.
Instead, include "exit.h". This hereby retires the work-around for
"Sony NEWS-OS Release 4.0C"'s bug due to "#define EXIT_FAILURE 0".
Jim Meyering [Sat, 14 Oct 2006 09:51:58 +0000 (09:51 +0000)]
[ChangeLog]
* Makefile.cfg: Remove cruft that's now handled via bootstrap.
* Makefile.maint: Likewise, remove these targets/rules/variables:
(local_updates, update, cvs-update, wget_files, get-targets): Remove.
(cvs_files, wget-update, automake_repo): Likewise.
Move the comment about cvsu to build-aux/vc-list-files,
where cvsu is actually used.
[build-aux/ChangeLog]
* vc-list-files: Add a comment about cvsu.
Jim Meyering [Sat, 14 Oct 2006 08:51:27 +0000 (08:51 +0000)]
Work also when the working directory (with e.g. coreutils sources)
is version controlled with git, rather than CVS.
* bootstrap (CVS_only_file): Test for the existence of README-cvs,
rather than CVS.
In messages and comments, say e.g., "checked-out sources",
rather than "CVS sources".
(version_controlled_file): New function. Work for git as well as
for CVS. Don't use grep's -q option.
(slurp): Call it here, in place of CVS-specific code.
Jim Meyering [Sat, 14 Oct 2006 05:20:27 +0000 (05:20 +0000)]
* NEWS: cp -r --backup dir1 dir2, would rename an existing dir1/dir2
to dir1/dir2~.
* src/copy.c (copy_internal): Although we do create a backup of each
destination directory when in move mode, don't do that when copying.
Reported by Peter Breitenlohner, in
<http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8616>.
* tests/cp/backup-dir: New file. Test for the above.
Jim Meyering [Fri, 13 Oct 2006 21:11:53 +0000 (21:11 +0000)]
More chown/chgrp dereferencing-related fixes.
* src/chown-core.c (change_file_owner): Don't use fts_statp if
we're dereferencing symlinks.
Reverse conjuncts, so that we use dereference file_stats
(aka ent->fts_statp) only *after* we've confirmed that
chopt->affect_symlink_referent is true. Otherwise, we might
use ent->fts_statp uninitialized.
Don't turn on FTS_NOSTAT when dereferencing symlinks.
* tests/chown/deref: Update the expected diagnostic, now that
this test case (trying to use "chown --dereference ..." on a
dangling symlink) takes a different code path.
Paul Eggert [Fri, 13 Oct 2006 19:07:21 +0000 (19:07 +0000)]
Sync from Bison, as follows:
2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
Fix problems with translating English-language diagnostics.
* bootstrap: Fix bug introduced in recent bootstrap changes, with
respect to bison-runtime pot generation. The YY_ stuff
wasn't being captured.
Jim Meyering [Fri, 13 Oct 2006 18:51:08 +0000 (18:51 +0000)]
* src/chown-core.c (change_file_owner): Use fstatat, not stat,
now that we're using fts_open with FTS_CWDFD.
* tests/chgrp/posix-H: Add --preserve-root to an invocation of
chgrp, to exercise the above fix.
Jim Meyering [Thu, 12 Oct 2006 21:13:24 +0000 (21:13 +0000)]
* Makefile.am (libcoreutils_a_LIBADD): Append $(LIBOBJS),
to accommodate the latest version of gnulib-tool.
(libcoreutils_a_DEPENDENCIES): Likewise.
From Bruno Haible.
Jim Meyering [Thu, 12 Oct 2006 20:39:33 +0000 (20:39 +0000)]
* configure.ac: Avoid compiler warnings about default return
type in function definitions and unused variables in tests.
* src/who.c (print_user) [HAVE_UT_HOST]: hostlen is only needed
if this is #defined.
Jim Meyering [Thu, 12 Oct 2006 20:37:02 +0000 (20:37 +0000)]
[ChangeLog]
* configure.ac: Reflect s/gl_MACROS/coreutils_MACROS/ renaming.
Call gl_INIT directly, rather than through the above.
[m4/ChangeLog]
* jm-macros.m4 (coreutils_MACROS): Rename from gl_MACROS, now that
most of the gnulib macros have migrated into gnulib.
Don't call gl_INIT here (now it's called from configure.ac, directly).
Paul Eggert [Wed, 11 Oct 2006 23:03:55 +0000 (23:03 +0000)]
* bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
variable was sometimes used without being initialized. This
messed up the installation of the INSTALL file in some cases.
Paul Eggert [Tue, 10 Oct 2006 22:57:07 +0000 (22:57 +0000)]
* src/ls.c (quote_name): Use initializer rather than memset to
initialize an object to zero. This is easier to read and is less
likely to introduce an runtime error due to a mixup. It causes
gcc -W to issue a warning, but you can work around this by
appending -Wno-missing-field-initializers.
* src/pathchk.c (portable_chars_only): Likewise.
* src/shred.c (main): Likewise.
* src/stty.c (main): Likewise.
* src/tr.c (card_of_complement): Likewise.
* src/wc.c (wc): Likewise.