* src/dircolors.hin (image formats): Add the .svg suffix.
[platform/upstream/coreutils.git] / ChangeLog
1 2008-01-12  Mike Frysinger  <vapier@gentoo.org>
2
3         * src/dircolors.hin (image formats): Add the .svg suffix.
4
5 2008-01-12  Jim Meyering  <meyering@redhat.com>
6
7         Use new version of announce-gen.
8         * Makefile.maint (announcement): Remove use of the
9         --gnulib-snapshot-time-stamp option.
10         Use new --gnulib-version option instead.
11         (gnulib-version): New variable.
12
13 2008-01-11  Jim Meyering  <meyering@redhat.com>
14
15         * Version 6.9.92.
16
17         * tests/tr/Test.pm: Prefer en_US.ISO-8859-1 to en_US.iso88591.
18         Suggestions from James Youngman and Pádraig Brady in
19         http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12218/focus=12227
20
21 2008-01-10  Jim Meyering  <meyering@redhat.com>
22
23         * README-hacking: Add Git to the list of required tools.
24
25 2008-01-08  Paul Eggert  <eggert@cs.ucla.edu>
26
27         Fix a minor race condition when using cp -p --parents.
28         * src/cp.c (make_dir_parents_private): If stat fails on the parent
29         directory, do not add it to the list of directories whose modes
30         might need fixing later.  Also, do not bother invoking 'stat'
31         unless the stat results might be needed later.
32
33 2008-01-08  Jim Meyering  <meyering@redhat.com>
34
35         parent-perm: avoid a bizarre test failure.
36         * tests/cp/parent-perm: Accommodate the situation in which
37         chmod ("dir", 02755) returns 0 yet fails to set the S_ISGID bit.
38
39         Remove uses of now-undefined Makefile variable.
40         * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Remove uses
41         of no-longer-defined variable, $(LIB_ACL_TRIVIAL).
42
43 2008-01-07  Jim Meyering  <meyering@redhat.com>
44
45         cp (but not copy.c): plug a small leak.
46         * src/cp.c (do_copy) [--parents]: Free the attribute list.
47
48         Make a racy test failure less likely to happen.
49         * tests/misc/tty-eof: Uncomment a debug "warn".
50         This change happens to make this test far less likely to fail.
51         With that statement commented out, this test would fail about
52         20% of the time on my desktop.  Now, it's gone 100 iterations
53         in a row with no failure.
54
55         * NEWS: Mention the cp bug fix.
56
57 2008-01-07  Jan Blunck  <jblunck@suse.de>
58
59         cp --parents: don't use uninitialized memory when restoring permissions
60         * src/cp.c (make_dir_parents_private): Always stat each source
61         directory, in case its permissions are required in re_protect,
62         when setting permissions of a just-created destination directory.
63
64 2008-01-07  Jim Meyering  <meyering@redhat.com>
65
66         cp: add a test for today's bug fix.
67         * tests/cp/parent-perm: New script.  Test today's change.
68         Based on reproducer from Jan Blunck.
69         * tests/cp/Makefile.am (TESTS): Add parent-perm.
70
71 2008-01-06  Jim Meyering  <meyering@redhat.com>
72
73         touch: add a test for today's change.
74         * tests/touch/now-owned-by-other: New script.  Test today's change.
75         * tests/touch/Makefile.am (TESTS): Add now-owned-by-other.
76         * tests/Makefile.am (all_t): Add td, a new root-only test.
77         (td): New target.
78         * NEWS: Mention the improvement.
79
80 2008-01-06  Paul Eggert  <eggert@cs.ucla.edu>
81
82         touch: ignore "-d now" option, when appropriate
83         * src/touch.c (main): Treat "-d now" as if it were absent, if
84         neither -a nor -m is specified.  Problem reported by Dan Jacobson in:
85         http://lists.gnu.org/archive/html/bug-coreutils/2008-01/msg00010.html
86
87 2008-01-05  Jim Meyering  <meyering@redhat.com>
88
89         Avoid tr case-conversion failure in some locales.
90         * src/tr.c (skip_construct): New function.
91         (main): When processing a pair of case-converting classes, don't
92         iterate through the elements of each [:upper:] or [:lower:] class.
93         Reported by Gerald Pfeifer in
94         <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12218>.
95         * tests/tr/Test.pm [tolower-F]: New test for the above fix.
96         [upcase-xtra, dncase-xtra]: New tests, for a related code path.
97         * NEWS: Mention the tr bug fix.
98
99 2008-01-02  Jim Meyering  <jim@meyering.net>
100
101         * .gitignore: Ignore lzma-compressed files, too.
102
103         Update copyright date.
104         * tests/sample-test: Likewise.
105         * doc/coreutils.texi: Likewise.
106
107 2007-12-31  Jim Meyering  <jim@meyering.net>
108
109         * doc/coreutils.texi (Block size): Put braces around multi-digit
110         exponents.  Reported by Darrel Francis.
111
112         Add a syntax check, so this doesn't recur.  Reorganize existing checks.
113         * doc/Makefile.am (sc-exponent-grouping):
114         (syntax_checks): New variable.
115         (sc-avoid-io, sc-avoid-non-zero, sc-avoid-timezone):
116         (sc-avoid-zeroes, sc-use-small-caps-NUL): New rules, extracted
117         from check-texinfo.
118         (check-texinfo): Depend on $(syntax_checks).
119
120 2007-12-30  Mike Frysinger <vapier@gentoo.org>
121
122         * src/dircolors.hin (TERM): Add gnome-256color.
123
124 2007-12-21  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
125
126         * doc/coreutils.texi: Fix a typo.  Avoid the term `relationals'.
127
128 2007-12-20  Jim Meyering  <meyering@redhat.com>
129
130         Use comma-separated list in ./configure --help output.
131         * configure.ac: Map commas to spaces in excluded-program list.
132         Use a comma-separated list, not a space-separated one.
133         * m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG):
134         Expect list of program names to be comma-separated.
135         Reported by Jan Bauke Douma.
136
137         Avoid another "make check" failure due to omitted programs.
138         * tests/test-lib.sh (require_built_): New function.
139         * tests/misc/groups-version: Use it to skip this test if
140         either groups or id is not built.
141
142         Avoid spurious "make check" failures due to omitted programs.
143         * man/Makefile.am (distcheck-hook): Make check rules dependents of
144         this target, not of check-local, so that people aren't distracted by
145         failures due to programs omitted via --enable-no-install-program=...
146
147 2007-12-19  Paul Eggert  <eggert@cs.ucla.edu>
148
149         * src/uniq.c (usage): Improve wording in --help "Note".
150
151 2007-12-18  Jim Meyering  <meyering@redhat.com>
152
153         * src/uniq.c (usage): Note that sorting uniq's input is often useful.
154         Suggested by Eric Blake.
155         (usage): Say "key-selection", not "field-selection".
156         Quote example commands consistently.
157
158 2007-12-15  Jim Meyering  <meyering@redhat.com>
159
160         Version 6.9.91.
161
162         * Makefile.cfg (gpg_key_ID): Use new, longer signing subkey.
163
164 2007-12-12  Jim Meyering  <meyering@redhat.com>
165
166         * tests/mv/part-symlink: Redirect diff output to stderr.
167
168 2007-12-11  Jim Meyering  <meyering@redhat.com>
169
170         Add a test to exercise today's bug fix.
171         * tests/misc/selinux: Test for today's bug fix.
172         * NEWS: Mention the SELinux "ls -l" fix.
173
174 2007-12-11  Paul Eggert  <eggert@cs.ucla.edu>
175
176         "ls -l" wouldn't output "+" on SELinux hosts unless -Z was also given.
177         * src/ls.c (gobble_file): Also get the file context if -l is specified.
178         Treat getfilecon failures like file_has_acl failures.
179         (UNKNOWN_SECURITY_CONTEXT): New constant.
180         (clear_files): Don't free it.
181         (gobble_file): Set unknown security contexts to it; that way, we
182         don't have to have special cases for unknown contexts.
183         (print_long_format, print_file_name_and_frills): Don't worry
184         about scontext being null, since it's always some string now.
185
186 2007-12-11  Jim Meyering  <meyering@redhat.com>
187
188         * NEWS: Add the "Bug fixes" heading.
189
190 2007-12-09  Jim Meyering  <meyering@redhat.com>
191
192         "rm" as root would fail to unlink a non-directory on OS X 10.4.x
193         * src/remove.c (remove_entry) ["can unlink directories"]: Fix a
194         mistakenly reversed condition.
195         * NEWS: Mention this bug fix.
196         Reported by Pieter Bowman.
197
198 2007-12-08  Jim Meyering  <meyering@redhat.com>
199
200         * src/c99-to-c89.diff: Adjust shred.c offsets.
201
202 2007-12-04  Jim Meyering  <meyering@rho.meyering.net>
203
204         Reflect change in gnulib: don't include getpagesize.h,
205         now that it's provided by unistd.h.
206         * src/cat.c: Don't include getpagesize.h.
207         * src/copy.c: Likewise.
208         * src/dd.c: Likewise.
209         * src/shred.c: Likewise.
210         * src/split.c: Likewise.
211
212 2007-12-02  Jim Meyering  <meyering@redhat.com>
213
214         Copy a .po file into place also when the target doesn't exist.
215         * bootstrap (gnulib_tool): ... not just when the checksum differs.
216         So now, if I manually remove po/xx.po, rerunning bootstrap will
217         copy the latest into place.
218
219         Make my-distcheck depend on "check".
220         * Makefile.maint (my-distcheck): Also depend on "check", so I can't tag
221         and release something that fails "make check" (however harmless) when
222         run in a checked-out-from-git dir, but not in the distributed tarball.
223
224         * NEWS: Add the usual "Noteworthy changes in release 6.9.91..." line.
225
226         Remove just-installed su, if unable to make it set-UID root.
227         Normally, su isn't even installed.  However, if you configure with
228         --enable-install-program=su, and then install with insufficient
229         privileges, we now make sure to remove the just-installed binary.
230         * src/Makefile.am (install-exec-hook): Rename from install-exec-local,
231         so that this rule is guaranteed to be run *after* installation.
232         If unable to chown and chmod the installed "su" program, remove it.
233         Reported by Greg Schaefer.
234
235 2007-12-01  Bob Proulx  <bob@proulx.com>
236
237         Make existing-perm-race executable.
238         * tests/cp/existing-perm-race: Update file mode.
239
240 2007-12-01  Jim Meyering  <meyering@redhat.com>
241
242         Version 6.9.90.
243
244         * NEWS: Remove the now-untrue statement about cp vs. dangling symlinks
245
246         Change release procedure: tag *before* running e.g., "make stable".
247         * Makefile.maint (vc-dist): Don't tag.  Now, you must apply the tag
248         before running "make beta", "make stable", etc.
249         (vc-tag-check): Remove rule.  No longer makes sense.
250
251         * Makefile.maint (vc-tag-check): Correct check for existing git tag.
252
253         Defer NEWS and ChangeLog checks until after the version-changing tag.
254         * Makefile.maint (alpha beta major): Don't depend on the
255         news-date-check changelog-check targets.  They must fail before
256         applying the version-changing tag.  Instead, run them after "vc-dist".
257
258         * NEWS: Record release date and new version number.
259         Mention some of the SELinux changes.
260         * src/stat.c (main): Adjust a comment.
261
262         * TODO: Add some entries (documentation needed),
263         and remove the one for mktemp.
264
265         Add "extern" keyword to declaration of cp_options_default.
266         * src/copy.c (cp_options_default): Mark as "extern", so the
267         "sc_tight_scope" part of "make distcheck" passes.
268
269 2007-12-01  Jim Meyering  <meyering@redhat.com>
270
271         Change comments: say bug present up to coreutils-6.9, not fixed in 6.10.
272         * tests/cut/Test.pm: Adjust comment.
273         * tests/misc/cut: Likewise.
274         * tests/misc/ls-misc: Likewise.
275         * tests/misc/od: Likewise.
276         * tests/misc/stty-invalid: Likewise.
277         * tests/tr/Test.pm: Likewise.
278
279 2007-11-29  Paul Eggert  <eggert@cs.ucla.edu>
280
281         Add a test for cp -p and existing file permissions.
282         * tests/cp/Makefile.am (TESTS): Add existing-perm-race.
283         * tests/cp/existing-perm-race: New test.  It isn't much of a
284         test yet, since it's hard to catch the race, but it has a FIXME
285         that will let us do a better test later.
286
287 2007-11-28  Paul Eggert  <eggert@cs.ucla.edu>
288
289         Fix a security race with "cp -p A B" when B already exists.
290         * src/copy.h (struct cp_options): New member owner_privileges.
291         * src/copy.c (USE_ACL): Define to 0 if not defined, for convenience.
292         (owner_failure_ok): New function.
293         (set_owner): Avoid a security-related race by doing an extra chmod
294         first if it looks like there might be trouble right after a chown.
295         Accept a source struct stat rather than a uid and gid, and
296         accept a boolean NEW_DST and destination struct stat.
297         All callers changed.
298         * src/copy.h (cp_options_default): New function, replacing the
299         old chown_privileges.
300         * src/copy.c (cp_options_default): Likewise.
301         * src/cp.c (cp_option_init): Use it.
302         * src/install.c (cp_option_init): Likewise.
303         * src/mv.c (cp_option_init): Likewise.
304
305 2007-11-30  Jim Meyering  <meyering@redhat.com>
306
307         Avoid a spurious test failure when build directory is set-GID.
308         * tests/cp/fail-perm: Ensure that '.'s set-GID bit is off.
309
310         Be extra careful to quote $abs_top_builddir-derived names.
311         * tests/misc/ls-misc (shell_quote): New function.
312         Use it to quote file names derived from $abs_top_builddir,
313         in case it contains shell meta-characters.  This is not currently
314         needed, since CuTmpdir detects the fishy name and skips the test.
315         But it's important enough to add the extra protection.
316         Reported by Ralf Wildenhues.
317
318         Include test name in the "unsafe working directory name" diagnostic.
319         * tests/CuTmpdir.pm (import): If $ME is '-', use $prefix.
320
321 2007-11-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
322
323         Add quotes to protect against white space in build dir name.
324         * tests/check.mk (TESTS_ENVIRONMENT): Quote $(abs_srcdir).
325         * tests/chmod/setgid: Quote absolute names.
326         * tests/misc/help-version: Likewise.
327         * tests/misc/pwd-unreadable-parent: Likewise.
328         * tests/rmdir/ignore: Likewise.
329         * tests/test-lib.sh: Likewise.
330
331         Define `tst', for CU_TEST_NAME.
332         * build-aux/check.mk (am__check_pre): Set `tst', for
333         CU_TEST_NAME in tests/check.mk.
334
335         * tests/CuTmpdir.pm (END): Do not do the cleanup if $dir is not
336         defined, because it then goes wild and changes the mode of all
337         directories below $HOME.  Undefined $dir can happen if the test
338         is to be skipped because of an unsafe working directory name.
339
340 2007-11-28  Paul Eggert  <eggert@cs.ucla.edu>
341
342         Close a file descriptor leak when cp --preserve=context fails.
343         * src/copy.c (copy_reg): Close dest_desc too, if getfscreatecon
344         or fsetfilecon fail.
345
346 2007-11-28  Jim Meyering  <meyering@redhat.com>
347
348         * README: Document the known problem with gettext <= 0.17.
349
350 2007-11-28  Paul Eggert  <eggert@cs.ucla.edu>
351
352         * gl/modules/randread (Depends-on): Remove nonexistent rand-isaac.
353
354 2007-11-27  Jim Meyering  <meyering@redhat.com>
355
356         Don't block use of 'cat' or 'wc' in "make check".
357         * Makefile.maint (my-distcheck): Add "cat" and "wc" to the list
358         of programs that we can't blacklist.
359
360         Fix md5sum+sha*sum on sparc: regenerate files with latest autoconf.
361         * configure et al: Regenerate with very latest version of autoconf
362         (v2.61a-312-gb524b0f), to fix md5sum and sha*sum miscompilation
363         on big-endian systems (like sparc) due to lack of the required
364         definition in of WORDS_BIGENDIAN in lib/config.h.
365
366 2007-11-26  Jim Meyering  <meyering@redhat.com>
367
368         setuidgid.c: more cleanup
369         * src/setuidgid.c: Include "mgetgroups.h".
370         (main): Don't presume there's a fixed limit on the maximum number
371         of group IDs.  Don't use NGROUPS; it's artificially low.
372         Change the name of a local: s/gids_count/n_gids/.
373         Remove non-portable "const": s/const int tmp =.../int tmp =.../
374
375 2007-11-25  Jim Meyering  <meyering@redhat.com>
376
377         Document install's -D option.
378         * doc/coreutils.texi (install invocation): Document -D.
379         Reported by Akim Demialle.
380
381         setuidgid: Update --help output.
382         * src/setuidgid.c (usage): Describe -g GID[,GID1...] option.
383         Mention that USER may be a numeric ID or a user name.
384
385 2007-11-24  Jim Meyering  <meyering@redhat.com>
386
387         Tweak new test.
388         * tests/cp/preserve-gid: Split some long lines.
389         Prepend "+" to numeric uid and gid chown arguments, on principle.
390         Use skip_test_.
391
392         setuidgid: minor clean-up.
393         * setuidgid.c: Include "xstrtoul.h".
394         (main): Detect overflow in string-to-gid_t and -to-uid_t conversions.
395         Improve diagnostics.
396
397         * src/setuidgid.c: Normalize leading white space: no more TABs.
398
399         Test the new feature: cp -p preserves the GID whenever possible.
400         * tests/cp/preserve-gid: New file.  Test for today's change.
401         * tests/cp/Makefile.am (TESTS): Add preserve-gid.
402         * tests/Makefile.am (all_t): Add tc.
403         (tc): New target.
404
405         setuidgid: accept numeric UID, and new option -g GID,GID1,GID2,...
406         * src/setuidgid.c: Add functionality for the new test above.
407
408         "cp -p" tries to preserve GID even if preserving the UID fails.
409         * NEWS: Mention this new feature.
410         * src/copy.c (set_owner): Try to preserve just the GID,
411         when initial fchown/lchown fails.
412         * src/cp.c (re_protect): Likewise.
413
414 2007-11-23  Jim Meyering  <meyering@redhat.com>
415
416         * src/runcon.c (main): Remove unused parameter, "envp".
417
418         Add tests to show new class of strings accepted by date -d.
419         * tests/misc/date (rel-1day, rel-plus1): New tests for the recent
420         change in gnulib's getdate.y.
421         * NEWS: Mention the fix.
422
423 2007-11-22  Jim Meyering  <meyering@redhat.com>
424
425         Quiet warnings about unused parameters.
426         * src/copy.c (set_author) [!HAVE_STRUCT_STAT_ST_AUTHOR]:
427         "Use" each of the parameters.
428
429         * GNUmakefile: Correct the "rerunning..." diagnostic.
430
431         Make it easier to diagnose PATH-induced "make distcheck" failures.
432         * Makefile.maint (write_loser): Define.
433         (my-distcheck): Use an always-failing wrapper script, that gives
434         a diagnostic, not "false".
435         Run only "make -C tests check" with the restrictive PATH.
436         Run the new gnulib-tests/ with the usual PATH.
437
438         cp: by default, refuse to copy through a dangling destination symlink
439         * NEWS: Mention this change.
440         * doc/coreutils.texi (cp invocation): Describe the new behavior.
441         * src/copy.c: No longer include "canonicalize.h".
442         (copy_reg): Upon failure to open a dangling destination symlink,
443         don't canonicalize the name, but rather fail (default) or, with
444         POSIXLY_CORRECT, repeat the open call without O_EXCL (potentially
445         dangerous).
446         * src/copy.h (struct cp_options) [open_dangling_dest_symlink]:
447         New member.  Reorder the others, grouping "bool" and "enum"
448         members together.
449         * tests/cp/thru-dangling: Test for changed and new behavior.
450         * src/cp.c (cp_option_init): Initialize new member.
451         * src/install.c (cp_option_init): Likewise.
452         * src/mv.c (cp_option_init): Likewise.
453
454 2007-11-21  Pádraig Brady <P@draigBrady.com>
455
456         * doc/coreutils.texi (split invocation): Improve the
457         descriptions of the split command options.
458
459 2007-11-21  Jim Meyering  <meyering@redhat.com>
460
461         * src/c99-to-c89.diff: Adjust seq.c offsets.
462
463 2007-11-18  Paul Eggert  <eggert@cs.ucla.edu>
464
465         * src/seq.c (print_numbers): Rewrite in an attempt to avoid the
466         more-general rounding issues exposed by the previous patch.
467
468 2007-11-18  Jim Meyering  <meyering@redhat.com>
469
470         * src/c99-to-c89.diff: Adjust seq.c offsets.
471
472         Remove unused parameter in remove.c.
473         * src/remove.c (fd_to_subdirp): Remove unused parameter.
474         (remove_cwd_entries, remove_dir): Update callers.
475
476         bootstrap: work also with 4-argument variant of AC_INIT (from gnulib)
477         2007-11-18  Sergey Poznyakoff  <gray@gnu.org.ua>
478         * bootstrap (gnulib_extra_files): Adjust sed command.
479
480 2007-11-17  Jim Meyering  <meyering@redhat.com>
481
482         Correct preceding patch.
483         * src/seq.c (print_numbers): Also handle first < last && step < 0.
484         * tests/misc/seq [empty-rev]: New test for this case.
485
486         "seq .1 .1" would mistakenly generate no output on some systems
487         * NEWS: Say this.
488         * src/seq.c (print_numbers): Handle another floating point corner case.
489         This avoids failure of seq's eq-wid-7 test on FreeBSD 6.1.
490
491 2007-11-16  Paul Eggert  <eggert@cs.ucla.edu>
492
493         Port tests/rmdir/ignore away from GNU/Linux.
494         * tests/rmdir/ignore: Don't assume that rmdir($PWD) will fail
495         with errno==ENOTEMPTY when $PWD is not empty; Posix also allows
496         rmdir to fail with errno==EBUSY.
497
498 2007-11-16  Jim Meyering  <meyering@redhat.com>
499
500         Avoid an obscure new "make distcheck" failure.
501         * Makefile.maint (my-distcheck): Also allow 'mv', for its use
502         in gnulib-tests/Makefile.
503
504 2007-11-16  Paul Eggert  <eggert@cs.ucla.edu>
505
506         Port readlink-fp-loop to Solaris.
507         * tests/misc/readlink-fp-loop (symlink_loop_msg): New var,
508         which records the symlink-loop message, whose wording is
509         not standardized by Posix.  Do not rely on "echo x > p/1"
510         to work when p/1 has a lot of indirect symlinks.  (I'm surprised
511         that it works on Linux.  Perhaps a Linux bug?)
512
513 2007-11-15  Paul Eggert  <eggert@cs.ucla.edu>
514
515         Port to Solaris 'make' and use a Posixish shell on Solaris.
516         * bootstrap.conf (gnulib_modules): Add gnu-make, posix-shell.
517         * build-aux/check.mk (SHELL): Set to $(PREFERABLY_POSIX_SHELL),
518         so that commands can assume Posix syntax.
519         (ENABLE_HARD_ERRORS, TEST_LOGS): Don't use GNU Make's "?=" syntax.
520         (SH_E_WORKAROUND): New macro.
521         (am__check_pre, $(TEST_SUITE_LOG)): Use it.
522         (am__check_pre): Fail if "mkdir" fails.  Use $(SHELL)
523         rather than relying on the "#!/bin/sh" in the file, so that tests
524         can use Posix syntax.
525         (am__check_pre, am__tty_colors): Use $$src rather than $$<, to
526         support the Posix-make $(TEST_LOGS) rule.
527         (%.log: %.test, %.log: %$(EXEEXT)): Remove unused inference rules
528         that rely on a GNU Make extension and cause Solaris 'make' to fail.
529         (SUFFIXES): New macro, so that we can use Posix style inference rules.
530         (%.log: %): Use this rule only if GNU_MAKE.
531         Set $$src so that macros can use $$src rather than $$<.
532         (CHECK-FORCE, DEPENDENCY, $(TEST_LOGS)): New macros and rules,
533         which rely only on Posix 'make' semantics, and are used only with
534         non-GNU 'make' implementations.  $(TEST_LOGS) invokes 'make'
535         recursively (and a bit inefficiently) to simulate the GNU 'make'
536         rules.
537         (.log.html): Renamed from "%.html: %.log", so that it relies only
538         on Posix 'make' semantics.
539         (check-clean, .PHONY): Do not depend on check-clean-local, since
540         Solaris 'make' complains about nonexistent rules like that.
541         * src/Makefile.am (SUFFIXES): Remove; no longer needed.
542         (groups): Use a specific rule rather than an inference rule that
543         is only instantiated once.  The inference-rule approach does not
544         work with Solaris 'make', which gets confused by the "groups:
545         Makefile" line.  It's not clear from the Posix spec that Solaris
546         'make' is buggy here, so instead of worrying about it, rewrite
547         the makefile so that it clearly conforms to Posix.
548         * tests/check.mk (TESTS_ENVIRONMENT): Export PACKAGE_BUGREPORT.
549         GNU 'make' does this automatically for us, but Solaris 'make'
550         doesn't.
551
552 2007-11-15  Paul Eggert  <eggert@cs.ucla.edu>
553
554         Port to Solaris 8 perl, which does not support "use warnings;".
555         * tests/dd/skip-seek: Skip test if "use warnings;" fails.
556         * tests/du/files0-from: Likewise.
557         * tests/misc/base64: Likewise.
558         * tests/misc/basename: Likewise.
559         * tests/misc/cut: Likewise.
560         * tests/misc/date: Likewise.
561         * tests/misc/dircolors: Likewise.
562         * tests/misc/dirname: Likewise.
563         * tests/misc/expand: Likewise.
564         * tests/misc/expr: Likewise.
565         * tests/misc/factor: Likewise.
566         * tests/misc/fmt: Likewise.
567         * tests/misc/fold: Likewise.
568         * tests/misc/head-elide-tail: Likewise.
569         * tests/misc/ls-misc: Likewise.
570         * tests/misc/md5sum: Likewise.
571         * tests/misc/md5sum-newline: Likewise.
572         * tests/misc/mktemp: Likewise.
573         * tests/misc/od: Likewise.
574         * tests/misc/paste-no-nl: Likewise.
575         * tests/misc/pr: Likewise.
576         * tests/misc/seq: Likewise.
577         * tests/misc/sha1sum: Likewise.
578         * tests/misc/sha1sum-vec: Likewise.
579         * tests/misc/sha224sum: Likewise.
580         * tests/misc/sha256sum: Likewise.
581         * tests/misc/sha384sum: Likewise.
582         * tests/misc/sha512sum: Likewise.
583         * tests/misc/sort-merge: Likewise.
584         * tests/misc/stat-printf: Likewise.
585         * tests/misc/sum: Likewise.
586         * tests/misc/test-diag: Likewise.
587         * tests/misc/tsort: Likewise.
588         * tests/misc/unexpand: Likewise.
589         * tests/misc/wc-files0-from: Likewise.
590         * tests/misc/xstrtol: Likewise.
591         * tests/mv/i-1: Likewise.
592         * tests/rm/empty-name: Likewise.
593         * tests/rm/unreadable: Likewise.
594
595 2007-11-15  Andreas Schwab  <schwab@suse.de>
596
597         * m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix syntax error.
598         Remove trailing space from result.
599
600 2007-11-15  Jim Meyering  <meyering@redhat.com>
601
602         Avoid misbehavior of a cross-device "mv" or "install".
603         Those programs must not dereference a destination symlink.
604         * src/copy.c (copy_reg): Don't treat a dangling destination symlink
605         differently in move mode.  In move mode, the only way the added
606         O_EXCL can cause failure is when some other process has recreated
607         the file this code unlinked a few instructions before.
608
609 2007-11-14  Jim Meyering  <meyering@redhat.com>
610
611         Another bootstrap kludge.
612         * bootstrap: Ensure gnulib-tests/test-*.sh are executable
613
614         #ifdef-out matchpathcon-related code, for now.
615         * src/install.c (setdefaultfilecon): #ifdef-out all of the
616         matchpathcon-related code, until it's more efficient.
617         (setdefaultfilecon): Instead of the above, stub-out the entire function.
618
619         Use gnulib's stpncpy module, now required by install.c
620         * bootstrap.conf (gnulib_modules): Add stpncpy.
621
622         Enable gnulib-tool's --with-tests option.
623         * bootstrap: After all is done, transform the generated
624         gnulib-tests/gnulib.mk.
625         * bootstrap.conf (gnulib_tool_option_extras): Set it here.
626         * gnulib-tests/Makefile.am: New file.
627         * Makefile.am (SUBDIRS): Add gnulib-tests.
628         * configure.ac (AC_CONFIG_FILES): Add gnulib-tests/Makefile.
629         * m4/jm-macros.m4 (coreutils_MACROS) [ARGMATCH_DIE_DECL]: Omit the
630         "extern " prefix to "void usage ()", so that the macro string value can
631         be used to construct a function definition in gnulib's test-argmatch.c.
632
633 2007-11-12  Benno Schulenberg  <bensberg@justemail.net>
634
635         Clarify description of cp's -a option.
636         * src/cp.c (usage) [-a]: Remove unnecessary 'P'.
637         Since option -d of 'cp' includes the function of -P, mentioning the
638         latter in the description of option -a is redundant and therefore
639         slightly confusing, as the reader tries to figure out what it adds.
640         * doc/coreutils.texi (cp invocation): Likewise: s/-dpPR/-dpR/.
641
642 2007-11-09  Jim Meyering  <meyering@redhat.com>
643
644         bootstrap: fix typo to enable use of $gnulib_tool_option_extras.
645         * bootstrap (gnulib_tool_options): Add a space before the use
646         of $gnulib_tool_option_extras, so that it's separated from the
647         preceding argument.
648
649         install+SELinux: reduce a 12x performance hit to ~1.5x
650         * src/install.c (setdefaultfilecon): Call matchpathcon_init_prefix,
651         to mitigate what would otherwise be a large performance hit due to
652         the use of matchpathcon.
653         Dan Walsh suggested the use of matchpathcon_init_prefix.
654         * gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Define.
655
656 2007-11-08  Jim Meyering  <meyering@redhat.com>
657
658         Adapt to gnulib's s/jm_/gl_/ cache variable renaming.
659         * configure.ac: Change the cache variable name prefix "jm_" to "gl_",
660         to match today's change in gnulib.
661
662 2007-11-05  Jim Meyering  <meyering@redhat.com>
663
664         Fix bootstrap failure to handle files like lib/uniwidth/cjk.h.
665         * bootstrap (cp_mark_as_generated): Create any required parent
666         destination directories before copying a file into place.
667
668         * src/c99-to-c89.diff: Adjust offsets.
669
670         Don't use GNU-sed-specific \< \> operators here, either.
671         * m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Use a loop, as below.
672
673         Use tighter regexps when performing name substitution.
674         * man/Makefile.am (mapped_name): Add ^ and $$ anchors.
675
676         Don't use GNU-sed-specific \< \> operators.
677         * configure.ac (MAN): Transform ginstall.1 to install.1 using
678         a loop, rather than sed with \<...\>.
679         Problem reported by Bruno Haible.
680         Andreas Schwab reminded me that \< and \> are not portable.
681
682         Get git-version-gen from gnulib.
683         * build-aux/git-version-gen: Remove file.
684         * build-aux/.gitignore: Add git-version-gen.
685         * bootstrap.conf (gnulib_modules): Add git-version-gen.
686
687 2007-11-03  Jim Meyering  <meyering@redhat.com>
688
689         git-version-gen: Sync from autoconf's version.
690         * build-aux/git-version-gen: Run git-status
691
692         Sync copyright and scriptversion bits from gnulib.
693         * build-aux/git-version-gen: No semantic change.
694
695         Change the first '-' to '.' in the snapshot version string,
696         e.g., 6.9-377-08144 -> 6.9.377-08144
697         * build-aux/git-version-gen: ... and add comments.
698
699         seq: add another test for the %% bug.
700         * tests/misc/seq (fmt-c): Test the other fixed case, too.
701
702 2007-11-03  Paul Eggert  <eggert@cs.ucla.edu>
703
704         Fix bug with "seq 10.8 0.1 10.95", plus another bug with %% in format.
705
706         * NEWS: Mention the %%-in-format bug fix.
707         * src/seq.c (struct layout): New type.
708         (long_double_format): New arg LAYOUT.  Fill it in.  Fix mishandling
709         of %% in formats.
710         (print_numbers): New arg LAYOUT.  Don't convert LAST to output format
711         when deciding whether to go slightly past LAST.  Instead, convert
712         X to output format and back.  This fixes a bug reported by
713         Andreas Schwab in
714         <http://lists.gnu.org/archive/html/bug-coreutils/2007-10/msg00237.html>
715         where "seq 10.8 0.1 10.95" would output 11.0 on platforms where
716         10.95 rounds to a value that prints as 11.0 when only one digit
717         past the decimal point is asked for.
718         (main): Compute layout, for benefit of print_numbers.
719         * tests/misc/seq (float-3): Undo previous change, since the bug
720         should be fixed now.
721         (fmt-b): New test, for the %% bug.
722
723 2007-11-01  Jim Meyering  <meyering@redhat.com>
724
725         * tests/misc/printf-surprise: Correct sed transform.
726         Reported by Bob Proulx.
727
728         Add example inspired by "make dist" running gzip and lzma in sequence.
729         * doc/coreutils.texi (tee invocation): Show how to run tar just
730         once, compressing the tee'd output streams in parallel.
731
732         Say that the first process substitution example is contrived.
733         * doc/coreutils.texi (tee invocation): ... and show how to do
734         it properly.  Pointed out by James Antill.
735
736         Use mktemp, not mkdtemp, to create test directories.
737         * tests/test-lib.sh: Use the mktemp binary we've just built,
738         not the mkdtemp script.
739         * tests/mkdtemp: Remove file.
740         * tests/Makefile.am (EXTRA_DIST): Remove mkdtemp.
741
742         Adjust a seq subtest not to depend on the vagaries of floating point.
743         * tests/misc/seq (float-3): Use 10.94 as the endpoint, not 10.95,
744         since 10.95 was precisely in the middle of the interval, and with
745         a %.1f format could map to either 10.9 or 11.0.
746         Reported by Mike Frysinger
747
748         Make the new printf-surprise test more precise.
749         * tests/test-lib.sh (require_ulimit_): New function.
750         * tests/misc/printf-surprise: Use ulimit -v to trigger the fixed bug,
751         and rather than checking printf's exit status (which would go wrong
752         on FreeBSD 6.1, since their printf(3) function doesn't require
753         lots of memory in this case) simply test whether it outputs
754         the first 10 bytes.
755
756         Accommodate FreeBSD 6.1 hard-link-to-symlink differences.
757         * tests/cp/same-file: Detect when linking to a symlink links to
758         the target of the symlink (FreeBSD 6.1 does this, Linux does not),
759         and skip the few tests that would otherwise fail.
760         Redirect output of final comparison to stderr, since all stdout
761         is already redirected.
762
763 2007-10-31  Jim Meyering  <meyering@redhat.com>
764
765         Fix a "make distcheck" failure.
766         * Makefile.maint (my-distcheck): Don't stub-out dirname,
767         since build-aux/check.mk now uses it.
768
769         * bootstrap.conf (gnulib_modules): Add xprintf-posix.
770
771 2007-10-30  Jim Meyering  <meyering@redhat.com>
772
773         Avoid seq floating-point test failure on FreeBSD 6.1.
774         * tests/misc/seq (float-4): Also accept -0.0.
775
776 2007-10-29  Jim Meyering  <meyering@redhat.com>
777
778         Change a "make dist" diagnostic.
779         * GNUmakefile: Don't imply that $(_curr-ver) is the new version string.
780
781 2007-10-29  Bob Proulx  <bob@proulx.com>
782
783         Improve color terminal escape usage.
784         * build-aux/check.mk (am__tty_colors): Use 'tput' to deduce
785         terminal color capabilities.
786
787 2007-10-29  Jim Meyering  <meyering@redhat.com>
788
789         Don't try to colorize a dumb terminal.
790         * build-aux/check.mk (am__tty_colors): Skip colors if $TERM is "dumb".
791         Thanks to Bob Proulx.
792
793         Remove gnulib's printf-posix module, for now.
794         * bootstrap.conf (gnulib_modules): It caused too many test failures.
795
796         Remove spurious semicolon after "else".
797         * build-aux/check.mk (am__tty_colors): Fix syntax error.
798
799         If $TERM is empty, don't use colors.  This helps the buildbot,
800         since it produces its result in an environment with a tty, but
801         we don't want color codes in that case.
802         * build-aux/check.mk (am__tty_colors): Test for nonempty $TERM.
803         Suggestion from Bob Proulx.
804
805         Always initialize terminal colorization string variables.
806         * build-aux/check.mk (am__tty_colors): Always initialize red, grn, etc.,
807         In case they're defined in the environment.
808
809         Avoid test failure in non-srcdir build vs. the git tree.
810         * tests/check.mk (vc_exe_in_TESTS): Run this test only in a
811         srcdir build directory.  Reported by Andreas Schwab.
812
813 2007-10-28  Jim Meyering  <meyering@redhat.com>
814
815         Define ENOTSUP, not ENOSYS.  Needed on OpenBSD 3.9.
816         * gl/lib/se-context.in.h (ENOTSUP): Define if missing.
817         * gl/lib/se-selinux.in.h: Likewise.
818
819         Define ENODATA, for FreeBSD 5.0 and 6.1.
820         * src/system.h (ENODATA): Define, if missing.
821
822         Run autoreconf, not just autoconf, to avoid warnings.
823         * GNUmakefile (dummy): Otherwise, we'd sometimes get a warning
824         about autoconf version mismatch between what was used to generate
825         aclocal.m4 and the currently-running autoconf.
826
827         Require gnulib's printf-posix module, to support Interix.
828         * bootstrap.conf (gnulib_modules): Add printf-posix.
829
830         Help xgettext recognize more printf-style format strings.
831         * bootstrap.conf (XGETTEXT_OPTIONS): Add directives for
832         error, error_at_line, xasprintf, xfprintf and xprintf.
833
834 2007-10-27  Jim Meyering  <meyering@redhat.com>
835
836         Adjust format string so msgfmt doesn't object.
837         * src/df.c (main): Use "%s%s" (not %smsg) to print "msg" with or
838         without a "Warning: " prefix.  Reported by Clytie Siddall.
839
840         Clean up tests/Makefile.am.
841         * tests/Makefile.am (EXTRA_DIST): Remove $(TESTS).  No longer defined.
842         (TESTS_ENVIRONMENT): Remove definition.
843
844 2007-10-26  Jim Meyering  <meyering@redhat.com>
845
846         * build-aux/check.mk: Merge with latest from Akim.
847
848         Add a test for the printf fix of 2007-10-21.
849         * tests/misc/printf-surprise: New file.  Test for 2007-10-21's fix.
850         * tests/misc/Makefile.am (TESTS): Add printf-surprise.
851
852 2007-10-24  Micah Cowan  <micah@cowan.name>
853
854         Remove vestiges of cvs-gnulib-checkout process.  Now we use git.
855         * bootstrap: Remove support for now-unnecessary option, --cvs-user,
856         and envvars CVS_USER, CVS_RSH.
857
858 2007-10-24  Micah Cowan  <micah@cowan.name>
859
860         Tell xgettext that "ARG1 % ARG2" is not a C format string.
861         * src/expr.c (usage): Add a comment to override xgettext's default
862         behavior, which would classify "ARG1 % ARG2" as a fprintf-style
863         format string.  Reported by Clytie Siddall.
864
865 2007-10-24  Jim Meyering  <meyering@redhat.com>
866
867         Avoid diagnostics from sha1sum when there is no cached checksum.
868         * bootstrap (update_po_files): Skip the sha1sum check if the po.s1
869         file hasn't been created yet.
870
871         Get gnulib from the git repository, not from an obsolete cvs one.
872         * bootstrap: Suggestion from Micah Cowan.
873
874         Doc improvements.
875         * README-hacking: Prefer the no-hyphen variant of git commands,
876         e.g., use "git pull" not "git-pull".
877         Don't presume that the only way to read this document is via a
878         prior git clone: provide instructions for cloning coreutils, too.
879
880         * README-hacking: Add "cd automake" in build instructions.
881         From Bob Proulx.
882
883         Don't fail part 2 of tests/rm/unreadable when run as root.
884         * tests/rm/unreadable: With UID == 0, expect different results.
885         Reported by Mike Frysinger.
886
887 2007-10-23  Jim Meyering  <meyering@redhat.com>
888
889         * README-hacking: Refer to LZMA Utils <http://tukaani.org/lzma/>.
890
891 2007-10-22  Paul Eggert  <eggert@cs.ucla.edu>
892
893         * README-hacking: Describe how to build with LZMA.
894
895 2007-10-22  Jim Meyering  <meyering@redhat.com>
896
897         Remove git-version-gen's first parameter.
898         * build-aux/git-version-gen: Add comments.
899         Remove first command-line parameter.
900         * configure.ac: Remove corresponding first argument.
901         * GNUmakefile (_curr-ver): Likewise.
902
903 2007-10-21  Jim Meyering  <meyering@redhat.com>
904
905         * NEWS: Mention the printf fix.
906
907         Reorder tests to run more basic ones earlier.
908         * tests/misc/Makefile.am (TESTS): Reorder.
909         * tests/Makefile.am (SUBDIRS): Reorder.
910
911         tr: do not reject an unmatched [:lower:] or [:upper:] in SET1.
912         * NEWS: Mention this.
913         * src/tr.c (get_next) [RE_CHAR_CLASS]: Don't skip the loop when
914         processing [:lower:] and [:upper:].
915         (main): Require [:lower:] or [:upper:] in SET1 only when
916         when one of those is specified in SET2.
917         * tests/tr/Test.pm: Add tests for this fix.
918         Reported by Per Starbäck.
919
920 2007-10-20  Jim Meyering  <meyering@redhat.com>
921
922         * tests/misc/help-version: Add a comment.
923
924         Detect printf(3) failure due to ENOMEM.
925         * src/printf.c: Include "xprintf.h"
926         (print_direc): Use xprintf, rather than printf.
927         * bootstrap.conf (gnulib_modules): Add xprintf.
928         * po/POTFILES.in: Add lib/xprintf.c.
929         Reported by Bruno Haible.
930
931         Put always-failing programs first in PATH, so tests cannot mistakenly
932         run installed versions.
933         * Makefile.maint (my-distcheck): Set up a bogus bin/ dir, to be used
934         for "make check".
935
936         * doc/coreutils.texi (tee invocation): Fix typo.  Add a little.
937         Add a cross-reference to bashref's Process Substitution node.
938
939         Adjust tests to pass, now that Test.pm ones use check.mk.
940         * tests/check.mk (vc_exe_in_TESTS): Adjust regexp not to match the
941         "TESTS = $x-tests" line in each Test.pm-derived Makefile.am file.
942         * tests/sort/main: Remove this unused file.
943
944         Ensure that Test.pm-derived tests use the right $PATH.
945         * tests/Makefile.am.in: Include $(top_srcdir)/tests/check.mk.
946
947 2007-10-20  Bob Proulx  <bob@proulx.com>
948
949         Prevent "make check" from leaving mktemp /tmp/tmp.* files behind.
950         * tests/misc/help-version (mktemp_args): Tell mktemp to create
951         its temporary file in the current directory.
952
953 2007-10-16  Jim Meyering  <meyering@redhat.com>
954
955         Show how to make tee redirect to multiple processes.
956         * doc/coreutils.texi (tee invocation): Tee can redirect output
957         to multiple _processes_, too.
958
959 2007-10-14  Jim Meyering  <meyering@redhat.com>
960
961         Pull all TESTS_ENVIRONMENT settings "up" into tests/check.mk.
962         * tests/Makefile.am.in (TESTS_ENVIRONMENT): Remove definition.
963         * tests/chgrp/Makefile.am: Likewise.
964         * tests/chmod/Makefile.am: Likewise.
965         * tests/chown/Makefile.am: Likewise.
966         * tests/cp/Makefile.am: Likewise.
967         * tests/dd/Makefile.am: Likewise.
968         * tests/du/Makefile.am: Likewise.
969         * tests/install/Makefile.am: Likewise.
970         * tests/ln/Makefile.am: Likewise.
971         * tests/ls/Makefile.am: Likewise.
972         * tests/misc/Makefile.am: Likewise.
973         * tests/mkdir/Makefile.am: Likewise.
974         * tests/mv/Makefile.am: Likewise.
975         * tests/readlink/Makefile.am: Likewise.
976         * tests/rm/Makefile.am: Likewise.
977         * tests/rmdir/Makefile.am: Likewise.
978         * tests/tail-2/Makefile.am: Likewise.
979         * tests/touch/Makefile.am: Likewise.
980         * tests/check.mk (TESTS_ENVIRONMENT) [EXEEXT, EGREP, MAKE, PERL]:
981         [CONFIG_HEADER, build_programs, host_os, host_triplet, PATH]:
982         [REPLACE_GETCWD, CU_TEST_NAME]: Add definitions here.
983         * tests/misc/pwd-long: Use $abs_top_builddir/src, not $BUILD_SRC_DIR.
984         * tests/dd/skip-seek: Don't use $ENV{PROG}.
985         * tests/rm/empty-name: Likewise.
986         * tests/rm/unreadable: Likewise.
987         * tests/mv/i-1: Likewise.
988
989         Fix a minor typo.
990         * configure.ac (AC_INIT): Fix a typo (s/9.6/6.9/) that makes a
991         difference only when running "make dist" without a .git/ subdir.
992
993 2007-10-09  Jim Meyering  <meyering@redhat.com>
994
995         Move the help-version test into misc/.
996         * tests/help-version: Move to...
997         * tests/misc/help-version: ...here.
998         Source test-lib.sh, as usual.
999         Use $abs_top_builddir, rather than ".." and "../..".
1000
1001         Make the runcon-no-reorder test slightly more general.
1002         * tests/misc/runcon-no-reorder: Don't hard-code "unconstrained_t".
1003         Use slightly more general "runcon $(id -Z)".
1004         Suggestion from Stephen Smalley.
1005
1006         Skip the chcon test on a system with no SELinux support.
1007         * tests/test-lib.sh (require_selinux_): New function.
1008         * tests/misc/chcon: Use it.
1009         * tests/misc/selinux: Use it here, too.
1010         * tests/cp/cp-a-selinux: and here.
1011         * tests/selinux: Remove file.
1012         * tests/Makefile.am (EXTRA_DIST): Remove selinux.
1013         Reported by Mike Frysinger and Bauke Jan Douma.
1014
1015         * src/dircolors.hin: Recognize .lzma as a compressed-file suffix.
1016
1017         * configure.ac (AM_INIT_AUTOMAKE): Use dist-lzma, rather than dist-bzip2.
1018
1019         Now that we don't install su, don't make misleading suggestions.
1020         * src/Makefile.am (install-exec-local) [$(INSTALL_SU) != yes]:
1021         Don't suggest running "make install-root".
1022         (uninstall-local) [$(INSTALL_SU) != yes]: Don't even check
1023         the installed binary.
1024
1025 2007-10-08  Jim Meyering  <meyering@redhat.com>
1026
1027         When forming a truncated name, use the "[...]" prefix even for
1028         an extremely long name in the current directory
1029         * src/remove.c (full_filename_): Rename a local variable.
1030         Use two separate "truncated" variables, in case the second
1031         call to right_justify does not indicate any truncation -- which
1032         would happen only if the single component FILENAME were longer
1033         than 511 bytes and DIR_NAME were empty.
1034
1035         rm could malfunction under unusual circumstances:
1036         When operating on a relative name longer than 511 bytes,
1037         and (when either processing a directory that is neither writable
1038         nor readable (but still searchable) or when determining whether
1039         to prompt), and encountering an ENOMEM error while forming the
1040         file name, rm would operate on a truncated-to-511-byte name
1041         starting with "[...]" rather than the intended one.
1042         * NEWS: Describe the bugs.
1043         * src/remove.c: Correct two misuses of full_filename:
1044         (full_filename0, xfull_filename): New functions.
1045         (full_filename_): Rewrite to use full_filename0.
1046         (AD_pop_and_chdir): Use xfull_filename, not full_filename.
1047         (write_protected_non_symlink): Likewise.
1048
1049 2007-10-07  Jim Meyering  <meyering@redhat.com>
1050
1051         Don't let a helper function modify errno.
1052         * src/remove.c (full_filename_): Save and restore errno.
1053         Spotted by Bruno Haible.
1054
1055         Reflect 2->3 GPL copyright version update in gnulib.
1056         * gl/lib/tempname.h: Update copyright from gnulib.
1057         * gl/lib/tempname.c: Likewise.
1058         * .x-sc_GPL_version: Don't make an exception for those two files.
1059
1060         * configure.ac (AM_INIT_AUTOMAKE): Don't use dist-lzma just yet.
1061
1062         New program: mktemp.
1063         * NEWS: Mention this.
1064         * README: Add mktemp to the list.
1065         * AUTHORS: Add this: mktemp: Jim Meyering
1066         * src/mktemp.c: New file.
1067         * src/Makefile.am (bin_PROGRAMS): Add mktemp.
1068         (mktemp_LDADD): Add $(LIB_GETHRXTIME).
1069         * man/mktemp.x: New file.
1070         * man/Makefile.am (dist_man_MANS): Add mktemp.1.
1071         (mktemp.1): New dependency.
1072         * man/.cvsignore: Add mktemp.1.
1073         * man/.gitignore: New file.
1074         * src/.cvsignore, src/.gitignore: Add mktemp.
1075         * tests/misc/mktemp: New file.
1076         * tests/misc/Makefile.am (TESTS): Add mktemp.
1077         * tests/Coreutils.pm (run_tests): Give the POST-test function
1078         access to stdout and stderr contents, so it can verify that
1079         the named-on-stdout file/dir does indeed exist and has proper
1080         permissions, etc.
1081         [po/ChangeLog]
1082         * POTFILES.in: Add src/mktemp.c.
1083
1084         Make tempname more random, via the randint module.
1085         * gl/modules/tempname (Depends-on): Add randint and stdbool.
1086         * gl/lib/tempname.c: Include randint.h and stdbool.h.
1087         (uint64_t): Remove definition.  Not needed.
1088         [_LIBC] (RANDOM_BITS): Remove this block, now that we have proper
1089         random bits.
1090         (check_x_suffix): New function.
1091         (gen_tempname_len): Rename from __gen_tempname.
1092         Add a parameter, x_suffix_len, telling how many X's there must be at
1093         the end of the template.
1094         Use pseudo-random numbers all the way, rather than adding 7777
1095         from one iteration to the next.
1096         (__gen_tempname): New function, to call gen_tempname_len, requiring a
1097         suffix length of 6.
1098         * gl/lib/tempname.h: Add prototype for gen_tempname_len.
1099
1100         Convert coreutils' rand*.{c,h,m4} into modules.
1101         First step: move these files to gl/lib:
1102         * lib/rand-isaac.c, lib/rand-isaac.h
1103         * lib/randint.c, lib/randint.h
1104         * lib/randperm.c, lib/randperm.h
1105         * lib/randread.c, lib/randread.h
1106         Step 2: add modules/rand* and remove now-unneeded .m4 files.
1107         * gl/modules/randint: New file.
1108         * gl/modules/randperm: New file.
1109         * gl/modules/randread: New file.
1110         * m4/randint.m4: Remove file.
1111         * m4/randperm.m4: Remove file.
1112         * m4/randread.m4: Remove file.
1113         Step 3: use the new modules
1114         * bootstrap.conf (gnulib_modules): Add randint and randperm.
1115         * m4/prereq.m4 (gl_RANDINT, gl_RANDREAD, gl_RANDPERM): Don't require;
1116         These have been removed.
1117         (gl_ROOT_DEV_INO): Don't require; already handled via bootstrap.conf.
1118
1119         Copy from gnulib the parts of tempname that we'll modify.
1120         * gl/lib/tempname.c: Copy from gnulib.
1121         * gl/lib/tempname.h: Likewise.
1122         * gl/modules/tempname: Likewise.
1123         Allow GPLv2 on temporarily(?)-imported file from gnulib/libc.
1124         * .x-sc_GPL_version: New file.
1125         * Makefile.am (EXTRA_DIST): Add .x-sc_GPL_version
1126
1127 2007-10-07  Jim Meyering  <meyering@redhat.com>
1128
1129         Avoid a pseudo-leak in sort.
1130         * src/sort.c (main) [lint]: Avoid a nominal leak.
1131
1132         Use puts, rather than printf ("%s\n".  Slightly cleaner.
1133         * src/tsort.c (tsort): ...and more efficient.
1134
1135         Avoid seq malfunction on non-POSIX systems: mingw, BeOS, Interix.
1136         * bootstrap.conf (gnulib_modules): Add vasprintf-posix.
1137         Suggestion from Bruno Haible.
1138
1139         Avoid a used-uninitialized error.
1140         * src/copy.c (copy_internal): Don't overload "use_stat".
1141
1142 2007-10-05  Jim Meyering  <meyering@redhat.com>
1143
1144         Make a failing cross-partition mv give a sensible diagnostic.
1145         A cross-partition move of a file in a sticky tmpdir and owned by
1146         another user would evoke an invalid diagnostic after copying it:
1147           mv: cannot remove `x': Operation not permitted
1148         Either of the following (mv.c, remove.c) changes would fix the bug by
1149         itself.  I think it's slightly better to use both; the added cost is
1150         minimal: mv: an extra lstat-per-mv-cmdline-arg-that-goes-cross-partition,
1151         rm: an extra lstat-per-unlink-that-fails-w/EPERM.
1152         * src/remove.c (remove_entry): Also lstat the file upon EPERM.
1153         * src/mv.c (rm_option_init): Initialize root_dev_ino just as is done
1154         in rm, so that a cross-partition invoked remove.c:rm call works the
1155         same way as one invoked from the command-line use of "rm".  That
1156         setting of root_dev_ino makes rm() do the equivalent of an additional
1157         lstat for each argument, which in turn gives rm enough information to
1158         issue the right diagnostic.
1159         * tests/mv/sticky-to-xpart (version): New file.  Test for the above.
1160         * tests/mv/Makefile.am (TESTS): Add sticky-to-xpart.
1161         Arrange for "make check-root" to run the new root-only test.
1162         * tests/Makefile.am (tb): New target, to run the new root-only test.
1163         (all_t): Add tb.
1164         * src/c99-to-c89.diff: Adjust offsets.
1165
1166         Add PACKAGE_VERSION to TESTS_ENVIRONMENT via check.mk.
1167         * tests/check.mk (TESTS_ENVIRONMENT): Add PACKAGE_VERSION here,
1168         rather than in every Makefile.am that needs it.
1169         * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Remove PACKAGE_VERSION.
1170         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Likewise.
1171
1172 2007-10-04  Jim Meyering  <jim@meyering.net>
1173
1174         Adapt to new gnulib naming scheme.
1175         * gl/lib/se-context.in.h: Rename from gl/lib/se-context_.h.
1176         * gl/lib/se-selinux.in.h: Rename from gl/lib/se-selinux_.h.
1177         * gl/m4/selinux-context-h.m4: Remove use of AC_LIBSOURCES.
1178         * gl/m4/selinux-selinux-h.m4: Likewise.
1179         * gl/modules/selinux-h (Files, Makefile.am): Reflect renaming.
1180         (Makefile.am) [lib_SOURCES]: Add se-context.in.h and se-selinux.in.h.
1181
1182         * lib/search_.h: Remove unused file.
1183
1184         * bootstrap (slurp): Adapt to _.h -> .in.h name change.
1185         (update_po_files): Work also when there are no .po files in po/.
1186
1187         Remove test program: lib/t-fpending.c.
1188         * lib/t-fpending.c: Remove file.  Now, this test is in gnulib.
1189         * lib/Makefile.am: Remove associated rules.
1190         * .gitignore: Remove lib/t-fpending.
1191
1192 2007-10-03  Jim Meyering  <jim@meyering.net>
1193
1194         * tests/misc/selinux: Skip this test if the initial chcon fails.
1195
1196 2007-10-02  Jim Meyering  <jim@meyering.net>
1197
1198         Never copy through a symlink that cp has just created.
1199         * src/copy.c (copy_internal): When same-file detection requires
1200         'stat'ing the destination file, also 'lstat' it and ensure that
1201         it wasn't the destination of a preceding copy operation.
1202         This bug was introduced on 2007-06-18.
1203         * tests/cp/abuse: New test for the above.
1204         * tests/cp/Makefile.am (TESTS): Add abuse.
1205
1206 2007-09-30  Jim Meyering  <jim@meyering.net>
1207
1208         cp: do not abbreviate in --help output.
1209         * src/cp.c (usage): Don't abbreviate: s/=link/=links/.
1210         Reported by GĂ©raud Meyer in <http://bugs.debian.org/444137>.
1211
1212 2007-09-29  Eric Blake  <ebb9@byu.net>
1213
1214         Test previous patch.
1215         * tests/misc/groups-dash: New test.
1216         * tests/misc/Makefile.am (TESTS): Add it.
1217
1218 2007-09-28  Eric Blake  <ebb9@byu.net>
1219
1220         * src/groups.sh: Don't ignore first argument if later argument is --.
1221
1222 2007-09-27  Jim Meyering  <jim@meyering.net>
1223
1224         Avoid spurious test failure when SELinux stats "selinux/class".
1225         * tests/ls/stat-free-symlinks: Grep for more precise /^stat("x"/.
1226
1227         Move file-set and hash-triple modules to gnulib.
1228         * bootstrap.conf (gnulib_modules): Remove file-set, now that
1229         it's in gnulib, and the canonicalize module requires it there.
1230         * gl/lib/file-set.c, gl/lib/file-set.h, gl/modules/hash-triple: Remove.
1231         * gl/lib/hash-triple.c, gl/lib/hash-triple.h, gl/modules/file-set:
1232         Remove.
1233
1234         Add a test to exercise a readlink bug.
1235         * tests/misc/readlink-fp-loop: New file.  Test for the readlink bug
1236         fixed through today's change to Gnulib's canonicalize module.
1237         * tests/misc/Makefile.am (TESTS): Add readlink-fp-loop.
1238         Bug report and a test case from mpb.mail@gmail.com.
1239
1240 2007-09-25  Pádraig Brady <P@draigBrady.com>
1241
1242         * doc/coreutils.texi (date invocation):
1243         Make "Date input formats" easier to navigate to.
1244
1245 2007-09-25  Jim Meyering  <jim@meyering.net>
1246
1247         Use XOR, not OR to combine bits.
1248         * gl/lib/hash-triple.c (triple_hash): Use XOR (^), not OR (|), to
1249         combine the bits from hashing the name and those of the inode number.
1250         Add a few comments and remove out-of-context ones.
1251
1252 2007-09-24  Jim Meyering  <jim@meyering.net>
1253
1254         * NEWS: The recent rm-diagnostic fix also affects cross-partition "mv".
1255
1256         copy.c: Remove definitions of factored-out functions.
1257         * src/copy.c: Include "file-set.h".
1258         (seen_file, record_file): Remove functions that I factored
1259         out on 2007-08-23.
1260
1261 2007-09-22  Jim Meyering  <jim@meyering.net>
1262
1263         Don't print the commands of a 10-line script that's run in each subdir.
1264         * tests/check.mk (vc_exe_in_TESTS): Add a leading "@", to reduce noise.
1265
1266         rm: give a sensible diagnostic when failing to remove a symlink
1267         On some systems (those with openat et al), when rm would fail to
1268         remove a symlink, it would fail with the misleading diagnostic,
1269         "Too many levels of symbolic links".
1270         * NEWS: Mention the bug fix.
1271         * src/remove.c (is_nondir_lstat): New function.
1272         (remove_entry): Use it to catch failed-to-remove symlink (and any
1273         other non-dir) here so that we don't fall through and try to treat
1274         it as directory, which -- with a symlink -- would provoke the bogus
1275         ELOOP failure.
1276         * tests/rm/fail-eacces: Add a test for the above.
1277         * src/c99-to-c89.diff: Adjust offsets.
1278
1279         rm: fix a tiny, nearly inconsequential bug.
1280         Don't perform a "."-relative lstat, when the file in question
1281         may well not be in ".".  Although this is a bug, a few attempts
1282         to exercise it on a linux-2.6.22 system failed.  You probably need
1283         a pre-openat system to trigger the failure.  The consequence of this
1284         bug would be a lower-quality diagnostic upon failed dir removal.
1285         * src/remove.c (is_dir_lstat): Add a parameter, fd_cwd.
1286         Use it instead of hard-coding AT_FDCWD.
1287         (remove_entry): Call is_dir_lstat with fd_cwd.
1288
1289 2007-09-22  Karl Berry  <karl@freefriends.org>
1290
1291         * TODO: It'd be nice to add renice.
1292
1293 2007-09-21  Jim Meyering  <jim@meyering.net>
1294
1295         Avoid test failure due to now-parallelized tests.
1296         * tests/du/two-args: Run "du .." from a sub-directory one level deeper.
1297
1298 2007-09-16  Jim Meyering  <jim@meyering.net>
1299
1300         * tests/misc/tac-continue: Arrange to remove a temporary file.
1301
1302         * tests/check.mk (vc_exe_in_TESTS): Don't rely on the value of
1303         $(TESTS), so that "make check TESTS=test-name" works once again.
1304
1305         * tests/CuTmpdir.pm: Use File::Find + chmod syscall, not chmod -R.
1306
1307         Revamp most test scripts.
1308
1309         * tests/rm/v-slash: Avoid test failure with non-C locale.
1310         Reported by Michael Stone.
1311
1312         Enable some previously omitted test scripts.  Add a test cross-check.
1313         * tests/rm/Makefile.am (TESTS): Add empty-name and unreadable.
1314         * tests/rm/empty-name: Likewise.
1315         * tests/rm/unreadable: Reenable this test.  Adjust for new rm.
1316         * tests/mkdir/Makefile.am: Add writable-under-readonly.
1317         * tests/mkdir/writable-under-readonly: Add some comments.
1318         This test is always skipped, for now.
1319         * tests/Makefile.am (ta): Hook up the new root-only script.
1320         * tests/tail-2/infloop-1: Make this test pass.
1321         * tests/tail-2/Makefile.am (TESTS): Add infloop-1.
1322         * tests/tail-2/fflush: Remove unused file.
1323         * tests/check.mk (vc_executable_is_in_TESTS): More portable.
1324         * tests/check.mk (check): Depend on the above.
1325         * build-aux/check.mk: Remove comment mentioning AUTHORS file.
1326
1327         Factor out definitions in TESTS_ENVIRONMENT of srcdir, top_srcdir, etc.
1328         tests/check.mk (top_srcdir): Define.
1329         tests/*/Makefile.am: Remove definitions of $(srcdir), $(top_srcdir),
1330         $(abs_top_srcdir), and $(abs_top_builddir), since they're
1331         defined via the included tests/check.mk.
1332
1333         tests/general: Remove from VC, this long-unused directory and contents.
1334
1335         Adapt tests/tail-2/ to use test-lib.sh.
1336         Adapt tests/readlink/ to use test-lib.sh.
1337
1338         Move the sole test in tests/ls-2/ to tests/misc/.
1339         * tests/ls-2/basic-1: Move this file to ...
1340         * tests/misc/ls-misc: ...here.  Don't rely on $PROG in env.
1341         * tests/misc/Makefile.am (TESTS): Add ls-misc.
1342         * tests/Makefile.am (SUBDIRS): Remove ls-2.
1343         * tests/ls-2: Remove the directory.
1344         * configure.ac (AC_CONFIG_FILES): Remove tests/ls-2/Makefile.
1345
1346         More misc, test-related changes. (some to allow running tests as root)
1347
1348         Move all tests from test/{od,sha1sum,shred,stty} to tests/misc/.
1349         Reflect these renamings:
1350         od/od-N             misc/od-N
1351         od/x8               misc/od-x8
1352         sha1sum/basic-1     misc/sha1sum
1353         sha1sum/sample-vec  misc/sha1sum-vec
1354         shred/exact         misc/shred-exact
1355         shred/remove        misc/shred-remove
1356         stty/basic-1        misc/stty
1357         stty/invalid        misc/stty-invalid
1358         stty/row-col-1      misc/stty-row-col
1359         * tests/misc/Makefile.am (TESTS): Add the new files.
1360         * tests/Makefile.am (SUBDIRS): Remove the dir names.
1361         * tests/od, tests/sha1sum, tests/shred, tests/stty: Remove the
1362         directories.
1363         * configure.ac (AC_CONFIG_FILES): Remove the corresponding Makefile
1364         names.
1365
1366         Move the two tests in tests/tee to tests/misc/.
1367         * tests/tee/basic: Move this file to ...
1368         * tests/misc/tee: ...here.  Don't rely on $PROG in env.
1369         * tests/tee/dash: Move this file to ...
1370         * tests/misc/tee-dash: ...here.  Don't rely on $PROG in env.
1371         * tests/misc/Makefile.am (TESTS): Add tee.
1372         * tests/Makefile.am (SUBDIRS): Remove tee.
1373         * tests/tee: Remove the directory.
1374         * configure.ac (AC_CONFIG_FILES): Remove tests/tee/Makefile
1375
1376         Move the two tests in tests/sum/ to tests/misc/.
1377         * tests/sum/basic-1: Move this file to ...
1378         * tests/misc/sum: ...here.  Don't rely on $PROG in env.
1379         * tests/sum/sysv: Move this file to ...
1380         * tests/misc/sum-sysv: ...here.  Adapt it to use test-lib.sh.
1381         * tests/misc/Makefile.am (TESTS): Add sum and sum-sysv.
1382         * tests/Makefile.am (SUBDIRS): Remove sum.
1383         * tests/sum: Remove the directory.
1384         * configure.ac (AC_CONFIG_FILES): Remove tests/sum/Makefile.
1385
1386         Move the sole test in tests/tsort/ to tests/misc/tsort.
1387         * tests/tsort/basic-1: Move this file to ...
1388         * tests/misc/tsort: ...here.  Don't rely on $PROG in env.
1389         * tests/misc/Makefile.am (TESTS): Add tsort.
1390         * tests/Makefile.am (SUBDIRS): Remove tsort.
1391         * tests/tsort: Remove the directory.
1392         * configure.ac (AC_CONFIG_FILES): Remove tests/tsort/Makefile.
1393
1394         Move the sole test in tests/unexpand to tests/misc/unexpand.
1395         * tests/unexpand/basic-1: Move this file to ...
1396         * tests/misc/unexpand: ...here.  Don't rely on $PROG in env.
1397         * tests/misc/Makefile.am (TESTS): Add unexpand.
1398         * tests/Makefile.am (SUBDIRS): Remove unexpand.
1399         * tests/unexpand: Remove the directory.
1400         * configure.ac (AC_CONFIG_FILES): Remove tests/unexpand/Makefile.
1401
1402         Move the sole test in tests/seq to tests/misc/seq.
1403         * tests/seq/basic: Move this file to ...
1404         * tests/misc/seq: ...here.  Don't rely on $PROG in env.
1405         * tests/misc/Makefile.am (TESTS): Add seq.
1406         * tests/Makefile.am (SUBDIRS): Remove seq.
1407         * tests/seq: Remove the directory.
1408         * configure.ac (AC_CONFIG_FILES): Remove tests/seq/Makefile
1409
1410         Convert tests/mkdir/ to use test-lib.sh.
1411
1412         Move the two tests in tests/md5sum to tests/misc/md5sum.
1413         * tests/md5sum/basic-1: Move this file to ...
1414         * tests/misc/md5sum: ...here.  Don't rely on $PROG in env.
1415         * tests/md5sum/newline-1: Move this file to ...
1416         * tests/misc/md5sum-newline: ...here.  Don't rely on $PROG in env.
1417         * tests/misc/Makefile.am (TESTS): Add md5sum.
1418         * tests/Makefile.am (SUBDIRS): Remove md5sum.
1419         * tests/md5sum: Remove the directory.
1420         * configure.ac (AC_CONFIG_FILES): Remove tests/md5sum/Makefile
1421
1422         tests/sample-test: Update to use test-lib.sh.
1423
1424         Convert tests/misc/ to use test-lib.sh, too.
1425         Convert tests/ls/, too.
1426         Convert tests/ln/, too.
1427         Convert tests/install/, too.
1428
1429         Move the two tests in tests/fmt to tests/misc/fmt.
1430         * tests/fmt/basic: Move this file to ...
1431         * tests/misc/fmt: ...here.  Don't rely on $PROG in env.
1432         * tests/fmt/long-line: Move this file to ...
1433         * tests/misc/fmt-long-line: ...here.
1434         * tests/misc/Makefile.am (TESTS): Add fmt.
1435         * tests/Makefile.am (SUBDIRS): Remove fmt.
1436         * tests/fmt: Remove the directory.
1437         * configure.ac (AC_CONFIG_FILES): Remove tests/fmt/Makefile
1438
1439         Move the sole test in tests/factor to tests/misc/factor.
1440         * tests/factor/basic: Move this file to ...
1441         * tests/misc/factor: ...here.  Don't rely on $PROG in env.
1442         * tests/misc/Makefile.am (TESTS): Add factor.
1443         * tests/Makefile.am (SUBDIRS): Remove factor.
1444         * tests/factor: Remove the directory.
1445         * configure.ac (AC_CONFIG_FILES): Remove tests/factor/Makefile
1446
1447         Move the sole test in tests/expr to tests/misc/expr.
1448         * tests/expr/basic: Move this file to ...
1449         * tests/misc/expr: ...here.  Don't rely on $PROG in env.
1450         * tests/misc/Makefile.am (TESTS): Add expr.
1451         * tests/Makefile.am (SUBDIRS): Remove expr.
1452         * tests/expr: Remove the directory.
1453         * configure.ac (AC_CONFIG_FILES): Remove tests/expr/Makefile
1454
1455         Convert tests/du/*, too.
1456
1457         Move the sole test in tests/dircolors to tests/misc/dircolors.
1458         * tests/dircolors/simple: Move this file to...
1459         * tests/misc/dircolors: ...here.  Don't rely on $PROG in env.
1460         * tests/misc/Makefile.am (TESTS): Add dircolors.
1461         * tests/Makefile.am (SUBDIRS): Remove dircolors.
1462         * tests/dircolors: Remove the directory.
1463         * configure.ac (AC_CONFIG_FILES): Remove tests/dircolors/Makefile
1464
1465         Convert tests/dd/*, too.
1466
1467         Convert tests/mv, too.
1468         * tests/other-fs-tmpdir: Before, all callers would exit 77 upon
1469         failure to find the required dir.  Now, exit 77 in this script so
1470         callers don't have to.  Adjust callers.
1471
1472         Adjust chgrp, chmod, chown, cp tests to use test-lib.sh.
1473         * tests/check.mk: Also define abs_top_builddir.
1474
1475         Parallel "make check" support.
1476         * build-aux/check.mk: New file, from The Vaucanson Group.
1477         * .x-sc_GPL_version: New file, to allow "version 2 or later"
1478         in build-aux/check.mk.
1479         * Makefile.am (EXTRA_DIST): Add .x-sc_GPL_version.
1480         * tests/check.mk: New file.
1481         * tests/Makefile.am (EXTRA_DIST): Add check.mk, mkdtemp and test-lib.sh.
1482
1483         Begin factoring "sample-test" out of test scripts.
1484         * tests/test-lib.sh: New file, to be sourced by all tests that
1485         were previously derived from the "sample-test" template.
1486         * tests/mkdtemp: New file.
1487         * tests/touch/dir-1: Use test-lib.sh.
1488         * tests/touch/empty-file: Likewise.
1489         * tests/touch/fail-diag: Likewise.
1490         * tests/touch/fifo: Likewise.
1491         * tests/touch/no-create-missing: Likewise.
1492         * tests/touch/no-rights: Likewise.  Also, don't sleep.
1493         * tests/touch/not-owner: Likewise.
1494         * tests/touch/obsolescent: Likewise.
1495         * tests/touch/read-only: Likewise.
1496         * tests/touch/relative: Likewise.
1497         * tests/touch/Makefile.am: Include $(top_srcdir)/tests/check.mk,
1498         to get the parallel-"make check" bits.
1499
1500         Move a slow test into tests/misc.
1501         * tests/check.mk: Wrapper.
1502         * tests/ls/time-1: Move this file to tests/misc/ls-time.
1503         * tests/misc/ls-time: New file.  From tests/ls/time-1.
1504         * tests/ls/Makefile.am (TESTS): Remove time-1.
1505         * tests/misc/Makefile.am (TESTS): Add ls-time.
1506
1507         Add support for parallel "make check" (in tests/misc, for now)
1508
1509 2007-09-08  Jim Meyering  <jim@meyering.net>
1510
1511         Accommodate gnulib's renaming: __fpending.h -> fpending.h.
1512         * lib/t-fpending.c: Include "fpending.h", not "__fpending.h".
1513
1514 2007-09-07  Jim Meyering  <jim@meyering.net>
1515
1516         chmod: don't ignore a dangling symlink
1517         * NEWS: Mention the bug fix.
1518         * src/chmod.c (process_file): Handle the case of FTS_SLNONE,
1519         i.e., give a diagnostic saying we cannot operate on such a file.
1520         * tests/chmod/thru-dangling: Compare new stderr output with expected.
1521
1522 2007-09-07  Bob Proulx  <bob@proulx.com>
1523
1524         Add a test: demonstrate that chmod ignores a dangling symlink
1525         * tests/chmod/thru-dangling: New test.  Fails.
1526         * tests/chmod/Makefile.am (TESTS): Add thru-dangling.
1527
1528 2007-09-05  Jim Meyering  <jim@meyering.net>
1529
1530         Adapt to new SELinux behavior: "?" vs. new "unlabeled"
1531         * src/ls.c (gobble_file): Interpret the new "unlabeled" indicator
1532         from getfilecon/lgetfilecon the same way we interpret a negative
1533         return value: no security context.  So we don't print the "+".
1534         * tests/selinux: Recognize that "unlabeled" means insufficient
1535         support for SELinux, just like "?".
1536
1537 2007-09-03  Jim Meyering  <jim@meyering.net>
1538
1539         Invoke $(AUTOCONF) manually, if needed to get an updated version string.
1540         * GNUmakefile: Don't actually touch configure.ac.
1541         That would make git-version-gen always print "...-dirty".
1542
1543         Don't change '-'s to '.'s in the string from git-describe.
1544         * build-aux/git-version-gen: Leave '-'s in the string from git-describe.
1545         Otherwise, s/-/./g would make it too hard to distinguish the base
1546         version number from the appended .DD suffixes.
1547
1548 2007-09-03  Jim Meyering  <jim@meyering.net>
1549
1550         * README-hacking: Require rsync, rather than wget.
1551
1552 2007-09-02  Jim Meyering  <jim@meyering.net>
1553
1554         * bootstrap (WGET_COMMAND): Remove code to set this variable.
1555
1556         Ensure that $(VERSION) is up to date for dist-related targets.
1557         * GNUmakefile: Arrange to rerun autoconf, if the version reported by
1558         git-version-gen doesn't match $(VERSION), but only for dist targets.
1559
1560         bootstrap: uses rsync to download the .po files
1561         * bootstrap (po_download_command_format): New global.
1562         (download_po_files): Use rsync.
1563         (update_po_files): Don't remove .po files after download,
1564         so future rsync runs can take advantage of the copies.
1565
1566 2007-09-01  Jim Meyering  <jim@meyering.net>
1567
1568         * bootstrap (gnulib_tool): Make sha1sum check quietly.
1569
1570         Ensure that snapshot version changes make it to groups, too.
1571         * src/Makefile.am (groups): Depend on Makefile.
1572
1573         Make groups-version executable,
1574         * tests/misc/groups-version: ... as it was in the patch.
1575
1576 2007-08-31  Eric Blake  <ebb9@byu.net>
1577
1578         Test yesterday's change to groups.
1579         * tests/misc/groups-version: New test.
1580         * tests/misc/Makefile.am (TESTS): Add groups-version.
1581
1582 2007-08-31  Jim Meyering  <jim@meyering.net>
1583
1584         Solve the unnecessary-.po-file-regeneration problem once and for all.
1585         * bootstrap (download_po_files): New function, renamed from
1586         get_translations.  Now, downloads, but doesn't update LINGUAS.
1587         (update_po_files): New function.
1588
1589 2007-08-30  Jim Meyering  <jim@meyering.net>
1590
1591         Shorten the snapshot version string by removing the "g".
1592         * build-aux/git-version-gen: Remove git-describe's "g" that would
1593         always precede the abbreviated SHA1.  Suggestion from Dmitry V. Levin.
1594
1595         Perform the s,rm,/bin/rm, fix-up properly.  No more kludge.
1596         * Makefile.am (EXTRA_DIST): Remove .kludge-stamp.
1597         (.kludge-stamp): Remove rule.  Instead, ...
1598         (dist-hook): Do the job here, operating on the file in $(distdir).
1599         (rm_subst): Adjust regexp to match "rm -f rm$(EXEEXT)", not "rm -f rm".
1600         (MAINTAINERCLEANFILES): s/+=/=/, now that this is the sole use.
1601         (dist-hook): Remove the legacy-from-cvs install-sh is-executable check.
1602         * .gitignore: Remove .kludge-stamp.
1603
1604         Make inter-release --version output more useful.
1605         Now, each snapshot has a version "number" like 6.9-219-g58ddd,
1606         which indicates that it is built using the 219th change set
1607         (in _some_ repository) following the "v6.9" tag, and that 58ddd
1608         is a prefix of the commit SHA1.
1609         * build-aux/git-version-gen: New file.
1610         * configure.ac: Run it to set the version.
1611         * Makefile.am (dist-hook): Arrange so that .version appears only
1612         in distribution tarballs, never in a checked-out repository.
1613         * .gitignore: Add .version here, too.  Just in case.
1614
1615 2007-08-30  Eric Blake  <ebb9@byu.net>
1616
1617         * src/.gitignore: Ignore *.exe for platforms with non-empty $(EXEEXT).
1618
1619 2007-08-30  Eric Blake  <ebb9@byu.net>
1620
1621         Use PACKAGE_NAME instead of GNU_PACKAGE.
1622         * src/Makefile.am (.sh, uninstall-local): Adjust all users of
1623         hand-rolled GNU_PACKAGE to instead use autoconf-provided
1624         PACKAGE_NAME.
1625         * src/basename.c (main): Likewise.
1626         * src/chroot.c (main): Likewise.
1627         * src/dirname.c (main): Likewise.
1628         * src/echo.c (main): Likewise.
1629         * src/expr.c (main): Likewise.
1630         * src/factor.c (main): Likewise.
1631         * src/groups.sh (version): Likewise.  Also, reflect change in
1632         --version output due to GPLv3.
1633         * src/hostid.c (main): Likewise.
1634         * src/hostname.c (main): Likewise.
1635         * src/link.c (main): Likewise.
1636         * src/logname.c (main): Likewise.
1637         * src/nice.c (main): Likewise.
1638         * src/nohup.c (main): Likewise.
1639         * src/printenv.c (main): Likewise.
1640         * src/printf.c (main): Likewise.
1641         * src/pwd.c (main): Likewise.
1642         * src/setuidgid.c (main): Likewise.
1643         * src/sleep.c (main): Likewise.
1644         * src/system.h (case_GETOPT_VERSION_CHAR): Likewise.
1645         * src/test.c (main): Likewise.
1646         * src/true.c (main): Likewise.
1647         * src/unlink.c (main): Likewise.
1648         * src/uptime.c (main): Likewise.
1649         * src/users.c (main): Likewise.
1650         * src/whoami.c (main): Likewise.
1651         * src/yes.c (main): Likewise.
1652         * configure.ac (AC_CHECK_DECLS): No need to check strtoimax,
1653         strtoumax, since gnulib does this.
1654
1655 2007-08-30  Jim Meyering  <jim@meyering.net>
1656
1657         Ensure that TMPDIR is valid.  Otherwise, it would cause test failures.
1658         * tests/misc/tty-eof: Set TMPDIR=.
1659         * tests/misc/sort-compress: Likewise.
1660
1661         Use EXIT_FAILURE, not EXIT_FAIL, now that EXIT_FAILURE is always 1.
1662         * src/system.h (EXIT_FAIL): Remove definition.
1663         * src/chroot.c (main): EXIT_FAIL -> EXIT_FAILURE.
1664         * src/env.c (main): Likewise.
1665         * src/nice.c (main): Likewise.
1666         * src/su.c (change_identity, main): Likewise.
1667         * src/tty.c (main): Likewise.
1668         Suggestion from Eric Blake.
1669
1670 2007-08-28  Jim Meyering  <jim@meyering.net>
1671
1672         * src/test.c (usage): Note that [ honors --help and --version,
1673         but that test does not.  Suggestion from Dan Jacobson.
1674
1675         By default, do not install hostname anymore; no kidding, this time.
1676         * src/Makefile.am (EXTRA_PROGRAMS): Remove hostname from this list,
1677         now that it's no longer being installed by default.  This should
1678         have been part of the 2007-08-21 change.
1679         (check-duplicate-no-install): New rule to ensure this doesn't
1680         happen again.
1681         (check): Depend on it.
1682
1683         Reflect renaming: mreadlink-with-size -> areadlink-with-size.
1684         * bootstrap.conf: Update module name.
1685         * src/copy.c (copy_internal): Update header and function names.
1686         * src/ls.c (get_link_name): Likewise.
1687         * src/readlink.c (main): Likewise.
1688         * src/stat.c (print_stat): Likewise.
1689
1690         Add file system type names and magic numbers from "man 2 statfs".
1691         * src/stat.c (human_fstype): Also handle BEFS, BFS, BINFMT_MISC,
1692         FUSECTL, HUGETLBFS, NFSD and OPENPROM.
1693
1694 2007-08-27  Jim Meyering  <jim@meyering.net>
1695
1696         Add some file system type names and magic numbers from glibc.
1697         * src/stat.c (human_fstype): Add any file system names and values
1698         present in glibc's linux_fsinfo.h but not in this list.
1699         Alphabetize the S_* names and capitalize the hexadecimal constants.
1700
1701 2007-08-26  Jim Meyering  <jim@meyering.net>
1702
1703         * tests/misc/fold: Fix a typo: missing \ in a diagnostic
1704         no one is likely ever to see.
1705
1706 2007-08-25  Jim Meyering  <jim@meyering.net>
1707
1708         * src/dircolors.hin: Add .dz and .svgz as archive suffixes.
1709
1710         Remove all .cvsignore files from version control.
1711
1712 2007-08-24  Jim Meyering  <jim@meyering.net>
1713
1714         bootstrap: Ignore more.
1715         * bootstrap (symlink_to_dir): Add a directory name like
1716         uniwidth to e.g., lib/.gitignore.
1717         (slurp): Handle the sys_stat_.h -> sys mapping, too.
1718         * .hgignore: Remove this file, too.
1719         * Makefile.am (EXTRA_DIST): Remove .gitignore and .hgignore.
1720
1721         No longer version-control .???ignore files in lib/, m4/, and po/.
1722         * .gitignore: Ignore a few files in lib/, m4/, and po/ that are not
1723         picked up automatically.
1724         * lib/.gitignore, lib/.cvsignore: Remove files.
1725         * m4/.gitignore, m4/.cvsignore: Remove files.
1726         * po/.gitignore, po/.cvsignore: Remove files.
1727
1728         bootstrap: when fetching .po files, do not remove .gmo files.
1729         * bootstrap (get_translations): Don't remove *.gmo files!
1730         They can be expensive to regenerate.
1731
1732         Create .gitignore and/or .cvsignore from scratch, if absent.
1733         This is in preparation for my removing those files from version
1734         control in the directories managed by gnulib-tool.
1735         * bootstrap: New setting: vc_ignore.
1736         (insert_sorted_if_absent): Create $file if absent.
1737         Adapt to new, possibly empty, list: $vc_ignore.
1738
1739         * src/system.h (fseeko, ftello): Remove now-unneeded definitions.
1740         * src/od.c (LDBL_DIG): Remove now-unneeded definition.
1741
1742         Arrange to use tag names like vM.N, rather than COREUTILS-M_N.
1743         * Makefile.maint (this-vc-tag) [git]: Simply use v$(VERSION).
1744         (this-vc-tag-regexp): New variable.
1745         (vc-tag-check): Use it, rather than $(this-vc-tag).
1746
1747 2007-08-23  Jim Meyering  <jim@meyering.net>
1748
1749         * src/dircolors.hin: Add xterm-16color, xterm-88color and eterm-color.
1750         Suggestion from Dan Nicolaescu.
1751
1752         Don't let ln be a party to destroying user data.
1753         * src/ln.c: Include "file-set.h", "hash.h" and "hash-triple.h".
1754         (dest_set, DEST_INFO_INITIAL_CAPACITY): New globals.
1755         (do_link): Refuse to remove a just-created link.
1756         Record a name,dev,ino triple for each link we create.
1757         (main): Initialize dest_set, if needed.
1758         * tests/mv/childproof: Test for the above fix.
1759         * NEWS: Document this.
1760         Reported by Eric Blake.
1761
1762         Move functions from copy.c into new modules, since ln needs them, too.
1763         * bootstrap.conf (gnulib_modules): Add file-set.
1764         * gl/lib/file-set.c (record_file, seen_file): Functions from copy.c.
1765         * gl/lib/file-set.h: Add prototypes.
1766         * gl/lib/hash-triple.c (triple_hash, triple_hash_no_name):
1767         (triple_compare, triple_free): Functions from copy.c.
1768         * gl/lib/hash-triple.h (struct F_triple): Define.  From copy.c.
1769         Add prototypes.
1770         * gl/modules/file-set: New module.
1771         * gl/modules/hash-triple: New module.
1772         * src/Makefile.am (copy_sources): New variable.
1773         (ginstall_SOURCES, cp_SOURCES, mv_SOURCES): Use it.
1774         * src/copy.c: Include hash-triple.h.
1775         No longer include hash-pjw.h.
1776         (copy_internal): Don't pass a NULL third argument to record_file,
1777         since that function no longer accepts that.
1778         (record_file): Move this function to file-set.c.
1779         Along the way, remove the code to allow a NULL stat-buffer pointer.
1780         Adjust sole caller.
1781         (seen_file): Move this function to file-set.c.
1782         (struct F_triple): Move declaration to hash-triple.h.
1783         (triple_compare, triple_free, triple_hash, triple_hash_no_name):
1784         Move these functions to hash-triple.c.
1785
1786         bootstrap: generate more ignorable names
1787         * bootstrap (slurp): When generating ignorable names, also map
1788         .sin to .sed, .gperf to .c, and .y to .c.
1789
1790         * Makefile.maint (patch-check): Don't remove temporaries upon failure.
1791
1792 2007-08-22  Jim Meyering  <jim@meyering.net>
1793
1794         * src/c99-to-c89.diff: Adjust offsets.
1795
1796         Change "rm --verbose -r a//" not to print extra slashes in a///b
1797         * src/remove.c (push_dir): Don't copy trailing slashes onto the stack.
1798         Reported by François Pinard.
1799         * tests/rm/v-slash: New file.  Test for the above change.
1800         * tests/rm/Makefile.am (TESTS): Add v-slash.
1801
1802         * src/date.c: Don't include "getline.h", now removed from gnulib;
1803         its declarations are now in <stdio.h>.
1804         * src/md5sum.c: Likewise.
1805         * src/dircolors.c: Likewise.
1806
1807         * src/copy.c (DEST_INFO_INITIAL_CAPACITY): Correct a comment.
1808
1809 2007-08-21  Jim Meyering  <jim@meyering.net>
1810
1811         By default, do not install hostname anymore.
1812         * configure.ac: Add "hostname" to the list of not-installed programs.
1813         * src/Makefile.am (no_install__progs): Add "hostname" here, too.
1814         * NEWS: Mention this.
1815
1816 2007-08-20  Bob Proulx  <bob@proulx.com>
1817
1818         Clarify touch documentation of file arguments.
1819         * src/touch.c (usage): Improve wording of documentation regarding
1820         file argument handling and special handling of - argument.
1821         * doc/coreutils.texi (touch invocation): Likewise.
1822         Documentation problem reported by Vincent Lefevre.
1823
1824 2007-08-20  Paul Eggert  <eggert@cs.ucla.edu>
1825
1826         * NEWS: The old cp -p bug affected coreutils releases before 6.0.
1827         Problem reported by Soren Spies in
1828         <http://lists.gnu.org/archive/html/bug-coreutils/2007-08/msg00106.html>.
1829         To be conservative, just say the bug was in all versions through 6.6.
1830
1831 2007-08-19  Eric Blake  <ebb9@byu.net>
1832
1833         Avoid consuming too much seekable input when yesno is used.
1834         * bootstrap.conf (gnulib_modules): Add closein.
1835         * src/system.h (includes): Also include closein.h.
1836         * src/mv.c (main): Use close_stdin, not close_stdout.
1837         * src/cp.c (main): Likewise.
1838         * src/ln.c (main): Likewise.
1839         * src/rm.c (main): Likewise.
1840         * src/install.c (main): Likewise.
1841         * NEWS: Document the fix.
1842
1843 2007-08-20  Jim Meyering  <jim@meyering.net>
1844
1845         Parallel "make check" support.
1846         * build-aux/check.mk: New file, from The Vaucanson Group.
1847         * .x-sc_GPL_version: New file, to allow "version 2 or later"
1848         in build-aux/check.mk.
1849         * Makefile.am (EXTRA_DIST): Add .x-sc_GPL_version.
1850         * tests/check.mk: New file.
1851         * tests/Makefile.am (EXTRA_DIST): Add check.mk, mkdtemp and test-lib.sh.
1852
1853         Begin factoring "sample-test" out of test scripts.
1854         * tests/test-lib.sh: New file, to be sourced by all tests that
1855         were previously derived from the "sample-test" template.
1856         * tests/mkdtemp: New file.
1857         * tests/touch/dir-1: Use test-lib.sh.
1858         * tests/touch/empty-file: Likewise.
1859         * tests/touch/fail-diag: Likewise.
1860         * tests/touch/fifo: Likewise.
1861         * tests/touch/no-create-missing: Likewise.
1862         * tests/touch/no-rights: Likewise.  Also, don't sleep.
1863         * tests/touch/not-owner: Likewise.
1864         * tests/touch/obsolescent: Likewise.
1865         * tests/touch/read-only: Likewise.
1866         * tests/touch/relative: Likewise.
1867         * tests/touch/Makefile.am: Include $(top_srcdir)/tests/check.mk,
1868         to get the parallel-"make check" bits.
1869
1870 2007-08-18  Jim Meyering  <jim@meyering.net>
1871
1872         Use new "idcache.h" header.
1873         * src/ls.c: Remove ancient declarations of getuser and getgroup.
1874         Include "idcache.h", instead.
1875
1876         Run each Coreutils.pm-based test in its own subdirectory.
1877         * tests/CuTmpdir.pm: New file.
1878         * tests/Makefile.am (EXTRA_DIST): Add CuTmpdir.pm.
1879         * tests/misc/od, tests/misc/base64, tests/misc/basename:
1880         * tests/misc/cut, tests/misc/date, tests/misc/dirname:
1881         * tests/misc/expand, tests/misc/fold, tests/misc/head-elide-tail:
1882         * tests/misc/paste-no-nl, tests/misc/pr, tests/misc/sha224sum:
1883         * tests/misc/sha256sum, tests/misc/sha384sum, tests/misc/sha512sum:
1884         * tests/misc/sort-merge, tests/misc/stat-printf, tests/misc/test-diag:
1885         * tests/misc/wc-files0-from, tests/misc/xstrtol:
1886         * tests/dd/skip-seek, tests/dircolors/simple, tests/du/files0-from:
1887         * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
1888         * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
1889         * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
1890         * tests/sum/basic-1, tests/tsort/basic-1, tests/unexpand/basic-1:
1891         * tests/mv/i-1, tests/rm/empty-name, tests/rm/unreadable: Use it.
1892         * tests/misc/test-diag: Use "$ENV{abs_top_builddir}/src/test",
1893         not "../../src/test", so it works when run from a subdirectory.
1894         * tests/ls-2/tests: Create temp files and dirs from within the perl
1895         script, so that they're removed, when run from a subdirectory.
1896         * tests/ls-2/Makefile.am (TESTS_ENVIRONMENT): Define abs_top_builddir,
1897         so we can use "$ENV{abs_top_builddir}/src/test" in a test script.
1898
1899 2007-08-16  Jim Meyering  <jim@meyering.net>
1900
1901         Consolidate od tests.
1902         * tests/misc/od: Perform od-zero-len's test here.
1903         Include boilerplate code, so tests run in a subdirectory.
1904         * tests/misc/od-zero-len: Remove this file.
1905
1906         * tests/ls/time-1: Include sample-test boilerplate code.
1907         Remove the then-unnecessary, hard-coded envvar "unset" commands.
1908
1909 2007-08-15  Jim Meyering  <jim@meyering.net>
1910
1911         Move a slow test into tests/misc.
1912         * tests/ls/time-1: Move this file to tests/misc/ls-time.
1913         * tests/misc/ls-time: New file.  From tests/ls/time-1.
1914         * tests/ls/Makefile.am (TESTS): Remove time-1.
1915         * tests/misc/Makefile.am (TESTS): Add ls-time.
1916
1917         od --skip (-j) works even on files in /proc, when the kernel lies
1918         * src/od.c (skip): Don't let kernel misinformation (nonempty files
1919         in /proc with stat.st_size == 0) make "od -j N" misbehave.
1920         Patch by Paul Eggert.
1921         * NEWS: Document this work-around.
1922         * tests/misc/od-zero-len: New file, test for the above.
1923
1924         * src/printf.c (usage): Adjust summary to also mention OPTIONs.
1925         From Karl Berry.
1926
1927 2007-08-14  Jim Meyering  <jim@meyering.net>
1928
1929         od: fix a bug that arises when skipping exact length of file
1930         * NEWS: Document the bug fix.
1931         * src/od.c (skip): Call fseek even when n_skip is exactly the
1932         same as the length of the current file.  Otherwise, the next
1933         iteration would use unadjusted input stream pointer, thus ignoring
1934         the desired "skip".  Report and patch by Paul GHALEB.
1935
1936         * tests/misc/od: New file, test for the above.
1937         * tests/misc/Makefile.am (TESTS): Add od.
1938
1939 2007-08-10  Paul Eggert  <eggert@cs.ucla.edu>
1940
1941         Accommodate more xstrtol changes.
1942         * src/df.c (long_options): Don't bother prepending "--" to long
1943         options that OPT_STR might decode, as that hack is no longer needed.
1944         (main): Invoke xstrtol_fatal rather than STRTOL_FATAL_ERROR.
1945         * src/du.c (long_options, main): Likewise.
1946         * src/ls.c (decode_switches): Likewise.
1947         * src/od.c (long_options, main): Likewise.
1948         * src/pr.c (first_last_page, main): Likewise.
1949         * src/sort.c (long_options, specify_sort_size): Likewise.
1950         * src/pr.c (first_last_page): Accept option index and option char
1951         instead of an assembled option string.  All callers changed.
1952         * src/sort.c (specify_sort_size): Likewise.
1953         * src/system.h (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
1954         Remove.
1955
1956 2007-08-05  Jim Meyering  <jim@meyering.net>
1957
1958         Encapsulate a static variable.
1959         * src/system.h (opt_str_storage): Move static var into...
1960         (short_opt_str): ... new static inline function.
1961         (OPT_STR): Use the new function.
1962
1963 2007-08-04  Jim Meyering  <jim@meyering.net>
1964
1965         Exercise xstrtol's diagnostics via pr's --pages option.
1966         * tests/misc/xstrtol: New file.
1967         * tests/misc/Makefile.am (TESTS): Add xstrtol.
1968
1969 2007-08-04  Paul Eggert  <eggert@cs.ucla.edu>
1970
1971         Adapt to new human and xstrtol API.
1972         * src/df.c (long_options): Prepend "--" to long options that
1973         OPT_STR might decode.
1974         * src/du.c (long_options): Likewise.
1975         * src/od.c (long_options): Likewise.
1976         * src/sort.c (long_options): Likewise.
1977         * src/df.c (main): Adjust to new human and xstrtol API.
1978         * src/du.c (main): Likewise.
1979         * src/ls.c (decode_switches): Likewise.
1980         * src/od.c (main): Likewise.
1981         * src/pr.c (first_last_page): Likewise.  New argument OPTION.
1982         All callers changed.
1983         * src/sort.c (specify_sort_size): New arg OPTION.  All callers
1984         changed.  Adjust to new xstrtol API.
1985         * src/system.h (opt_str_storage): New static var.
1986         (OPT_STR, LONG_OPT_STR, OPT_STR_INIT): New macros.
1987
1988 2007-08-02  Jim Meyering  <jim@meyering.net>
1989
1990         Adjust one more test to accommodate the recent fts change.
1991         This matters only on systems with insufficient openat support.
1992         * tests/du/inacc-dest: Adjust expected diagnostic.
1993
1994         Adjust the other two "no-x" tests and unify all three.
1995         * tests/du/no-x: Factor out du-specific bits.
1996         * tests/chmod/no-x: Use the same code.
1997         * tests/chgrp/no-x: Use the same code.
1998
1999         Adapt du's no-x test not to fail on older Linux systems.
2000         * tests/du/no-x: Accept a third variant of the diagnostic.
2001
2002 2007-07-31  Jim Meyering  <jim@meyering.net>
2003
2004         du: print size (probably incomplete) of each inaccessible directory
2005         * src/du.c (process_file): Print what we know of the size of a
2006         directory even when it is inaccessible.  What we print is just the
2007         size of the directory itself, not counting any of its contents.
2008         * tests/du/inacc-dir: Test for this.
2009         * NEWS: Mention this change.
2010
2011         Add a test for du not counting size of inaccessible directories.
2012         * tests/du/inacc-dir: New file. Test for fts.c bug fixed yesterday.
2013         * tests/du/Makefile.am (TESTS): Add inacc-dir.
2014         * NEWS: Mention the bug fix.
2015
2016 2007-07-28  Jim Meyering  <jim@meyering.net>
2017
2018         Attempt to copy a regular file, even if stat says it is empty.
2019         * NEWS: Document this bug fix.
2020         * src/copy.c (copy_reg): Read from a regular file, even if it
2021         appears (stat.st_size == 0) to be empty.  This reverts an
2022         optimization introduced on 2005-11-23 for coreutils-6.0.
2023         Otherwise, "cp /proc/cpuinfo /tmp" creates an empty file,
2024         on e.g., linux-2.6.20.
2025         * tests/cp/proc-zero-len: New file.  Test for the above.
2026         * tests/cp/Makefile.am (TESTS): Add proc-zero-len.
2027         Reported by Dan BerrangĂ©.
2028
2029 2007-07-26  Bob Proulx  <bob@proulx.com>
2030
2031         sort: Improve sort --random-sort test.
2032         * tests/misc/sort-rand: If "locale" is available pick a random
2033         non-C locale and check "sort --random-sort" behavior using it.
2034
2035 2007-07-24  Jim Meyering  <jim@meyering.net>
2036
2037         sort: add a test to exercise the affected code.
2038         * tests/sort/Test.pm (realloc-buf): Exercise the code that changed
2039         yesterday.  No other test in all of "make check" does this.
2040         * NEWS: Mention the fix.
2041
2042 2007-07-23  Paul Eggert  <eggert@cs.ucla.edu>
2043
2044         sort: avoid unaligned access.
2045         * src/sort.c (fillbuf): When enlarging the line buffer, ensure that
2046         the new size is a multiple of "sizeof (struct line)".  This avoids
2047         alignment problems when indexing from the end of the buffer.
2048         Problem reported by Andreas Schwab in
2049         <http://lists.gnu.org/archive/html/bug-coreutils/2007-07/msg00158.html>.
2050
2051 2007-07-23  Jim Meyering  <jim@meyering.net>
2052
2053         Update all copyright notices to use the newer form (e.g., remove
2054         the postal address, and add the 'licenses' URL).
2055
2056         * COPYING: Update to Version 3.
2057
2058         Update c99/c89 patch for new, copyright-change-induced offsets.
2059         * Makefile.maint (patch-check): Filter out '^Only in...' lines.
2060         * src/c99-to-c89.diff: Handle new c99'isms in seq.c.
2061
2062 2007-07-22  Jim Meyering  <jim@meyering.net>
2063
2064         * configure.ac: Arrange to rerun configure whenever src/Makefile.am
2065         changes.  That file contains the list of program names that must be
2066         substituted into files like man/Makefile.
2067         Add quotes around AC_SUBST arguments.
2068
2069 2007-07-21  Paul Eggert  <eggert@cs.ucla.edu>
2070
2071         * bootstrap (slurp): Work even in environments where "ls" defaults
2072         to "ls -A".  Put in a FIXME, though, since the current code does
2073         not slurp files whose names start with ".", and this looks like
2074         it might be a troublesome area.
2075
2076 2007-07-20  Jim Meyering  <jim@meyering.net>
2077
2078         Document and add a test for today's sort bug fix.
2079         * NEWS: Describe the bug fix.
2080         * tests/sort/Test.pm (obs-inval): Add a test for today's fix.
2081
2082 2007-07-20  Andreas Schwab  <schwab@suse.de>
2083
2084         * src/sort.c (main): Don't free a pointer to non-malloc'd memory.
2085
2086 2007-07-19  Jim Meyering  <jim@meyering.net>
2087
2088         Fix a portability bug in the new ls-color test.
2089         * tests/ls/stat-free-symlinks: Don't rely on the ability of
2090         a built-in printf to interpolate '\e'.  Use '\033' instead.
2091
2092 2007-07-18  Jim Meyering  <jim@meyering.net>
2093
2094         "cp -i --update older newer" no longer prompts; same for mv
2095         * src/copy.c (copy_internal): Perform "update" check before the
2096         possible interactive prompt.  Reported by zeno_AT_biyg_DOT_org
2097         in <http://bugzilla.redhat.com/248591>
2098         * tests/mv/update: Add tests for the above.
2099         * NEWS: Mention the bug fix.
2100
2101 2007-07-15  Jim Meyering  <jim@meyering.net>
2102
2103         ls --color: Don't stat symlinks when neither ORPHAN nor MISSING
2104         attribute has a color.
2105         * src/ls.c (main): Don't set check_symlink_color when C_EXEC is
2106         colored, unless ln=target (aka color_symlink_as_referent) is set.
2107         (gobble_file): Set f->linkok = true also when !check_symlink_color.
2108         http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/10608/focus=10927
2109         Reported by Jeremy Maitin-Shepard.
2110         * tests/strace: New file, contents extracted from...
2111         * tests/mv/atomic: ...here.  Source strace.
2112         * tests/ls/stat-free-symlinks: New file.  Test for the above.
2113         Use strace to ensure that in this corner case, ls does not call stat.
2114         * tests/ls/Makefile.am (TESTS): Add stat-free-symlinks.
2115         * tests/Makefile.am (EXTRA_DIST): Add strace.
2116
2117 2007-07-14  Jim Meyering  <jim@meyering.net>
2118
2119         Remove long-deprecated options.
2120         * NEWS: Mention this.
2121         * src/df.c, src/ls.c: Remove --kilobytes option.
2122         * src/du.c: Remove --kilobytes and --megabytes options.
2123         * src/who.c: Remove -i and --idle options.
2124         * src/ptx.c: Remove --copyright option.
2125
2126         Change interface: make 2nd param _space_-separated, not comma-separated
2127         * m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG): Remove now-
2128         unnecessary use of tr.
2129         Improve comments.
2130         * configure.ac: Adjust caller, as well as the code that ensures the
2131         2nd parameter stays in sync with the list in src/Makefile.am.
2132
2133 2007-07-14  Karel Zak  <kzak@redhat.com>
2134
2135         * m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix typo: s/$2/$1/.
2136         (gl_INCLUDE_EXCLUDE_PROG): Quote first use of $2 parameter.
2137         Don't mix comma- and space-separated lists.
2138         Patch from Karel Zak.
2139
2140 2007-07-13  Jim Meyering  <jim@meyering.net>
2141
2142         Warn about non-portable use of unescaped backslash at end of string,
2143         and treat it as if it were escaped.
2144         * src/tr.c (unquote): Considering that such usage would make GNU tr
2145         from coreutils-5.2.1 and earlier *fail*, the least we can do now is
2146         to warn about it.  Solaris' tr ignores it.
2147         * NEWS: Mention this.
2148
2149         Use proper backslash-quoting inside backticks.
2150         * configure.ac: Otherwise we run afoul of strict GNU tr:
2151         a string ending in a lone backslash would provoke a failure.
2152
2153 2007-07-12  Jim Meyering  <jim@meyering.net>
2154
2155         Expand default-no-install prog list in ./configure --help output,
2156         and fix some []-quoting bugs in sed expressions.
2157         * configure.ac: Hard-code the list, "arch,su" here as well
2158         as in src/Makefile.am, and ensure the two stay in sync.
2159         * m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG): Use $2,
2160         rather than the nearly-equivalent shell variable.
2161         Karel Zak reported that ./configure --help's output included
2162         the literal string, $gl_no_install_progs_default.
2163
2164         Clean up include-exclude-prog.m4.
2165         * m4/include-exclude-prog.m4 (gl_ADD_PROG): Don't modify MAN.
2166         (gl_REMOVE_PROG): Likewise.
2167         Add omitted "\>" in sed regexp.
2168         Remove any leading or trailing spaces.
2169         (gl_ADD_PROG): Remove any leading space.
2170         * configure.ac: Instead, derive $MAN from $optional_bin_progs.
2171         Append $(EXEEXT) to *all* names, not just the first one.
2172
2173 2007-07-11  Jim Meyering  <jim@meyering.net>
2174
2175         If there's a GPL vN copyright comment, require that N == 3.
2176         * Makefile.maint (sc_GPL_version): New rule.
2177         * tests/misc/arch: Fix the sole violation.
2178
2179 2007-07-10  Jim Meyering  <jim@meyering.net>
2180
2181         Skip "arch" test if it's not built.
2182         * tests/misc/Makefile.am (built_programs): Define.
2183         (TESTS_ENVIRONMENT): Add $(built_programs), for...
2184         * tests/misc/arch: ...this: skip the test if arch is not built.
2185         * src/Makefile.am (built_programs.list): New rule.
2186         * tests/Makefile.am (built_programs): Rename from all_programs.
2187         (TESTS_ENVIRONMENT): Use built_programs, not all_programs.
2188         * tests/help-version: Likewise.
2189         * NEWS: Mention that using --enable-no-install-program=X may
2190         cause "make check" to fail.
2191
2192         Add support for enabling/disabling installation of specified programs.
2193         * NEWS: Mention new configure-time options.
2194         Mention that neither arch nor su is built/installed, by default.
2195         * m4/include-exclude-prog.m4: New file.
2196         * configure.ac: Use new macro, gl_ADD_PROG, rather than
2197         manually appending to OPTIONAL_BIN_PROGS and MAN.
2198         Move the code that adds "df" to the list of programs to build from
2199         m4/jm-macros into this file.
2200         Use gl_INCLUDE_EXCLUDE_PROG, then handle special cases: ginstall, [.
2201         (NO_INSTALL_PROGS_DEFAULT): AC_SUBST it.  Used by man/Makefile.am.
2202         * man/Makefile.am (dist_man_MANS): Remove from this list all man pages
2203         corresponding to "bin" programs. Add $(MAN) instead.
2204         (optional_mans): Remove all uses.
2205         (check-x-vs-1): Adapt to work even though arch and su are typically
2206         no longer built (and neither are their .1 files).
2207         * src/Makefile.am (install_su): Rename from INSTALL_SU, now that
2208         INSTALL_SU has a different meaning. Use the new $(INSTALL_SU) value.
2209
2210 2007-07-10  Karel Zak  <kzak@redhat.com>
2211
2212         New program: arch
2213         * NEWS: Mention arch.
2214         * README: Add arch to the list of programs.
2215         * AUTHORS: Add arch.
2216         * src/uname.c: Include "uname.h".
2217         (PROGRAM_NAME): Handle arch, too.
2218         (ARCH_AUTHORS): Define.
2219         (uname_long_options, arch_long_options): Renamed and new globals.
2220         (usage): Handle arch-mode as well as uname-mode.
2221         (decode_switches): New function, extracted from main,
2222         to handle arch-mode as well as uname-mode.
2223         (main): Handle both modes.
2224         * src/uname-arch.c: New program, alias for "uname -m".
2225         * src/uname-uname.c: New file, default uname mode.
2226         * src/uname.h: New file, uname modes.
2227         * src/Makefile.am (EXTRA_PROGRAMS): Add arch.
2228         (uname_SOURCES, arch_SOURCES): Define.
2229         * man/arch.x: New file.
2230         * man/Makefile.am (dist_man_MANS): Add arch.1.
2231         (arch.1): New dependency.
2232         * tests/misc/arch: New test, compare "arch" with "uname -m"
2233         * configure.ac (OPTIONAL_BIN_PROGS): Add arch.
2234         (MAN): Add arch.1.
2235         * .x-sc_require_config_h: Exempt uname-arch.c and uname-uname.c
2236         from the always-include-<config.h> rule.
2237
2238 2007-07-10  Jim Meyering  <jim@meyering.net>
2239
2240         Change "version 2" to "version 3" in all copyright notices.
2241
2242 2007-07-09  Jim Meyering  <jim@meyering.net>
2243
2244         Compensate for new c99'isms in seq.c.
2245         * Makefile.maint (patch-check): Use -p1, not -p2, so a patch
2246         generated via "make patch-check REGEN=1" actually works.
2247         * src/c99-to-c89.diff: Handle new c99'isms in seq.c.
2248
2249 2007-07-09  Pádraig Brady <P@draigBrady.com>
2250
2251         Fix the automatic number width formatting in seq.
2252         * src/seq.c: Fix the -w logic. Ignore spaces and '+'
2253         characters of input numbers when determining width.
2254         Set format correctly for input numbers in scientific notation.
2255         * tests/seq/basic: Add various number width tests.
2256         Details: <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/10903>
2257
2258 2007-07-08  Jim Meyering  <jim@meyering.net>
2259
2260         Run the coreutils-specific code only if tests/Makefile.am.in exists.
2261         * bootstrap (mam_template): Move definition out of loop.
2262
2263         Create symlinks for gl/{lib,m4}/*, just as for gnulib/{lib,m4}/*.
2264         * bootstrap (symlink_to_dir): Rename function from symlink_to_gnulib.
2265         Add a directory parameter.  Update all callers.
2266         (cp_mark_as_generated): Also check for -- and link to -- files in gl/.
2267
2268         * THANKS: Add Pádraig Brady.
2269
2270 2007-07-08  Jim Meyering  <jim@meyering.net>
2271
2272         Adapt to deeper hierarchy in gnulib.
2273         * bootstrap (symlink_to_dir): If the destination directory doesn't
2274         exist, create it. This is required at least for "lib/uniwidth/cjk.h".
2275
2276         Use <wchar.h>, not "wcwidth.h".
2277         * src/wc.c: Now that gnulib provides the POSIX-specified <wchar.h>,
2278         include it and <wctype.h>, rather than "wcwidth.h".
2279         * src/ls.c: Include <wchar.h>, rather than "wcwidth.h".
2280
2281 2007-07-05  Jim Meyering  <jim@meyering.net>
2282
2283         setuidgid: set all groups, not just the primary one.
2284         I wanted to use the xgetgroups function from id.c, so factored
2285         it out and made it into a non-exiting function (hence the "m"
2286         prefix rather than "x").
2287         * src/setuidgid.c (main): Use mgetgroups.
2288         Include "mgetgroups.h".
2289
2290         * src/id.c (xgetgroups): Remove function.
2291         Include "mgetgroups.h".
2292         (print_group_list): Use mgetgroups, not xgetgroups.
2293
2294         * gl/modules/mgetgroups: New module.
2295         * gl/lib/mgetgroups.c: New file.  mgetgroups is derived from
2296         id.c's xgetgroups function.
2297         * bootstrap.conf (gnulib_modules): Add mgetgroups.
2298         * gl/m4/mgetgroups.m4: New file.
2299         * gl/lib/mgetgroups.h: New file.
2300
2301         * bootstrap: Merge in changes from gnulib.
2302
2303         * src/id.c: Include "getugroups.h" rather than declaring manually.
2304
2305 2007-07-04  Paul Eggert  <eggert@cs.ucla.edu>
2306
2307         * NEWS: pr -F no longer suppresses the footer or the first two blank
2308         lines in the header.
2309         * doc/coreutils.texi (pr invocation): Likewise.  Also, a too-short
2310         page length implies -t, not -T.
2311         * src/pr.c (lines_per_header, lines_per_footer): Now constants.
2312         (init_parameters): Don't try to change them.
2313         (print_header): Use the same header and footer format regardless of
2314         wither form feeds are being used.
2315         (usage): Adjust to above change when describing too-short page length.
2316         Too-short page length impliesy -t, not -T.
2317         * tests/pr/2-S_f-t_notab: Adjust to the fact that -F now affects
2318         only formfeed handling; it does not change the header.
2319         * tests/pr/2-Sf-t_notab: Likewise.
2320         * tests/pr/2f-t_notab: Likewise.
2321         * tests/pr/2s_f-t_notab: Likewise.
2322         * tests/pr/2s_w60f-t_nota: Likewise.
2323         * tests/pr/2sf-t_notab: Likewise.
2324         * tests/pr/2sw60f-t_notab: Likewise.
2325         * tests/pr/2w60f-t_notab: Likewise.
2326         * tests/pr/3a3f-0F: Likewise.
2327         * tests/pr/3b3f-0F: Likewise.
2328         * tests/pr/3b3f-0FF: Likewise.
2329         * tests/pr/3b3f-FF: Likewise.
2330         * tests/pr/3f-0F: Likewise.
2331         * tests/pr/3f-FF: Likewise.
2332         * tests/pr/Test.pm: Likewise.
2333         * tests/pr/a3f-0F: Likewise.
2334         * tests/pr/a3f-0FF: Likewise.
2335         * tests/pr/a3f-FF: Likewise.
2336         * tests/pr/b3f-0F: Likewise.
2337         * tests/pr/b3f-0FF: Likewise.
2338         * tests/pr/b3f-FF: Likewise.
2339         * tests/pr/3-5l17f-t: Remove, since it's been renamed to another
2340         file whose name has a line count 7 larger,
2341         reflecting the new line count needed for this behavior.
2342         * tests/pr/3a3l8f-t: Likewise.
2343         * tests/pr/3b3l8f-t: Likewise.
2344         * tests/pr/3l17f-t: Likewise.
2345         * tests/pr/3ml17f-t: Likewise.
2346         * tests/pr/Ja3l17f-lm: Likewise.
2347         * tests/pr/Jb3l17f-lm: Likewise.
2348         * tests/pr/Jml17f-lm-lo: Likewise.
2349         * tests/pr/W-72l17f-ll: Likewise.
2350         * tests/pr/W20l17f-ll: Likewise.
2351         * tests/pr/W26l17f-ll: Likewise.
2352         * tests/pr/W27l17f-ll: Likewise.
2353         * tests/pr/W28l17f-ll: Likewise.
2354         * tests/pr/W35Ja3l17f-lm: Likewise.
2355         * tests/pr/W35Jb3l17f-lm: Likewise.
2356         * tests/pr/W35Jml17f-lmlo: Likewise.
2357         * tests/pr/W35a3l17f-lm: Likewise.
2358         * tests/pr/W35b3l17f-lm: Likewise.
2359         * tests/pr/W35ml17f-lm-lo: Likewise.
2360         * tests/pr/W72Jl17f-ll: Likewise.
2361         * tests/pr/a3l17f-lm: Likewise.
2362         * tests/pr/a3l8f-t: Likewise.
2363         * tests/pr/b3l17f-lm: Likewise.
2364         * tests/pr/b3l8f-t: Likewise.
2365         * tests/pr/l17f-t: Likewise.
2366         * tests/pr/ml17f-0F: Likewise.
2367         * tests/pr/ml17f-lm-lo: Likewise.
2368         * tests/pr/ml17f-t: Likewise.
2369         * tests/pr/ml17f-t-0F: Likewise.
2370         * tests/pr/n+2-5l17f-0FF: Likewise.
2371         * tests/pr/n+2l17f-0FF: Likewise.
2372         * tests/pr/n+2l17f-bl: Likewise.
2373         * tests/pr/n+3l17f-0FF: Likewise.
2374         * tests/pr/n+3l17f-bl: Likewise.
2375         * tests/pr/n+3ml13f-bl-FF: Likewise.
2376         * tests/pr/n+3ml17f-bl-tn: Likewise.
2377         * tests/pr/n+3ml17f-tn-bl: Likewise.
2378         * tests/pr/n+4b2l10f-0FF: Likewise.
2379         * tests/pr/n+5-8b3l10f-FF: Likewise.
2380         * tests/pr/n+5a3l6f-0FF: Likewise.
2381         * tests/pr/n+6b3l6f-FF: Likewise.
2382         * tests/pr/nJml17f-lmlmlo: Likewise.
2383         * tests/pr/nJml17f-lmlolm: Likewise.
2384         * tests/pr/nN1+3l17f-bl: Likewise.
2385         * tests/pr/nN15l17f-bl: Likewise.
2386         * tests/pr/nSml13-bl-FF: Likewise.
2387         * tests/pr/nSml13-t-t-FF: Likewise.
2388         * tests/pr/nSml13-t-tFFFF: Likewise.
2389         * tests/pr/nSml17-bl-FF: Likewise.
2390         * tests/pr/nSml17-t-t-FF: Likewise.
2391         * tests/pr/nSml17-t-tFFFF: Likewise.
2392         * tests/pr/nl17f-bl: Likewise.
2393         * tests/pr/o3Jml17f-lm-lo: Likewise.
2394         * tests/pr/o3a3Sl17f-tn: Likewise.
2395         * tests/pr/o3a3Snl17f-tn: Likewise.
2396         * tests/pr/o3a3l17f-tn: Likewise.
2397         * tests/pr/o3b3Sl17f-tn: Likewise.
2398         * tests/pr/o3b3Snl17f-tn: Likewise.
2399         * tests/pr/o3b3l17f-tn: Likewise.
2400         * tests/pr/o3mSl17f-bl-tn: Likewise.
2401         * tests/pr/o3mSnl17fbltn: Likewise.
2402         * tests/pr/o3ml17f-bl-tn: Likewise.
2403         * tests/pr/w72l17f-ll: Likewise.
2404         * tests/pr/3-5l24f-t: New file, containing the contents of the
2405         file with the same name but with the line count smaller by 7,
2406         reflecting the new behavior with -F.
2407         * tests/pr/3a3l15f-t: Likewise.
2408         * tests/pr/3b3l15f-t: Likewise.
2409         * tests/pr/3l24f-t: Likewise.
2410         * tests/pr/3ml24f-t: Likewise.
2411         * tests/pr/Ja3l24f-lm: Likewise.
2412         * tests/pr/Jb3l24f-lm: Likewise.
2413         * tests/pr/Jml24f-lm-lo: Likewise.
2414         * tests/pr/W-72l24f-ll: Likewise.
2415         * tests/pr/W20l24f-ll: Likewise.
2416         * tests/pr/W26l24f-ll: Likewise.
2417         * tests/pr/W27l24f-ll: Likewise.
2418         * tests/pr/W28l24f-ll: Likewise.
2419         * tests/pr/W35Ja3l24f-lm: Likewise.
2420         * tests/pr/W35Jb3l24f-lm: Likewise.
2421         * tests/pr/W35Jml24f-lmlo: Likewise.
2422         * tests/pr/W35a3l24f-lm: Likewise.
2423         * tests/pr/W35b3l24f-lm: Likewise.
2424         * tests/pr/W35ml24f-lm-lo: Likewise.
2425         * tests/pr/W72Jl24f-ll: Likewise.
2426         * tests/pr/a3l15f-t: Likewise.
2427         * tests/pr/a3l24f-lm: Likewise.
2428         * tests/pr/b3l15f-t: Likewise.
2429         * tests/pr/b3l24f-lm: Likewise.
2430         * tests/pr/l24f-t: Likewise.
2431         * tests/pr/ml24f-0F: Likewise.
2432         * tests/pr/ml24f-lm-lo: Likewise.
2433         * tests/pr/ml24f-t: Likewise.
2434         * tests/pr/ml24f-t-0F: Likewise.
2435         * tests/pr/n+2-5l24f-0FF: Likewise.
2436         * tests/pr/n+2l24f-0FF: Likewise.
2437         * tests/pr/n+2l24f-bl: Likewise.
2438         * tests/pr/n+3l24f-0FF: Likewise.
2439         * tests/pr/n+3l24f-bl: Likewise.
2440         * tests/pr/n+3ml20f-bl-FF: Likewise.
2441         * tests/pr/n+3ml24f-bl-tn: Likewise.
2442         * tests/pr/n+3ml24f-tn-bl: Likewise.
2443         * tests/pr/n+4b2l17f-0FF: Likewise.
2444         * tests/pr/n+5-8b3l17f-FF: Likewise.
2445         * tests/pr/n+5a3l13f-0FF: Likewise.
2446         * tests/pr/n+6b3l13f-FF: Likewise.
2447         * tests/pr/nJml24f-lmlmlo: Likewise.
2448         * tests/pr/nJml24f-lmlolm: Likewise.
2449         * tests/pr/nN1+3l24f-bl: Likewise.
2450         * tests/pr/nN15l24f-bl: Likewise.
2451         * tests/pr/nSml20-bl-FF: Likewise.
2452         * tests/pr/nSml20-t-t-FF: Likewise.
2453         * tests/pr/nSml20-t-tFFFF: Likewise.
2454         * tests/pr/nSml24-bl-FF: Likewise.
2455         * tests/pr/nSml24-t-t-FF: Likewise.
2456         * tests/pr/nSml24-t-tFFFF: Likewise.
2457         * tests/pr/nl24f-bl: Likewise.
2458         * tests/pr/o3Jml24f-lm-lo: Likewise.
2459         * tests/pr/o3a3Sl24f-tn: Likewise.
2460         * tests/pr/o3a3Snl24f-tn: Likewise.
2461         * tests/pr/o3a3l24f-tn: Likewise.
2462         * tests/pr/o3b3Sl24f-tn: Likewise.
2463         * tests/pr/o3b3Snl24f-tn: Likewise.
2464         * tests/pr/o3b3l24f-tn: Likewise.
2465         * tests/pr/o3mSl24f-bl-tn: Likewise.
2466         * tests/pr/o3mSnl24fbltn: Likewise.
2467         * tests/pr/o3ml24f-bl-tn: Likewise.
2468         * tests/pr/w72l24f-ll: Likewise.
2469
2470 2007-06-23  Jim Meyering  <jim@meyering.net>
2471
2472         Prefer "STREQ (a, b)" over "strcmp (a, b) == 0"; similar for != 0.
2473         * src/base64.c (main): Likewise.
2474         * src/install.c (setdefaultfilecon): Likewise.
2475         * src/sort.c (main): Likewise.
2476         * Makefile.maint (sc_prohibit_strcmp): New rule.
2477         * .x-sc_prohibit_strcmp: New file, to list the few exceptions.
2478         * Makefile.am (EXTRA_DIST): Add .x-sc_prohibit_strcmp.
2479
2480 2007-06-22  Paul Eggert  <eggert@cs.ucla.edu>
2481
2482         * NEWS: seq no longer mishandles obvious cases like
2483         "seq 0 0.000001 0.000003" by omitting the last output number.
2484         * doc/coreutils.texi (seq invocation): Remove advice about workaround
2485         for seq off-by-one problem, since the bug is fixed now.  Replace
2486         it with more-generic advice about rounding errors.
2487         * src/seq.c (long_double_format, print_numbers):
2488         New arg NUMERIC_FORMAT.  All uses changed.
2489
2490 2007-06-22  Pádraig Brady  <P@draigBrady.com>  (trivial change)
2491
2492         * tests/seq/basic: Add test cases for seq off-by-one problem.
2493
2494 2007-06-22  Jim Meyering  <jim@meyering.net>
2495
2496         * src/stat.c (long_options): Add a FIXME comment to help ensure
2497         that the deprecated and undocumented "--filesystem" option is
2498         removed someday.
2499
2500 2007-06-18  Paul Eggert  <eggert@cs.ucla.edu>
2501
2502         A few more symlink-related fixes.  Fix a bug triggered by cp
2503         --parents and symlinks.  Close some race conditions possible when
2504         the destination replaces a newly-created file with a symlink.
2505         * NEWS: Document that 'cp --parents' no longer mishandles
2506         symlinks in file name components of source.
2507         * src/copy.c (HAVE_LCHOWN): Default to false.
2508         (lchown) [!defined HAVE_LCHOWN]: Define to chown, for convenience.
2509         * src/cp.c (lchown) [!HAVE_LCHOWN]: Likewise.
2510         * src/install.c (lchown [!HAVE_LCHOWN]: Likewise.
2511         * src/copy.c (set_owner): Use lchown instead of chown, for safety
2512         in case the file got replaced by a symlink in the meantime.
2513         * src/cp.c (re_protect): Likewise.
2514         * src/install.c (change_attributes): Likewise.
2515         * src/copy.c (copy_internal): Use ordinary C rather than an #if.
2516         * src/cp.c (lchown) [!HAVE_LCHOWN]: Define to chown, for convenience.
2517         (struct dir_attr): Cache the entire struct stat of the directory,
2518         rather than just its mode, so that we needn't stat the directory
2519         twice (which can lead to races).
2520         (re_protect): Don't use XSTAT as that's not appropriate in
2521         this context (symlinks should be followed here).  Instead, use
2522         the cached stat value.
2523         (make_dir_parents_private): Save dir's entire struct stat, not
2524         just its mode.
2525         * tests/cp/cp-parents: Add test to check against bug with
2526         cp --parents and symlinks.
2527
2528 2007-06-18  Jim Meyering  <jim@meyering.net>
2529
2530         Use mreadlink_with_size (doesn't exit), not xreadlink_with_size.
2531         * bootstrap.conf (gnulib_modules): Add readlink-with-size.
2532         Remove xreadlink and xreadlink-with-size.
2533         * src/copy.c (copy_internal): Use mreadlink_with_size,
2534         not xreadlink_with_size.
2535         * src/ls.c (get_link_name): Likewise.
2536         * src/readlink.c (main): Likewise.
2537         * src/stat.c (print_stat): Likewise.
2538
2539         * README-hacking: Don't mention Gzip 1.2.4, now that 1.3.12 is out.
2540
2541 2007-06-16  Jim Meyering  <jim@meyering.net>
2542
2543         Make chgrp and chown diagnostics consistent.
2544         * src/chown.c (main): Emit the diagnostic before the file name,
2545         not after it, to be consistent with chgrp's diagnostic.
2546         * src/chgrp.c (parse_group): Emit a ":" between the diagnostic
2547         and the file name.
2548         Reported by Egmont Koblinger.
2549         * THANKS: Add Egmont Koblinger.
2550
2551 2007-06-15  Paul Eggert  <eggert@cs.ucla.edu>
2552
2553         Correct cp's handling of destination symlinks in some cases.
2554         * NEWS: "cp" no longer considers a destination symlink to be the
2555         same as the referenced file when copying links or making backups.
2556         * src/copy.c (copy_reg): When following a symlink, use the
2557         followed name in later chown etc. requests, so that the created
2558         file is affected, rather than the symlink.  Use O_NOFOLLOW on
2559         source when not dereferencing symlinks; this avoids a race.
2560         Preserve errno correctly when doing multiple open attempts on the
2561         destination.
2562         (copy_internal): Follow destination symlinks only when copying a
2563         regular file and only when we don't intend to remove or rename the
2564         destination first, regardless of whether following source
2565         symlinks; this is because since POSIX and tradition (e.g.,
2566         FreeBSD) say we should ordinarily follow destination symlinks if
2567         the system calls would ordinarily do so.
2568         * src/copy.h (struct cp_options): Add comment that 'dereference'
2569         is only for source files.
2570         * src/cp.c (usage): Note that --derereference etc. are only for
2571         source files.
2572         (make_dir_parents_private): Follow symlinks, regardless of whether
2573         --dereference is specified, because these are destination symlinks.
2574         * tests/cp/same-file: Adjust tests to match revised behavior.
2575         Filter out perror output since it might vary from host to host.
2576         Use sed alone instead of also using echo.
2577
2578         * doc/coreutils.texi (cp invocation): Document the behavior better when
2579         the destination is a symlink.  Clarify source versus destination
2580         symlinks.  Describe the new behavior for destination symlinks.
2581
2582 2007-06-15  Jim Meyering  <jim@meyering.net>
2583
2584         * src/copy.c: Include "canonicalize.h".
2585         (copy_reg): Use canonicalize_filename_mode to follow the symlink,
2586         so that we can always open with O_EXCL and avoid a race.
2587
2588 2007-06-15  Jim Meyering  <jim@meyering.net>
2589
2590         Don't include "quote.h" when it is not used.
2591         * src/md5sum.c: Remove unnecessary inclusion of "quote.h".
2592         * src/expr.c: Likewise.
2593         * src/shred.c: Likewise.
2594         * Makefile.maint (sc_prohibit_quote_without_use): New rule.
2595         * src/c99-to-c89.diff: Adjust offsets.
2596
2597 2007-06-14  Paul Eggert  <eggert@cs.ucla.edu>
2598
2599         Clarify what "cat" documentation means by "blank" lines.
2600         * doc/coreutils.texi (cat invocation): "Blank" lines actually mean
2601         empty lines.
2602         * src/cat.c (usage): Say that "nonblank" means nonempty.  Clarify
2603         --squeeze-blank.
2604
2605 2007-06-13  Jim Meyering  <jim@meyering.net>
2606
2607         rmdir: give better diagnostics
2608         * src/rmdir.c (remove_parents): Give a more descriptive/consistent
2609         diagnostic upon failure.
2610         (main): Likewise.
2611         Suggestion from Joey Hess.
2612         * THANKS: Add Joey Hess.
2613
2614         Don't include "quotearg.h" when it is not used.
2615         * Makefile.maint (sc_prohibit_quotearg_without_use): New rule.
2616         * src/cp.c: Don't include "quotearg.h".  It wasn't used.
2617
2618         * README-hacking: List Gperf as a build-requirement, too.
2619         Reported by Steve Ward.
2620
2621 2007-06-11  Jim Meyering  <jim@meyering.net>
2622
2623         * README: Mention README-hacking, for whose who start from
2624         cloned/checked-out sources rather than from a distribution tarball.
2625         Reported by Steve Ward.
2626         * THANKS: Add Steve Ward.
2627
2628 2007-06-10  Jim Meyering  <jim@meyering.net>
2629
2630         bug-fix: cp would fail to write through a dangling symlink
2631         * NEWS: Mention the bug fix.
2632         * src/copy.c (copy_reg): When open fails with EEXIST, the destination
2633         is lstat'able, and a symlink, call open again, but now without O_EXCL.
2634         * tests/cp/thru-dangling: New file, to test for the above fix.
2635         * tests/cp/Makefile.am (TESTS): Add thru-dangling.
2636         * THANKS: Add Michael McLagan.
2637         Bug report from Michael McLagan in <http://bugzilla.redhat.com/243588>.
2638
2639 2007-06-04  Paul Eggert  <eggert@cs.ucla.edu>
2640
2641         * doc/coreutils.texi (Common options): Mention that -h and
2642         --human-readable are equivalent to --block-size=human-readable.
2643         Documentation problem reported by Steve Ward in
2644         <http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00007.html>.
2645         (du invocation): Use optSi rather than duplicating the macro's
2646         contents (incorrectly, since we claimed a "B" was output).
2647
2648 2007-05-31  Jim Meyering  <jim@meyering.net>
2649
2650         Pull printf-related code from gnulib, rather than using forked copy.
2651         * bootstrap.conf (gnulib_modules): Don't avoid size_max and xsize
2652         modules.  While I dislike xsize-style overflow avoidance, maintaining
2653         a forked version of e.g., vasnprintf.c was too much work.
2654
2655 2007-05-29  Jim Meyering  <jim@meyering.net>
2656
2657         * src/dircolors.hin: Add screen-256color.
2658         Suggested by sdl.web@gmail.com in <http://bugzilla.redhat.com/239266>.
2659
2660 2007-05-26  Jim Meyering  <jim@meyering.net>
2661
2662         * TODO: Add an entry for comm --output-delimiter=STR
2663
2664 2007-05-25  James Youngman  <jay@gnu.org>
2665
2666         wc: ignore multibyte-character decoding errors
2667         * src/wc.c (wc): Don't issue an error message when mbrtowc
2668         indicates that we have seen an invalid byte sequence.  This
2669         makes "wc /bin/sh" bearable (though the word and line counts
2670         are likely not to be useful).
2671         * NEWS: Mention the change.
2672
2673 2007-05-22  Jim Meyering  <jim@meyering.net>
2674
2675         Check for an up-to-date copyright year in coreutils.texi.
2676         * Makefile.maint (copyright-check): Also check for an up-to-date
2677         copyright year in doc/$().texi, if that file exists.
2678         * doc/coreutils.texi: Add 2007 to list of Copyright years.
2679         Reported by Karl Berry.
2680
2681         cut: diagnose a range starting with 0 (-f 0-2) as invalid, and
2682         give a better diagnostic for a field-number/offset of 0.
2683         * NEWS: Mention the fix.
2684         * src/cut.c (ADD_RANGE_PAIR): Add an explicit check.
2685         Based on a patch from James Youngman.
2686         * tests/misc/cut: Add tests for the above.
2687
2688         "cut -f 2-0" now fails; before, it was equivalent to "cut -f 2-"
2689         Also, diagnose the '-' in "cut -f -" as an invalid range, rather
2690         than interpreting it as the unlimited range, "1-".
2691         * NEWS: Mention these changes.
2692         * src/cut.c (set_fields): Don't interpret an accumulator "value"
2693         of 0 as an unspecified range endpoint.
2694         Give better diagnostics.
2695         Adjust a comment so that it is true also for 64-bit size_t.
2696
2697         * tests/cut/Test.pm: Add tests for the above.
2698
2699         stty: fix a harmless syntax nit
2700         * src/stty.c (visible): Use ";" as the statement terminator
2701         between two assignments, not ",".
2702         (integer_arg): Join an unnecessarily wrapped line.
2703
2704 2007-05-20  Jim Meyering  <jim@meyering.net>
2705
2706         stty: diagnose an invalid hex value in 35-colon commmand-line argument
2707         * NEWS: Mention this.
2708         * src/stty.c (strtoul_tcflag_t, strtoul_cc_t): New functions.
2709         (recover_mode): Use those functions (not sscanf), to parse the
2710         string robustly.
2711         * tests/stty/invalid: New file.  Test for the above.
2712         * tests/stty/Makefile.am (TESTS): Add invalid.
2713         * .x-sc_prohibit_atoi_atof: Don't exempt stty.c from this check.
2714         Add tests/stty/invalid so we don't have to obfuscate the comment
2715         about sscanf therein.
2716         * Makefile.maint (sc_prohibit_atoi_atof): Mention sscanf in the
2717         diagnostic, too.
2718
2719         * TODO: Remove some now-completed or no longer relevant items.
2720
2721 2007-05-19  Jim Meyering  <jim@meyering.net>
2722
2723         Rename uses of futimens -> gl_futimens; glibc now declares the former.
2724         * src/copy.c (copy_reg): Reflect renaming: futimens -> gl_futimens.
2725         * src/touch.c (touch): Likewise.
2726
2727 2007-05-18  Jim Meyering  <jim@meyering.net>
2728
2729         * Makefile.maint (my-distcheck): Remove -pedantic from $(CFLAGS)
2730         for now, to avoid c89-check failure due to use of #include_next.
2731
2732 2007-05-15  Jim Meyering  <jim@meyering.net>
2733
2734         Generate a dozen test-related Makefile.am files at bootstrap-time.
2735         * README-hacking: Build-from-checkout now require Perl, too.
2736         * bootstrap: Now that these generated Makefile.am files are no longer
2737         under version control, they must be created at bootstrap time.
2738
2739 2007-05-14  Paul Eggert  <eggert@cs.ucla.edu>
2740
2741         * man/chmod.x: Document chmod's behavior with setuid and setgid bits.
2742         Remove misleading implication about leading zero.  Problem
2743         reported by Jan Engelhardt in
2744         <http://lists.gnu.org/archive/html/bug-coreutils/2007-05/msg00134.html>.
2745
2746 2007-05-13  Jim Meyering  <jim@meyering.net>
2747
2748         Remove the generated tests/*/Makefile.am files from version control.
2749         * tests/cut/Makefile.am: git-remove this generated file.
2750         * tests/head/Makefile.am: Likewise.
2751         * tests/join/Makefile.am: Likewise.
2752         * tests/pr/Makefile.am: Likewise.
2753         * tests/sort/Makefile.am: Likewise.
2754         * tests/tac/Makefile.am: Likewise.
2755         * tests/tail/Makefile.am: Likewise.
2756         * tests/test/Makefile.am: Likewise.
2757         * tests/tr/Makefile.am: Likewise.
2758         * tests/uniq/Makefile.am: Likewise.
2759         * tests/wc/Makefile.am: Likewise.
2760         * .cvsignore, .gitignore: Ignore these generated files.
2761
2762         * src/.cvsignore, src/.gitignore: Add chcon here, ...
2763         * .cvsignore, .gitignore: ... not here.
2764
2765         Test uniq's new --zero-terminated (-z) option.
2766         * tests/uniq/Test.pm: When possible, create a "-z"-testing variant
2767         of each existing test.
2768         (2z, 3z, 4z, 5z, 20z, 122, 123): New tests from James Youngman.
2769
2770 2007-05-12  James Youngman  <jay@gnu.org>
2771
2772         Add -z option to uniq.  Originally proposed by Egmont Koblinger.
2773         * NEWS: Mention uniq's new option: --zero-terminated (-z).
2774         * src/uniq.c: Add new option, --zero-terminated (-z), to make
2775         uniq use the NUL byte as separator/delimiter rather than newline.
2776         (check_file): Add a parameter: delimiter.  Update caller.
2777         Use readlinebuffer_delim in place of readlinebuffer everywhere.
2778         (main): Handle the new option.
2779         (usage): Describe new option the same way sort does.
2780         * doc/coreutils.texi (uniq invocation): Describe the new option.
2781
2782 2007-05-07  Jim Meyering  <jim@meyering.net>
2783
2784         * NEWS: Mention that last week's tr bug dates back to 1992.
2785
2786 2007-05-04  Jim Meyering  <jim@meyering.net>
2787
2788         Avoid test failure when run with an unusual umask.
2789         * tests/ls/color-dtype-dir: Set umask to 022.
2790         Suggestion from AIDA Shinra.
2791
2792         Avoid failure of root-only test when run with a restrictive umask.
2793         * tests/rm/no-give-up: Ensure that non-root can access "d/" through
2794         root-owned ".".  Reported by AIDA Shinra.
2795
2796         tr -c: don't abort when translating with S2 larger than complement of S1
2797         * src/tr.c (main): Remove invalid assertion triggered by e.g.,
2798         tr -c a '[b*256]'.  There's nothing wrong with having Set2 larger
2799         than Set1.  Reported by Guntram Blohm.
2800         * tests/tr/Test.pm (no-abort-1): Test for the above.
2801         * NEWS: Mention this bug fix.
2802         * THANKS: Add Guntram Blohm.
2803
2804 2007-05-03  Jim Meyering  <jim@meyering.net>
2805
2806         Avoid test failure when run with a permissive umask.
2807         * tests/rm/no-give-up: Set permissions of test directory properly,
2808         i.e., not depending on umask prohibiting go=w.
2809         Reported by AIDA Shinra.
2810
2811 2007-05-02  Paul Eggert  <eggert@cs.ucla.edu>
2812
2813         The following commands and options now support the standard size
2814         suffixes kB, M, MB, G, GB, and so on for T, P, Y, Z, and Y:
2815         head -c, head -n, od -j, od -N, od -S, split -b, split -C,
2816         tail -c, tail -n.
2817         * doc/coreutils.texi (od invocation, head invocation, tail invocation):
2818         Document support for new size suffixes.
2819         (head invocation, tail invocation):
2820         Document that -n uses the same suffixes as -c.
2821         (tail invocation): More-clearly document what leading "+" does.
2822         * src/head.c (usage, string_to_integer): Support new suffixes.
2823         * src/od.c (usage, main): Likewise.
2824         * src/split.c (usage, main): Likewise.
2825         * src/tail.c (usage, parse_options): Likewise.
2826         Prompted by a patch from Evan Hunt.
2827
2828 2007-05-02  Jim Meyering  <jim@meyering.net>
2829
2830         * src/du.c (usage): Tweak description of --dereference-args (-D) again.
2831         Prompted by another request for clarification from Justin Pryzby.
2832
2833         Invoke rm via 'setuidgid ... env PATH="$PATH" ...', as in fail-eperm.
2834         * tests/rm/fail-2eperm: Patch from AIDA Shinra.
2835         Reported by Peter Dyballa.
2836         * THANKS: Add AIDA Shinra and Peter Dyballa.
2837
2838 2007-04-28  Paul Eggert  <eggert@cs.ucla.edu>
2839
2840         * src/nohup.c (usage): Describe how standard input and output
2841         are redirected.
2842
2843 2007-04-25  Jim Meyering  <jim@meyering.net>
2844
2845         * src/du.c (usage): Clarify description of --dereference-args (-D).
2846         Prompted by a report from Justin Pryzby.
2847
2848         * bootstrap.conf (gnulib_modules): Add fseeko and ftello.
2849         (gnulib_modules): Add autobuild.
2850
2851 2007-04-24  Jim Meyering  <jim@meyering.net>
2852
2853         * THANKS: Add Andreas Frische.
2854         * NEWS: Mention today's ls --color fix.
2855         * tests/ls-2/tests (sl-dangle): Add a test for today's fix.
2856
2857 2007-04-24  Eric Blake  <ebb9@byu.net>
2858
2859         ls --color once again colors dangling symlinks correctly
2860         * src/ls.c (gobble_file): Much like the 2007-04-07 fix,
2861         add a term to the expression that decides whether we need
2862         stat and/or lstat calls.  Reported by Andreas Frische.
2863
2864 2007-04-16  Jim Meyering  <jim@meyering.net>
2865
2866         * src/cut.c (usage): Adjust synopsis to show that an OPTION is required.
2867         Reported by Rudolf Kastl.
2868         * THANKS: Add Rudolf Kastl.
2869
2870 2007-04-11  Paul Eggert  <eggert@cs.ucla.edu>
2871
2872         split --line-bytes=N (-C N): don't create an empty file.
2873         * src/split.c (line_bytes_split): Don't create an empty line
2874         afterwards if the last buffer happens to be exactly full.
2875         * tests/misc/split-fail: Add a test case for this.
2876         * NEWS: mention this.
2877
2878 2007-04-10  Jim Meyering  <jim@meyering.net>
2879
2880         ls: don't form or compute the length of strings that won't be used.
2881         * src/ls.c (gobble_file): Form and compute length of strings for
2882         block size, owner, group, author, major+minor numbers and file size
2883         only if they'll actually be used.  I.e., don't form most of them
2884         when not producing long format output.
2885
2886 2007-04-07  Jim Meyering  <jim@meyering.net>
2887
2888         Add a test for, and document, today's fix.
2889         * NEWS: Mention today's ls --color fix.
2890         * tests/ls-2/tests (sl-target): Add a test for today's fix.
2891         * THANKS: Add Kirk Kelsey.
2892
2893 2007-04-07  Eric Blake  <ebb9@byu.net>
2894
2895         Fix a bug in how the LS_COLORS ln=target attribute is handled.
2896         * src/ls.c (gobble_file): Use "stat" (not lstat) also when the
2897         ln=target attribute applies.  Reported by Kirk Kelsey.
2898
2899 2007-04-02  Jim Meyering  <jim@meyering.net>
2900
2901         * src/copy.c (copy_reg): Initialize local "con", before calling
2902         getfscreatecon, in case that function (or its inline stub) does
2903         not set it.
2904
2905 2007-04-01  Paul Eggert  <eggert@cs.ucla.edu>
2906
2907         * src/ls.c (print_horizontal): Fix bug reported by Mike Frysinger:
2908         ls -x DIR would sometimes output the wrong string in place of the
2909         first entry.
2910         * NEWS: Mention the bug fix.
2911         * tests/ls/x-option: New file.
2912         * tests/ls/Makefile.am (TESTS): Add x-option.
2913
2914         gnulib moved md5 and sha1 modules into a new crypt/ directory; adapt
2915         * bootstrap.conf (gnulib_modules): Adjust to gnulib's renaming of
2916         md5 to crypt/md5 and sha1 to crypt/sha1.
2917
2918 2007-03-30  Jim Meyering  <jim@meyering.net>
2919
2920         * NEWS: Mention these SELinux changes.
2921
2922         * ChangeLog-selinux: Remove file.
2923         Move its contents into this file, removing old dates.
2924
2925         * src/runcon.c (main): Don't reorder arguments.  Reported by
2926         Ulrich Drepper in <http://bugzilla.redhat.com/232652>.
2927         * tests/misc/runcon-no-reorder: New file.  Test for the above.
2928         * tests/misc/Makefile.am (TESTS): Add runcon-no-reorder.
2929
2930         * src/runcon.c (main): Remove "." at end of a diagnostic.
2931
2932         * src/runcon.c: New program.
2933         * src/Makefile.am (bin_PROGRAMS): Add runcon.
2934         (runcon_LDADD): Define.
2935         * README: Add runcon to the list of programs.
2936         * AUTHORS: Add this: runcon: Russell Coker
2937         * tests/help-version: Add runcon as an exception.
2938         * man/Makefile.am (dist_man_MANS): Add runcon.1.
2939         (runcon.1): New dependency.
2940
2941         mkfifo, mknod: Accept new "-Z, --context=C" option.
2942         * src/mkfifo.c, src/mknod.c: Include <selinux/selinux.h>.
2943         (main): Honor it.
2944         * src/Makefile.am (mkfifo_LDADD, mknod_LDADD): Use $(LIB_SELINUX).
2945
2946         mkdir: Accept new "-Z, --context=C" option.
2947         * src/mkdir.c: Include <selinux/selinux.h>.
2948         (main): Honor it.
2949         * src/Makefile.am (mkdir_LDADD): Use $(LIB_SELINUX).
2950
2951         * tests/cp/cp-a-selinux: New file.  Test for the bug reported in
2952         <http://bugzilla.redhat.com/219900>.
2953         * tests/cp/Makefile.am (TESTS): Add cp-a-selinux.
2954
2955         * tests/selinux: New file.
2956         * tests/Makefile.am (EXTRA_DIST): Add selinux.
2957         * tests/misc/selinux: Source the new script, rather than open coding it.
2958
2959         Change how "cp -a" and "cp --preserve=context" work with SELinux.
2960         Now, cp -a attempts to preserve context, but failure to do so does
2961         not change cp's exit status.  However "cp --preserve=context" is
2962         similar, but failure *does* cause cp to exit with nonzero status.
2963         * src/copy.h (struct cp_options) [require_preserve_context]: New member.
2964         * src/copy.c (copy_reg, copy_internal): Implement the above.
2965         * src/mv.c (cp_option_init): Initialize the new member.
2966         * src/install.c (cp_option_init): Likewise.
2967         * src/cp.c (cp_option_init): Likewise.
2968         (decode_preserve_arg): Set it or reset it.
2969
2970         cp, mv, install: add SELinux support, but unlike with the Red Hat
2971         patch, mv and cp do not provide the "-Z context" option.
2972         * src/copy.c: Include <selinux/selinux.h>.
2973         (restore_default_fscreatecon): New function.
2974         (copy_reg): Make cp --preserve=context work for existing destination.
2975         (copy_internal): Likewise for new destinations.
2976         * src/copy.h (cp_options) [preserve_security_context]: New member.
2977         * src/cp.c: Include <selinux/selinux.h>.
2978         (selinux_enabled): New global.
2979         (usage): Mention new --preserve=context option.
2980         (PRESERVE_CONTEXT): Define/use.
2981         (decode_preserve_arg): Handle PRESERVE_CONTEXT.
2982         (main): Remove an obsolete comment.
2983         If --preserve=context is specified on a system without SELinux
2984         enabled, give a diagnostic and fail.
2985         * src/mv.c: Include <selinux/selinux.h>.
2986         Set x->preserve_security_context if SELinux is enabled.
2987         * src/install.c: Accept new "-Z, --context=C" option.
2988         Accept --preserve-context option (but not -P option).
2989         Accept alternate spelling: --preserve_context, for now.
2990         Include <selinux/selinux.h> and "quotearg.h".
2991         (selinux_enabled, use_default_selinux_context): New globals.
2992         (PRESERVE_CONTEXT_OPTION): Define.
2993         (cp_option_init): Default: do not preserve security context.
2994         (setdefaultfilecon): New function.
2995         (main): Honor new options.
2996         * src/Makefile.am (mv_LDADD, cp_LDADD, ginstall_LDADD):
2997         Add $(LIB_SELINUX).
2998         * src/system.h (GETOPT_SELINUX_CONTEXT_OPTION_DECL): Define.
2999
3000         * tests/misc/selinux [VERBOSE]: Print version info for each
3001         of the tested tools, not just ls.
3002
3003         * src/c99-to-c89.diff: Remove the ls.c patch, now that I've
3004         temporarily removed the offending c99'ism.
3005
3006         * src/chcon.c (usage): Split a string literal that was longer than 509.
3007
3008         * src/ls.c (gobble_file): Don't call getfilecon unless print_scontext.
3009         Upon failed getfilecon, accept not just ENOTSUP, but also ENODATA.
3010
3011         * src/c99-to-c89.diff: Adjust offsets.
3012
3013         * AUTHORS: Add chcon.
3014
3015         * src/c99-to-c89.diff: Remove trailing blanks.
3016
3017         * src/chcon.c: Don't include "dirname.h".  system.h already includes it.
3018
3019         * gl/lib/selinux-at.c: Remove a use of HAVE_CONFIG_H.
3020
3021         * src/c99-to-c89.diff: Handle a new c99'ism in ls.c.
3022
3023         * src/id.c (main): Tweak id -Z diagnostic.
3024
3025         id: Add SELinux support: -Z option.
3026         * src/id.c (main): Apply patches from Fedora, with these changes:
3027         Remove #ifdef WITH_SELINUX.
3028         Use error (EXIT_FAILURE, not fprintf+exit(1).
3029         * src/Makefile.am (id_LDADD): Define, so as to add $(LIB_SELINUX).
3030
3031         stat: Add support for SELinux in the form of a %C format directive.
3032         * src/stat.c (follow_links): Make this variable file-global.
3033         (out_file_context): New function.
3034         (print_statfs): Honor %C.
3035         (print_stat): Honor %C.
3036         (do_stat): Remove follow_links parameter.
3037         (usage): Document the two %C directives.
3038         (main): Accept -Z (though it's a no-op).
3039         * src/Makefile.am (stat_LDADD): Define.
3040
3041         ls: Add support for SELinux and a slightly modified -Z option.
3042         I started with the patches from Red Hat.
3043         The entries below tell how the code evolved.
3044
3045         * src/ls.c (print_long_format, print_file_name_and_frills): When
3046         there is no security context (due to getfilecon/lgetfilecon failing
3047         with e.g. ENOTSUP), print it as "?", not "".
3048         * src/ls.c (print_file_name_and_frills): Make -Z work without -l.
3049         (length_of_file_name_and_frills): Likewise.
3050
3051         * src/ls.c: Remove the --lcontext and --scontext options.
3052         Change the way -Z, --context work so that it no longer implies -l.
3053         Thus, -Z -l will work like -lcontext and -Z without -l will work
3054         like --scontext.
3055
3056         Adjust tests to reflect new 'ls -l' syntax -- affects only
3057         systems with SELinux when operating on a file with no ACL.
3058         These tests assumed that everything before the first space on
3059         each line is the 10-byte mode string.  But there may also be a "+"
3060         in the 11th column, just before the space.  However, note that this
3061         is not new.  The same thing would have happened even without the
3062         change below, when listing a file with an ACL.
3063         * tests/chmod/equals, tests/cp/cp-parents, tests/cp/fail-perm:
3064         * tests/cp/link-preserve, tests/install/basic-1, tests/misc/mknod:
3065         * tests/mkdir/parents, tests/mkdir/special-1, tests/mv/partition-perm:
3066
3067         Don't make compilation depend on USE_ACL.  An SELinux security
3068         context counts as an "alternate access control method", so ls
3069         must output a "+" for each file with a security context.
3070         * src/ls.c [struct fileinfo] (have_acl): Declare unconditionally.
3071         (FILE_HAS_ACL): Remove macro definition.  Use f->have_acl directly.
3072         (gobble_file): Record whether a file has a security context, and
3073         update the condition used to determine whether to print the "+".
3074         (gobble_file): Call getfilecon/lgetfilecon also when
3075         format == long_format, so that we get the "+".
3076
3077         * src/ls.c (gobble_file): Add a comment explaining why (with a
3078         security context option) ls doesn't exit nonzero due to e.g.,
3079         getfilecon failing with errno == ENOTSUP.
3080
3081         * src/ls.c (gobble_file): Ignore failure of getfilecon if it's due
3082         to ENOTSUP.
3083
3084         * src/ls.c (gobble_file): Factor out three small blocks using
3085         getfilecon and lgetfilecon.
3086         Don't ignore return value from getfilecon and lgetfilecon.
3087
3088         * src/ls.c (print_long_format): Don't use ?: (empty 2nd arg with C
3089         ternary operator).
3090         (print_scontext_format): Likewise.
3091         (print_scontext): Declare to be "bool", not int.  Adjust uses.
3092
3093         * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Add $(LIB_SELINUX).
3094
3095         * tests/misc/chcon: New file.
3096         * tests/misc/chcon-fail: New file.
3097         * tests/Makefile.am (check-root): Run new, root-only misc/chcon test.
3098         * tests/misc/Makefile.am (TESTS): Add chcon and chcon-fail.
3099
3100         * tests/misc/Makefile.am (TESTS): Add selinux.
3101         * tests/misc/selinux: New file.
3102         * tests/help-version: Skip chcon.
3103         * man/chcon.x: New file.
3104         * man/Makefile.am: Build chcon.1.
3105
3106         New program: chcon
3107         * gl/modules/selinux-at: New module.  Check for libselinux and set
3108         LIB_SELINUX here, unconditionally, rather than depending on
3109         the configure-time --enable-selinux option.
3110         * gl/modules/selinux-h: New module.
3111         * bootstrap.conf (gnulib_modules): Add selinux-at.
3112         * gl/lib/selinux-at.c, gl/lib/selinux-at.h: New files.
3113         * gl/lib/se-selinux_.h: New file.
3114         * gl/lib/se-context_.h: New file.
3115         * gl/m4/selinux-selinux-h.m4: New file.
3116         * gl/m4/selinux-context-h.m4: New file.
3117         * src/Makefile.am (bin_PROGRAMS): Add chcon.
3118         (chcon_LDADD): Define.
3119         * README: Add chcon to the list of programs.
3120         * src/chcon.c: Rewrite the original (Red Hat) chcon to use fts.
3121
3122 2007-03-29  Jim Meyering  <jim@meyering.net>
3123
3124         * .vg-suppressions: Add libc-getpwuid-leak.
3125
3126 2007-03-28  Jim Meyering  <jim@meyering.net>
3127
3128         Help translators include translation team's web or email address.
3129         * src/system.h (emit_bug_reporting_address): New function.
3130         * src/base64.c: Use it rather than a literal printf.
3131         * src/basename.c, src/cat.c, src/chgrp.c, src/chmod.c:
3132         * src/chown.c, src/chroot.c, src/cksum.c, src/comm.c, src/cp.c:
3133         * src/csplit.c, src/cut.c, src/date.c, src/dd.c, src/df.c:
3134         * src/dircolors.c, src/dirname.c, src/du.c, src/echo.c, src/env.c:
3135         * src/expand.c, src/expr.c, src/factor.c, src/fmt.c, src/fold.c:
3136         * src/head.c, src/hostid.c, src/hostname.c, src/id.c, src/install.c:
3137         * src/join.c, src/kill.c, src/link.c, src/ln.c, src/logname.c:
3138         * src/ls.c, src/md5sum.c, src/mkdir.c, src/mkfifo.c, src/mknod.c:
3139         * src/mv.c, src/nice.c, src/nl.c, src/nohup.c, src/od.c:
3140         * src/paste.c, src/pathchk.c, src/pinky.c, src/pr.c, src/printenv.c:
3141         * src/printf.c, src/ptx.c, src/pwd.c, src/readlink.c, src/rm.c:
3142         * src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c, src/shuf.c:
3143         * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c:
3144         * src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac.c:
3145         * src/tail.c, src/tee.c, src/test.c, src/touch.c, src/tr.c:
3146         * src/true.c, src/tsort.c, src/tty.c, src/uname.c, src/unexpand.c:
3147         * src/uniq.c, src/unlink.c, src/uptime.c, src/users.c, src/wc.c:
3148         * src/who.c, src/whoami.c, src/yes.c: Likewise.
3149
3150         * src/stty.c: Don't include "vasprintf.h", now that its
3151         declarations are guaranteed to be in gnulib's stdio.h.
3152         * src/who.c: Likewise.
3153
3154 2007-03-27  Jim Meyering  <jim@meyering.net>
3155
3156         * README: Use "install", not "ginstall" in the list of program names.
3157         * src/Makefile.am (check-README): Substitute s/ginstall/install/.
3158
3159 2007-03-25  Jim Meyering  <jim@meyering.net>
3160
3161         * src/c99-to-c89.diff: Regenerate.
3162
3163 2007-03-25  Paul Eggert  <eggert@cs.ucla.edu>
3164
3165         Avoid the need for euidaccess and/or lstat on every directory entry
3166         with 'rm -r dir' (without -f), if we are root, or if we are removing
3167         a directory tree that is full of symbolic links.
3168         * bootstrap.conf (gnulib_modules): Add write-any-file.
3169         * src/copy.c: Include write-any-file.h.
3170         (UNWRITABLE): Remove macro, replacing with....
3171         (writable_destination): New function, which uses can_write_any_file
3172         to avoid the need for euidaccess when we are privileged.
3173         (overwrite_prompt, abandon_move): Use it.
3174         * src/remove.c: Include write-any-file.h.
3175         (D_TYPE): New macro.
3176         (DT_UNKNOWN, DT_DIR, DT_LNK) [!HAVE_STRUCT_DIRENT_D_TYPE]: New macros.
3177         (write_protected_non_symlink): Don't bother to stat if we can write
3178         any file.
3179         (prompt): New arg PDIRENT_TYPE.  All callers changed.
3180         Use readdir dirent type to avoid the need for 'lstat' on each directory
3181         entry in cases like 'rm -r dir', if we are root, or if the tree is
3182         full of symbolic links.
3183         (DT_IS_KNOWN, DT_MUST_BE): Remove.
3184         (remove_entry): New arg DIRENT_TYPE_ARG.  All callers changed.
3185
3186 2007-03-24  Jim Meyering  <jim@meyering.net>
3187
3188         If strace malfunctions, skip the test rather than failing it.
3189         * tests/mv/atomic: Required on a mips-unknown-linux-gnu system
3190         running the aging linux-2.4.27-mipscvs-20040814.
3191
3192 2007-03-23  Paul Eggert  <eggert@cs.ucla.edu>
3193
3194         * src/pathchk.c: Don't include euidaccess.h, as we don't call
3195         euidaccess.
3196
3197 2007-03-23  Jim Meyering  <jim@meyering.net>
3198
3199         * README-package-renamed-to-coreutils: Add a URL for the FAQ,
3200         and a couple more archive links.
3201
3202 2007-03-22  Jim Meyering  <jim@meyering.net>
3203
3204         Post-release version change.
3205         * NEWS: Add a line for 6.9+.
3206         * configure.ac (AC_INIT): Set new version string.
3207
3208         Version 6.9.
3209         * NEWS: Record release date and new version number.
3210         * configure.ac (AC_INIT): New version number.
3211
3212         * tests/mv/hard-3: Correct the preceding change: $3 -> $2.
3213
3214 2007-03-22  Paul Eggert  <eggert@cs.ucla.edu>
3215
3216         Improve a test script.
3217         * tests/mv/hard-3: Check for 'ls' failure, too.
3218         Generate more-useful debugging output when 'ls' fails.
3219
3220 2007-03-21  Jim Meyering  <jim@meyering.net>
3221
3222         Fix a test script not to claim an ext2 file system is of type xfs.
3223         * tests/du/slink: When using df --local and df --type=TYPE,
3224         test only the exit code.  Don't bother with stdout.
3225         Prompted by a report by Thomas Schwinge of an inaccurate diagnostic.
3226
3227         * gl/lib/savewd.c: Remove this file, since the savewd_save change
3228         is now in gnulib.  The other wasn't useful.
3229
3230 2007-03-20  Jim Meyering  <jim@meyering.net>
3231
3232         * gl/lib/acl.c: Remove this file, now that gnulib's version subsumes it.
3233
3234         Skip part of this test when "." is not a local file system.
3235         * tests/install/basic-1: Otherwise, it would fail on some NFS
3236         file systems.
3237         * tests/mkdir/p-3: Likewise.
3238
3239 2007-03-19  Paul Eggert  <eggert@cs.ucla.edu>
3240
3241         * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD):
3242         Add $(LIB_ACL_TRIVIAL).
3243
3244 2007-03-18  Jim Meyering  <jim@meyering.net>
3245
3246         Fix a generic NFS-related test failure.
3247         * tests/mkdir/p-3: When setting up an unreadable "." in an
3248         inaccessible parent, make the parent inaccessible *after* making "."
3249         unreadable.  Otherwise, running "chmod a-r ." in an already-
3250         inaccessible parent would fail on NFS with "Stale NFS file handle".
3251
3252         Fix a bug in how pr -m -s works.
3253         * NEWS: Describe how the fix affects pr.
3254         * src/pr.c (init_parameters): The --merge (-m) option does
3255         not imply --expand-tabs (-e), so don't set "untabify_input".
3256         Reported by Wis Macomson.
3257         * tests/misc/pr: New file.  Test for the above fix.
3258         * tests/misc/Makefile.am (TESTS): Add pr.
3259         * THANKS: Update.
3260
3261 2007-03-17  Jim Meyering  <jim@meyering.net>
3262
3263         Detect use of AC_CONFIG_AUX_DIR also when its argument is quoted.
3264         * bootstrap: Put ""s around use of $build_aux, in case
3265         someone uses a name containing shell meta-characters.
3266         Reported by Alfred M. Szmidt.
3267         * tests/misc/tty-eof: Add shuf to the list of tested commands.
3268
3269         Avoid test failure on NFS-mounted Solaris ZFS file system.
3270         * tests/du/basic: Skip a test if "." is on a non-local file system.
3271
3272         Avoid an obscure build failure, prefer waitpid over wait.
3273         * src/install.c (strip): Use waitpid, not wait.  It's equivalent,
3274         but feels less obsolescent.
3275
3276         * bootstrap: Don't use \> in grep regexp.  For HP-UX.
3277
3278 2007-03-16  Jim Meyering  <jim@meyering.net>
3279
3280         Begin adding support for Solaris ZFS (4 entries per trivial ACL)
3281         * gl/lib/acl.c (ACL_NOT_WELL_SUPPORTED): New macro.
3282         (file_has_acl, copy_acl): Use it, rather than enumerating errno values.
3283         (is_trivial_acl): New function.  Incomplete, for now.
3284         (file_has_acl, copy_acl): Use the new function, rather than
3285         counting the number of entries in an ACL.
3286
3287         * bootstrap: Update from gnulib.
3288
3289         * .x-sc_prohibit_atoi_atof: Add TODO here, too.
3290
3291 2007-03-16  Paul Eggert  <eggert@cs.ucla.edu>
3292
3293         * src/copy.c: Include filemode.h.
3294         (overwrite_prompt): Say "try to overwrite", not "overwrite", to
3295         make it clearer that the attempt may fail.  Problem reported by
3296         Dan Jacobson in:
3297         http://lists.gnu.org/archive/html/bug-coreutils/2007-03/msg00130.html
3298         Output symbolic mode as well as numeric.
3299         * tests/mv/i-2 (fail): Adjust to new prompt format.
3300
3301 2007-03-15  Jim Meyering  <jim@meyering.net>
3302
3303         Enforce policy: don't use *scanf functions.
3304         * Makefile.maint (sc_prohibit_atoi_atof): Add to regexp and diagnostic.
3305         * .x-sc_prohibit_atoi_atof: Give stty a temporary pass.
3306         * TODO: note that stty.c needs this small clean-up.
3307
3308 2007-03-13  Jim Meyering  <jim@meyering.net>
3309
3310         Prepare to work on ACL-related failure when using Solaris ZFS.
3311         * gl/lib/acl.c: New file, copied from gnulib.
3312
3313         Work around a failing test due to an NFS-based race condition.
3314         * tests/cp/sparse: Accept a report that the copy is *smaller*.
3315
3316 2007-03-12  Jim Meyering  <jim@meyering.net>
3317
3318         Make bootstrap.conf a tiny bit more generic.
3319         * bootstrap.conf (XGETTEXT_OPTIONS): Exclude gettext-related .m4
3320         files when e.g., AM_GNU_GETTEXT([external] appears in configure.ac.
3321
3322 2007-03-10  Jim Meyering  <jim@meyering.net>
3323
3324         Try to fix today's NFS-related failure: Treat ESTALE like EACCES.
3325         * gl/lib/savewd.c: Copy this file from gnulib, then change
3326         "errno != EACCES" to (errno != EACCES && errno != ESTALE).
3327         The symptom was this failure in tests/install/basic-1:
3328         ginstall: cannot create directory `rel/a': Stale NFS file handle
3329
3330         The preceding change solved part of the problem.  Now ginstall fails.
3331         * tests/install/basic-1: Temporarily, don't redirect ginstall's
3332         stderr to /dev/null, so I can see why the NFS autobuilder's NFS test
3333         is failing.
3334
3335         * tests/install/basic-1: When setting up an unreadable "." in an
3336         inaccessible parent, make the parent inaccessible *after* making "."
3337         unreadable.  Otherwise, running "chmod a-r ." in an already-
3338         inaccessible parent would fail on NFS with "Stale NFS file handle".
3339         Reported by Bob Proulx.
3340
3341         * Makefile.maint (po-check): Exclude c99-to-c89.diff.
3342
3343 2007-03-09  Jim Meyering  <jim@meyering.net>
3344
3345         Avoid test failures on Darwin 7.9.0 (MacOS X 10.3.9)
3346         * tests/chgrp/basic: Don't let failure by chgrp to set the
3347         group of a symlink make this test fail.  Do give a diagnostic.
3348         In the chgrp-no-change-ctime test, add darwin7.9.0 as another
3349         known-failing system.
3350         When failing on some other system, print $host_triplet, too.
3351         Also avoid test failures on Darwin 8.8.x (MacOS X 10.4).
3352         Reported by Peter Fales.
3353
3354 2007-03-08  Jim Meyering  <jim@meyering.net>
3355
3356         * src/c99-to-c89.diff: Reflect the new c99'ism, update offsets.
3357
3358 2007-03-08  Paul Eggert  <eggert@cs.ucla.edu>
3359
3360         rm without -f: give a better diagnostic when euidaccess fails.
3361         * src/remove.c (write_protected_non_symlink): Return int, not bool,
3362         so that we can indicate failure too (as a postive error number).
3363         (prompt): If write_protected_non_symlink fails, report that error
3364         number and fail rather than charging ahead and removing the dubious
3365         entry.  Redo the logic of printing a diagnostic so that we need to
3366         invoke quote (full_filename (...)) only once.  More details at:
3367         <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9952/focus=9996>
3368
3369 2007-03-08  Jim Meyering  <jim@meyering.net>
3370
3371         Generalize a few more cvs-isms.
3372         * bootstrap (checkout_only_file): Rename from CVS_only_file.
3373         Change comments and diagnostics not to say "CVS".
3374
3375         * bootstrap: Run libtool, if necessary.
3376
3377         Make bootstrap a little more general.
3378         * bootstrap (build_aux): Factor out/use this definition.
3379         Formally require a "AC_CONFIG_AUX_DIR($build_aux)" line in configure.ac.
3380         (insert_sorted_if_absent): Move function definition "up", to
3381         precede new first use.
3382         If $build_aux/ doesn't exist initially, create it, and
3383         mark it as ignored.
3384
3385 2007-03-03  Andrew Church  <achurch@achurch.org>  (tiny change)
3386             Paul Eggert  <eggert@cs.ucla.edu>
3387
3388         Fix a bug: cp -x would fail to set mount point permissions.
3389         * NEWS: mention cp -x bug fix
3390         * src/copy.c (copy_internal): Don't return immediately after
3391         copying a mount point that we do not intend to recurse under.
3392         Based on a patch by Andrew Church.
3393
3394 2007-03-03  Jim Meyering  <jim@meyering.net>
3395
3396         pwd-unreadable-parent: Skip test on ia64/Linux, too.
3397         * tests/misc/pwd-unreadable-parent: Also skip when $REPLACE_GETCWD.
3398         Reported by Bob Proulx.
3399
3400 2007-03-02  Jim Meyering  <jim@meyering.net>
3401
3402         pwd-unreadable-parent: Skip test on non-Linux/GNU systems.
3403         * tests/misc/pwd-unreadable-parent: Rather than trying to decide
3404         whether this test has a chance of succeeding, run it only when
3405         $(host_os) is linux-gnu.  It was failing on powerpc-apple-darwin8.8.0
3406         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Add host_os=$(host_os).
3407
3408         * tests/misc/pwd-long: Also allow "+" in $PWD.
3409
3410         Remove another coreutils-ism.  Formatting cleanup.
3411         * Makefile.maint (my-distcheck): Update an outdated comment.
3412         (emit_upload_commands): Use $(PACKAGE) rather than "coreutils".
3413         (my-distcheck): Skip the c99/c89 check if there's no such .diff file.
3414
3415 2007-03-01  Jim Meyering  <jim@meyering.net>
3416
3417         * Makefile.maint (warn_cflags): Hoist, adding "-Dlint -O".
3418         (my-distcheck): Use the new variable, instead of too-long literal.
3419
3420         Make "make syntax-check" rules less coreutils-specific.
3421         * Makefile.maint (sc_cast_of_x_alloc_return_value): Use CVS_LIST_EXCEPT.
3422         (sc_cast_of_alloca_return_value): Likewise.
3423         (sc_root_tests): Do nothing if there is no check-root target
3424         in tests/Makefile.am.
3425
3426         Run the writable-files check only for release-building targets.
3427         * Makefile.maint (local-checks-available): Remove writable-files.
3428         (alpha beta major): Put it here, instead.
3429
3430         "make syntax-check" now runs only Makefile.cfg-selected tests
3431         * Makefile.maint (syntax-check-rules): Hoist this definition so that
3432         it precedes the indirect use in the definition of $(local-check).
3433         (local-check): Use :=, not just "=".
3434         (syntax-check): Depend on $(local-check), not $(syntax-check-rules).
3435
3436 2007-02-28  Bruno Haible  <bruno@clisp.org>
3437
3438         * bootstrap.conf (gnulib_modules): Replace xreadlink with
3439         xreadlink-with-size. Add xreadlink.
3440         * src/copy.c (copy_internal): Update.
3441         * src/ls.c (is_directory): Update.
3442         * src/stat.c (print_stat): Update.
3443         * src/readlink.c (main): Use the one-argument xreadlink function.
3444
3445 2007-02-28  Paul Eggert  <eggert@cs.ucla.edu>
3446
3447         * doc/coreutils.texi (Common options): --si outputs "M", not "MB".
3448         Problem reported by Philip Rowlands in
3449         <http://lists.gnu.org/archive/html/bug-coreutils/2007-02/msg00283.html>.
3450
3451 2007-02-28  Jim Meyering  <jim@meyering.net>
3452
3453         * .x-sc_file_system: Add the new test, tests/misc/df-P, to this
3454         list of exceptions, for the "make distcheck" sc_file_system rule.
3455
3456         * Makefile.maint (gnulib_snapshot_date): Remove now-unused definition.
3457
3458 2007-02-27  Paul Eggert  <eggert@cs.ucla.edu>
3459
3460         Make df -P immune to effects of e.g., the BLOCK_SIZE envvar.
3461         * NEWS: With -P, the default block size and output format is not
3462         affected by DF_BLOCK_SIZE, BLOCK_SIZE, or BLOCKSIZE.
3463         * src/df.c (main): Implement this.
3464
3465 2007-02-27  Jim Meyering  <jim@meyering.net>
3466
3467         Add a test for the above.
3468         * tests/misc/df-P: New file.
3469         * tests/misc/Makefile.am (TESTS): Add df-P.
3470
3471 2007-02-25  Jim Meyering  <jim@meyering.net>
3472
3473         * Makefile.maint (announcement): Adjust so that it works with
3474         announce-gen's --gnulib-snapshot-time-stamp option.
3475         Indent one of the command lines using TAB, not 8 spaces.
3476
3477         Post-release version change.
3478         * NEWS: Add a line for 6.8+.
3479         * configure.ac (AC_INIT): Set new version string.
3480
3481 2007-02-24  Jim Meyering  <jim@meyering.net>
3482
3483         Version 6.8.
3484         * NEWS: Record release date and new version number.
3485         * configure.ac (AC_INIT): New version number.
3486
3487         Don't skip this test on new-enough Linux/GNU systems.
3488         * tests/misc/pwd-unreadable-parent: Test $REPLACE_GETCWD = 0,
3489         rather than for __GETCWD_PREFIX in config.h (the latter is no
3490         longer defined, ever, due to gnulib changes).
3491         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define REPLACE_GETCWD.
3492
3493         Remove the "gnits" option; it prohibits my using "+" as a version
3494         string suffix, and all it does (beyond the default "gnu" option)
3495         is to _require_ the THANKS file.
3496         * configure.ac (AM_INIT_AUTOMAKE): Remove it.
3497
3498         Remove all AUTOMAKE_OPTIONS settings in Makefile.am files.
3499         * tests/chgrp/Makefile.am, tests/chmod/Makefile.am:
3500         * tests/chown/Makefile.am, tests/cp/Makefile.am:
3501         * tests/du/Makefile.am, tests/expr/Makefile.am:
3502         * tests/factor/Makefile.am, tests/general/Makefile.am:
3503         * tests/install/Makefile.am, tests/ln/Makefile.am:
3504         * tests/ls/Makefile.am, tests/mkdir/Makefile.am:
3505         * tests/mv/Makefile.am, tests/readlink/Makefile.am:
3506         * tests/rm/Makefile.am, tests/rmdir/Makefile.am:
3507         * tests/seq/Makefile.am, tests/stty/Makefile.am:
3508         * tests/tee/Makefile.am, tests/touch/Makefile.am:
3509
3510         * README: Document the OSF/1 4.0d build failure and work-around.
3511         Reported by Bruno Haible.
3512
3513         * NEWS: Use a simple "+" suffix to denote pre-release, not "-dirty".
3514         Nicer connotations.
3515         * configure.ac: Use 6.7+, not 6.7-dirty.
3516
3517 2007-02-24  Paul Eggert  <eggert@cs.ucla.edu>
3518
3519         * NEWS: sort no longer compresses temporaries by default.
3520         * bootstrap.conf: Remove findprog.
3521         * doc/coreutils.texi (sort invocation): The default is to not
3522         compress.  Don't treat "" specially.
3523         * src/sort.c: Don't include findprog.h.
3524         (create_temp): Compress only if the user specified --compress-program.
3525         * tests/misc/sort-compress: Adjusts tests to match new behavior.
3526
3527 2007-02-24  Jim Meyering  <jim@meyering.net>
3528
3529         Avoid a shell syntax error, when building with an inadequate Perl.
3530         * man/Makefile.am (.x.1): Add quotes around $(PERL) in case, since
3531         it can expand to "/.../missing perl".
3532
3533         * man/Makefile.am (.x.1): Warn when unable to update a man page.
3534         Suggestion from Bruno Haible.
3535
3536 2007-02-23  Bruno Haible  <bruno@clisp.org>
3537
3538         Handle better the combination of old Perl and a pre-c99 compiler.
3539         * man/Makefile.am (.x.1): If the autoconf test has determined that
3540         perl is missing or not a sufficient version, do nothing.
3541
3542         * tests/readlink/can-e: Put the closing double-quote at the end of a
3543         backquoted word, not in the middle. Works around a bug in sh on
3544         OSF/1 4.0d.
3545         * tests/readlink/can-f: Likewise.
3546         * tests/readlink/can-m: Likewise.
3547
3548         * tests/du/slink: Skip the test if executing on an nfsv3 file system.
3549         This avoids a test failure at least on OSF/1 4.0d.
3550
3551 2007-02-23  Jim Meyering  <jim@meyering.net>
3552
3553         * src/date.c (usage): Split a diagnostic that had grown to be
3554         longer than the C89 maximum of 509 bytes.
3555
3556 2007-02-23  Ed Santiago <ed@edsantiago.com>
3557
3558         * src/date.c (usage): Mention that --rfc-3339 uses space, not 'T',
3559         for a separator.  Include sample RFC 2822 and 3339 output.
3560
3561 2007-02-23  Jim Meyering  <jim@meyering.net>
3562
3563         With -Dlint, make shuf free all heap-allocated storage.
3564         * src/shuf.c (main): Move declaration of input_lines to
3565         function scope, and initialize to NULL, so we can free it.
3566         [lint]: Free all malloc'd memory.
3567         * tests/misc/shuf: Also test shuf's -e and -i options.
3568
3569 2007-02-22  Jim Meyering  <jim@meyering.net>
3570
3571         Merge in a change from some other incarnation of this file (gzip?)
3572         * bootstrap (gnulib_tool): Skip get_translations if there is no po/ dir.
3573
3574         Adjust preceding change not to perform an unaligned access.
3575         * src/copy.c (copy_reg): Undo previous change.  Instead, make
3576         it clearer that we're using a single-byte sentinel, and
3577         [lint]: Initialize sizeof (uintptr_t) - 1 bytes after the sentinel.
3578         Reported by Andreas Schwab.
3579
3580         Placate valgrind, wrt ./cp --sparse=always
3581         * src/copy.c (copy_reg): Place the sentinel by setting a
3582         full word's worth of bits, not just a single byte's worth.
3583         This avoids a harmless (but distracting) case of memory being
3584         used-uninitialized.
3585
3586 2007-02-21  Paul Eggert  <eggert@cs.ucla.edu>
3587
3588         Honor dd's noatime flag if possible, even if not supported on build fs
3589         * doc/coreutils.texi (dd invocation): Warn that noatime might not be
3590         reliable.
3591         * src/dd.c (flags, usage): Look at O_NOATIME, not
3592         HAVE_WORKING_O_NOATIME, to decide whether to support the noatime
3593         flag, so that dd attempts O_NOATIME even if the build file system
3594         does not support it.  Problem reported by Jim Meyering today in
3595         bug-coreutils.
3596         * tests/dd/misc: Generate a warning, not a failure, if noatime
3597         exists but fails.
3598
3599 2007-02-21  Jim Meyering  <jim@meyering.net>
3600
3601         * tests/misc/date: Remove vestigial use of Data::Dumper.
3602
3603 2007-02-20  Paul Eggert  <eggert@cs.ucla.edu>
3604
3605         * src/copy.c (cached_umask): Cast -1 to mode_t to avoid a warning
3606         about out-of-range initializer with Sun C 5.8.
3607
3608 2007-02-20  Jim Meyering  <jim@meyering.net>
3609
3610         * bootstrap (CVS_only_file): Use README-hacking.
3611
3612         Now that we use GIT, not cvs, rename README-cvs.
3613         * README-hacking: Renamed from...
3614         Update to reflect that we now use git.
3615
3616         * README-cvs: ...this.
3617
3618         * src/env.c (main): When invoked with no arguments (i.e. when printing
3619         the environment), use a local variable to iterate through the global
3620         "environ" array, rather than "environ" itself.  This is solely to
3621         avoid changing the environment for an LD_PRELOAD-substituted "puts"
3622         or "exit" function.  Tiny patch by Harvey Eneman.  See
3623         <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9735>.
3624         * THANKS: Update.
3625
3626         * bootstrap: Move definitions of temporary directory names and the
3627         new bt_regex "up" to precede all uses, so it's clearer what their
3628         scope is.  Also, use [.], rather than \\., since the former works
3629         even if eval'd.
3630
3631         * bootstrap: Remove occurrences of $bt (._bootmp) from lib/Makefile.
3632         Based on the bison 2007-02-19 change by Joel E. Denny.
3633
3634 2007-02-19  Paul Eggert  <eggert@cs.ucla.edu>
3635
3636         * NEWS: sort now uses a --compress-program option rather than
3637         an environment variable.
3638         * doc/coreutils.texi (sort invocation): Document this.
3639         * src/sort.c (usage): Likewise.
3640         (COMPRESS_PROGRAM_OPTION): New const.
3641         (long_options, create_temp, main): Support new option.
3642         * tests/misc/sort-compress: Test it.
3643
3644 2007-02-19  Jim Meyering  <jim@meyering.net>
3645
3646         * bootstrap: Fix typo s/dowloading/downloading/ in --help output.
3647
3648 2007-02-18  Jim Meyering  <jim@meyering.net>
3649
3650         * src/system.h: Don't include exit.h, now that it's subsumed
3651         by the gnulib-generated stdlib.h.
3652
3653         * tests/rm/fail-eacces: Skip this test when running as root.
3654         Reported by Matthew Woehlke.
3655
3656         * bootstrap: Use "._bootmp" as the temporary directory name,
3657         not ".#bootmp".  The latter's "#" caused trouble with the new,
3658         gnulib-added "LINK_WARNING_H = $(top_srcdir)/.#bootmp/..." line.
3659
3660 2007-02-14  Paul Eggert  <eggert@cs.ucla.edu>
3661
3662         * bootstrap.conf (gnulib_modules): Add c-strcase.  Remove strcase.
3663         * src/dircolors.c: Include c-strcase.h.
3664         (dc_parse_stream): Use c_strcasecmp rather than
3665         strcasecmp to avoid unreliable results in locales like Turkish
3666         where strcasecmp is incompatible with the C locale.
3667
3668 2007-02-13  Jim Meyering  <jim@meyering.net>
3669
3670         Also check for and print stderr output, in case a program fails.
3671         * tests/misc/tty-eof: Occasionally (not reproducible), this
3672         test would fail, with one or more programs exiting nonzero, e.g.,
3673         tty-eof: sha224sum exited with status 1 (expected 0)
3674         Now, maybe we'll get a clue, the next time that happens.
3675
3676 2007-02-12  Jim Meyering  <jim@meyering.net>
3677
3678         * .x-sc_useless_cpp_parens: Ignore a false-positive in a shell script.
3679
3680         * tests/misc/pwd-unreadable-parent: Skip the test if we're
3681         definitely using the replacement.
3682         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define CONFIG_HEADER.
3683
3684 2007-02-10  Jim Meyering  <jim@meyering.net>
3685
3686         Remove excess leading spaces that would make help2man misbehave.
3687         * src/printf.c (usage): Remove excess spaces on 2nd line of %b desc.
3688         * src/nl.c (usage): Remove excess spaces on 2nd line of pBRE desc.
3689         * src/dd.c (usage): Remove excess spaces on 2nd line of sync desc.
3690         * src/date.c (usage): Use two spaces after each optional flag, not one.
3691         Reported by Thomas Huriaux in <http://bugs.debian.org/410407>.
3692
3693         * Makefile.maint (longopt_re): Relax the regexp, making square
3694         brackets optional, so it matches the newly reported violations, too.
3695
3696         * src/csplit.c (usage): Use two spaces (not one) to separate
3697         each option string from its description, so help2man formats
3698         the derived man page properly.  Reported by Thomas Huriaux in
3699         <http://bugs.debian.org/410407>.
3700         * src/df.c (usage): Likewise.
3701         * src/du.c (usage): Likewise.
3702         * src/install.c (usage): Likewise.
3703         * src/ls.c (usage): Likewise.
3704
3705 2007-02-03  Jim Meyering  <jim@meyering.net>
3706
3707         Test for today's gnulib/lib/getcwd.c fix affecting pwd and readlink
3708         * NEWS: Mention the bug fix.
3709         * tests/misc/pwd-unreadable-parent: New file.
3710         * tests/misc/Makefile.am (TESTS): Ad pwd-unreadable-parent.
3711
3712 2007-02-02  Paul Eggert  <eggert@cs.ucla.edu>
3713
3714         * NEWS: Document fix for cp --preserve=mode.
3715         * src/copy.c (copy_internal): Omit the group- or other-writeable
3716         permissions when creating a directory, to avoid a race condition
3717         if the special mode bits aren't right just after the directory is
3718         created.
3719         * src/cp.c (make_dir_parents_private): Likewise.
3720         * tests/cp/parent-perm-race: Test for the "cp --preserve=mode"
3721         race fix in copy.c.
3722
3723         * NEWS: Document fix for cp --parents.
3724         * src/cp.c (make_dir_parents_private): Report the error sooner with
3725         "cp --parents DIR/FILE DEST" when DIR is a non-directory, thus not
3726         creating the directory, DEST/DIR.
3727         * tests/cp/cp-parents: Test for the non-race-condition bug fixed
3728         by the above change.
3729
3730 2007-02-02  Jim Meyering  <jim@meyering.net>
3731
3732         * src/nl.c (proc_text): Use "NULL", not "(struct re_registers *) 0".
3733
3734         * src/c99-to-c89.diff: Make shred.c Index: and a/b prefixes
3735         consistent, so this can be applied with patch -p0.
3736         Reported by Matthew Woehlke.
3737
3738         Arrange for "make check-root" to run the new root-only test.
3739         * tests/Makefile.am (t9): New target, to run tests/cp/cp-a-selinux.
3740         (all_t): Add t9.
3741
3742         * Makefile.maint (patch-check): Use patch with its -p2 option,
3743         since that makes this check slightly more strict.
3744
3745         Use a directory on a loopback device mounted with -o context=...
3746         * tests/cp/cp-a-selinux: Since this test now runs mount and umount,
3747         it is a root-only one.
3748
3749 2007-01-29  Jim Meyering  <jim@meyering.net>
3750
3751         Plug a leak in ls.
3752         * src/ls.c (print_dir): Don't leak a "DIR"+fd upon failure to
3753         determine dev/inode or upon detecting a symlink loop.
3754
3755         * src/ls.c: Rename three global variables.
3756         (cwd_file): Rename from 'files'.
3757         (cwd_n_alloc): Rename from 'nfiles'.
3758         (cwd_n_used): Rename from 'files_index'.
3759
3760         Shave 8 bytes off the size of "struct fileinfo".
3761         * src/ls.c (fileinfo): Put all members of type "bool" together.
3762
3763 2007-01-28  Paul Eggert  <eggert@cs.ucla.edu>
3764
3765         Modify "ls" to sort its data faster, using the new gnulib mpsort
3766         module rather than qsort.  This is particularly a win in
3767         environments where strcoll is slow, since mpsort typically calls
3768         strcoll less often than qsort does.
3769         * bootstrap.conf (gnulib_modules): Add mpsort.
3770         * src/ls.c: Include mpsort.h.
3771         (sorted_file, sorted_file_alloc): New vars, for a new vector of
3772         pointers to the file info, for speed.
3773         (clear_files, extract_dirs_from_files, sort_files, print_current_files):
3774         (print_many_per_line, print_horizontal, print_with_commas):
3775         (calculate_columns): Set and use new vector.
3776         (initialize_ordering_vector): New function.
3777
3778 2007-01-26  Paul Eggert  <eggert@cs.ucla.edu>
3779
3780         Adjust to today's change to gnulib, which added a module for
3781         string.h to replace the little include files like strcase.h.
3782         * src/dircolors.c: Don't include strcase.h.
3783         * src/system.h: Don't include mempcpy.h, memrchr.h, stpcpy.h, strpbrk.h.
3784
3785 2007-01-26  Jim Meyering  <jim@meyering.net>
3786
3787         * src/dd.c (advance_input_after_read_error): Change diagnostic to
3788         say "invalid file offset" rather than "screwy file offset".
3789
3790         * .x-sc_cast_of_argument_to_free: Remove this file.
3791         * Makefile.am (EXTRA_DIST): Likewise.
3792
3793 2007-01-25  Dan Hipschman  <dsh@linux.ucla.edu>
3794
3795         * src/sort.c (create_temp): Remove superfluous access-X_OK
3796         check.  find_in_path does this for us.
3797
3798 2007-01-24  Jim Meyering  <jim@meyering.net>
3799
3800         Remove usually-skipped test.
3801         * tests/cp/open-perm-race: Remove this file.  It is subsumed
3802         by parent-perm-race.
3803         * tests/cp/Makefile.am (TESTS): Remove open-perm-race.
3804         * tests/sort/Makefile.am: Regenerate.
3805
3806         Pass "make distcheck" again.
3807         * src/sort.c (usage): Split a diagnostic that had grown to be
3808         longer than the C89 maximum of 509 bytes.
3809         * .x-sc_cast_of_argument_to_free: New file.  Allow a cast in sort.c.
3810         FIXME: this is just temporary, while we wait to remove the offending
3811         access-calling code.
3812         * Makefile.am (EXTRA_DIST): Add .x-sc_cast_of_argument_to_free.
3813         * Makefile.maint (sc_cast_of_argument_to_free): Use the
3814         canonical, $$($(CVS_LIST_EXCEPT)).
3815         * m4/.gitignore, m4/.cvsignore, lib/.gitignore, lib/.cvsignore: Update.
3816
3817 2007-01-24  Paul Eggert  <eggert@cs.ucla.edu>
3818
3819         * NEWS: New option sort -C, proposed by XCU ERN 127, which looks
3820         like it will be approved.  Also add --check=quiet, --check=silent
3821         as long aliases, and --check=diagnose-first as an alias for -c.
3822         * doc/coreutils.texi (sort invocation): Document this.
3823         Also, mention that sort -c can take at most one file.
3824         * src/sort.c: Implement this.
3825         Include argmatch.h.
3826         (usage): Document the change.
3827         (CHECK_OPTION): New constant.
3828         (long_options): --check now takes an optional argument, and is now
3829         treated differently from 'c'.
3830         (check_args, check_types): New constant arrays.
3831         (check): New arg CHECKONLY, which suppresses diagnostic if -C.
3832         (main): Parse the new options.
3833         * tests/sort/Test.pm (02d, 02d, incompat5, incompat6):
3834         New tests for -C.
3835
3836 2007-01-24  Jim Meyering  <jim@meyering.net>
3837
3838         Fix a typo.
3839         * tests/misc/sort-compress: Use $abs_top_builddir, not $top_builddir.
3840         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Likewise.
3841
3842         Don't depend on "which".
3843         * tests/misc/sort-compress (SORT): Use $abs_builddir, now which.
3844         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Export top_builddir.
3845
3846 2007-01-24  Dan Hipschman  <dsh@linux.ucla.edu>
3847
3848         Test sort compression.
3849         * tests/misc/Makefile.am: Add the test.
3850         * tests/misc/sort-compress: New file containing the tests.
3851
3852 2007-01-24  Jim Meyering  <jim@meyering.net>
3853
3854         * NEWS: sort temp file compression: tweak wording.
3855         * src/sort.c (struct sortfile) [name]: Declare member to be const.
3856
3857 2007-01-21  Jim Meyering  <jim@meyering.net>
3858
3859         * src/sort.c (MAX_FORK_RETRIES_COMPRESS, MAX_FORK_RETRIES_DECOMPRESS):
3860         In pipe_fork callers, use these named constants, not "2" and "8".
3861         (proctab, nprocs): Declare to be "static".
3862         (pipe_fork) [lint]: Initialize local, pid,
3863         to avoid unwarranted may-be-used-uninitialized warning.
3864         (create_temp): Use the active voice.  Describe parameters, too.
3865
3866 2007-01-21  James Youngman  <jay@gnu.org>
3867
3868         Centralize all the uses of sigprocmask().  Don't restore an invalid
3869         saved mask.
3870         * src/sort.c (enter_cs, leave_cs): New functions for protecting
3871         code sequences against signal delivery.
3872         * (exit_cleanup): Use enter_cs and leave_cs instead of
3873         calling sigprocmask directly.
3874         (create_temp_file, pipe_fork, zaptemp): Likewise
3875
3876 2007-01-21  Dan Hipschman  <dsh@linux.ucla.edu>
3877
3878         Add compression of temp files to sort.
3879         * NEWS: Mention this.
3880         * bootstrap.conf: Import findprog.
3881         * configure.ac: Add AC_FUNC_FORK.
3882         * doc/coreutils.texi: Document GNUSORT_COMPRESSOR environment
3883         variable.
3884         * src/sort.c (compress_program): New global, holds the name of the
3885         external compression program.
3886         (struct sortfile): New type used by mergepfs and friends instead
3887         of filenames to hold PIDs of compressor processes.
3888         (proctab): New global, holds compressor PIDs on which to wait.
3889         (enum procstate, struct procnode): New types used by proctab.
3890         (proctab_hasher, proctab_comparator): New functions for proctab.
3891         (nprocs): New global, number of forked but unreaped children.
3892         (reap, reap_some): New function, wait for/cleanup forked processes.
3893         (register_proc, update_proc, wait_proc): New functions for adding,
3894         modifying and removing proctab entries.
3895         (create_temp_file): Change parameter type to pointer to file
3896         descriptor, and return type to pointer to struct tempnode.
3897         (dup2_or_die): New function used in create_temp and open_temp.
3898         (pipe_fork): New function, creates a pipe and child process.
3899         (create_temp): Creates a temp file and possibly a compression
3900         program to which we filter output.
3901         (open_temp): Opens a compressed temp file and creates a
3902         decompression process through which to filter the input.
3903         (mergefps): Change FILES parameter type to struct sortfile array
3904         and update access accordingly.  Use open_temp and reap_some.
3905         (avoid_trashing_input, merge): Change FILES parameter like
3906         mergefps and call create_temp instead of create_temp_file.
3907         (sort): Call create_temp instead of create_temp_file.
3908         Use reap_some.
3909         (avoid_trashing_input, merge, sort, main): Adapt to mergefps.
3910
3911         The idea of compressing sorts temporary files was first
3912         suggested/implemented by Jay Soffian in 1998, and again
3913         by Charles Randall in 2001.
3914
3915 2007-01-20  Jim Meyering  <jim@meyering.net>
3916
3917         * tests/misc/pwd-long: Work properly even when run from the
3918         wrong one of two or more bind-mounted sibling directories.
3919         Suggestion from Mike Stone in <http://bugs.debian.org/380552>.
3920
3921 2007-01-20  Paul Eggert  <eggert@cs.ucla.edu>
3922
3923         Standardize on list of signals when an app catches signals.
3924         * src/csplit.c (main): Also catch SIGALRM, SIGPIPE, SIGPOLL,
3925         SIGPROF, SIGVTALRM, SIGXCPU, SIGXFSZ.
3926         * src/ls.c (main): Likewise (except SIGPIPE was already caught).
3927         Note that ls.c is special, as it also catches SIGTSTP.
3928         * src/sort.c (main): Likewise.  Also catch SIGQUIT.  More details in
3929         <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9510>.
3930
3931 2007-01-19  Dan Hipschman  <dsh@linux.ucla.edu>
3932         and Paul Eggert  <eggert@cs.ucla.edu>
3933
3934         * src/sort.c (cleanup): Clear temphead at the end.
3935         (exit_cleanup): New function.
3936         (main): Don't invoke atexit until we're ready.
3937         Invoke it with exit_cleanup, not with cleanup and close_stdout,
3938         to avoid a race condition with cleanup and signal handling.  More
3939         details: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9508
3940
3941 2007-01-18  Jim Meyering  <jim@meyering.net>
3942
3943         * src/c99-to-c89.diff: Adjust remove.c offsets.
3944
3945 2007-01-17  Jim Meyering  <jim@meyering.net>
3946
3947         Make "rm --interactive=never ..." never prompt.
3948         * NEWS: Mention this.
3949         * src/remove.h (enum rm_interactive): New ternary type.
3950         (struct rm_options) [interactive]: Use it, here -- rather than bool.
3951         * src/remove.c (prompt): Reflect type change.
3952         * src/mv.c (rm_option_init): Initialize to RMI_NEVER now.
3953         * src/rm.c (main): Add a FIXME comment for '-d' option.
3954         Adapt to type change of rm_options.interactive.
3955
3956         * tests/rm/i-never: New file.  Test for the above fix.
3957         * tests/rm/Makefile.am (TESTS): Add i-never.
3958
3959 2007-01-15  Jim Meyering  <jim@meyering.net>
3960
3961         * bootstrap (gnulib_tool): When adding to .cvsignore and .gitignore,
3962         emit foo.h, for each foo_.h.  This yields one false-positive, fts.h,
3963         but that's ok, since fts_.h will eventually be renamed.
3964
3965         * src/remove.c (remove_dir): Don't use errno in diagnostic.
3966         Root-only test failure reported by Alex van Hout and Jon Grosshart in
3967         <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9415/focus=9415>.
3968
3969         * bootstrap.conf (avoided_gnulib_modules): Fix my typo:
3970         s/--avoid=canonicalize-lgpl/--avoid=canonicalize-gpl/
3971
3972 2007-01-14  Bruno Haible  <bruno@clisp.org>
3973
3974         Enable use of gnulib's new fchdir module.
3975         * bootstrap.conf (avoided_gnulib_modules): Avoid canonicalize-lgpl,
3976         since we use canonicalize.
3977         (gnulib_modules): Add fchdir.
3978         * m4/jm-macros.m4 (coreutils_MACROS): Remove fchdir-stub.
3979
3980 2007-01-13  Jim Meyering  <jim@meyering.net>
3981
3982         * tests/cp/open-perm-race: Remove gdb-based test.
3983         It would run only when compiled with -g, and besides is now
3984         subsumed by file-perm-race.
3985         * tests/cp/Makefile.am (TESTS): Remove open-perm-race.
3986
3987         * Transform all Makefile.am files so that when running "make check",
3988         CU_TEST_NAME is set to the name of the test.  This is so that when I
3989         run valgrind-enabled (--log-file-qualifier=CU_TEST_NAME) "make check"
3990         on the entire package it is more convenient to map a leak or error
3991         found in a valgrind log file back to the offending test.
3992         Use this command:
3993         (echo tests/Makefile.am.in; find tests -name Makefile.am) \
3994          |xargs perl -pi -e '/^(\s*)PATH=...VG_PATH_PREFIX/ and ' \
3995            -e 'print $1,q|CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst |,"\\\n"'
3996
3997 2007-01-11  Jim Meyering  <jim@meyering.net>
3998
3999         Avoid a leak in expr's implementation of the ":" (match) operator.
4000         * src/expr.c (docolon): Free the regexp buffer using regfree, rather
4001         than doing it manually, being careful to set fastmap to NULL first.
4002         Free any re_regs.start and .end members, if necessary.
4003
4004         * tests/misc/test-diag: Work also when libc's error function
4005         reports the entire program name ("../../src/test"), rather than
4006         just the final component.
4007
4008 2007-01-10  Jim Meyering  <jim@meyering.net>
4009
4010         Don't use fts_statp uninitialized for "chown -RLh --preserve-root ...".
4011         * src/chown-core.c (FTSENT_IS_DIRECTORY): New macro.
4012         (change_file_owner): Perform the ROOT_DEV_INO_CHECK only for a
4013         directory.  Non-directory entries lack fts_statp data when using
4014         the FTS_NOSTAT option.
4015
4016 2007-01-07  Jim Meyering  <jim@meyering.net>
4017
4018         * tests/sample-test: Update copyright date to 2007.
4019         * Makefile.maint (copyright-check): Also check the copyright date
4020         in tests/sample-test.
4021
4022 2007-01-06  Jim Meyering  <jim@meyering.net>
4023
4024         * tests/fmt/basic (pfx-only, pfx-of-pfx): New tests,
4025         based on examples from G.P. Halkes in
4026         <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/9388>.
4027
4028 2007-01-06  G.P. Halkes  <buscom@ghalkes.nl>
4029
4030         * src/fmt.c (copy_rest): Correct prefix handling.
4031         Don't elide a line with the prefix followed by only white space.
4032         (get_line): Move EOF-check to loop-termination condition.
4033         * tests/fmt/basic (pfx-1): Adjust test to expect desired result.
4034         (pfx-2): Remove test; its premise was contrary to the documentation.
4035
4036 2007-01-05  Jim Meyering  <jim@meyering.net>
4037
4038         Avoid a used-uninitialized bug for invalid input, i.e., when the size
4039         of the input, not counting newlines, is 1 % 4.
4040         * gl/lib/base64.c (base64_decode): Don't hard-code inlen==4.
4041         It may be smaller when flushing.
4042
4043 2007-01-05  Mike Frysinger  <vapier@gentoo.org>
4044
4045         * src/dircolors.hin: Add a TERM directive for cons25.
4046
4047 2007-01-04  Jim Meyering  <jim@meyering.net>
4048
4049         * Makefile.cfg (local-checks-to-skip): Skip strftime-check, in
4050         case you don't have convenient access to glibc info documentation.
4051
4052         Use the release year, not the current year.
4053         * src/groups.sh (version): Use a better name: @RELEASE_YEAR@.
4054         * src/Makefile.am (RELEASE_YEAR): Define it.
4055         (.sh): Use it.
4056         Thanks to a prod from Eric Blake.
4057
4058         Ensure that "group --version" always prints the current year.
4059         * src/groups.sh (version): Use @CURRENT_YEAR@, rather than 2006.
4060         * src/Makefile.am (.sh): Also substitute for @CURRENT_YEAR@.
4061         Suggestion from Eric Blake.
4062
4063         When decoding, always allow newlines in input, with almost no
4064         performance impact.
4065         * src/base64.c (do_decode): Initialize decode context.
4066         Call base64_decode one more time, after all input is processed.
4067         (usage): When decoding, newlines are always accepted.
4068
4069         * tests/misc/base64: Add a bunch of tests, for the above.
4070         * gl/lib/base64.c: Include <string.h>.
4071         (base64_decode_ctx_init, get_4, decode_4): New functions.
4072         (base64_decode): Efficiently handle interspersed newlines.
4073         (base64_decode_alloc): Update signature.
4074         * gl/lib/base64.h (struct base64_decode_context): Define.
4075         (base64_decode_ctx_init): Add prototype.
4076         (base64_decode, base64_decode_alloc): Update prototypes.
4077
4078         * gl/lib/base64.c: Copied from gnulib.
4079         * gl/lib/base64.h: Likewise.
4080
4081 2007-01-03  Jim Meyering  <jim@meyering.net>
4082
4083         * THANKS: Add Evan Hunt.
4084
4085 2007-01-03  Bruno Haible  <bruno@clisp.org>
4086
4087         Avoid spurious test failures on MacOS X 10.3.9, in a German locale.
4088         * tests/chown/deref: Apply lang-default.
4089         * tests/misc/split-a: Likewise.
4090         * tests/mv/reply-no: Likewise.
4091
4092         * src/copy.c (copy_internal): Use mkfifo as a fallback if mknod fails.
4093         Needed on MacOS X.
4094
4095 2007-01-02  Paul Eggert  <eggert@cs.ucla.edu>
4096
4097         Now, "ls -FRL" always follows symbolic links on Linux.
4098         * NEWS: Mention this bug fix.
4099         * src/ls.c (gobble_file): Fix bug reported by
4100         Nobuyuki Tsuchimura in
4101         http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00152.html
4102         where "ls -FRL" didn't follow a symbolic link in some cases on Linux.
4103         * tests/ls/follow-slink: Add a test for this case.
4104
4105 2007-01-01  Jim Meyering  <jim@meyering.net>
4106
4107         * tests/rm/fail-eperm: Revert last change.  The PATH=... setting
4108         is not honored at least on HP-UX 11.23 systems.
4109         Instead, simply transform the actual output diagnostic.
4110         Test failure reported by Bob Proulx.
4111
4112 2006-12-30  Jim Meyering  <jim@meyering.net>
4113
4114         * bootstrap (gnulib_extra_files): Remove announce-gen.
4115         * bootstrap.conf (gnulib_modules): Add it here instead, now that
4116         it's a module.
4117
4118         * tests/misc/base64: Factor a long, repetitive string.
4119
4120         * src/c99-to-c89.diff: Adjust remove.c offsets.
4121
4122         Clean up after the change of 2006-12-28.
4123         * src/remove.c (AD_pop_and_chdir): Change **DIRP parameter to *DIRP,
4124         now that this function never modifies the pointer.  Adjust comments
4125         and code accordingly.
4126         (remove_dir): Set "dirp" to NULL right after AD_pop_and_chdir call,
4127         now that AD_pop_and_chdir no longer does that.
4128
4129         * tests/rm/fail-eperm: Avoid spurious differences (the error function
4130         from latest glibc no longer prints the full program_name): so don't
4131         invoke rm via ../../src/rm.  Instead, invoke it via "PATH=../../src rm".
4132
4133         * tests/mv/acl (skip): Skip this test also if the destination
4134         directory, which is on a different file system, lacks ACL support.
4135
4136         * src/copy.c (copy_reg): Rewrite a comment that was rendered
4137         inaccurate by the 2006-10-18 change.
4138
4139 2006-12-28  Jim Meyering  <jim@meyering.net>
4140
4141         When moving "up" the hierarchy, be careful to remove a just-emptied
4142         directory before opening ".", to avoid trouble with file system
4143         implementations that cache readdir results at opendir-time.
4144         * src/remove.c (AD_pop_and_chdir): Add a file descriptor parameter.
4145         Don't update **DIRP.  Don't call fdopendir here.
4146         (remove_dir): Call fdopendir here instead.
4147         Report and patch from Mikulas Patocka:
4148         <http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00170.html>
4149
4150 2006-12-27  Jim Meyering  <jim@meyering.net>
4151
4152         * src/tail.c (usage): Mention +N for --bytes and --lines.
4153         Suggestion from Evan Hunt.
4154
4155 2006-12-26  Jim Meyering  <jim@meyering.net>
4156
4157         * configure.ac: Require autoconf-2.61 and automake-1.10.
4158         Without the former (even with autoconf-2.60), "make distcheck"
4159         would fail (without the 2006-09-26 autoconf AC_CHECK_DECL fix),
4160         due to an inttypes.h generated with CFLAGS including -pedantic.
4161         With the old decl check, @HAVE_DECL_STRTOUMAX@ would be 0.
4162
4163         * Makefile.maint (VC-tag): Define, so as to gpg-sign each release
4164         tag, using the release version number as the message.
4165         (vc-dist): Use $(VC-tag), rather than "$(VC) tag".
4166
4167 2006-12-21  Paul Eggert  <eggert@cs.ucla.edu>
4168
4169         * NEWS: dd bs= operands now silently override later ibs= and obs=,
4170         as POSIX requires.
4171         * src/dd.c (scanargs): Implement it.
4172         * tests/dd/misc (outbytes): Test it.
4173         * doc/coreutils.texi (dd invocation): Specify that bs=N
4174         overrides later ibs and obs, undoing part of the
4175         previous change.  (The behavior was wrong.)
4176
4177 2006-12-20  Jim Meyering  <jim@meyering.net>
4178
4179         "rm -rf /etc/motd" (run by non-root) now prints a diagnostic.
4180         * src/remove.c (remove_entry): Handle EACCES for a non-directory, too.
4181         Don't let a non-directory get by with errno == EPERM, either.
4182         Check the file type directly (using cached stat value), rather
4183         than trying to guess it from errno values.
4184         Karl Berry reported that a cross-partition "mv /etc/issue ~"
4185         failed with the um,... suboptimal diagnostic,
4186         "mv: cannot remove `/etc/issue': Not a directory".
4187         * tests/rm/Makefile.am (TESTS): Add fail-eacces.
4188         * tests/rm/fail-eacces: New file.
4189         * NEWS: Mention that both mv and rm are affected.
4190
4191         "cut -f 2- A B" no longer triggers a double-free bug
4192         * src/cut.c (cut_fields): Set file-scoped global to NULL after
4193         freeing it.  This avoids a double-free (and core dump on some systems)
4194         for this usage: "echo 1>a; echo 2>b; cut -f2- a b".  Reported by
4195         James Hunt in <http://bugzilla.redhat.com/220312>.
4196         * NEWS: List this bug fix.
4197         * THANKS: Mention him.
4198         * tests/misc/cut: New file.
4199         * tests/misc/Makefile.am (TESTS): Add cut.
4200
4201 2006-12-15  Jim Meyering  <jim@meyering.net>
4202
4203         * tests/cp/open-perm-race: Correct the gdb-existence check.
4204         Don't run either subsequent gdb command in a sub-shell.
4205         Reported by Thomas Schwinge.
4206         * THANKS: bring up to date.
4207
4208 2006-12-14  Paul Eggert  <eggert@cs.ucla.edu>
4209
4210         Make sure cp -p isn't too generous with file permissions.
4211         * tests/cp/Makefile.am (TESTS): Add file-perm-race.
4212         * tests/cp/file-perm-race: New file.
4213
4214         Ensure cp -pR --parents isn't too generous with parent permissions.
4215         * tests/cp/Makefile.am (TESTS): Add parent-perm-race.
4216         * tests/cp/parent-perm-race: New file.
4217
4218 2006-12-14  Jim Meyering  <jim@meyering.net>
4219
4220         * tests/chgrp/default-no-deref: Don't assume that files are created
4221         with the primary group by default.  That's not true in a directory
4222         with the set-GID bit set.
4223
4224         Don't hang when there's no input tty.
4225         * tests/cp/open-perm-race: Skip this test if there is no
4226         controlling input `terminal'.
4227
4228         Test for a hard-to-detect race fix, using gdb.
4229         * tests/cp/open-perm-race: New file, to test for the
4230         cp --preserve=ownership fix of 2006-12-06.
4231
4232         * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Define abs_top_builddir.
4233         (TESTS): Add open-perm-race.
4234
4235         * src/chgrp.c (main): Don't prohibit -RLh, aka -RL with --no-dereference.
4236         * src/chown.c (main): Likewise.
4237         * src/chown-core.c (change_file_owner): Add to a comment.
4238         * tests/chown/preserve-root: Add tests.
4239
4240         * NEWS: --preserve-root now works with chgrp, chmod, and chown.
4241         * src/chmod.c (process_file): Do honor the --preserve-root option.
4242         * src/chown-core.c (change_file_owner): Likewise, but here, also
4243         handle the case in which a traversal would go "through" a symlink
4244         to root.  Reported by Matthew M. Boedicker
4245         * tests/chown/preserve-root: Test for the above.
4246         * tests/chown/Makefile.am (TESTS): Add preserve-root.
4247
4248         * NEWS: Mention the chmod fix induced by the 2006-12-11 change
4249         to gnulib's m4/openat.m4.
4250
4251 2006-12-13  Andreas Schwab  <schwab@suse.de>
4252
4253         Don't fail if mv/acl test succeeds.
4254         * tests/mv/acl (skip): Check for acl support in the file system.
4255         * tests/mv/Makefile.am (XFAIL_TESTS): Remove.
4256         (TESTS_ENVIRONMENT): Pass CONFIG_HEADER.
4257
4258 2006-12-13  Paul Eggert  <eggert@cs.ucla.edu>
4259
4260         Remove some arbitrary restrictions on size fields, so that
4261         commands like "sort -k 18446744073709551616" no longer fail merely
4262         because 18446744073709551616 doesn't fit in uintmax_t.  The trick
4263         is that these fields can all be treated as effectively infinity;
4264         their exact values don't matter, since no internal buffer can be
4265         that long.
4266         * src/join.c (string_to_join_field): Verify that SIZE_MAX <=
4267         ULONG_MAX if the code assumes this.  Silently truncate too-large
4268         values to SIZE_MAX, as the remaining code will do the right thing
4269         in this case.
4270         * src/sort.c (parse_field_count): Likewise.
4271         * src/uniq.c (size_opt, main): Likewise.
4272         * tests/join/Test.pm (bigfield): New test.
4273         * tests/sort/Test.pm (bigfield): New test.
4274         * tests/uniq/Test.pm (121): New test.
4275
4276 2006-12-13  Jim Meyering  <jim@meyering.net>
4277
4278         * tests/chgrp/default-no-deref: New test.
4279         * tests/chgrp/Makefile.am (TESTS): Add default-no-deref.
4280
4281 2006-12-12  Jim Meyering  <jim@meyering.net>
4282
4283         * src/system.h (SETVBUF): Remove definition, now that the
4284         autoconf macro, AC_FUNC_SETVBUF_REVERSED, does nothing.
4285         * src/tee.c (tee_files): s/SETVBUF/setvbuf/.
4286         * src/od.c (open_next_file): Likewise.
4287
4288 2006-12-09  Jim Meyering  <jim@meyering.net>
4289
4290         * man/Makefile.am (.x.1): Make help2man use $(PACKAGE_STRING) as the
4291         "source".  I.e. "GNU coreutils 6.7".
4292
4293         * NEWS: With the change from "-pre" to "-dirty" suffix, also change
4294         from NEXT_VER-pre to CUR_VER-dirty.  So, this is 6.7-dirty.
4295         * configure.ac (AC_INIT): s/6.8-dirty/6.7-dirty/.
4296
4297         * tests/uniq/Test.pm (test_vector): Skip the pipe-reading test
4298         whenever uniq is expected to fail.  This should catch the other case
4299         [test #112] in which uniq emits "cat: write error: Broken pipe" on
4300         some systems.
4301
4302 2006-12-08  Jim Meyering  <jim@meyering.net>
4303
4304         Include bootstrap tool version info in the announcement form.
4305         * Makefile.maint (gnulib_snapshot_date): Define.
4306         (announcement): Use two new announce-gen options,
4307         --bootstrap-tools and --gnulib-snapshot-date.
4308         * Makefile.cfg (gnulib_dir): Set.
4309
4310         Post-release version change.
4311         * NEWS: Add a line for 6.8-dirty.
4312         * configure.ac (AC_INIT): Set new version string.
4313
4314 2006-12-07  Jim Meyering  jim@meyering.net
4315
4316         Version 6.7.
4317         * NEWS: Record release date.  Remove '-pre' suffix.
4318         * configure.ac (AC_INIT): Remove version string suffix.
4319
4320 2006-12-07  Jim Meyering  <jim@meyering.net>
4321
4322         Make the output of "make check" more reproducible.
4323         * tests/touch/empty-file: Use envvar-check, so "make check" doesn't
4324         evoke diagnostics like this when COLUMNS=0 in the environment:
4325         ls: ignoring invalid width in environment variable COLUMNS: 0
4326         * tests/touch/no-rights: Likewise.
4327         * tests/help-version: Likewise.
4328         * tests/uniq/Test.pm: Don't perform the pipe-reading version of test
4329         118, since it emits "cat: write error: Broken pipe" on some systems.
4330
4331 2006-12-06  Paul Eggert  <eggert@cs.ucla.edu>
4332
4333         * NEWS: Document the cp -p fix for special bits.
4334         * src/copy.c (set_owner): Now returns a three-way result, so
4335         that the caller can clear the special bits.  All callers changed.
4336         (copy_reg): Don't set the special bits if chown failed.
4337         (copy_internal): Likewise.
4338         * tests/cp/special-bits: Test this fix.
4339
4340 2006-12-06  Paul Eggert  <eggert@cs.ucla.edu>
4341
4342         * NEWS: Document the cp --preserve=ownership fix.
4343         * m4/jm-macros.m4 (coreutils_MACROS): Check for fchmod.
4344         * src/copy.c (fchmod_or_lchmod): New function.
4345         (copy_reg): New arg OMITTED_PERMISSIONS.  All uses changed.
4346         Omit confusing and unused ", dst_mode" arg to 'open' without O_CREAT.
4347         When creating a file, use O_EXCL, so we're more likely to detect
4348         funny business by other processes.  At the end, if permissions
4349         were omitted, chmod them back in.
4350         (copy_internal): If the ownership might change, omit some permissions
4351         at first, then restore them after chowning the file.
4352         * src/cp.c (make_dir_parents_private): Likewise.
4353         * src/copy.c (cached_umask): New function.
4354         * src/copy.h (cached_umask): New decl.
4355
4356 2006-12-06  Jim Meyering  <jim@meyering.net>
4357
4358         Make the output of "make check" more reproducible.
4359         * tests/misc/date-sec: Don't emit any diagnostic about sleeping.
4360
4361 2006-12-03  Paul Eggert  <eggert@cs.ucla.edu>
4362
4363         * src/install.c (install_file_in_file): Preserve time stamps
4364         before changing owner or file mode bits, for consistency with
4365         other coreutils programs.
4366
4367 2006-12-03  Jim Meyering  <jim@meyering.net>
4368
4369         * tests/misc/date-sec: Output a fixed string.
4370
4371         * NEWS: du --one-file-system (-x) would skip subdirectories of any
4372         directory listed as second or subsequent command line argument.
4373         * tests/du/one-file-system: New file.  Test for today's fts.c fix.
4374         * tests/du/Makefile.am (TESTS): Add one-file-system.
4375         Reported by Mike Frysinger.
4376
4377 2006-12-02  Jim Meyering  <jim@meyering.net>
4378
4379         * tests/du/basic: Generate 4KB file simply using printf, rather than
4380         seq+head.  This avoids a spurious "Broken pipe" diagnostic from seq.
4381
4382 2006-11-28  Jim Meyering  <jim@meyering.net>
4383
4384         * tests/mv/no-target-dir: Detect a buggy rename syscall.  If found,
4385         skip this test.  This happens at least on ia64 linux-2.4.19 w/ext3.
4386         Reported by Matthew Woehlke.
4387
4388         * tests/mv/dir2dir: Also accept EBUSY.
4389         Reported by Matthew Woehlke.
4390
4391 2006-11-27  Jim Meyering  <jim@meyering.net>
4392
4393         * Makefile.maint (patch-check): Rewrite to diagnose failure.
4394         * src/c99-to-c89.diff: Adjust shred.c offsets.
4395
4396 2006-11-26  Paul Eggert  <eggert@cs.ucla.edu>
4397
4398         Improve the check for departures from C89, and fix the departures
4399         I found.
4400         * Makefile.maint (my-distcheck): Also check for C89 compatibility
4401         as best we can with GCC.
4402         * src/stat.c (PRINTF_OPTION): Omit comma before } in enum
4403         declaration; C89 doesn't allow this.
4404         * src/dcgen: Don't generate string literals longer than
4405         what C89 requires support for.
4406         * src/cut.c (usage): Don't use string literals longer than
4407         what C89 requires support for.
4408         * src/date.c (usage): Likewise.
4409         * src/dd.c (usage): Likewise.
4410         * src/du.c (usage): Likewise.
4411         * src/ls.c (usage): Likewise.
4412         * src/od.c (usage): Likewise.
4413         * src/readlink.c (usage): Likewise.
4414         * src/seq.c (usage): Likewise.
4415         * src/shred.c (usage): Likewise.
4416
4417 2006-11-26  Mike Frysinger  <vapier@gentoo.org>
4418
4419         Recognize new archive, audio and image formats.
4420         Give audio files a separate color.
4421         * src/dircolors.hin: Add comments for common .sh and .csh scripts.
4422         Add .bz2, .tbz2, .tz, .rar, .ace, .zoo, .cpio, .7z, .rz as archive
4423         suffixes.  Add .mng, .pcx, .m2v, .mkv, .ogm, .mp4, .m4v, .mp4v, .vob,
4424         .qt, .nuv, .wmv, .asf, .rm, .rmvb, .flc, .yuv as image formats.
4425         Add .aac, .au, .mid, .midi, .mka, .ra as audio suffixes.  Change
4426         audio color to 00;36 to differentiate from image/video color.
4427
4428 2006-11-26  Jim Meyering  <jim@meyering.net>
4429
4430         * Makefile.maint (patch-check): Compile patched sources with
4431         CFLAGS='-Wdeclaration-after-statement -Werror', to ensure that
4432         no violations remain.
4433
4434         * src/c99-to-c89.diff: Remove 3 bogus hunks.
4435
4436         * src/remove.c (fd_to_subdirp): Remove unused parameter, ds.
4437         Update callers.
4438
4439         * src/c99-to-c89.diff: Adjust for changes in rm.c and in remove.c.
4440
4441         * src/rm.c (main): Remove unnecessary (assuming C99) braces.
4442
4443 2006-11-26  Paul Eggert  <eggert@cs.ucla.edu>
4444
4445         Port parts of the code to C89 to minimize the need for c99-to-c89.diff,
4446         while trying to retain the readability of C99 as much as possible.
4447         * src/remove.c (rm_1): Remove decl of local, fd_cwd.
4448         Replace each of two uses with literal AT_FDCWD.
4449         (cache_stat_init): Return its argument, for convenience.
4450         Update the caller in remove_dir.
4451         (AD_pop_and_chdir): Return prev_dir rather than storing through
4452         a pointer argument.  All uses changed.
4453         (AD_ensure_initialized): New function.
4454         (AD_mark_helper): Use it, to avoid the need for declaration
4455         after statement.
4456         (rm): Move cycle_check_init call into callee...
4457         (rm_1): ...here.
4458         Use an else clause in place of a "continue" statement.
4459         (close_preserve_errno): Remove.
4460         (fd_to_subdirp): Rewrite to avoid the need for decl after statement.
4461
4462 2006-11-25  Jim Meyering  <jim@meyering.net>
4463
4464         * Makefile.am (EXTRA_DIST): Remove announce-gen from here, too.
4465
4466 2006-11-24  Theodoros V. Kalamatianos  <thkala@softlab.ece.ntua.gr> (tiny change)
4467
4468         * tests/du/inacc-dest: Skip this test when running as root.
4469
4470 2006-11-23  Jim Meyering  <jim@meyering.net>
4471
4472         * announce-gen: Remove file.  It's moving to gnulib.
4473         * bootstrap: Pull it from gnulib/build-aux instead.
4474         * Makefile.maint (announcement): Reflect move to ./build-aux.
4475
4476         * tests/du/deref-args: Use "printf %65536s x" to create a 64KB file,
4477         rather than a pipeline that would sometimes evoke a diagnostic
4478         like "seq: write error: Broken pipe".
4479
4480         * tests/help-version: Suppress dd transfer rate output.
4481
4482         * configure.ac (AC_INIT): Bump to 6.7-pre, not 6.6-pre.
4483
4484 2006-11-22  Jim Meyering  <jim@meyering.net>
4485
4486         * announce-gen (print_news_deltas): Fix silly, but harmless typo:
4487         change "(:?..." to "(?:..." in regexps.
4488
4489         Post-release version change.
4490         * NEWS: Add a line for 6.7-pre.
4491         * configure.ac (AC_INIT): Bump to 6.7 and add "-pre" suffix.
4492
4493         Version 6.6.
4494         * NEWS: Record release date.  Remove "-pre" suffix.
4495         * configure.ac (AC_INIT): Remove "-pre" suffix from version string.
4496
4497         * announce-gen: Remove unused --release-archive-directory option.
4498         (print_news_deltas): Accept new adjective, "Noteworthy", in addition
4499         to the old "Major".
4500         Match version numbers in NEWS using tighter regular expressions.
4501         (main): Require the --gpg-key-id=ID option.
4502         * Makefile.maint (announcement): Don't use now-removed
4503         --release-archive-directory=... option.
4504
4505         * NEWS: Mention the three noteworthy changes, all fixed via gnulib.
4506
4507 2006-11-21  Jim Meyering  <jim@meyering.net>
4508
4509         * tests/rm/one-file-system: Upon setup failure (e.g., mount failure),
4510         skip the test rather than failing.  Reported by Michael Deutschmann.
4511
4512         * tests/rm/fail-eperm: Use the "(exit N); exit N" idiom,
4513         rather than just "exit N".
4514
4515         Arrange for "make check-root" to run the new root-only test.
4516         * tests/Makefile.am (t7): New target, to run tests/ls/nameless-uid.
4517         (all_t): Add t7.
4518
4519 2006-11-20  Jim Meyering  <jim@meyering.net>
4520
4521         Add a root-only test for today's lib/idcache.c fix.
4522         * tests/ls/nameless-uid: New file.
4523         * tests/ls/Makefile.am (TESTS): Add nameless-uid.
4524         (TESTS_ENVIRONMENT): Add PERL to the list.
4525
4526 2006-11-19  Jim Meyering  <jim@meyering.net>
4527
4528         * tests/tail-2/assert-2: Mark as a very-expensive test, because I
4529         find the 7-second sleep annoyingly long.  Besides, this test is
4530         probably far too specific and timing sensitive ever to trigger again.
4531         * tests/tail-2/assert: Likewise.
4532
4533         Post-release version change.
4534         * NEWS: Add a line for 6.6-pre.
4535         * configure.ac (AC_INIT): Bump to 6.6 and add "-pre" suffix.
4536
4537         Version 6.5.
4538         * NEWS: Record release date.  Remove "-cvs" suffix.
4539         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
4540
4541 2006-11-18  Jim Meyering  <jim@meyering.net>
4542
4543         "ln --backup f f" produces a misleading diagnostic:
4544         ln: creating hard link `f' => `f': No such file or directory
4545         * src/ln.c (do_link): Give a better diagnostic in this unusual case.
4546         (do_link): Rename local: s/lstat_ok/dest_lstat_ok/.
4547         * tests/ln/Makefile.am (TESTS): Add hard-backup.
4548         * tests/ln/hard-backup: New test for the above.
4549         * NEWS: Mention this fix.
4550
4551 2006-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4552
4553         * bootstrap.conf (gnulib_modules): Add sys_stat, since we use it
4554         directly too.
4555         * lib/.cvsignore, lib/.gitignore: Add root-dev-ino.c, root-dev-ino.h.
4556         * m4/.cvsignore, m4/.gitignore: Add root-dev-ino.m4.
4557         * src/ls.c (DIRED_FPUTS_LITERAL, PUSH_CURRENT_DIRED_POS):
4558         Omit unnecessary parenthesization of args.
4559         * src/od.c (EQUAL_BLOCKS): Likewise.
4560         * src/system.h (STREQ, ASSIGN_STRDUPA): Likewise.
4561
4562 2006-11-16  Jim Meyering  <jim@meyering.net>
4563
4564         * tests/tail-2/append-only: If chattr +a fails, exit 77 (to tell
4565         automake we're skipping this test), and give a diagnostic to tell
4566         the user the same thing.  Reported by Mike Grayson.
4567
4568 2006-11-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4569
4570         * man/Makefile.am (dist_man_MANS): Replace all optional manpages
4571         with `$(MAN)', computed at configure time; also, list them ...
4572         (optional_mans): ... in this new variable.
4573         (max_aux, EXTRA_DIST): Ensure that we distribute all manpages.
4574
4575 2006-11-16  Jim Meyering  <jim@meyering.net>
4576
4577         Help valgrind see that there is no leak in dd.c.
4578         * src/dd.c (dd_copy): Declare real_buf and real_obuf to be static,
4579         so we need not free them at all.  This is easier than freeing
4580         both buffers at each of the early "return"s.
4581
4582         * src/csplit.c (load_buffer): Plug an inconsequential leak.
4583
4584 2006-11-15  Jim Meyering  <jim@meyering.net>
4585
4586         * .x-po-check: Exclude gl/ files.  Otherwise, po-check would
4587         complain that some of gl/lib/*.[ch] are not listed in POTFILES.in.
4588
4589 2006-11-14  Jim Meyering  <jim@meyering.net>
4590
4591         * gl/m4/root-dev-ino.m4: Now that this is part of a real "module",
4592         remove the now-unnecessary use of AC_LIBSOURCES.
4593
4594         Adapt to new version of gnulib-tool.
4595         * gl/modules/root-dev-ino: New file.
4596         * lib/root-dev-ino.c, lib/root-dev-ino.h: Move these files ...
4597         * gl/lib/root-dev-ino.c, gl/lib/root-dev-ino.h: ... to here.
4598         * m4/root-dev-ino.m4: Move this file ...
4599         * gl/m4/root-dev-ino.m4: ... to here.
4600
4601         * bootstrap.conf (gnulib_modules): Add root-dev-ino.
4602
4603 2006-11-13  Jim Meyering  <jim@meyering.net>
4604
4605         * src/sort.c (insertkey): Use xmemdup, rather than xmalloc+assignment.
4606         From Paul Eggert.
4607
4608         Plug another technically-unimportant leak in sort.
4609         * src/sort.c (main): Don't allocate memory for each new key here.
4610         (insertkey): Allocate memory for each key here, instead.
4611         (key_init): Rename from new_key.  Don't allocate.
4612
4613         * src/sort.c (main): Plug a tiny memory leak.
4614         Move declaration of local "minus" down to be nearer point of use.
4615
4616 2006-11-12  Jim Meyering  <jim@meyering.net>
4617
4618         du would exit early, when encountering an inaccessible directory
4619         Reported by Mike Frysinger, in
4620         http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8831
4621         * tests/du/inacc-dest: New test, based on an example from Mike Frysinger.
4622         * tests/chgrp/no-x: Remove the "fts_read failed: ..."
4623         diagnostic from the expected output when using native fdopendir.
4624         * tests/chmod/no-x: Likewise.
4625         * tests/du/no-x: Likewise.
4626         * NEWS: Mention this bug fix.
4627         * tests/du/Makefile.am (TESTS): Add inacc-dest.
4628
4629         * Makefile.maint (sc_cast_of_x_alloc_return_value): Add an exclusion
4630         for xalloc.h itself.
4631
4632         Avoid false-positive when testing via valgrind.
4633         * tests/mv/atomic: Grep strace output for a more specific pattern
4634         than just "unlink", since that got a false positive when testing
4635         under valgrind: unlink("/tmp/valgrind_proc_9657_cmdline_A51E9991") = 0
4636         * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define EGREP.
4637
4638 2006-10-28  Jim Meyering  <jim@meyering.net>
4639
4640         * Makefile.maint (patch-check): Make it easier to regenerate
4641         the src/c99-to-c89.diff file.  E.g., I do this:
4642         make patch-check REGEN_PATCH=1; ediff src/c99-to-c89.diff new-diff
4643
4644         * src/c99-to-c89.diff: Update to reflect new offsets in rm.c.
4645
4646 2006-10-26  Jim Meyering  <jim@meyering.net>
4647
4648         * src/system.h (ftello): Add a compile-time check for the highly
4649         unlikely condition of off_t narrower than long int, rather than
4650         handling it at run time.  Based on a patch from Paul Eggert.
4651
4652 2006-10-25  Paul Eggert  <eggert@cs.ucla.edu>
4653
4654         * tests/chmod/c-option: When double-quoting part of a word, prefer
4655         to double-quote the whole word.  This is a bit easier to read (at
4656         least for me), and in some cases it avoids a shell bug with Tru64
4657         4.0 sh reported by Nelson H. F. Beebe.  For example, instead of
4658         "$abs_srcdir"/../setgid-check we now write
4659         "$abs_srcdir/../setgid-check".
4660         * tests/cp/cp-parents: Likewise.
4661         * tests/du/inaccessible-cwd: Likewise.
4662         * tests/du/long-from-unreadable: Likewise.
4663         * tests/install/basic-1: Likewise.
4664         * tests/install/trap: Likewise.
4665         * tests/misc/close-stdout: Likewise.
4666         * tests/mkdir/concurrent-1: Likewise.
4667         * tests/mkdir/p-1: Likewise.
4668         * tests/mkdir/p-3: Likewise.
4669         * tests/mkdir/parents: Likewise.
4670         * tests/mkdir/perm: Likewise.
4671         * tests/readlink/can-e: Likewise.
4672         * tests/readlink/can-f: Likewise.
4673         * tests/readlink/can-m: Likewise.
4674         * tests/rm/inaccessible: Likewise.
4675         * tests/rm/unread3: Likewise.
4676         * tests/touch/no-create-missing: Likewise.
4677
4678         * lib/.cvsignore: Add uinttostr.c.
4679
4680 2006-10-25  Jim Meyering  <jim@meyering.net>
4681
4682         Portability to Tru64 V4.0.
4683         * src/system.h (ftello) [!HAVE_FSEEKO && !defined ftello]:
4684         Define inline replacement function.
4685         This (along with a yesterday's fix for autoconf's
4686         _AC_SYS_LARGEFILE_MACRO_VALUE macro) makes it so coreutils
4687         now builds once more on Tru64 V4.0.  Reported by Nelson Beebe.
4688
4689 2006-10-25  Bruno Haible  <bruno@clisp.org>
4690
4691         * src/cat.c (infile): Add "const" to declaration.
4692         * src/csplit.c (prefix): Likewise.
4693         * src/printf.c (cfcc_msg): Likewise.
4694         * src/tail.c (valid_file_spec): Likewise.
4695         * src/cut.c (cut_file): Likewise, for a parameter.
4696         * src/expr.c (str_value): Likewise.
4697         * src/fold.c (fold_file): Likewise.
4698         * src/pr.c (init_header): Likewise.
4699         * src/dircolors.c (dc_parse_stream): Likewise, for a local.
4700         * src/tr.c (make_printable_str): Likewise.
4701         * src/nl.c (body_type, header_type, footer_type, current_type):
4702         (separator_str, build_type_arg, nl_file): Likewise, for many.
4703         * src/paste.c (main): Don't assign a read-only string to 'optarg'.
4704         * src/tac.c (separator, tac_seekable, copy_to_temp): Likewise.
4705
4706 2006-10-25  Jim Meyering  <jim@meyering.net>
4707
4708         * tests/sample-test: Update copyright year list to include only
4709         the current year, since this is what I'll want in any new test.
4710
4711 2006-10-24  Jim Meyering  <jim@meyering.net>
4712
4713         * src/c99-to-c89.diff: Update to reflect new offsets.
4714
4715         * NEWS: new feature: rm accepts new option: --one-file-system
4716         Suggested by Steve McIntyre in <http://bugs.debian.org/392925>.
4717         * src/remove.h (struct rm_options) [one_file_system]: New member.
4718         * src/rm.c (rm_option_init): Initialize it.
4719         (usage): Document the option.
4720         * src/mv.c (rm_option_init): Likewise.
4721         * src/remove.c (remove_dir): With --one-file-system and --recursive,
4722         for each directory command line argument, do not affect a file system
4723         different from that of the starting directory.  And give a diagnostic.
4724         * src/rm.c (ONE_FILE_SYSTEM): New enum.
4725         (main): Handle new option.
4726         * tests/rm/one-file-system: Test the above.
4727         * tests/rm/Makefile.am (TESTS): Add one-file-system.
4728         * tests/Makefile.am (check-root): Add the rm/one-file-system
4729         test to the list.
4730         (EXTRA_DIST): Add other-fs-tmpdir.
4731
4732         * tests/mv/setup: Removed.  Renamed to...
4733         * tests/other-fs-tmpdir: ...this new file.
4734         * tests/mv/Makefile.am (EXTRA_DIST): Remove setup.
4735         * tests/mv/acl: Reflect renaming: use ../other-fs-tmpdir.
4736         * tests/mv/backup-is-src: Likewise.
4737         * tests/mv/hard-link-1: Likewise.
4738         * tests/mv/leak-fd: Likewise.
4739         * tests/mv/mv-special-1: Likewise.
4740         * tests/mv/part-fail: Likewise.
4741         * tests/mv/part-hardlink: Likewise.
4742         * tests/mv/part-rename: Likewise.
4743         * tests/mv/part-symlink: Likewise.
4744         * tests/mv/partition-perm: Likewise.
4745         * tests/mv/to-symlink: Likewise.
4746         * tests/mv/into-self-2: Likewise.
4747
4748         Don't let a failure in one test stop "make -k" from running the others.
4749         * tests/Makefile.am (t1 t2 t3 t4 t5): New targets.
4750         (check-root): Depend on them, rather than executing the five
4751         commands in a single rule.  Reported by Greg Schafer.
4752
4753 2006-10-23  Bob Proulx  <bob@proulx.com>  (tiny change)
4754
4755         * Makefile.maint (alpha beta major): Use a better log message for
4756         the automatic commit of .prev-version.
4757
4758 2006-10-23  Jim Meyering  <jim@meyering.net>
4759
4760         * tests/misc/pwd-long: Undo last change, since it made Perl invoke
4761         pwd via a shell.  Instead, ensure that the absolute name of the
4762         pwd binary consists solely of reasonable characters.
4763         Whoops.  Don't exec the perl script.  Otherwise, the sh-trap-based
4764         clean-up code isn't run.
4765
4766         * NEWS: Add a line for 6.5-cvs.
4767         * configure.ac (AC_INIT): Bump to 6.5 and add "-cvs" suffix.
4768
4769 2006-10-22  Jim Meyering  <jim@meyering.net>
4770
4771         Version 6.4.
4772
4773         * NEWS: Record the 6.4 release date.
4774         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
4775
4776         * Makefile.maint: Complete the adaptation to function with a working
4777         directory that is using git (rather than cvs) for version control.
4778
4779 2006-10-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4780
4781         * tests/chmod/c-option: Double-quote instances of `$abs_srcdir'.
4782         * tests/cp/cp-parents: Likewise.
4783         * tests/mkdir/parents: Likewise.
4784         * tests/mkdir/perm: Likewise.
4785
4786         * tests/sample-test: Quote variables containing absolute build
4787         tree paths.  In the cleanup trap, make sure `cd' succeeds before
4788         `chmod'ing and `rm'ing the temporary files.
4789         * tests/chgrp/basic: Likewise.
4790         * tests/chgrp/deref: Likewise.
4791         * tests/chgrp/no-x: Likewise.
4792         * tests/chgrp/posix-H: Likewise.
4793         * tests/chgrp/recurse: Likewise.
4794         * tests/chmod/c-option: Likewise.
4795         * tests/chmod/equal-x: Likewise.
4796         * tests/chmod/equals: Likewise.
4797         * tests/chmod/inaccessible: Likewise.
4798         * tests/chmod/no-x: Likewise.
4799         * tests/chmod/octal: Likewise.
4800         * tests/chmod/setgid: Likewise.
4801         * tests/chmod/umask-x: Likewise.
4802         * tests/chmod/usage: Likewise.
4803         * tests/chown/basic: Likewise.
4804         * tests/chown/deref: Likewise.
4805         * tests/chown/separator: Likewise.
4806         * tests/cp/acl: Likewise.
4807         * tests/cp/backup-1: Likewise.
4808         * tests/cp/backup-dir: Likewise.
4809         * tests/cp/backup-is-src: Likewise.
4810         * tests/cp/cp-HL: Likewise.
4811         * tests/cp/cp-deref: Likewise.
4812         * tests/cp/cp-i: Likewise.
4813         * tests/cp/cp-mv-backup: Likewise.
4814         * tests/cp/cp-parents: Likewise.
4815         * tests/cp/deref-slink: Likewise.
4816         * tests/cp/dir-rm-dest: Likewise.
4817         * tests/cp/dir-slash: Likewise.
4818         * tests/cp/dir-vs-file: Likewise.
4819         * tests/cp/fail-perm: Likewise.
4820         * tests/cp/into-self: Likewise.
4821         * tests/cp/link: Likewise.
4822         * tests/cp/link-no-deref: Likewise.
4823         * tests/cp/link-preserve: Likewise.
4824         * tests/cp/no-deref-link1: Likewise.
4825         * tests/cp/no-deref-link2: Likewise.
4826         * tests/cp/no-deref-link3: Likewise.
4827         * tests/cp/perm: Likewise.
4828         * tests/cp/preserve-2: Likewise.
4829         * tests/cp/r-vs-symlink: Likewise.
4830         * tests/cp/same-file: Likewise.
4831         * tests/cp/slink-2-slink: Likewise.
4832         * tests/cp/sparse: Likewise.
4833         * tests/cp/special-bits: Likewise.
4834         * tests/cp/src-base-dot: Likewise.
4835         * tests/cp/symlink-slash: Likewise.
4836         * tests/dd/not-rewound: Likewise.
4837         * tests/dd/skip-seek2: Likewise.
4838         * tests/dd/unblock-sync: Likewise.
4839         * tests/du/2g: Likewise.
4840         * tests/du/8gb: Likewise.
4841         * tests/du/basic: Likewise.
4842         * tests/du/deref: Likewise.
4843         * tests/du/deref-args: Likewise.
4844         * tests/du/exclude: Likewise.
4845         * tests/du/fd-leak: Likewise.
4846         * tests/du/hard-link: Likewise.
4847         * tests/du/inaccessible-cwd: Likewise.
4848         * tests/du/long-from-unreadable: Likewise.
4849         * tests/du/long-sloop: Likewise.
4850         * tests/du/no-deref: Likewise.
4851         * tests/du/no-x: Likewise.
4852         * tests/du/restore-wd: Likewise.
4853         * tests/du/slash: Likewise.
4854         * tests/du/slink: Likewise.
4855         * tests/du/trailing-slash: Likewise.
4856         * tests/du/two-args: Likewise.
4857         * tests/fmt/long-line: Likewise.
4858         * tests/install/basic-1: Likewise.
4859         * tests/install/create-leading: Likewise.
4860         * tests/install/d-slashdot: Likewise.
4861         * tests/install/trap: Likewise.
4862         * tests/ln/misc: Likewise.
4863         * tests/ln/target-1: Likewise.
4864         * tests/ls/color-dtype-dir: Likewise.
4865         * tests/ls/dangle: Likewise.
4866         * tests/ls/dired: Likewise.
4867         * tests/ls/file-type: Likewise.
4868         * tests/ls/follow-slink: Likewise.
4869         * tests/ls/infloop: Likewise.
4870         * tests/ls/inode: Likewise.
4871         * tests/ls/m-option: Likewise.
4872         * tests/ls/no-arg: Likewise.
4873         * tests/ls/recursive: Likewise.
4874         * tests/ls/rt-1: Likewise.
4875         * tests/ls/stat-dtype: Likewise.
4876         * tests/ls/stat-failed: Likewise.
4877         * tests/ls/stat-vs-dirent: Likewise.
4878         * tests/misc/cat-proc: Likewise.
4879         * tests/misc/close-stdout: Likewise.
4880         * tests/misc/csplit: Likewise.
4881         * tests/misc/date-sec: Likewise.
4882         * tests/misc/false-status: Likewise.
4883         * tests/misc/head-c: Likewise.
4884         * tests/misc/head-pos: Likewise.
4885         * tests/misc/mknod: Likewise.
4886         * tests/misc/nl: Likewise.
4887         * tests/misc/nohup: Likewise.
4888         * tests/misc/pathchk1: Likewise.
4889         * tests/misc/printf: Likewise.
4890         * tests/misc/printf-hex: Likewise.
4891         * tests/misc/pwd-long: Likewise.
4892         * tests/misc/shuf: Likewise.
4893         * tests/misc/sort-rand: Likewise.
4894         * tests/misc/split-a: Likewise.
4895         * tests/misc/split-fail: Likewise.
4896         * tests/misc/split-l: Likewise.
4897         * tests/misc/stat-fmt: Likewise.
4898         * tests/misc/tac-continue: Likewise.
4899         * tests/misc/wc-files0: Likewise.
4900         * tests/mkdir/concurrent-1: Likewise.
4901         * tests/mkdir/p-1: Likewise.
4902         * tests/mkdir/p-2: Likewise.
4903         * tests/mkdir/p-3: Likewise.
4904         * tests/mkdir/p-slashdot: Likewise.
4905         * tests/mkdir/p-thru-slink: Likewise.
4906         * tests/mkdir/p-v: Likewise.
4907         * tests/mkdir/parents: Likewise.
4908         * tests/mkdir/perm: Likewise.
4909         * tests/mkdir/t-slash: Likewise.
4910         * tests/mv/acl: Likewise.
4911         * tests/mv/atomic: Likewise.
4912         * tests/mv/backup-dir: Likewise.
4913         * tests/mv/childproof: Likewise.
4914         * tests/mv/diag: Likewise.
4915         * tests/mv/dir-file: Likewise.
4916         * tests/mv/dir2dir: Likewise.
4917         * tests/mv/dup-source: Likewise.
4918         * tests/mv/hard-2: Likewise.
4919         * tests/mv/hard-3: Likewise.
4920         * tests/mv/hard-4: Likewise.
4921         * tests/mv/hard-link-1: Likewise.
4922         * tests/mv/hard-verbose: Likewise.
4923         * tests/mv/i-2: Likewise.
4924         * tests/mv/i-3: Likewise.
4925         * tests/mv/i-4: Likewise.
4926         * tests/mv/i-5: Likewise.
4927         * tests/mv/i-link-no: Likewise.
4928         * tests/mv/into-self-4: Likewise.
4929         * tests/mv/leak-fd: Likewise.
4930         * tests/mv/mv-special-1: Likewise.
4931         * tests/mv/no-target-dir: Likewise.
4932         * tests/mv/part-fail: Likewise.
4933         * tests/mv/part-hardlink: Likewise.
4934         * tests/mv/part-rename: Likewise.
4935         * tests/mv/part-symlink: Likewise.
4936         * tests/mv/partition-perm: Likewise.
4937         * tests/mv/perm-1: Likewise.
4938         * tests/mv/reply-no: Likewise.
4939         * tests/mv/trailing-slash: Likewise.
4940         * tests/mv/update: Likewise.
4941         * tests/od/od-N: Likewise.
4942         * tests/od/x8: Likewise.
4943         * tests/readlink/can-e: Likewise.
4944         * tests/readlink/can-f: Likewise.
4945         * tests/readlink/can-m: Likewise.
4946         * tests/readlink/rl-1: Likewise.
4947         * tests/rm/cycle: Likewise.
4948         * tests/rm/dangling-symlink: Likewise.
4949         * tests/rm/deep-1: Likewise.
4950         * tests/rm/dir-no-w: Likewise.
4951         * tests/rm/dir-nonrecur: Likewise.
4952         * tests/rm/dot-rel: Likewise.
4953         * tests/rm/empty-inacc: Likewise.
4954         * tests/rm/f-1: Likewise.
4955         * tests/rm/fail-2eperm: Likewise.
4956         * tests/rm/hash: Likewise.
4957         * tests/rm/i-1: Likewise.
4958         * tests/rm/i-no-r: Likewise.
4959         * tests/rm/ignorable: Likewise.
4960         * tests/rm/inaccessible: Likewise.
4961         * tests/rm/interactive-always: Likewise.
4962         * tests/rm/interactive-once: Likewise.
4963         * tests/rm/ir-1: Likewise.
4964         * tests/rm/isatty: Likewise.
4965         * tests/rm/no-give-up: Likewise.
4966         * tests/rm/r-1: Likewise.
4967         * tests/rm/r-2: Likewise.
4968         * tests/rm/r-3: Likewise.
4969         * tests/rm/r-4: Likewise.
4970         * tests/rm/readdir-bug: Likewise.
4971         * tests/rm/rm1: Likewise.
4972         * tests/rm/rm2: Likewise.
4973         * tests/rm/rm3: Likewise.
4974         * tests/rm/rm4: Likewise.
4975         * tests/rm/rm5: Likewise.
4976         * tests/rm/sunos-1: Likewise.
4977         * tests/rm/unread2: Likewise.
4978         * tests/rm/unread3: Likewise.
4979         * tests/rmdir/fail-perm: Likewise.
4980         * tests/rmdir/t-slash: Likewise.
4981         * tests/shred/exact: Likewise.
4982         * tests/shred/remove: Likewise.
4983         * tests/sum/sysv: Likewise.
4984         * tests/tail-2/append-only: Likewise.
4985         * tests/tail-2/assert: Likewise.
4986         * tests/tail-2/assert-2: Likewise.
4987         * tests/tail-2/big-4gb: Likewise.
4988         * tests/tail-2/fflush: Likewise.
4989         * tests/tail-2/infloop-1: Likewise.
4990         * tests/tail-2/proc-ksyms: Likewise.
4991         * tests/tail-2/start-middle: Likewise.
4992         * tests/tail-2/tail-n0f: Likewise.
4993         * tests/tee/basic: Likewise.
4994         * tests/tee/dash: Likewise.
4995         * tests/touch/fail-diag: Likewise.
4996         * tests/touch/no-create-missing: Likewise.
4997         * tests/touch/not-owner: Likewise.
4998         * tests/touch/obsolescent: Likewise.
4999         * tests/touch/read-only: Likewise.
5000         * tests/touch/relative: Likewise.
5001
5002 2006-10-21  Jim Meyering  <jim@meyering.net>
5003
5004         * NEWS: (cp --backup fix): Fix a typo.
5005
5006         * .gitignore: Remove some references to files in subdirectories.
5007         * build-aux/.gitignore, doc/.gitignore, lib/.gitignore: New files.
5008         * m4/.gitignore, po/.gitignore, src/.gitignore: Likewise.
5009
5010         * src/copy.c (copy_internal): Add a comment saying why we prefer
5011         mknod over mkfifo.
5012
5013         Enable an fts optimization (call lstat only for directories,
5014         on some file system types) also with the --preserve-root option
5015         of chown or chgrp.
5016         * src/chown-core.c (change_file_owner): Compare fts_statp-based
5017         dev/ino against root dev/ino only for directories.
5018         (chown_files): Don't let the root_dev_ino setting influence whether
5019         we use FTS_NOSTAT: fts always sets *fts_statp for a directory.
5020
5021 2006-10-20  Jim Meyering  <jim@meyering.net>
5022
5023         * src/od.c (usage): Change description of default to use "-w16",
5024         not the now-invalid "-w 16" syntax.  From Dan Jacobson.
5025
5026 2006-10-19  Jim Meyering  <jim@meyering.net>
5027
5028         * bootstrap: Add names to each .gitignore file (if it exists)
5029         as well as to .cvsignore.
5030
5031         * Makefile.maint (po-check): This rule didn't detect the new use
5032         of "gettext" (as opposed to the use of "_" everywhere else) in
5033         lib/xstrtol.h.  Adjust the grep regexp so that now it does.
5034
5035 2006-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5036
5037         * src/copy.c (copy_reg): Rewrite slightly to avoid duplicate code
5038         when opening dst_name.
5039         (copy_reg, copy_internal): Use (SYSCALL != 0) rather than plain
5040         (SYSCALL) to test for failure in a system call.
5041
5042         * src/copy.c (copy_internal): Use mknod rather than mkfifo to copy
5043         a fifo.  This preserves the special mode bits on Solaris 10, which
5044         is compatible with what Solaris 10 cp -R does.
5045
5046         * src/copy.c (copy_internal): Remove redundant and confusing local
5047         variable src_type.
5048
5049         * src/copy.c (copy_internal): Don't pass mkdir a mode greater than
5050         7777.  This matches historical 'cp' behavior and avoids some
5051         (though not all) implementation-defined behavior of mkdir.
5052         * src/cp.c (make_dir_parents_private): Likewise.
5053         * src/copy.c (copy_internal): Don't pass 'open' a mode greater
5054         than 777.  This is required by POSIX.  It doesn't make any difference
5055         in actual behavior on any host that I know of.
5056
5057 2006-10-17  Jim Meyering  <jim@meyering.net>
5058
5059         * src/dd.c (usage): Use two spaces (not one) to separate the
5060         "fdatasync" option string from its description, so help2man formats
5061         the derived man page properly.  Reported by Samuel Thibault
5062         in <http://bugs.debian.org/393649>.
5063
5064 2006-10-16  Jim Meyering  <jim@meyering.net>
5065
5066         * .x-sc_trailing_blank: Remove names of files that are no longer
5067         version-controlled.
5068
5069 2006-10-16  Paul Eggert  <eggert@cs.ucla.edu>
5070
5071         * src/groups.sh (version): Reword message to match the other programs.
5072         Problem reported by Eric Blake.
5073
5074 2006-10-14  Jim Meyering  <jim@meyering.net>
5075
5076         * Makefile.maint (headers_with_interesting_macro_defs): Define.
5077         (.re-defmac, sc_always_defined_macros): New rules.
5078
5079         * src/system.h (EXIT_FAILURE, EXIT_SUCCESS): Remove definitions.
5080         Instead, include "exit.h".  This hereby retires the work-around for
5081         "Sony NEWS-OS Release 4.0C"'s bug due to "#define EXIT_FAILURE 0".
5082
5083         * src/cksum.c (uint_fast32_t): Don't define.
5084         Instead, include <stdint.h>.
5085
5086         * src/pinky.c (S_IWGRP): Don't define.
5087         It's already defined by "stat-macros.h" (included via system.h).
5088
5089         * Makefile.cfg: Remove cruft that's now handled via bootstrap.
5090         * Makefile.maint: Likewise, remove these targets/rules/variables:
5091         (local_updates, update, cvs-update, wget_files, get-targets): Remove.
5092         (cvs_files, wget-update, automake_repo): Likewise.
5093         Move the comment about cvsu to build-aux/vc-list-files,
5094         where cvsu is actually used.
5095
5096         * Makefile.maint (cvs-update): Use $(CVS), not "cvs".
5097
5098         Work also when the working directory (with e.g. coreutils sources)
5099         is version controlled with git, rather than CVS.
5100         * bootstrap (CVS_only_file): Test for the existence of README-cvs,
5101         rather than CVS.
5102         In messages and comments, say e.g., "checked-out sources",
5103         rather than "CVS sources".
5104         (version_controlled_file): New function.  Work for git as well as
5105         for CVS.  Don't use grep's -q option.
5106         (slurp): Call it here, in place of CVS-specific code.
5107
5108         * NEWS: cp -r --backup dir1 dir2, would rename an existing dir1/dir2
5109         to dir1/dir2~.
5110         * src/copy.c (copy_internal): Although we do create a backup of each
5111         destination directory when in move mode, don't do that when copying.
5112         Reported by Peter Breitenlohner, in
5113         <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8616>.
5114         * tests/cp/backup-dir: New file.  Test for the above.
5115         * tests/cp/Makefile.am (TESTS): Add backup-dir.
5116
5117 2006-10-13  Jim Meyering  <jim@meyering.net>
5118
5119         More chown/chgrp dereferencing-related fixes.
5120         * src/chown-core.c (change_file_owner): Don't use fts_statp if
5121         we're dereferencing symlinks.
5122         Reverse conjuncts, so that we use dereference file_stats
5123         (aka ent->fts_statp) only *after* we've confirmed that
5124         chopt->affect_symlink_referent is true.  Otherwise, we might
5125         use ent->fts_statp uninitialized.
5126         Don't turn on FTS_NOSTAT when dereferencing symlinks.
5127         * tests/chown/deref: Update the expected diagnostic, now that
5128         this test case (trying to use "chown --dereference ..." on a
5129         dangling symlink) takes a different code path.
5130
5131 2006-10-13  Paul Eggert  <eggert@cs.ucla.edu>
5132
5133         Sync from Bison, as follows:
5134
5135         2006-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5136
5137         Fix problems with translating English-language diagnostics.
5138         * bootstrap: Fix bug introduced in recent bootstrap changes, with
5139         respect to bison-runtime pot generation.  The YY_ stuff
5140         wasn't being captured.
5141
5142 2006-10-13  Jim Meyering  <jim@meyering.net>
5143
5144         * src/chown-core.c (change_file_owner): Use fstatat, not stat,
5145         now that we're using fts_open with FTS_CWDFD.
5146         * tests/chgrp/posix-H: Add --preserve-root to an invocation of
5147         chgrp, to exercise the above fix.
5148         * NEWS: Mention the above.
5149
5150         * src/du-tests: Clean up a little, though it's still not portable.
5151
5152         * .vg-suppressions: Add 3 more for debian unstable.
5153
5154         * tests/ls/Test.pm: Remove long-unused file.
5155         * Makefile.am (EXTRA_DIST): Add bootstrap.conf.
5156         Suggestions from Bruno Haible.
5157
5158 2006-10-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5159
5160         * Makefile.am (THANKS-to-translators): Add missing $(srcdir).
5161         (MAINTAINERCLEANFILES): Add .kludge-stamp.
5162         * man/Makefile.am (MAINTAINERCLEANFILES): Typo $(dist_man_MANS)
5163         instead of $(man_MANS).
5164
5165 2006-10-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5166
5167         * configure.ac: Avoid compiler warnings about default return
5168         type in function definitions and unused variables in tests.
5169         * src/who.c (print_user) [HAVE_UT_HOST]: hostlen is only needed
5170         if this is #defined.
5171
5172 2006-10-12  Jim Meyering  <jim@meyering.net>
5173
5174         * configure.ac: Reflect s/gl_MACROS/coreutils_MACROS/ renaming.
5175         Call gl_INIT directly, rather than through the above.
5176
5177 2006-10-11  Paul Eggert  <eggert@cs.ucla.edu>
5178
5179         * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
5180         variable was sometimes used without being initialized.  This
5181         messed up the installation of the INSTALL file in some cases.
5182
5183 2006-10-11  Jim Meyering  <jim@meyering.net>
5184
5185         * src/ls.c (usage): Correct description of -s, --size.
5186         It works even without -l.  Suggestion from Karl Berry.
5187
5188 2006-10-10  Paul Eggert  <eggert@cs.ucla.edu>
5189
5190         * src/ls.c (quote_name): Use initializer rather than memset to
5191         initialize an object to zero.  This is easier to read and is less
5192         likely to introduce a runtime error due to a mixup.  It causes
5193         gcc -W to issue a warning, but you can work around this by
5194         appending -Wno-missing-field-initializers.
5195         * src/pathchk.c (portable_chars_only): Likewise.
5196         * src/shred.c (main): Likewise.
5197         * src/stty.c (main): Likewise.
5198         * src/tr.c (card_of_complement): Likewise.
5199         * src/wc.c (wc): Likewise.
5200
5201 2006-10-09  Paul Eggert  <eggert@cs.ucla.edu>
5202
5203         * src/sort.c (usage): Mention again that sort fields are origin 1.
5204
5205         * NEWS: Fix typo: iso-8602 -> iso-8601.  Problem reported by
5206         Bob Proulx.
5207
5208         * bootstrap (usage, main program, symlink_to_gnulib): Add option
5209         --copy.  Inspired by a suggestion from Bruno Haible.
5210
5211 2006-10-09  Jim Meyering  <jim@meyering.net>
5212
5213         Avoid a compiler warning.
5214         * src/pathchk.c (portable_chars_only): Initialize variable of type
5215         mbstate_t via memset, rather than via '{0}'.  Patch from Bruno Haible.
5216
5217 2006-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5218
5219         Fix bug reported today by Mike Frysinger: mkdir -pv is logging the
5220         wrong file name in some cases.  Lars Wendler reported a bug in
5221         my original fix.
5222         * src/install.c (make_ancestor): New arg COMPONENT.
5223         * src/mkdir.c (make_ancestor): Likewise.
5224         * tests/install/basic-1: Check for install -Dv bug.
5225         * tests/mkdir/Makefile.am (TESTS): Add p-v.
5226         * tests/mkdir/p-v: New file, to test this bug.
5227
5228 2006-10-05  Paul Eggert  <eggert@cs.ucla.edu>
5229
5230         * src/chgrp.c: Don't include lchown.h; no longer needed.
5231         * src/chown.c: Likewise.
5232
5233         * tests/ls/stat-dtype: Use a dynamic test to decide whether the
5234         current file system has useful d_type info.
5235
5236         * src/dd.c (flags): noatime and nofollow now depend on
5237         HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, too.
5238         (usage): Output info about noatime and nofollow only if
5239         they are known to work.
5240         * src/remove.c (AD_push): Inspect HAVE_WORKING_O_NOFOLLOW rather
5241         than O_NOFOLLOW, when testing whether it's possible to avoid a
5242         race condition reliably.
5243
5244 2006-10-05  Jim Meyering  <jim@meyering.net>
5245
5246         * src/c99-to-c89.diff: Update to reflect new offsets.
5247
5248         * tests/install/basic-1: Skip the latter part of this test if the
5249         just-built dd binary is not readable.  Otherwise, this test would fail
5250         when binaries were created as root.  Reported by Bauke Jan Douma in
5251         <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8433>.
5252
5253 2006-10-03  Paul Eggert  <eggert@cs.ucla.edu>
5254
5255         * src/system.h (ST_BLKSIZE): Ceiling at SIZE_MAX / 8 + 1, not at 4
5256         MiB, since XFS hosts can legitimately have large values of
5257         st_blksize.  Problem reported by Tony Ernst in
5258         <http://savannah.gnu.org/bugs/?17903>.
5259
5260 2006-10-04  Jim Meyering  <jim@meyering.net>
5261
5262         * src/remove.c (nonexistent_file_errno): Remove ENAMETOOLONG.
5263         Paul Eggert pointed out that the specified file may exist,
5264         in spite of such an errno value.
5265         * tests/rm/Makefile.am (TESTS): Remove ignore-name-too-long.
5266         * tests/rm/ignore-name-too-long: Remove file.
5267         * NEWS: Update here, too.
5268
5269 2006-10-03  Jim Meyering  <jim@meyering.net>
5270
5271         * tests/rm/fail-eperm: Report failure also if rm is terminated by
5272         a signal.
5273
5274         * src/c99-to-c89.diff: Convert two c99'isms -- one in remove.c
5275         and one in shred.c -- that were added before coreutils-6.3.
5276         Reported by Michael Deutschmann.
5277
5278         * src/c99-to-c89.diff: Update to reflect new offsets.
5279
5280         * src/remove.c (remove_entry): With -f, exit successfully in spite
5281         of a missing file under some very unusual conditions (with errno
5282         being any of ENOENT, ENOTDIR, ENAMETOOLONG).
5283
5284         With --force (-f), rm no longer fails for ENOTDIR.
5285         * src/remove.c (ignorable_missing): New function.
5286         Use it everywhere, rather than open-coding the test.
5287         Andreas Schwab reported the ENOTDIR problem.
5288         (ignorable_missing): Similarly, don't fail for ENAMETOOLONG.
5289
5290         * NEWS: Mention the bug fix.
5291         * tests/rm/ignorable: New file.  Test for the ENOTDIR case.
5292         * tests/rm/ignore-name-too-long: New file. Test for ENAMETOOLONG.
5293         * tests/rm/Makefile.am (TESTS): Add the new file names.
5294
5295         * bootstrap: Undo last change to this file, since now gnulib-tool
5296         sticks with the automake default in generating dependencies.
5297
5298         * NEWS: Add a line for 6.4-cvs.
5299         * configure.ac (AC_INIT): Bump to 6.4 and add "-cvs" suffix.
5300
5301 2006-09-30  Jim Meyering  <jim@meyering.net>
5302
5303         Version 6.3.
5304         * NEWS: Record the 6.3 release date.
5305         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
5306
5307         * NEWS: Mention Paul's Solaris 8 vs. 10 work-around.
5308
5309         * src/c99-to-c89.diff: Update offsets.
5310
5311 2006-09-29  Paul Eggert  <eggert@cs.ucla.edu>
5312
5313         * tests/rm/readdir-bug: Don't use $(...) in a shell script,
5314         as it doesn't work with Solaris /bin/sh.
5315
5316 2006-09-29  Jim Meyering  <jim@meyering.net>
5317
5318         * NEWS: Mention Paul's fix (to gnulib's canon-host.c) for
5319         the pinky segfault.
5320
5321         * tests/seq/basic [neg-2, eq-wid-2]: Comment out tests that
5322         use .1 as the increment.  Actual output varies too much.
5323         [eq-wid-3]: New, commented out test.
5324
5325         * src/shuf.c (read_input): Fix an off-by-one error that
5326         would cause an infloop for piped input of 8KB or more.
5327         * NEWS: Mention the fix.
5328         * tests/misc/shuf: Test for the above fix.
5329
5330         Since any system may be affected by the Darwin readdir bug,
5331         perform the extra rewinddir unconditionally.  The performance
5332         impact of rewinding a directory is negligible.
5333         * src/remove.c (NEED_REWIND): Define to use
5334         CONSECUTIVE_READDIR_UNLINK_THRESHOLD unconditionally.
5335
5336         * tests/seq/basic: Use .11 as the upper bound, in case the ".1"
5337         increment translates to a slightly larger value.
5338         This corrects a test failure on FreeBSD 6.1 reported by Nelson Beebe.
5339         The final expected value wasn't being printed.
5340
5341         Work around a readdir bug in Darwin 7.9.0 (MacOS X 10.3.9) on HFS+
5342         and NFS, whereby rm would not remove all files in a directory.
5343         * src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Reduce to 10.
5344         (NEED_REWIND): New macro, so that we incur the cost of the work-around
5345         rewinddir only on afflicted systems.
5346         * NEWS: Clarify and correct.
5347         * tests/rm/readdir-bug: New file.  Test for the above fix.
5348         * tests/rm/Makefile.am (TESTS): Add it.
5349         Prompted by testing and analysis from Bruno Haible:
5350         http://lists.gnu.org/archive/html/bug-coreutils/2006-09/msg00326.html
5351
5352 2006-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5353
5354         * tests/rm/fail-eperm: Unset BASH_ENV, CDPATH, and ENV, too;
5355         suggested for Debian stable, which uses Perl 5.8.4.
5356
5357 2006-09-28  Jim Meyering  <jim@meyering.net>
5358
5359         Automatically generated dependencies are important even
5360         when all of the sources in a directory come from gnulib.
5361         * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
5362         option that gnulib-tool adds to what becomes our lib/gnulib.mk.
5363
5364         * tests/rm/fail-eperm: Enable Perl's (-T) taint checking.
5365         Ensure that IFS is set properly and unset PATH.
5366         Sanitize inputs.
5367         Work properly even when the name of the selected file starts with "-".
5368         Invoke rm via "../../src/rm", and adjust expected output.
5369         Prompted by a patch from Tim Waugh.
5370
5371         * README-cvs: Add Bison to the list of required packages.
5372
5373 2006-09-26  Jim Meyering  <jim@meyering.net>
5374
5375         * src/c99-to-c89.diff: Update offsets.
5376
5377         * NEWS: rm works around a bug in Darwin 8.6.1 w/NFS that kept
5378         it from removing a directory containing 188 or more entries.
5379         * src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Decrease by
5380         20, go work around the buggy readdir on Darwin 8.6.1 with NFS.
5381         Reported by Matthew Woehlke.
5382
5383 2006-09-26  Paul Eggert  <eggert@cs.ucla.edu>
5384
5385         * NEWS: "groups user" no longer outputs "user :"; you need at least
5386         two users.  "groups" now processes options like --help more compatibly.
5387         * src/groups.sh: Implement the option-processing change.
5388         Handle user and group names with special characters more robustly.
5389         Report write errors instead of exiting silently with status 1.
5390
5391 2006-09-26  Jim Meyering  <jim@meyering.net>
5392
5393         * README: Warn not to run autoreconf manually.  Use bootstrap instead.
5394
5395         * src/groups.sh: When invoked with 0 or 1 argument, just exec "id".
5396         Rewrite to avoid using temporary, $status.
5397
5398         * NEWS: Mention the bug fix.
5399         * src/groups.sh: Don't hide a write failure.
5400         Reported by Iain Calder <ic56@rogers.com>.
5401
5402 2006-09-25  Jim Meyering  <jim@meyering.net>
5403
5404         * src/chown.c (usage): Clarify --dereference description.
5405         * src/chgrp.c (usage): Likewise.  Suggestion from Jamie McClelland.
5406
5407 2006-09-24  Jim Meyering  <jim@meyering.net>
5408
5409         * NEWS: Mention these fixes.
5410         * src/copy.c (copy_reg): With --verbose (-v), print
5411         "removed `file_name'" just after unlinking a file.
5412         (copy_internal): Likewise, in three more places.
5413         Marc Lehman reported that "touch x; ln x y; mv -v x y" was silent.
5414         * tests/mv/hard-verbose: New file.  Test for the above fix.
5415         * tests/mv/Makefile.am (TESTS): Add hard-verbose.
5416
5417         * tests/help-version (sync_args): Don't call sync, since it spins up
5418         disks that I've deliberately caused to spin down (but not unmounted).
5419
5420         * NEWS: Mention the improvement to sort.
5421
5422         * tests/tail-2/proc-ksyms: Require that /proc/ksyms be readable
5423         as well as existing.
5424
5425         * tests/ls/stat-dtype: Don't use tmpfs on linux-2.4 or older,
5426         since that predated addition of d_type support.
5427
5428 2006-09-23  Jim Meyering  <jim@meyering.net>
5429
5430         * gl/modules/getloadavg.diff: New file.  Work around the way the latest
5431         version of the getloadavg module interacts with our bootstrap script.
5432         * bootstrap (gnulib_tool_options): Add "--local-dir gl".
5433         * Makefile.am (EXTRA_DIST): Sort file names.
5434         Add bootstrap and gl/modules/getloadavg.diff
5435
5436 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
5437
5438         * bootstrap: Add support for --force.
5439         (usage): New function.  Describe usage less tersely.
5440         (CVS_only_file): New var.
5441
5442         * NEWS: Document fix for cp -i and mv -i.
5443         * src/copy.c (copy_internal): With -i, prompt even if the source
5444         is a directory and the destination is not.  This is required by
5445         POSIX and gives the user a chance to bail out before failing.
5446         * tests/cp/Makefile.am (TESTS): Add cp-i.
5447         * tests/cp/cp-i: New file.
5448         * tests/mv/Makefile.am (TESTS): Add i-5.
5449         * tests/mv/i-5: New file.
5450
5451 2006-09-20  Jim Meyering  <jim@meyering.net>
5452
5453         * NEWS: Mention the chmod bug fix.
5454
5455         * tests/chmod/inaccessible: New test, specifically for this bug.
5456         Based on a test case from Paul Eggert.
5457         * tests/chmod/Makefile.am (TESTS): Add inaccessible.
5458
5459         Fix the 2006-09-18 bug differently.
5460         * src/chmod.c: (process_file): Upon FTS_NS for a top-level file,
5461         tell fts_read to stat the file again, in case it has become
5462         accessible since the initial fts_open call.
5463         * src/chown-core.c (change_file_owner): Likewise.
5464
5465         * src/chmod.c: Revert last change.  There is a better way.
5466         * src/chown-core.c: Likewise.
5467
5468 2006-09-19  Paul Eggert  <eggert@cs.ucla.edu>
5469
5470         * src/ln.c (target_directory_operand): Rewrite to avoid porting
5471         problem on Tandem reported by Matthew Woehlke in
5472         <https://savannah.gnu.org/bugs/?17172>.
5473
5474 2006-09-18  Paul Eggert  <eggert@cs.ucla.edu>
5475
5476         Fix bug where chmod, chown, and chgrp did not process operands
5477         left-to-right in some cases.
5478         * src/chmod.c (wd_errno): New var.
5479         (chmod_file): New function, with most of the contents of the
5480         old prcess_file function.
5481         (process_files): Use it.  This gives file names to fts one
5482         at a time, so that they are processed left-to-right as POSIX
5483         requires.
5484         * src/chown-core.c (wd_errno, chown_files): Likewise.
5485         (chown_file): New function.
5486         * tests/install/basic-1: Redo test so as to not workaround
5487         the chmod bug, thereby testing for it.
5488
5489         * src/shuf.c (main): Quote the entire range when reporting an
5490         invalid one, rather than just the part that contained the error.
5491
5492         * tests/stty/row-col-1: Rewrite to avoid temporary file that is
5493         sometimes left behind if the test is skipped or interrupted.
5494
5495         * bootstrap (symlink_to_gnulib): New function.
5496         (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
5497         to copies-of-gnulib.
5498         (cp_mark_as_generated, slurp, gnulib_files):
5499         Avoid making a copy if it's the same as the old version.
5500         (gnulib_files): Add support for this variable (used by Bison).
5501
5502         * tests/ls/stat-vs-dirent: Fix quoting problem in diagnostic
5503         indicating flaw in kernel.  Reword to say that the flaw isn't
5504         serious for coreutils, since the flaw does affect ls -i.
5505
5506         * tests/chgrp/basic: Fix bug in test case exposed by building on
5507         Solaris 8 in a setgid directory.  The test case incorrectly
5508         assumed that 'symlink' would be in group $g1.
5509
5510 2006-09-18  Jim Meyering  <jim@meyering.net>
5511
5512         * NEWS: Add a line for 6.3-cvs.
5513         * configure.ac (AC_INIT): Bump to 6.3 and add "-cvs" suffix.
5514
5515         Version 6.2.
5516         * NEWS: Record the 6.2 release date.
5517         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
5518
5519 2006-09-17  Jim Meyering  <jim@meyering.net>
5520
5521         * tests/chgrp/basic: On an OpenBSD system, rather than failing
5522         due to a known problem, merely warn about it.
5523         Rewrite to avoid testing output of chgrp --verbose and chgrp -c.
5524         Instead, use stat to test file system for desired results, directly.
5525         * tests/chgrp/Makefile.am (TESTS_ENVIRONMENT): Set host_triplet.
5526
5527         * tests/envvar-check: Add more variable names to the list of those
5528         that can affect these programs and tests: _POSIX2_VERSION, COLUMNS,
5529         QUOTING_STYLE, TABSIZE, TERM, TMPDIR.
5530
5531 2006-09-16  Paul Eggert  <eggert@cs.ucla.edu>
5532
5533         * NEWS: Document that mkdir -p and install -d now fork on occasion.
5534         * bootstrap.conf (gnulib_modules): Add savewd.
5535         * src/install.c: Include savewd.h.
5536         (process_dir): New function.
5537         (main, install_file_in_file_parents): Use it, along with the new
5538         savewd module, to avoid some race conditions.
5539         * src/mkdir.c: Include savewd.h.
5540         (struct mkdir_options): New members make_ancestor_function, mode,
5541         mode_bits.
5542         (make_ancestor): Return 1 if the resulting directory is not readable.
5543         (process_dir): New function.
5544         (main): Use it, along with new savewd module, to avoid some
5545         race conditions.  Fill in new slots of struct mkdir_options, so
5546         that callees get the values.
5547         * tests/install/basic-1: Test for coreutils 5.97 bug that was
5548         fixed in coreutils 6.0, and which should still be fixed with
5549         this change.
5550         * tests/mkdir/p-3: Likewise.
5551
5552 2006-09-15  Jim Meyering  <jim@meyering.net>
5553
5554         * bootstrap.conf (gnulib_modules): Add rename-dest-slash.
5555         The 2006-09-08 changes made it so "mv dir new-name/" would
5556         fail on NetBSD 1.6.  This makes it work once again.
5557
5558 2006-09-14  Jim Meyering  <jim@meyering.net>
5559
5560         * src/mv.c (main): Remove unnecessary (always-true) test for 2 <= n.
5561         Instead, since it's a little fragile, assert the condition.
5562         (target_directory_operand): Update comment to reflect latest change.
5563
5564 2006-09-12  Paul Eggert  <eggert@cs.ucla.edu>
5565
5566         * src/who.c (print_user): Rewrite to avoid warning from
5567         GCC 4.1.1 with -Wall.
5568
5569 2006-09-12  Jim Meyering  <jim@meyering.net>
5570
5571         * tests/mv/atomic: Check for specific strace output, rather than
5572         simply nonempty.  RHEL AS 4 would fail this test due to strace
5573         generating "[ Process PID=14434 runs in 32 bit mode. ]".
5574         Reported by Nelson Beebe.
5575
5576 2006-09-11  Jim Meyering  <jim@meyering.net>
5577
5578         * src/remove.c (remove_dir): Move new cache_stat_init call onto
5579         it's own line.
5580         (rm_1): Move declaration of "st" and new cache_stat_init call
5581         "down" to nearer where they're used.
5582         * src/c99-to-c89.diff: Add another set of curly braces.
5583
5584 2006-09-10  Paul Eggert  <eggert@cs.ucla.edu>
5585
5586         * src/expr.c (eval6): Fix buffer overrun, or bad performance, if
5587         substr's last operand is very large.  Performance problem reported
5588         by Sebastian Kreft.
5589
5590 2006-09-09  Jim Meyering  <jim@meyering.net>
5591
5592         * Makefile.maint (sc_prohibit_jm_in_m4): Don't hang when there
5593         are no .m4 files.
5594         (sc_require_config_h): Skip this test if there are no version-
5595         controlled .c files.
5596         (sc_prohibit_assert_without_use): Likewise.
5597
5598 2006-09-08  Jim Meyering  <jim@meyering.net>
5599
5600         * bootstrap: Export CVS_RSH separate from its assignment, to work
5601         even with Solaris 10's /bin/sh.  Suggestion from Mark D. Baushke.
5602
5603 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
5604
5605         * NEWS: tail now ignores the -f option if POSIXLY_CORRECT is set,
5606         no file operand is given, and standard input is any FIFO.
5607         This is in response to Open Group XCU ERN 114.
5608         * src/tail.c (main): Likewise.
5609
5610 2006-09-08  Jim Meyering  <jim@meyering.net>
5611
5612         mv and "cp -r" no longer fail when invoked with two arguments
5613         where the first one names a directory and the second name ends in
5614         a slash and doesn't exist.  E.g., "mv dir B/", for nonexistent B,
5615         now succeeds, once more. This reverts part of the 2004-06-27
5616         change for 5.3.0.
5617         * NEWS: Say the above.
5618         * src/mv.c (target_directory_operand): Don't require (here)
5619         that the target operand "look like" a directory.  This change
5620         pushes the test down to the rename syscall level, where a
5621         "mv dir existing-non-dir/" will mistakenly succeed on older systems
5622         that ignore trailing slashes in the rename destination argument.
5623         * src/cp.c (target_directory_operand): Likewise, but for cp.
5624         * tests/mv/trailing-slash: Exercise the above fixes.
5625         * tests/cp/trailing-slash: New file.
5626         * tests/cp/Makefile.am (EXTRA_DIST): Add trailing-slash.
5627
5628         * bootstrap: Use the previously unused variable, $src,
5629         to avoid repeating "$GNULIB_SRCDIR/$file".
5630
5631         * bootstrap (cp_mark_as_generated): Don't use "local", to
5632         accommodate ancient "/bin/sh".  Suggested by Ralf Wildenhues.
5633         Rename now-global "$src" and "$dst" to have cp_ prefix.
5634         Safer, and avoids confusion.
5635
5636         * bootstrap (cp_mark_as_generated): New function.
5637         (slurp): Use it to prepend editor hints and a warning that
5638         the file we're copying is generated.
5639         Suggestion from Bruce Korb.
5640         (cp_mark_as_generated): Don't add C-style comments for .l or .y files.
5641         Fix last-minute typo.
5642
5643 2006-09-07  Jim Meyering  <jim@meyering.net>
5644
5645         * bootstrap: Revert last change.  There are less disruptive ways
5646         to mark these generated files as read-only.
5647
5648         * src/c99-to-c89.diff: Update to have proper offsets.
5649
5650 2006-09-06  Jim Meyering  <jim@meyering.net>
5651
5652         Ensure that some gnulib-tool-generated files are read-only.
5653         * bootstrap (slurp): Put the body of this function in a sub-shell,
5654         with "umask a-w" so that all new files are read-only.  Remove each
5655         file before we write to it, in case it's read-only.
5656         Make po/Makevars and runtime-po/Makevars read-only, too.
5657
5658 2006-09-05  Jim Meyering  <jim@meyering.net>
5659
5660         * tests/cp/acl: Skip this test when cp lacks ACL support.
5661         * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Set $(CONFIG_HEADER).
5662
5663         * src/c99-to-c89.diff (remove.c): Adapt one hunk to match the new
5664         context from change of 2006-09-02.
5665
5666 2006-09-04  Jim Meyering  <jim@meyering.net>
5667
5668         * README-cvs: Fix typo in update command.
5669
5670 2006-09-03  Jim Meyering  <jim@meyering.net>
5671
5672         * NEWS: Tweak the wording in the new change description so that
5673         no one can think this change causes e.g., `rm -fr foo../' to fail.
5674
5675         * tests/rm/inaccessible: Adjust for movement of config.h to lib/.
5676         Use $CONFIG_HEADER, rather than hard-coding it.
5677         * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Set $CONFIG_HEADER.
5678
5679 2006-09-02  Paul Eggert  <eggert@cs.ucla.edu>
5680
5681         * NEWS: rm now rejects attempts to remove /, ./, and ../.
5682         * src/basename.c: Don't include dirname.h, since system.h does it now.
5683         * src/chmod.c: Likewise.
5684         * src/copy.c: Likewise.
5685         * src/cp.c: Likewise.
5686         * src/df.c: Likewise.
5687         * src/dircolors.c: Likewise.
5688         * src/dirname.c: Likewise.
5689         * src/du.c: Likewise.
5690         * src/install.c: Likewise.
5691         * src/ln.c: Likewise.
5692         * src/ls.c: Likewise.
5693         * src/mkdir.c: Likewise.
5694         * src/mv.c: Likewise.
5695         * src/remove.c: Likewise.
5696         * src/rm.c: Likewise.
5697         * src/rmdir.c: Likewise.
5698         * src/shred.c: Likewise.
5699         * src/split.c: Likewise.
5700         * src/su.c: Likewise.
5701         * src/system.h: Include "dirname.h", since dot_or_dotdot needs it
5702         now.
5703         (dot_or_dotdot): Succeed even if "." or ".." is followed by a
5704         slash.
5705         * src/rm.c (usage, main): --preserve-root is now the default.
5706         * src/remove.h: Fix comment.
5707         * src/remove.c (cache_fstatat, cache_stat_init): New functions.
5708         (cache_statted, cache_stat_ok): New functions.
5709         (write_protected_non_symlink): Remove struct stat ** buf_p arg,
5710         which is no longer needed with the new functions.  All callers
5711         changed.
5712         (prompt, is_dir_lstat, remove_entry, remove_dir):
5713         New struct stat * arg.  All callers changed.
5714         (write_protected_non_symlink, prompt, is_dir_lstat, remove_entry):
5715         (remove_cwd_entries, remove_dir, rm_1):
5716         Use and maintain the file status cache.
5717         (prompt, remove_entry): Omit the first "directory" in the diagnostic
5718         "Cannot remove directory `foo': is a directory".  This causes "rm"
5719         to pass a test case that it would otherwise fail now that it
5720         "knows" more about its argument.  I think the diagnostic is better
5721         without the first "directory" anyway.
5722         (prompt): Remove the no-longer-needed IS_DIR arg; all callers changed.
5723         (rm_1): Reject attempts to remove /, ./, or ../.
5724         * tests/rm/Makefile.am (TESTS): Add r-4.
5725         * tests/rm/r-4: New file.
5726
5727 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
5728
5729         * src/stat.c: Include <stddef.h>
5730         (alignof): New macro.
5731         (HAVE_STRUCT_STATXFS_F_FSID___VAL, HAVE_STRUCT_STATXFS_F_FSID_VAL):
5732         Remove.
5733         (STRUCT_STATXFS_F_FSID_IS_INTEGER): New macro.
5734         (FSID_VAL): Remove.
5735         (print_statfs): If f_fsid isn't an integer, grab its words one
5736         at a time in little-endian order.  This is a bit easier to configure
5737         and should avoid a compilation failure on MacOS reported by Bruno
5738         Haible.
5739
5740 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
5741
5742         * src/stat.c (HAVE_STRUCT_STATXFS_F_FSID_VAL, FSID_VAL): New macros, to
5743         work around a Mac OS X porting problem reported by Bruno Haible in
5744         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00308.html>.
5745         (print_statfs): Use them.
5746
5747         * bootstrap.conf (gnulib_modules): Add isapipe.
5748         * src/tail.c: Include isapipe.h.
5749         (IS_PIPE_LIKE_FILE_TYPE): Remove.
5750         (IS_TAILABLE_FILE_TYPE): Just list both FIFOs and sockets as
5751         tailable, since this seems to be portable.
5752         (main): Use isapipe, to fix a bug on MacOS X reported by Bruno Haible in
5753         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00304.html>.
5754
5755         * src/system.h (LOCALEDIR): Remove, since configmake.h now defines
5756         it for us.
5757
5758 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
5759
5760         * src/copy.c (copy_internal): Don't test whether macros like
5761         S_ISLNK are defined, since they're always defined now.
5762         * src/cp.c (main): Likewise.
5763         * src/ln.c (main): Likewise.
5764         * src/ls.c (get_link_name, make_link_name): Likewise.
5765         * src/mknod.c (main): Likewise.
5766         * src/mkfifo.c (usage): Likewise.
5767         * src/who.c (S_IWGRP): Likewise.
5768
5769         Adjust to recent gnulib changes for the gnulib module.
5770         * bootstrap.conf (gnulib_modules): Add fcntl.
5771         * src/system.h (SEEK_SET, SEEK_CUR, SEEK_END): Remove.  Other code
5772         is already assuming these macros are defined.
5773         (O_DIRECT, O_DIRECTORY, O_DSYNC, O_NDELAY, O_NOATIME, O_NONBLOCK):
5774         (O_NOCTTY, O_NOFOLLOW, O_NOLINKS, O_RSYNC, O_SYNC, O_BINARY, O_TEXT):
5775         Remove; the fcntl module now handles these.
5776
5777         Adjust to recent gnulib changes for the inttypes module.
5778         * bootstrap.conf (gnulib_modules): Remove stdint; add inttypes.
5779         (excluded_files): Don't exclude m4/inttypes-h.m4 or m4/inttypes-pri.m4.
5780
5781         * src/system.h: Don't bother to include <stdint.h>, since we can
5782         now assume inttypes.h does the equivalent of including stdint.h.
5783
5784 2006-08-27  Jim Meyering  <jim@meyering.net>
5785
5786         * src/copy.c (copy_internal): Don't make a backup if the last
5787         component of the source name is "." or "..".
5788         Reported by Andreas Schwab in http://savannah.gnu.org/bugs/?17540.
5789         * NEWS: Mention this.
5790         * tests/cp/src-base-dot: New file.  Test for the above fix.
5791         * tests/cp/Makefile.am (TESTS): Add src-base-dot.
5792
5793         * src/system.h (DOT_OR_DOTDOT): Remove macro.  Rewrite as a...
5794         (dot_or_dotdot): ...new static inline function.
5795         * src/remove.c (rm_1): Reflect this renaming.
5796         * src/ls.c (basename_is_dot_or_dotdot): Likewise.
5797
5798         * src/copy.c (copy_internal): Add comments.
5799
5800 2006-08-26  Paul Eggert  <eggert@cs.ucla.edu>
5801
5802         * src/Makefile.am (AM_CPPFLAGS): Remove -I$(srcdir) and -I../lib,
5803         since Automake supplies them for us.  It always did -I$(srcdir),
5804         and with the recent change to AC_CONFIG_HEADERS in configure.ac it
5805         is now also doing -I../lib.
5806
5807         * bootstrap (get_translations): Skip this if WGET_COMMAND is empty.
5808         Fail if the first "echo" fails.  Suppress diagnostics from "ls po/*.po"
5809         since there might not be any .po files.
5810         (WGET_COMMAND): Set to empty if wget doesn't
5811         seem to be available.
5812
5813 2006-08-26  Jim Meyering  <jim@meyering.net>
5814
5815         This test was failing in some environments.
5816         * tests/ls/color-dtype-dir: Don't rely on eval "`dircolors -b`"
5817         to set LS_COLORS in the environment.
5818         * tests/envvar-check: Instead, ensure that LS_COLORS is not set.
5819         Reported by Bob Proulx.
5820
5821         * src/c99-to-c89.diff: Remove hunk for copy.c; no longer needed.
5822
5823         * Makefile.am (EXTRA_DIST): Remove these files here, too:
5824         .x-sc_no_if_have_config_h, .x-sc_prohibit_assert_without_use,
5825         .x-sc_two_space_separator_in_usage.
5826
5827         Fix "mv --verbose --backup" so its output includes the
5828         " (backup: foo.~1~)" suffix also when backing up a directory.
5829         * NEWS: Report this bug fix.
5830         * src/copy.c (emit_verbose): New function, factored out of...
5831         (copy_internal): ...here.  Use the new function.
5832         * tests/mv/backup-dir: Test for the above fix.
5833         * tests/mv/Makefile.am (TESTS): Add backup-dir.
5834
5835 2006-08-25  Paul Eggert  <eggert@cs.ucla.edu>
5836
5837         * .x-sc_no_if_have_config_h: Remove; no longer needed.
5838         * .x-sc_prohibit_assert_without_use: Remove; it was empty.
5839         * .x-sc_two_space_separator_in_usage: Likewise.
5840         * Makefile.maint (sc_no_have_config_h): Renamed from
5841         sc_no_if_have_config_h, since it now checks that HAVE_CONFIG_H
5842         is absent everywhere.
5843         * bootstrap.conf (gnulib_modules): Add config-h.
5844         * src/shred.c: Include <config.h> unconditionally, since
5845         we now assume config.h exists.
5846         * src/dircolors.c: Likewise.
5847
5848 2006-08-26  Jim Meyering  <jim@meyering.net>
5849
5850         "ls --color" would highlight other-writable and sticky directories
5851         no differently than regular directories on a file system with
5852         dirent.d_type support.
5853         * NEWS: Say the above.
5854         * src/ls.c (gobble_file): With --color, also stat the file when
5855         we know it is a directory.
5856         Derived from an anonymous one-line fix and bug report:
5857         <http://savannah.gnu.org/bugs/?15043>.
5858         * tests/ls/color-dtype-dir: New file.  Test for the above fix.
5859         * tests/ls/Makefile.am (TESTS): Add color-dtype-dir.
5860
5861 2006-08-25  Paul Eggert  <eggert@cs.ucla.edu>
5862
5863         * .cvsignore: Remove stamp-h1.  Add coreutils-*, to ignore
5864         tarballs.
5865         * bootstrap.conf: Add configmake, verify.
5866         * src/.cvsignore: Remove localedir.h.
5867         * src/Makefile.am (localedir, DISTCLEANFILES, localedir.h): Remove;
5868         subsumed by configmake.
5869         * src/system.h: Include configmake.h rather than localedir.h
5870         (LOCALEDIR): New macro.
5871
5872         Rewrite to avoid some unnecessary casts, macros, literals.
5873         * src/shred.c (DEFAULT_PASSES, VERBOSE_UPDATE): Now constants,
5874         not macros.
5875         (SECTOR_SIZE, SECTOR_MASK): New constants.
5876         (fillpattern, dopass, do_wipefd, main): Remove unnecessary casts,
5877         and use the SECTOR_* constants when applicable.  Check for size <
5878         0 rather than size == -1, since negative-size files are a sign of
5879         trouble anyway.
5880
5881 2006-08-25  Bruno Haible  <bruno@clisp.org>
5882
5883         * src/shred.c (dopass): Assume a continuable error if EIO even
5884         if the current position is not a multiple of 512.
5885
5886 2006-08-24  Jim Meyering  <jim@meyering.net>
5887
5888         * src/stat.c (print_statfs): Fix typo: remove extra "sizeof".
5889
5890 2006-08-23  Paul Eggert  <eggert@cs.ucla.edu>
5891
5892         * src/stat.c (HAVE_STRUCT_STATXFS_F_FSID___VAL): Define.  This
5893         macro was being used without being defined.
5894         (SB_F_NAMEMAX): Remove cast.
5895         (f_fsid) [BeOS]: Likewise.
5896         (OUT_NAMEMAX): Renamed from NAMEMAX_FORMAT, with a new meaning.
5897         All uses changed.
5898         (out_string, out_int, out_uint, out_uint_o, out_uint_x): New
5899         functions.
5900         (xstrcat): Remove.  All uses changed to use the above functions.
5901         (print_statfs, print_stat): 2nd arg is now the prefix len, not the
5902         buffer len.  All uses changed.  Output '?', not '*', for unknown
5903         data or errors.  Do not assume signed values can be interchanged
5904         with unsigned when printing.
5905         (print_statfs): For %i, print the fsid as a single int, not as a
5906         pair.
5907         (print_it): Quote invalid format better.
5908
5909         * NEWS: printf supports the I flag.
5910         * src/printf.c (print_formatted) [glibc 2.2 or later]: Likewise.
5911
5912 2006-08-23  Bruno Haible  <bruno@clisp.org>
5913
5914         * src/stat.c (STRUCT_STATVFS, statfs, f_fsid, f_blocks, f_bfree) [BeOS]:
5915         (f_bavail, f_bsize, STATFS_FRSIZE, f_files, f_ffree) [BeOS]:
5916         (STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME) [BeOS]: Define.
5917
5918         * src/ls.c (SA_RESTART): Fallback define.
5919
5920 2006-08-23  Paul Eggert  <eggert@cs.ucla.edu>
5921
5922         * src/system.h (EDQUOT): Define if not already defined.
5923         Problem reported by Bruno Haible for BeOS.
5924
5925         * .cvsignore: Remove config.h, config.hin, as they are now
5926         in lib.
5927         * configure.ac (AC_CONFIG_HEADERS): Move config.h and config.hin
5928         to lib.
5929         * src/Makefile.am (AM_CPPFLAGS): Remove '-I..'; no longer needed.
5930
5931         * bootstrap (slurp): Define gl_LOCK_EARLY instead of gl_LOCK,
5932         to accommodate today's gnulib change.
5933
5934 2006-08-23  Jim Meyering  <jim@meyering.net>
5935
5936         * NEWS: Mention the sweeping infrastructure changes.
5937
5938 2006-08-22  Paul Eggert  <eggert@cs.ucla.edu>
5939
5940         * bootstrap.conf (gnulib_modules): Add gnupload.
5941         * Makefile.maint (emit_upload_commands): gnupload is now
5942         in build-aux.
5943         * gnupload: Remove from CVS, since it's now a gnulib module.
5944
5945         * bootstrap (bootstrap_conf_cleanup): Remove.
5946         (excluded_files): New var.
5947         * bootstrap.conf: Likewise.
5948         * bootstrap (slurp): Exclude files early if they're in the
5949         excluded_files list.  That way, their names don't get put into
5950         .cvsignore.
5951
5952         * aclocal.m4, config.hin, configure:
5953         Remove from CVS, since ./bootstrap generates them automatically.
5954         * .cvsignore: Add INSTALL, Makefile.in, aclocal.m4, config.hin,
5955         configure, *.cache, *.lineno, *.log.
5956         Remove more-specific entries.  This catches files like configure.lineno.
5957         * man/.cvsignore: Add Makefile.in.
5958         * src/.cvsignore: Add Makefile.in.
5959         Remove .version, dir.c, install, mvdir, stamp-v, vdir.c, version.c.
5960
5961         * tests/.cvsignore:
5962         * tests/chgrp/.cvsignore:
5963         * tests/chmod/.cvsignore:
5964         * tests/chown/.cvsignore:
5965         * tests/cp/.cvsignore:
5966         * tests/cut/.cvsignore:
5967         * tests/dd/.cvsignore:
5968         * tests/dircolors/.cvsignore:
5969         * tests/du/.cvsignore:
5970         * tests/expr/.cvsignore:
5971         * tests/factor/.cvsignore:
5972         * tests/fmt/.cvsignore:
5973         * tests/head/.cvsignore:
5974         * tests/install/.cvsignore:
5975         * tests/join/.cvsignore:
5976         * tests/ln/.cvsignore:
5977         * tests/ls/.cvsignore:
5978         * tests/ls-2/.cvsignore:
5979         * tests/md5sum/.cvsignore:
5980         * tests/misc/.cvsignore:
5981         * tests/mkdir/.cvsignore:
5982         * tests/mv/.cvsignore:
5983         * tests/od/.cvsignore:
5984         * tests/pr/.cvsignore:
5985         * tests/readlink/.cvsignore:
5986         * tests/rm/.cvsignore:
5987         * tests/rmdir/.cvsignore:
5988         * tests/seq/.cvsignore:
5989         * tests/sha1sum/.cvsignore:
5990         * tests/shred/.cvsignore:
5991         * tests/sort/.cvsignore:
5992         * tests/stty/.cvsignore:
5993         * tests/sum/.cvsignore:
5994         * tests/tac/.cvsignore:
5995         * tests/tail/.cvsignore:
5996         * tests/tail-2/.cvsignore:
5997         * tests/tee/.cvsignore:
5998         * tests/test/.cvsignore:
5999         * tests/touch/.cvsignore:
6000         * tests/tr/.cvsignore:
6001         * tests/tsort/.cvsignore:
6002         * tests/unexpand/.cvsignore:
6003         * tests/uniq/.cvsignore:
6004         * tests/wc/.cvsignore:
6005         Add Makefile.in.  Sort entries if necessary.  Remove *.I, *.E,
6006         *.X, *.O, *-tests, build-script, mk-script if they're never
6007         created in this directory.
6008
6009 2006-08-22  Bruno Haible  <bruno@clisp.org>
6010
6011         BeOS portability.
6012         * src/uptime.c: Include OS.h if it exists.
6013         (print_uptime): On BeOS, use the get_system_info function (actually a
6014         macro). Loop through utmp entries only if utmp.h or utmpx.h exists.
6015         (uptime): Call read_utmp only if utmp.h or utmpx.h exists.
6016
6017 2006-08-22  Jim Meyering  <jim@meyering.net>
6018
6019         * .cvsignore: Add ABOUT-NLS.
6020
6021         Move the check-AUTHORS rule to be run as part of "make distcheck",
6022         rather than "make check".
6023         * src/Makefile.am (check): Don't depend on check-AUTHORS; it would
6024         cause "make check" to fail on systems unable to build all binaries.
6025         * Makefile.maint (check-AUTHORS): New rule.
6026         (local-checks-available): Add it here.
6027         Reported by Bruno Haible.  Needed for BeOS.
6028
6029 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
6030
6031         * src/df.c (print_header, show_dev): Use a column width that
6032         depends on the block size of -P is specified and not autoscaling.
6033         Problem reported by Gustavo G. Rondina in:
6034         http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00164.html
6035
6036 2006-08-21  Jim Meyering  <jim@meyering.net>
6037
6038         * tests/dircolors/simple (a): Don't fail with an unexpected diagnostic
6039         when the shell variable, SHELL, is not set.
6040         Trigger the failure with "(unset SHELL; make check TESTS=simple)".
6041         Reported by Sven Joachim in <http://bugs.debian.org/355368>.
6042
6043         * src/od.c: Now that HAVE_UNSIGNED_LONG_LONG is no longer defined
6044         in config.h, change the uses to HAVE_UNSIGNED_LONG_LONG_INT.
6045         Otherwise, on a system with 4-byte longs, "od -t u8" fails with this:
6046         od: invalid type string `u8';
6047         this system doesn't provide a 8-byte integral type
6048         FIXME: add a test for this, but skip it when sizeof uintmax < 8.
6049
6050 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
6051
6052         Add a bootstrap procedure, so that the CVS version contains fewer
6053         files and we bootstrap the rest from gnulib, gettext, etc.
6054         * README-cvs: New file.
6055         * bootstrap: New file.
6056         * bootstrap.conf: New file.
6057         * .x-sc_trailing_blank: Remove config-log, .gdb-history.  Add .po.
6058         * configure.ac (AC_PREREQ): Move here from m4/*.m4, for benefit
6059         of gnulib-tool.
6060         (gl_DEFAULT_POSIX2_VERSION, gl_USE_SYSTEM_EXTENSIONS, gl_PERL):
6061         (gl_IGNORE_UNUSED_LIBRARIES): Remove; now done by gnulib.
6062         (gl_EARLY): Add.
6063         (gl_MACROS): Call just after gl_EARLY, just for clarity.
6064         * src/c99-to-c89.diff: Remove patch to ls.c; no longer needed.
6065         * src/kill.c (strtoimax): Remove decl.
6066         * src/ls.c: Include "wcwidth.h" instead of rolling it ourselves.
6067         * src/wc.c: Likewise.
6068         * src/ls.c (sort_files): Rewrite to avoid need for C99-style
6069         declaration, so that we don't need to patch this file.
6070         * src/printf.c (strtoimax, strtoumax): Remove decls.
6071         * src/su.c: Include getpass.h.
6072         (getpass): remove.
6073         * src/system.h: Include mempcpy.h, stpcpy.h, strpbrk.h.
6074         Include inttypes.h unconditionally.
6075         (LONGEST_MODIFIER, PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Remove.
6076         (stpcpy, strndup, strstr, strtoul, mempcpy, CHAR_MIN, CHAR_MAX):
6077         (SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, SHRT_MIN, SHRT_MAX, INT_MAX):
6078         (INT_MIN, INTMAX_MAX, INTMAX_MIN, UINT_MAX, LONG_MAX, ULONG_MAX):
6079         (SIZE_MAX, SSIZE_MAX, UINTMAX_MAX): Remove.
6080
6081         * ABOUT-NLS, INSTALL, Makefile.in, man/Makefile.in:
6082         * src/Makefile.in, tests/Makefile.in, tests/chgrp/Makefile.in:
6083         * tests/chmod/Makefile.in, tests/chown/Makefile.in:
6084         * tests/cp/Makefile.in, tests/cut/Makefile.in:
6085         * tests/dd/Makefile.in, tests/dircolors/Makefile.in:
6086         * tests/du/Makefile.in, tests/expr/Makefile.in:
6087         * tests/factor/Makefile.in, tests/fmt/Makefile.in:
6088         * tests/general/Makefile.in, tests/head/Makefile.in:
6089         * tests/install/Makefile.in, tests/join/Makefile.in:
6090         * tests/ln/Makefile.in, tests/ls/Makefile.in:
6091         * tests/ls-2/Makefile.in, tests/md5sum/Makefile.in:
6092         * tests/misc/Makefile.in, tests/mkdir/Makefile.in:
6093         * tests/mv/Makefile.in, tests/od/Makefile.in:
6094         * tests/pr/Makefile.in, tests/readlink/Makefile.in:
6095         * tests/rm/Makefile.in, tests/rmdir/Makefile.in:
6096         * tests/seq/Makefile.in, tests/sha1sum/Makefile.in:
6097         * tests/shred/Makefile.in, tests/sort/Makefile.in:
6098         * tests/stty/Makefile.in, tests/sum/Makefile.in:
6099         * tests/tac/Makefile.in, tests/tail/Makefile.in:
6100         * tests/tail-2/Makefile.in, tests/tee/Makefile.in:
6101         * tests/test/Makefile.in, tests/touch/Makefile.in:
6102         * tests/tr/Makefile.in, tests/tsort/Makefile.in:
6103         * tests/unexpand/Makefile.in, tests/uniq/Makefile.in:
6104         * tests/wc/Makefile.in:
6105         Remove from CVS, since ./bootstrap generates them automatically.
6106
6107 2006-08-20  Eric Blake  <ebb9@byu.net>
6108
6109         * src/stat.c (USE_STATVFS): Reinstate the patch from 2006-08-15;
6110         the patch from 2006-08-18 broke on cygwin.
6111
6112 2006-08-20  Jim Meyering  <jim@meyering.net>
6113
6114         * NEWS: Add a line for 6.2-cvs.
6115         * configure.ac (AC_INIT): Bump to 6.2 and add "-cvs" suffix.
6116
6117 2006-08-19  Jim Meyering  <jim@meyering.net>
6118
6119         * Version 6.1.
6120         * NEWS: Record the 6.1 release date.
6121         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
6122
6123         * tests/Makefile.am (EXTRA_DIST): Add sparse-file.
6124
6125         Avoid test failure when `make check' is run through debuild.
6126         * tests/help-version: Ensure that $SHELL is set to some value
6127         and exported.  Patch from Sven Joachim.  For details, see
6128         <http://bugs.debian.org/355368>.
6129
6130         * tests/ls/stat-dtype: Test for the 2006-08-17 `ls -CF' fix.
6131
6132         * README: Describe potential "pre-C99 build failure", and work-around.
6133
6134         Some of my 2006-07-03 changes to tests/*/Makefile.am were being
6135         backed out due to updates provoked by the copyright changes.
6136         * tests/Makefile.am.in (PATH): Prepend $(VG_PATH_PREFIX), so that
6137         it propagates to the derived Makefile.am files.
6138         ($(srcdir)/Makefile.am): Mark generated .am files as read-only,
6139         so we don't mistakenly edit them again.
6140         * tests/cut/Makefile.am: Regenerate.
6141         * tests/head/Makefile.am: Likewise.
6142         * tests/join/Makefile.am: Likewise.
6143         * tests/pr/Makefile.am: Likewise.
6144         * tests/sort/Makefile.am: Likewise.
6145         * tests/tac/Makefile.am: Likewise.
6146         * tests/tail/Makefile.am: Likewise.
6147         * tests/test/Makefile.am: Likewise.
6148         * tests/tr/Makefile.am: Likewise.
6149         * tests/uniq/Makefile.am: Likewise.
6150         * tests/wc/Makefile.am: Likewise.
6151
6152         * NEWS: Fix cp --sparse so that it preserves tail-end sparseness, even
6153         when the file's apparent size is not a multiple of its block size.
6154         * src/copy.c (copy_reg): Don't write a NUL before calling ftruncate.
6155         For some file sizes, writing that single byte would unnecessarily
6156         waste a few file blocks.  That write may have been necessary in the
6157         early days of Linux, but now, removing it should be safe.
6158         Based on a patch by Alan Curry: <http://bugs.debian.org/370792>
6159         * tests/cp/sparse: New test for the above.
6160         * tests/cp/Makefile.am (TESTS): Add sparse.
6161
6162         * tests/sparse-file: New file, essence factored out of...
6163         * tests/du/8gb: ... here.  Use the new script.
6164
6165 2006-08-18  Paul Eggert  <eggert@cs.ucla.edu>
6166
6167         * src/system.h (select_plural): Reduce by 1000000, not 1000, since
6168         the CVS gettext manual now suggests 1000000.
6169
6170 2006-08-18  Bruno Haible  <bruno@clisp.org>
6171
6172         Add support for NetBSD 3.0.
6173         * src/stat.c (USE_STATVFS): Set to 1 if 'struct statvfs' has a field
6174         f_fstypename.
6175         (STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME): Define also if 'struct statvfs'
6176         has a field f_fstypename.
6177         This undoes the 2006-08-15 to src/stat.c.
6178
6179 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
6180
6181         Copyright notice fixes.
6182
6183         * COPYING: Upgrade to latest version from FSF.
6184
6185         * src/uname.c: Use (C) in copyright notice.
6186
6187         * .vg-suppressions: Add copyright notice.
6188         * ChangeLog: Likewise.
6189         * ChangeLog-2005: Likewise.
6190         * Makefile.am: Likewise.
6191         * NEWS: Likewise.
6192         * README: Likewise.
6193         * README-valgrind: Likewise.
6194         * TODO: Likewise.
6195         * announce-gen: Likewise.
6196         * man/Makefile.am: Likewise.
6197         * man/chmod.x: Likewise.
6198         * man/chown.x: Likewise.
6199         * man/df.x: Likewise.
6200         * man/du.x: Likewise.
6201         * man/rm.x: Likewise.
6202         * src/dircolors.hin: Likewise.
6203         * src/du-tests: Likewise.
6204         * src/extract-magic: Likewise.
6205         * src/tac-pipe.c: Likewise.
6206         * src/wheel-gen.pl: Likewise.
6207         * tests/Coreutils.pm: Likewise.
6208         * tests/Makefile.am.in: Likewise.
6209         * tests/acl: Likewise.
6210         * tests/envvar-check: Likewise.
6211         * tests/expensive: Likewise.
6212         * tests/group-names: Likewise.
6213         * tests/help-version: Likewise.
6214         * tests/mk-script: Likewise.
6215         * tests/priv-check: Likewise.
6216         * tests/rwx-to-mode: Likewise.
6217         * tests/sample-test: Likewise.
6218         * tests/setgid-check: Likewise.
6219         * tests/chgrp/basic: Likewise.
6220         * tests/chgrp/deref: Likewise.
6221         * tests/chgrp/no-x: Likewise.
6222         * tests/chgrp/posix-H: Likewise.
6223         * tests/chgrp/recurse: Likewise.
6224         * tests/chmod/c-option: Likewise.
6225         * tests/chmod/equal-x: Likewise.
6226         * tests/chmod/equals: Likewise.
6227         * tests/chmod/no-x: Likewise.
6228         * tests/chmod/octal: Likewise.
6229         * tests/chmod/setgid: Likewise.
6230         * tests/chmod/umask-x: Likewise.
6231         * tests/chmod/usage: Likewise.
6232         * tests/chown/basic: Likewise.
6233         * tests/chown/deref: Likewise.
6234         * tests/chown/separator: Likewise.
6235         * tests/cp/Makefile.am: Likewise.
6236         * tests/cp/acl: Likewise.
6237         * tests/cp/backup-1: Likewise.
6238         * tests/cp/backup-is-src: Likewise.
6239         * tests/cp/cp-HL: Likewise.
6240         * tests/cp/cp-deref: Likewise.
6241         * tests/cp/cp-mv-backup: Likewise.
6242         * tests/cp/cp-parents: Likewise.
6243         * tests/cp/deref-slink: Likewise.
6244         * tests/cp/dir-rm-dest: Likewise.
6245         * tests/cp/dir-slash: Likewise.
6246         * tests/cp/dir-vs-file: Likewise.
6247         * tests/cp/fail-perm: Likewise.
6248         * tests/cp/into-self: Likewise.
6249         * tests/cp/link: Likewise.
6250         * tests/cp/link-no-deref: Likewise.
6251         * tests/cp/link-preserve: Likewise.
6252         * tests/cp/no-deref-link1: Likewise.
6253         * tests/cp/no-deref-link2: Likewise.
6254         * tests/cp/no-deref-link3: Likewise.
6255         * tests/cp/perm: Likewise.
6256         * tests/cp/preserve-2: Likewise.
6257         * tests/cp/r-vs-symlink: Likewise.
6258         * tests/cp/same-file: Likewise.
6259         * tests/cp/slink-2-slink: Likewise.
6260         * tests/cp/special-bits: Likewise.
6261         * tests/cp/symlink-slash: Likewise.
6262         * tests/cut/Makefile.am: Likewise.
6263         * tests/cut/Test.pm: Likewise.
6264         * tests/dd/misc: Likewise.
6265         * tests/dd/not-rewound: Likewise.
6266         * tests/dd/skip-seek: Likewise.
6267         * tests/dd/skip-seek2: Likewise.
6268         * tests/dd/unblock-sync: Likewise.
6269         * tests/dircolors/simple: Likewise.
6270         * tests/du/2g: Likewise.
6271         * tests/du/8gb: Likewise.
6272         * tests/du/Makefile.am: Likewise.
6273         * tests/du/basic: Likewise.
6274         * tests/du/deref: Likewise.
6275         * tests/du/deref-args: Likewise.
6276         * tests/du/exclude: Likewise.
6277         * tests/du/fd-leak: Likewise.
6278         * tests/du/files0-from: Likewise.
6279         * tests/du/hard-link: Likewise.
6280         * tests/du/inaccessible-cwd: Likewise.
6281         * tests/du/long-from-unreadable: Likewise.
6282         * tests/du/long-sloop: Likewise.
6283         * tests/du/no-deref: Likewise.
6284         * tests/du/no-x: Likewise.
6285         * tests/du/restore-wd: Likewise.
6286         * tests/du/slash: Likewise.
6287         * tests/du/slink: Likewise.
6288         * tests/du/trailing-slash: Likewise.
6289         * tests/du/two-args: Likewise.
6290         * tests/expr/basic: Likewise.
6291         * tests/factor/basic: Likewise.
6292         * tests/fmt/basic: Likewise.
6293         * tests/fmt/long-line: Likewise.
6294         * tests/general/Makefile.am: Likewise.
6295         * tests/general/atgeneral.m4: Likewise.
6296         * tests/general/dd.at: Likewise.
6297         * tests/head/Makefile.am: Likewise.
6298         * tests/head/Test.pm: Likewise.
6299         * tests/install/basic-1: Likewise.
6300         * tests/install/create-leading: Likewise.
6301         * tests/install/d-slashdot: Likewise.
6302         * tests/install/trap: Likewise.
6303         * tests/join/Makefile.am: Likewise.
6304         * tests/join/Test.pm: Likewise.
6305         * tests/ln/backup-1: Likewise.
6306         * tests/ln/misc: Likewise.
6307         * tests/ln/sf-1: Likewise.
6308         * tests/ln/target-1: Likewise.
6309         * tests/ls/Makefile.am: Likewise.
6310         * tests/ls/Test.pm: Likewise.
6311         * tests/ls/dangle: Likewise.
6312         * tests/ls/dired: Likewise.
6313         * tests/ls/file-type: Likewise.
6314         * tests/ls/follow-slink: Likewise.
6315         * tests/ls/infloop: Likewise.
6316         * tests/ls/inode: Likewise.
6317         * tests/ls/m-option: Likewise.
6318         * tests/ls/no-arg: Likewise.
6319         * tests/ls/recursive: Likewise.
6320         * tests/ls/rt-1: Likewise.
6321         * tests/ls/stat-dtype: Likewise.
6322         * tests/ls/stat-failed: Likewise.
6323         * tests/ls/stat-vs-dirent: Likewise.
6324         * tests/ls/symlink-slash: Likewise.
6325         * tests/ls/time-1: Likewise.
6326         * tests/ls-2/tests: Likewise.
6327         * tests/md5sum/basic-1: Likewise.
6328         * tests/md5sum/newline-1: Likewise.
6329         * tests/misc/Makefile.am: Likewise.
6330         * tests/misc/base64: Likewise.
6331         * tests/misc/basename: Likewise.
6332         * tests/misc/cat-proc: Likewise.
6333         * tests/misc/close-stdout: Likewise.
6334         * tests/misc/csplit: Likewise.
6335         * tests/misc/date: Likewise.
6336         * tests/misc/date-sec: Likewise.
6337         * tests/misc/df: Likewise.
6338         * tests/misc/dirname: Likewise.
6339         * tests/misc/expand: Likewise.
6340         * tests/misc/false-status: Likewise.
6341         * tests/misc/fold: Likewise.
6342         * tests/misc/head-c: Likewise.
6343         * tests/misc/head-elide-tail: Likewise.
6344         * tests/misc/head-pos: Likewise.
6345         * tests/misc/mknod: Likewise.
6346         * tests/misc/nice: Likewise.
6347         * tests/misc/nl: Likewise.
6348         * tests/misc/nohup: Likewise.
6349         * tests/misc/paste-no-nl: Likewise.
6350         * tests/misc/pathchk1: Likewise.
6351         * tests/misc/printf: Likewise.
6352         * tests/misc/printf-hex: Likewise.
6353         * tests/misc/pwd-long: Likewise.
6354         * tests/misc/sha224sum: Likewise.
6355         * tests/misc/sha256sum: Likewise.
6356         * tests/misc/sha384sum: Likewise.
6357         * tests/misc/sha512sum: Likewise.
6358         * tests/misc/shuf: Likewise.
6359         * tests/misc/sort-merge: Likewise.
6360         * tests/misc/sort-rand: Likewise.
6361         * tests/misc/split-a: Likewise.
6362         * tests/misc/split-fail: Likewise.
6363         * tests/misc/split-l: Likewise.
6364         * tests/misc/stat-fmt: Likewise.
6365         * tests/misc/stat-printf: Likewise.
6366         * tests/misc/tac-continue: Likewise.
6367         * tests/misc/test-diag: Likewise.
6368         * tests/misc/tty-eof: Likewise.
6369         * tests/misc/wc-files0: Likewise.
6370         * tests/misc/wc-files0-from: Likewise.
6371         * tests/mkdir/concurrent-1: Likewise.
6372         * tests/mkdir/p-1: Likewise.
6373         * tests/mkdir/p-2: Likewise.
6374         * tests/mkdir/p-3: Likewise.
6375         * tests/mkdir/p-slashdot: Likewise.
6376         * tests/mkdir/p-thru-slink: Likewise.
6377         * tests/mkdir/parents: Likewise.
6378         * tests/mkdir/perm: Likewise.
6379         * tests/mkdir/special-1: Likewise.
6380         * tests/mkdir/t-slash: Likewise.
6381         * tests/mkdir/writable-under-readonly: Likewise.
6382         * tests/mv/Makefile.am: Likewise.
6383         * tests/mv/acl: Likewise.
6384         * tests/mv/atomic: Likewise.
6385         * tests/mv/backup-is-src: Likewise.
6386         * tests/mv/childproof: Likewise.
6387         * tests/mv/diag: Likewise.
6388         * tests/mv/dir-file: Likewise.
6389         * tests/mv/dir2dir: Likewise.
6390         * tests/mv/dup-source: Likewise.
6391         * tests/mv/force: Likewise.
6392         * tests/mv/hard-2: Likewise.
6393         * tests/mv/hard-3: Likewise.
6394         * tests/mv/hard-4: Likewise.
6395         * tests/mv/hard-link-1: Likewise.
6396         * tests/mv/i-1: Likewise.
6397         * tests/mv/i-2: Likewise.
6398         * tests/mv/i-3: Likewise.
6399         * tests/mv/i-4: Likewise.
6400         * tests/mv/i-link-no: Likewise.
6401         * tests/mv/into-self: Likewise.
6402         * tests/mv/into-self-2: Likewise.
6403         * tests/mv/into-self-3: Likewise.
6404         * tests/mv/into-self-4: Likewise.
6405         * tests/mv/leak-fd: Likewise.
6406         * tests/mv/mv-special-1: Likewise.
6407         * tests/mv/no-target-dir: Likewise.
6408         * tests/mv/part-fail: Likewise.
6409         * tests/mv/part-hardlink: Likewise.
6410         * tests/mv/part-rename: Likewise.
6411         * tests/mv/part-symlink: Likewise.
6412         * tests/mv/partition-perm: Likewise.
6413         * tests/mv/perm-1: Likewise.
6414         * tests/mv/reply-no: Likewise.
6415         * tests/mv/setup: Likewise.
6416         * tests/mv/to-symlink: Likewise.
6417         * tests/mv/trailing-slash: Likewise.
6418         * tests/mv/update: Likewise.
6419         * tests/mv/vfat: Likewise.
6420         * tests/od/od-N: Likewise.
6421         * tests/od/x8: Likewise.
6422         * tests/pr/Makefile.am: Likewise.
6423         * tests/pr/Test.pm: Likewise.
6424         * tests/readlink/can-e: Likewise.
6425         * tests/readlink/can-f: Likewise.
6426         * tests/readlink/can-m: Likewise.
6427         * tests/readlink/rl-1: Likewise.
6428         * tests/rm/Makefile.am: Likewise.
6429         * tests/rm/cycle: Likewise.
6430         * tests/rm/dangling-symlink: Likewise.
6431         * tests/rm/deep-1: Likewise.
6432         * tests/rm/dir-no-w: Likewise.
6433         * tests/rm/dir-nonrecur: Likewise.
6434         * tests/rm/dot-rel: Likewise.
6435         * tests/rm/empty-inacc: Likewise.
6436         * tests/rm/empty-name: Likewise.
6437         * tests/rm/f-1: Likewise.
6438         * tests/rm/fail-2eperm: Likewise.
6439         * tests/rm/fail-eperm: Likewise.
6440         * tests/rm/hash: Likewise.
6441         * tests/rm/i-1: Likewise.
6442         * tests/rm/i-no-r: Likewise.
6443         * tests/rm/inaccessible: Likewise.
6444         * tests/rm/interactive-always: Likewise.
6445         * tests/rm/interactive-once: Likewise.
6446         * tests/rm/ir-1: Likewise.
6447         * tests/rm/isatty: Likewise.
6448         * tests/rm/no-give-up: Likewise.
6449         * tests/rm/r-1: Likewise.
6450         * tests/rm/r-2: Likewise.
6451         * tests/rm/r-3: Likewise.
6452         * tests/rm/rm1: Likewise.
6453         * tests/rm/rm2: Likewise.
6454         * tests/rm/rm3: Likewise.
6455         * tests/rm/rm4: Likewise.
6456         * tests/rm/rm5: Likewise.
6457         * tests/rm/sunos-1: Likewise.
6458         * tests/rm/unread2: Likewise.
6459         * tests/rm/unread3: Likewise.
6460         * tests/rm/unreadable: Likewise.
6461         * tests/rmdir/fail-perm: Likewise.
6462         * tests/rmdir/ignore: Likewise.
6463         * tests/rmdir/t-slash: Likewise.
6464         * tests/seq/basic: Likewise.
6465         * tests/sha1sum/basic-1: Likewise.
6466         * tests/sha1sum/sample-vec: Likewise.
6467         * tests/shred/exact: Likewise.
6468         * tests/shred/remove: Likewise.
6469         * tests/sort/Makefile.am: Likewise.
6470         * tests/sort/Test.pm: Likewise.
6471         * tests/sort-time/Makefile: Likewise.
6472         * tests/sort-time/README: Likewise.
6473         * tests/sort-time/rand-gen: Likewise.
6474         * tests/stty/basic-1: Likewise.
6475         * tests/stty/row-col-1: Likewise.
6476         * tests/sum/basic-1: Likewise.
6477         * tests/sum/sysv: Likewise.
6478         * tests/tac/Makefile.am: Likewise.
6479         * tests/tac/Test.pm: Likewise.
6480         * tests/tail/Makefile.am: Likewise.
6481         * tests/tail/Test.pm: Likewise.
6482         * tests/tail-2/Makefile.am: Likewise.
6483         * tests/tail-2/append-only: Likewise.
6484         * tests/tail-2/assert: Likewise.
6485         * tests/tail-2/assert-2: Likewise.
6486         * tests/tail-2/big-4gb: Likewise.
6487         * tests/tail-2/fflush: Likewise.
6488         * tests/tail-2/infloop-1: Likewise.
6489         * tests/tail-2/proc-ksyms: Likewise.
6490         * tests/tail-2/start-middle: Likewise.
6491         * tests/tail-2/tail-n0f: Likewise.
6492         * tests/tee/basic: Likewise.
6493         * tests/tee/dash: Likewise.
6494         * tests/test/Makefile.am: Likewise.
6495         * tests/test/Test.pm: Likewise.
6496         * tests/touch/Makefile.am: Likewise.
6497         * tests/touch/dangling-symlink: Likewise.
6498         * tests/touch/empty-file: Likewise.
6499         * tests/touch/fail-diag: Likewise.
6500         * tests/touch/fifo: Likewise.
6501         * tests/touch/no-create-missing: Likewise.
6502         * tests/touch/no-rights: Likewise.
6503         * tests/touch/not-owner: Likewise.
6504         * tests/touch/obsolescent: Likewise.
6505         * tests/touch/read-only: Likewise.
6506         * tests/touch/relative: Likewise.
6507         * tests/tr/Makefile.am: Likewise.
6508         * tests/tr/Test.pm: Likewise.
6509         * tests/tr/failures: Likewise.
6510         * tests/tsort/basic-1: Likewise.
6511         * tests/unexpand/basic-1: Likewise.
6512         * tests/uniq/Makefile.am: Likewise.
6513         * tests/uniq/Test.pm: Likewise.
6514         * tests/wc/Makefile.am: Likewise.
6515         * tests/wc/Test.pm: Likewise.
6516
6517 2006-08-17  Jim Meyering  <jim@meyering.net>
6518
6519         ls -CF would misalign columns in some cases.
6520         * src/ls.c (get_type_indicator): New function.  extracted from...
6521         (print_type_indicator): ...here.  Use it.
6522         (length_of_file_name_and_frills): Use it here, too, rather than
6523         assuming stat.st_mode is valid.
6524         Reported by Andreas Schwab, here:
6525         <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7774>
6526         See the test for this above. FYI, I did ls -CF /proc and visually
6527         inspected the result.
6528
6529         * src/copy.c (copy_internal, same_file_ok): Adjust comments not
6530         to mention the now-removed cp_options.xstat member.
6531
6532         * Makefile.maint (patch-check): Adapt to work now that the patch
6533         modifies more than one file in src/.
6534
6535         With this patch, permit building with Solaris cc on Solaris 7.
6536         * src/c99-to-c89.diff: Add diffs to convert more c99-isms.
6537         This integrates patches from Bruno Haible.
6538
6539 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
6540
6541         Fix some problems reported by Bruno Haible.
6542         * tests/chmod/setgid (abs_srcdir): Remove; not used or needed.
6543         Skip this test if "chmod g+s d" silently does nothing.
6544         * tests/ls-2/tests: Skip this test suite if we can't set up files
6545         properly for the setuid-etc test.  This simplifies some of the
6546         hacks we were using to work around porting problems.
6547
6548 2006-08-16  Jim Meyering  <jim@meyering.net>
6549
6550         * tests/cp/Makefile.am: Don't mark "acl" as XFAIL.
6551         * tests/cp/acl: Instead, skip the test if either setfacl
6552         or getfacl fails.
6553         Reported by Michael Stone.
6554
6555 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
6556
6557         * tests/lang-default (LC_ALL): Set to "C", so we get
6558         English-language diagnostics.  Unset the other variables; it
6559         should be portable to use 'unset' for this stuff nowadays.
6560         Problem reported by Bruno Haible.  Using "C" reverses the
6561         2000-10-22 change to fileutils in this area.
6562
6563         Fix bugs when printing plurals of numbers that are not
6564         unsigned long int values.
6565         * src/system.h (select_plural): New function.
6566         * src/md5sum.c (digest_check): Use select_plural to avoid bug.
6567         * src/uptime.c (print_uptime): Likewise.
6568         * src/dd.c (print_stats): Likewise.  Also, don't use ngettext to
6569         print a floating point number, as reducing to 0 or 1 doesn't work
6570         for some languages.  Instead, just use "s" for seconds since it
6571         doesn't need a plural form.
6572
6573 2006-08-16  Bruno Haible  <bruno@clisp.org>
6574
6575         Old versions of gzip would write --help output to stderr, and it
6576         would be annoying to see that in the output of every "make" command.
6577         * Makefile.maint (gzip_rsyncable): Throw away stderr output of
6578         "gzip --help".
6579
6580 2006-08-16  Andreas Schwab  <schwab@suse.de>
6581
6582         * tests/cp/acl: Don't use non-portable == operator for test.
6583
6584 2006-08-16  Jim Meyering  <jim@meyering.net>
6585
6586         * tests/ls/stat-dtype: Use stat to test file system type, rather
6587         than df -T, in case /etc/mtab lies.  Reported by Michael Stone.
6588
6589 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
6590
6591         * NEWS: Mention that df exits with nonzero status if it generates
6592         no output.  This change was in 6.0 but inadvertently unmentioned.
6593         * src/df.c (file_systems_processed): Renamed from n_valid_args, and now
6594         a boolean.
6595         (show_dev): Don't set it until we actually output something.
6596         Print the header if this is the first output.
6597         (main): Don't print a header, as that is now show_dev's job.
6598         * tests/misc/Makefile.am (TESTS): Add df.
6599         * tests/misc/df: New file.
6600
6601 2006-08-15  Eric Blake  <ebb9@byu.net>
6602
6603         * src/stat.c (USE_STATVFS): Define to 0 if f_type is needed, but
6604         statvfs.f_type not present.  See
6605         <http://savannah.gnu.org/bugs/?func=detailitem&item_id=16325>.
6606
6607 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
6608
6609         * src/dd.c (print_stats): Don't substitute "1" for number, as this
6610         causes confusion for the Hungarian translators.  Problem reported
6611         by Egmont Koblinger here:
6612         http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7726
6613
6614 2006-08-15  Jim Meyering  <jim@meyering.net>
6615
6616         * .x-sc_require_config_h: Add lib/at-func.c.
6617
6618         * NEWS: Add a line for 6.1-cvs.
6619         * configure.ac (AC_INIT): Bump to 6.1 and add "-cvs" suffix.
6620
6621 2006-08-15  Jim Meyering  <jim@meyering.net>
6622
6623         * Version 6.0.
6624         * NEWS: Record the 6.0 release date.
6625         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
6626
6627         * TODO: Add an item (convert to use gnulib-tool), add to the plan
6628         for id-vs-getgrouplist, and remove a few completed items.
6629
6630         * Makefile.maint (alpha beta major): Fix syntax error.
6631
6632 2006-08-13  Jim Meyering  <jim@meyering.net>
6633
6634         * src/shred.c (usage): Don't indent the second line of an item.
6635         Otherwise, help2man would misformat the output.
6636         Reported by Adam Buchbinder in <https://launchpad.net/bugs/48917>.
6637
6638 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
6639
6640         * configure.ac (AM_GNU_GETTEXT): Upgrade to need-formatstring-macros.
6641         Suggested by Eric Blake to avoid problems like
6642         <http://lists.gnu.org/archive/html/bug-coreutils/2006-07/msg00087.html>.
6643
6644 2006-08-11  Jim Meyering  <jim@meyering.net>
6645
6646         * tests/ls/stat-vs-dirent: Too many (losing) systems trigger the
6647         failure that this test checks for (stat/dirent inode mismatch at
6648         a mount point), so continue to give a diagnostic about the failure,
6649         but don't actually count it as a failure.
6650
6651 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
6652
6653         * ABOUT-NLS: Update from gettext 0.15.
6654         * configure.ac (AM_GNU_GETTEXT_VERSION): Update from 0.13.1 to 0.15.
6655
6656         * src/csplit.c (struct control): Remove fastmap member.
6657         (extract_regexp): Allocate fastmap separately, since otherwise
6658         it might move due to a realloc.  This fixes a bug that led
6659         to a core dump on 64-bit sparc Solaris 10 (Sun Studio 10).
6660
6661 2006-08-10  Jim Meyering  <jim@meyering.net>
6662
6663         * tests/ls/stat-dtype: If "." is tmpfs, skip this test unless uname -s
6664         reports "Linux".  This avoids a failure on Solaris 10's tmpfs.
6665         Redirect both stdout and stderr of df invocations.
6666
6667         * src/dircolors.hin: Add a TERM directive for each of the following:
6668         ansi, color-xterm, gnome, konsole, kterm, rxvt-cygwin,
6669         rxvt-cygwin-native, screen.linux, xterm-256color.
6670         Sort the TERM directives.
6671         From Mike Frysinger.
6672
6673 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
6674
6675         * src/dd.c (usage): Warn about oflag=append without conv=notrunc.
6676         See Debian bug 373736.
6677
6678         * src/dircolors.hin: Add mlterm, rxvt-unicode; this fixes Debian
6679         bug 317503.
6680
6681         * src/.cvsignore: Add shuf.
6682
6683         * Makefile.maint: Remove the po-update procedure; it doesn't
6684         work with the new repository on http://www.iro.umontreal.ca/.
6685         For now I guess we'll have to fix things by hand.
6686         (do-po-update, po-update): Remove.  All references removed.
6687
6688         * src/shuf.c (next_line): New function.
6689         (read_input): Use it, to avoid relying on GCC-specific behavior
6690         with void * arithmetic.  Problem reported by Bob Proulx.
6691         * Makefile.maint (my-distcheck): Compile with -Wpointer-arith
6692         to detect this sort of problem automatically in the future.
6693
6694 2006-08-09  Jim Meyering  <jim@meyering.net>
6695
6696         * src/ls.c: Add a compile-time check to ensure that filetype
6697         and filetype_letter have the same number of elements.
6698
6699         * tests/misc/sort-rand: Remove use of --seed=S.
6700
6701 2006-08-08  Paul Eggert  <eggert@cs.ucla.edu>
6702
6703         Add a command 'shuf', and modify shred and sort to use the new
6704         random number generator library of 'shuf'.
6705
6706         * AUTHORS: Add shuf.
6707         * README: Likewise.
6708         * NEWS: Likewise.  Mention new --random-source option for shred
6709         and sort.  Move "sort +1 -2" notice to the appropriate section,
6710         and clarify its role with respect to POSIXLY_CORRECT.
6711         * man/.cvsignore: Add shuf.1.
6712         * man/Makefile.am (dist_man_MANS): Add shuf.1.
6713         (shuf.1): New dependency.
6714         * man/shuf.x: New file.
6715         * src/Makefile.am (bin_PROGRAMS): Add shuf.
6716         (EXTRA_DIST): Remove rand-isaac.c.
6717         (shuf_LDADD): New macro.
6718         * src/rand-isaac.c: Remove, moving most of its contents to
6719         lib/rand-isaac.c.
6720         * src/shuf.c: New file.
6721         * src/shred.c: Use new random-number interface rather than rand-isaac.c.
6722         Don't include rand-isaac.c; include randint.h and randread.h instead.
6723         (RANDOM_SOURCE_OPTION): New enum.
6724         (long_opts, usage, main): New option --random-source.
6725         * src/sort.c: Likewise.
6726         * src/shred.c (struct irand_state, irand_init, irand32, irand_mod): Remove.
6727         All callers changed to use randint interface.
6728         (fillrand): Remove.  All callers changed to use randread interface.
6729         (dopass): Remove dependency on ISAAC buffer size.
6730         (genpattern): Don't wipe the random state here.
6731         (randint_source): New static var.
6732         (clear_random_data): New function.
6733         (main): Allocate random source, and arrange to wipe it on exit.
6734         * src/sort.c: Include md5.h, randread.h, xmemxfrm.h.
6735         (longopts, usage, main): Remove undocumented --seed option;
6736         it's now replaced by --random-source.
6737         (rand_state, get_hash): Remove.
6738         (randread_source): New static var.
6739         (random_state, cmp_hashes, compare_random): New functions; they guarantee
6740         no collisions in the random hash function.
6741         (keycompare): Use compare_random for -R; don't fall back on comparing
6742         via memcoll, since compare_random does the right thing.
6743         * tests/misc/Makefile.am (TESTS): Add shuf.
6744         * tests/misc/shuf: New file.
6745
6746 2006-07-29  Paul Eggert  <eggert@cs.ucla.edu>
6747
6748         * src/copy.c (set_author): Preserve the st_author field via the
6749         file descriptor dest_desc.
6750
6751 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
6752
6753         * NEWS: chmod now preserves setuid and setgid bits on directories
6754         if you use a numeric mode with them clear, e.g., "chmod 755 DIR".
6755
6756         Fix test case problems if working directory is setgid,
6757         reported by Bob Proulx.
6758         * tests/cp/fail-perm: Use symbolic mode so that we clear
6759         setgid bit more reliably on directories.
6760         * tests/mkdir/special-1 (set_mode_string): Likewise.
6761
6762 2006-07-27  Jim Meyering  <jim@meyering.net>
6763
6764         * src/chgrp.c (usage): Use correct grammar in description of the
6765         --reference option
6766         * src/chown.c (usage): Likewise.
6767
6768 2006-07-26  Thomas Schwinge  <tschwinge@gnu.org>  (tiny change)
6769
6770         * src/copy.c (set_author) [HAVE_STRUCT_STAT_ST_AUTHOR]:
6771         Correctly access SRC_SB's element ST_AUTHOR.
6772
6773 2006-07-26  Jim Meyering  <jim@meyering.net>
6774
6775         * tests/ls/stat-failed: Adapt to match new expected output.
6776         From Paul Eggert.
6777
6778         * src/ls.c (print_color_indicator): Test for S_IFREG first, rather
6779         than having the code test for all of the other types first.
6780         Hoist the set-uid/gid-testing code "up" into this new block.
6781         Classify any other type of file (e.g., S_TYPEISSHM, etc.) as
6782         C_ORPHAN, not as C_FILE.
6783
6784 2006-07-26  Jim Meyering  <jim@meyering.net>
6785
6786         Checking in a change from Paul.
6787
6788         2006-07-25  Paul Eggert  <eggert@cs.ucla.edu>
6789
6790         * src/ls.c (DT_INIT): Remove.  All uses removed.
6791         (enum filetype): Use an ordinary enum rather than trying to keep
6792         the values in sync with DT_FIFO etc.  That way, we don't have
6793         to make special assumptions about them.  All uses changed.
6794         (whiteout): New constant member of enum filetype.
6795         (filetype_letter): New constant, for use with enum filetype.
6796         (FILETYPE_INDICATORS): New initializer list.
6797         (print_dir): Add case for DT_WHT.
6798         (gobble_file): If stat fails, don't discard information from
6799         readdir; instead, preserve it so it can be printed.
6800         (print_long_format): Fall back on readdir result if stat info
6801         is not available.  Use "?" to denote each unknown mode char,
6802         instead of an overall "?", since we now know some of the mode
6803         typically.
6804         (print_type_indicator): Now that MODE isn't necessarily
6805         useful, guard all uses.
6806         Now that two blocks in the type-checking tree can set "type = C_FILE",
6807         move the suffix-handling code out and down.
6808
6809 2006-07-26  Jim Meyering  <jim@meyering.net>
6810
6811         Prepare for the above change.
6812         * src/ls.c [struct fileinfo] (stat_ok): Rename from stat_failed,
6813         and adjust uses.  From a patch by Paul Eggert.
6814
6815 2006-07-26  Jim Meyering  <jim@meyering.net>
6816
6817         * src/ls.c: Correct indentation/formatting in a few places.
6818
6819 2006-07-25  Paul Eggert  <eggert@cs.ucla.edu>
6820
6821         * tests/cp/fail-perm: Use "chmod 0500" rather than "chmod 500".
6822         Problem report and fix from Bob Proulx.
6823         * NEWS: Clarify the "chmod 0500" news, and correct the vague
6824         statements about compatibility with BSD.
6825
6826 2006-07-25  Jim Meyering  <jim@meyering.net>
6827
6828         * src/ls.c (gobble_file): When handling a stat-failed entry,
6829         print the entry name not the absolute_name -- to be consistent
6830         with the usual case.
6831         * tests/ls/stat-failed: Update accordingly.
6832
6833         * src/ls.c: Add parens around the new uses of ?: ternary operator.
6834
6835         * src/dircolors.hin: Mention that ORPHAN refers not just to dangling
6836         symlinks.
6837
6838         Get --dired offsets right when handling stat-failed entries.
6839         * src/ls.c (print_long_format): Be careful to increment P by the
6840         appropriate amount, even when inode_number_width and nlink_width
6841         are zero.
6842         * tests/ls/stat-failed: Test for the above.
6843
6844         * src/ls.c (gobble_file) [USE_ACL]: Don't use-uninitialized the
6845         have_acl member.  That would happen for a directory with both a
6846         non-stat'able entry and one with an ACL.
6847
6848         * src/ls.c (gobble_file): Make it so failure to stat a
6849         non-command-line file provokes an exit status of 1, not 0.
6850         Say "cannot access" rather than "cannot stat".
6851         * tests/ls/stat-failed: New file/test, for the above.
6852         * tests/ls/Makefile.am (TESTS): Add stat-failed.
6853         * tests/ls-2/tests (no-a-isdir-b): Update to reflect addition
6854         of "cannot access " to diagnostic.
6855
6856         * src/ls.c: Declare stat_failed to be "bool", not "int" everywhere.
6857
6858         * src/ls.c [enum filetype] (command_line): Remove member.  Not needed.
6859         Replace all occurrences of "type == command_line" with the
6860         equivalent, "command_line_arg".
6861
6862         * src/ls.c: Apply the stat-failed parts of Red Hat's
6863         coreutils-selinux.patch.  From Ulrich Drepper.
6864         This makes it so files not mentioned on the command line (e.g.,
6865         names read from a directory that *is* mentioned on the command
6866         line) for which stat fails are still listed.  With --color,
6867         such files are colored just like ORPHANs (aka dangling symlinks).
6868
6869         * src/df.c (n_valid_args): Declare global to be static.
6870
6871 2006-07-24  Jim Meyering  <jim@meyering.net>
6872
6873         * tests/ls/stat-dtype: Skip this test on reiserfs, since that file
6874         system lacks d_type support.
6875
6876 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
6877
6878         * man/chmod.x: Update to reflect recent changes to coreutils.texi.
6879
6880 2006-07-21  Jim Meyering  <jim@meyering.net>
6881
6882         * src/su.c (usage): Correct typo in --help output: s/commmand/command/
6883         Reported by Tim Waugh.
6884         Also remove the comment duplicating much of --help output.
6885
6886         * src/ls.c (FILE_TYPE_INDICATOR_OPTION): Reposition this new
6887         name so the list remains alphabetized.
6888
6889         Fix another bug: ls --indicator-style=file-type would call
6890         stat for a symlink, even though it wasn't always needed.
6891         In some cases, that unnecessary stat would cause ls to fail.
6892         * src/ls.c (gobble_file): Don't treat symlinks specially (in
6893         requiring a stat syscall).  Remove the offending exclusion.
6894
6895         * NEWS: Mention the fix.
6896
6897         * tests/ls/stat-dtype: New file/test, for the above fix.
6898         Also exercises the new df feature, below.
6899
6900         * src/df.c (main): Fail and don't print the headers if no
6901         file system is processed.  This makes it easy to test whether
6902         a specified directory is on a file system of a given type or types.
6903         Otherwise, applications would have had to parse df's output.
6904         E.g., is "." either ext3 or reiserfs: df -t ext3 -t reiserfs .
6905
6906         Fix a bug: ls --file-type worked like --indicator-style=slash,
6907         rather than like --indicator-style=file-type.
6908         * src/ls.c (FILE_TYPE_INDICATOR_OPTION): New enum member.
6909         (long_options): Map "file-type" to FILE_TYPE_INDICATOR_OPTION,
6910         not to 'p'.
6911         (decode_switches): Handle new case: FILE_TYPE_INDICATOR_OPTION.
6912         * NEWS: Mention the fix.
6913         * tests/ls-2/tests (file-type): New test, for the above fix.
6914
6915 2006-07-19  Jim Meyering  <jim@meyering.net>
6916
6917         * src/ls.c (print_dir): Give a better diagnostic for failed opendir.
6918
6919         * Makefile.am (EXTRA_DIST): Add build-aux/vc-list-files.
6920
6921 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
6922
6923         * NEWS: chmod, install, and mkdir now leave setgid and setuid bits
6924         of directories alone unless you specify them explicitly.
6925         install and mkdir now implement X correctly.
6926         install now creates parent directories with mode 755, without
6927         changing their owner or group.
6928         * src/chmod.c (process_file): Adjust to mode_adjust API change.
6929         * src/install.c: Include mkancesdirs.h.
6930         (announce_mkdir, make_ancestor): New functions.
6931         (DEFAULT_MODE): New macro, specifying initial value of 'mode'.
6932         (mode): Use it.
6933         (dir_mode, dir_mode_bits): New vars.
6934         (main): Set dir modes separately from nondir, so that the X
6935         op of -m works correctly.
6936         (main): Remove cwd_errno cruft, since make_dir_parents no longer
6937         affects cwd.  Adjust to new make_dir_parents API.
6938         (install_file_in_file_parents): 2nd arg is now char *, not char
6939         const *.  Use mkancesdirs instead of rolling our own code.
6940         (change_attributes): Don't worry about AFS, since that kludge
6941         should not be needed any more.
6942         * src/mkdir.c (struct mkdir_options): New struct.
6943         (announce_mkdir, make_ancestor): New functions.
6944         (main): Use them.  Adjust to mode_adjust API change.  Stick with
6945         umask 0.  Use make_dir_parents for all the work.
6946         * src/mkfifo.c (main): Adjust to new mode_adjust API.
6947         * src/mknod.c (main): Likewise.
6948         * tests/chmod/setgid: Do the setgid test instead of bailing.
6949         * tests/mkdir/p-3: Remove re_protect case that no longer applies.
6950         GNU chmod now behaves like other versions of chmod.
6951         * tests/mkdir/perm: Add a test for the X bug.
6952
6953 2006-07-14  Paul Eggert  <eggert@cs.ucla.edu>
6954
6955         * src/base64.c (do_decode): Output to parameter OUT, not to stdout.
6956         This doesn't fix any bugs, since OUT always equals stdout, but it
6957         makes the code easier to understand.
6958
6959 2006-07-14  Jim Meyering  <jim@meyering.net>
6960
6961         * Makefile.maint (CVS_LIST): Use new file, build-aux/vc-list-files,
6962         rather than open-coding it.  Now supports mercurial, too.
6963         * .hgignore: New file.
6964         * Makefile.am (EXTRA_DIST): Add .hgignore, which ignores nearly
6965         all generated files, including ones like configure and po/*.po
6966         that are currently version-controlled in cvs.
6967
6968         * Makefile.am (EXTRA_DIST): Add a few more .??* files.
6969         They've been in CVS, just haven't been distributed before this.
6970         Distribute ChangeLog-2005, too.
6971         (MAINTAINERCLEANFILES): Add THANKS-to-translators.
6972
6973 2006-07-11  Paul Eggert  <eggert@cs.ucla.edu>
6974
6975         * src/system.h: Assume <dirent.h> exists, since gnulib assumes
6976         this now as well.
6977
6978 2006-07-09  Jim Meyering  <jim@meyering.net>
6979
6980         * tests/mv/dir2dir: Adjust so failing with ENOTEMPTY is ok, too.
6981         That happens with Linux/tmpfs.
6982         * tests/mv/Makefile.am (TESTS): Add dir2dir.
6983
6984 2006-07-09  Paul Eggert  <eggert@cs.ucla.edu>
6985
6986         Adjust to recent updates from gnulib.
6987         * src/dd.c (apply_translations): Use toupper rather than
6988         islower followed by toupper; it's simpler and typically
6989         faster now that we assume at least C89 semantics.  Similarly
6990         for tolower.
6991         * src/sort.c (inittables): Likewise.
6992         * src/expand.c (expand): Don't assume that isprint etc. return
6993         booleans (needed for pre-C99 hosts).
6994         * src/fmt.c (check_punctuation): Likewise.
6995         * src/ptx.c (initialize_regex, fix_output_parameters): Likewise.
6996         * src/tr.c (is_char_class_member): Likewise.
6997         * src/unexpand.c (unexpand): Likewise.
6998         * src/join.c (is_blank): Remove; no longer needed.  All uses
6999         replaced by isblank (to_uchar (...)).
7000         * src/pinky.c (create_fullname): Don't assume char is unsigned.
7001         * src/printf.c (print_esc): Likewise.
7002         * src/ptx.c (SKIP_NON_WHITE, SKIP_WHITE, SKIP_WHITE_BACKWARDS):
7003         (copy_unescaped_string): Likewise.
7004         * src/stat.c (print_it): Likewise.
7005         * src/system.h (_D_EXACT_NAMELEN): Renamed from NLENGTH, for
7006         convenience on GNU systems.  All uses changed.  Don't bother
7007         looking for any dirent.h substitute other than ndir.h.
7008         (D_INO): Remove unnecessary parentheses.
7009         (IN_CTYPE_DOMAIN, ISGRAPH, ISPRINT, ISALNUM, ISALPHA):
7010         (ISCNTRL, ISLOWER, ISPUNCT, ISSPACE, ISUPPER, ISXDIGIT):
7011         (ISDIGIT_LOCALE, TOLOWER, TOUPPER): Remove.  All uses changed
7012         to ctype.h equivalents.
7013         (isblank): Renamed from ISBLANK.  Check for HAVE_DECL_ISBLANK too.
7014         All uses changed.
7015
7016 2006-07-08  Jim Meyering  <jim@meyering.net>
7017
7018         * tests/mv/dir2dir: New file, test for 2006-07-05 fix in copy.c.
7019
7020         * Makefile.maint (sc_the_the): New rule.
7021
7022         * src/dd.c (skip): Remove one of two adjacent "the"s in a comment.
7023         * tests/Coreutils.pm (run_tests): Remove one of two adjacent "then"s
7024         in a comment.
7025
7026 2006-07-07  Jim Meyering  <jim@meyering.net>
7027
7028         * NEWS: Mention that mv can now remove an empty destination directory,
7029         and give an example.  Prompted by a report from Florent Bayle.
7030
7031 2006-07-05  Jim Meyering  <jim@meyering.net>
7032
7033         * src/ls.c (usage): Correct the description of -G: it is useful
7034         only in a long listing.  Reported by Martin Pool in
7035         <https://launchpad.net/distros/ubuntu/+source/coreutils/+bug/51653>.
7036
7037         * man/chmod.x: Correct the description of the sticky bit.  Reported
7038         by Chris Moore via Ian Jackson in <http://bugs.debian.org/376745>.
7039
7040         * src/copy.c (copy_internal): Don't work around old NFS clients like
7041         SunOS-4.1.4 and Irix 5.3 that set errno to values like EIO and
7042         ENOTEMPTY upon failed rename.  Otherwise, we risk misinterpreting
7043         a banal failure as a recursive move-into-self failure.
7044         Reported by Florent Bayle in <http://bugs.debian.org/376749>.
7045
7046         * src/c99-to-c89.diff: Regenerate, to remove fuzz.
7047
7048 2006-07-03  Jim Meyering  <jim@meyering.net>
7049
7050         Plug another unusual leak.
7051         (AD_mark_helper): Free malloc'd filename if hash_insert says
7052         that string is already in the hash table.
7053
7054         The dev/inode of the topmost directory in each hierarchy were not
7055         being recorded.
7056         * src/remove.c (remove_cwd_entries): Don't call cycle_check here.
7057         (AD_push): Call it from here instead.
7058
7059         Fix two small leaks.
7060         * src/remove.c (AD_stack_clear): New function.
7061         (rm_1): Use it.
7062         (AD_pop_and_chdir): Free *prev_dir just before longjmp.
7063
7064         * tests/Makefile.am, tests/*/Makefile.am: (TESTS_ENVIRONMENT):
7065         Add $VG_PATH_PREFIX as a prefix to $PATH
7066
7067         * tests/envvar-check (vars): Add CDPATH and POSIXLY_CORRECT.
7068         * tests/Makefile.am (evar-check): Remove rule.
7069         (EXTRA_DIST): Remove .env-warn.
7070         * tests/.env-warn: Remove file.  No longer used.
7071         Suggestion from Eric Blake.
7072
7073 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
7074
7075         * src/system.h: Include <stdint.h> unconditionally, since we
7076         now assume the stdint module.
7077
7078 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
7079
7080         * NEWS: With no operand, 'tail -f' now silently ignores the '-f'
7081         only if standard input is a FIFO or pipe and POSIXLY_CORRECT is set.
7082         * src/tail.c (main): Implement this.
7083         * tests/tail/Test.pm (f-pipe-1): Renamed from f-1.
7084         (test_vector): Set POSIXLY_CORRECT for the f-pipe-* tests.
7085
7086 2006-07-01  Jim Meyering  <jim@meyering.net>
7087
7088         * src/ln.c (do_link): Use new, shorter URL, for ag-review link.
7089
7090         * .x-sc_require_config_h: Add ^lib/xstrtold\.c$, so make distcheck
7091         passes once again.
7092
7093 2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
7094
7095         * NEWS: seq now uses long double internally rather than double.
7096         It now defaults to a minimal fixed point format if possible.
7097         It lets you use %a, %A, %E, %F, %G.
7098         * src/Makefile.am (seq_LDADD): Remove $(SEQ_LIBM); add $(POW_LIB).
7099         * src/seq.c: Don't include <math.h> or <xstrtol.h>; no longer needed.
7100         (isfinite) [!defined isfinite]: New macro.
7101         (separator, terminator): Now points to const.
7102         (first, step, last): Remove.
7103         (usage): Update to match new behavior.
7104         (struct operand, operand): New type.
7105         (scan_arg): Renamed from scan_double_arg, since we no longer use double.
7106         All uses changed.
7107         Compute and return a value of type operand, not double.
7108         (long_double_format): Renamed from valid_format, and now returns a
7109         new format with an "L" added if needed, if the original format was
7110         valid.  Allow %a, %A, %E, %F, and %G formats.
7111         (print_numbers): Take numeric values as args rather than from globals.
7112         Print long double, not double.
7113         (get_width_format): Remove.
7114         (get_default_format): New function.
7115         (main): Implement new way of calculating default format.
7116         Don't worry about locale's representation of the decimal point, since
7117         the arguments are always processed in the C locale.
7118         * tests/seq/basic (neg-2): Adjust to new default format.
7119         (eq-wid-1, eq-wid-2): Resurrect these tests, since the new
7120         implementation should do the right thing.
7121
7122 2006-06-30  Jim Meyering  <jim@meyering.net>
7123
7124         * tests/stty/basic-1: Work around an intermittent test failure
7125         on HP-UX 11.11.  Report and analysis from Bob Proulx.
7126         http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7475
7127
7128 2006-06-28  Paul Eggert  <eggert@cs.ucla.edu>
7129
7130         * NEWS: Support obsolete usages like "sort +1 -2" even when
7131         conforming to POSIX 1003.1-2001, since this is a pure extension to
7132         POSIX.  Problem reported by Christian in:
7133         http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00220.html
7134         * src/sort.c (main): Implement this.
7135
7136         * src/system.h (CLOSEDIR): Remove.  All uses changed to closedir.
7137         Autoconf 2.60 says this stuff was obsolete.
7138
7139 2006-06-28  Jim Meyering  <jim@meyering.net>
7140
7141         * src/c99-to-c89.diff: Regenerate, to remove fuzz.
7142
7143 2006-06-28  Bob Proulx  <bob@proulx.com>  (tiny change)
7144
7145         * tests/mv/i-link-no: Work around HP-UX /bin/sh tracing problem
7146         (set -x when VERBOSE=yes) when stderr is redirected before stdout
7147         causing shell tracing of the stdout redirection to be written to
7148         the stderr file.  Avoid problem and test failure on HP-UX by
7149         redirecting stderr last.
7150         * tests/dd/unblock-sync: Order shell file redirections for
7151         stderr and stdout in the common style.
7152         tests/acl: Likewise.
7153
7154 2006-06-27  Jim Meyering  <jim@meyering.net>
7155
7156         * tests/misc/cat-proc: Try to avoid any spurious numeric
7157         differences in frequently-changing /proc/cpuinfo.
7158         Reported by Nelson Beebe.
7159
7160 2006-06-26  Jim Meyering  <jim@meyering.net>
7161
7162         Attempt rmdir (actually, unlinkat-with-AT_REMOVEDIR) upon any
7163         fd_to_subdirp failure, not just when errno == EACCES.
7164         * src/remove.c (remove_dir): Use unlinkat-with-AT_REMOVEDIR, not
7165         rmdir, here, even though rmdir may happen to be adequate.
7166
7167         * NEWS: rm no longer fails to remove an empty, unreadable directory
7168         * src/remove.c (remove_cwd_entries): If we can't open a directory,
7169         and the failure is not being ignored, try to remove the directory
7170         with rmdir (aka unlinkat-with-AT_REMOVEDIR), in case it's empty.
7171         Problem report and test case from Paul Eggert in
7172         <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7425>.
7173
7174         * tests/rm/empty-inacc: New test, for the above.
7175
7176         Avoid a segfault for wc --files0=- < /dev/null.
7177         * src/wc.c (compute_number_width): Return right away if nfiles == 0.
7178
7179 2006-06-25  Jim Meyering  <jim@meyering.net>
7180
7181         * NEWS: wc accepts a new option --files0-from=FILE, where FILE
7182         contains a list of NUL-separated file names.
7183
7184         * src/wc.c: Include "readtokens.h".
7185         (usage): Describe the new option, and adjust the `Usage':
7186         with this option, no FILE may be specified on the command line.
7187         (main): Handle the new option.
7188         * tests/misc/wc-files0: New tests, for the above.
7189         * tests/misc/wc-files0-from: Likewise.
7190         * tests/misc/Makefile.am (TESTS): Add wc-files0.
7191
7192 2006-06-24  Jim Meyering  <jim@meyering.net>
7193
7194         * src/md5sum.c (DIGEST_BUFFER): Remove now-unused definitions.
7195
7196 2006-06-22  Jim Meyering  <jim@meyering.net>
7197
7198         * src/tee.c (tee_files): Rename from tee, to avoid conflict with
7199         the function in glibc's <fcntl.h>.  Reported by Andreas Schwab.
7200
7201 2006-06-19  Jim Meyering  <jim@meyering.net>
7202
7203         * Makefile.cfg (local-checks-to-skip): Add changelog-check,
7204         so this check is not run as part of "make distcheck".
7205
7206 2006-06-18  Bob Proulx  <bob@proulx.com>  (tiny change)
7207
7208         * tests/misc/pwd-long: Fix typo (s/neq/ne/) in previous change.
7209
7210 2006-06-18  Jim Meyering  <jim@meyering.net>
7211
7212         * tests/misc/pwd-long: Make error output a little clearer.
7213
7214 2006-06-17  Jim Meyering  <jim@meyering.net>
7215
7216         * tests/rm/inaccessible: Skip this test on systems without openat
7217         support.  Reported by Bob Proulx.
7218
7219 2006-06-15  Bob Proulx  <bob@proulx.com>  (tiny change)
7220
7221         * tests/misc/mknod: Improve permission checks to handle
7222         running mkdir test in set-gid directories.
7223
7224 2006-06-14  Jim Meyering  <jim@meyering.net>
7225
7226         * tests/du/basic: Revamp not to hard-code file system block sizes.
7227
7228 2006-06-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
7229
7230         * tests/du/Makefile.am (TESTS_ENVIRONMENT): Pass $(PERL), for
7231         files0-from test.
7232
7233 2006-06-11  Jim Meyering  <jim@meyering.net>
7234
7235         * .gitignore: New file.
7236         * Makefile.am (EXTRA_DIST): Add .gitignore.
7237
7238         Setting TIME_STYLE=long-iso in the environment would make the
7239         cp/same-file test fail.
7240         * tests/envvar-check (vars): Add TIME_STYLE to the list.
7241         * tests/cp/same-file: Revert last change.
7242         Source the envvar-check script, to ensure that TIME_STYLE
7243         settings don't affect these tests.
7244
7245 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
7246
7247         * tests/cp/same-file: Execute 'ls' in the C locale, so that it
7248         uses POSIX time stamp formats.  Problem reported by John Nixon in
7249         <http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00062.html>.
7250
7251 2006-06-10  Jim Meyering  <jim@meyering.net>
7252
7253         * NEWS: Mention the AIX-strndup-bug vs. dircolors workaround.
7254
7255         Require a "Version N.M" line at the top of the ChangeLog
7256         file only when making the actual release, not when running
7257         "make distcheck".
7258         * Makefile.maint (maintainer-distcheck): Don't depend on
7259         changelog-check.
7260         (alpha beta major): Depend on it here, instead.
7261
7262 2006-06-08  Jim Meyering  <jim@meyering.net>
7263
7264         Ensure that cat works with any of the options, -A -v -e -E -T,
7265         when applied to files in /proc and /sys, even when the FIONREAD
7266         ioctl produces nonsensical results.  Before this change, cat would
7267         produce no output (or truncated output), for some linux kernels.
7268
7269         * src/cat.c (write_pending): New function, factored out of cat.
7270         (cat): Also interpret a negative ioctl/FIONREAD count as indicating
7271         that there are bytes to read.  Some versions of linux-2.6.16 do that.
7272         Write any pending output before returning.
7273         Reported by Dan Jacobson in <http://bugs.debian.org/370583>.
7274         * NEWS: Mention this bug fix.
7275         * tests/misc/cat-proc: New file.  Test for the above.
7276         * tests/misc/Makefile.am (TESTS): Add cat-proc.
7277
7278 2006-06-07  Paul Eggert  <eggert@cs.ucla.edu>
7279
7280         * src/expr.c (eval4): Detect overflow properly when multiplying
7281         INTMAX_MIN * -1.
7282
7283 2006-06-06  Paul Eggert  <eggert@cs.ucla.edu>
7284
7285         * NEWS: The 'expr' command now detects and reports integer overflow.
7286         (It would be better to use extended precision instead, but that
7287         would be more work.)
7288         * src/expr.c (integer_overflow): New function.
7289         (eval4, eval3): Check for integer overflow.
7290
7291 2006-06-05  Paul Eggert  <eggert@cs.ucla.edu>
7292
7293         Fix problems when building with Solaris/SVR4/etc. make, which uses a
7294         different and somewhat bogus implementation of VPATH.  In the
7295         directory tests/misc, rename tests whose names might appear in the
7296         Automake-generated rules.  For example, we can't use a test named
7297         'test', since Automake generates a rule that contains the text
7298         "if test -f ./$$tst; ...", and this might expand to something like
7299         "if ../../../coreutils-6.0/tests/misc/test -f ./$$test; ...",
7300         which executes the 'test' script rather than the 'test' command.
7301         * tests/misc/false-status: Renamed from tests/misc/false.
7302         * tests/misc/pwd-long: Renamed from tests/misc/pwd.
7303         * tests/misc/sort-merge: Renamed from tests/misc/sort.
7304         ($prog): Set to 'sort' rather than to $PROG.
7305         * tests/misc/test-diag: Renamed from tests/misc/test.
7306         * tests/misc/Makefile.am (PROG): Take the basename of $$tst,
7307         in case Solaris make has prepended the directory.
7308         (TESTS): Adjust to above renamings.
7309         * tests/misc/expand: Don't assign to PROG; no longer needed
7310         now that Makefile.am sets PROG to the basename.
7311         * tests/misc/fold: Likewise.
7312
7313 2006-06-03  Jim Meyering  <jim@meyering.net>
7314
7315         Make `cp --link --no-dereference' work also on systems where the
7316         link system call cannot create a hard link to a symbolic link.
7317         * src/copy.c (copy_internal) [LINK_FOLLOWS_SYMLINKS]: Don't use
7318         the link syscall on a symlink when it would do the wrong thing.
7319         Based on the patch by Aurelien Jarno: <http://bugs.debian.org/329451>
7320         * tests/cp/link-no-deref: New file/test for the above.
7321         * tests/cp/Makefile.am (TESTS): Add link-no-deref.
7322         * NEWS: Mention the change (doesn't affect Linux).
7323
7324 2006-06-01  Paul Eggert  <eggert@cs.ucla.edu>
7325
7326         Fix some porting problems in the test cases reported by
7327         Ralf Wildenhues for HP-UX 11.23 in:
7328         http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00238.html
7329         * tests/help-version: Don't assume that \< \> works in sed.
7330         * tests/misc/close-stdout: Don't assume that >&- works.
7331         Add a /dev/full test.
7332         * tests/touch/no-create-missing: Don't assume that >&- works.
7333
7334 2006-05-30  Jim Meyering  <jim@meyering.net>
7335
7336         * src/ls.c (usage): Add `v' to the list of sorting-related options.
7337         From Justin Pryzby.
7338
7339 2006-05-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
7340
7341         * tests/cp/fail-perm: source lang-default.
7342         * tests/rm/inaccessible: Likewise.
7343
7344 2006-05-28  Jim Meyering  <jim@meyering.net>
7345
7346         * tests/rm/inaccessible: AIX 4.3.3 gives a different diagnostic.
7347         Recognize it, too.  Reported by Ralf Wildenhues, in
7348         http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html
7349
7350 2006-05-27  Jim Meyering  <jim@meyering.net>
7351
7352         * src/chgrp.c: Support new options: --preserve-root and
7353         --no-preserve-root.  Somehow this program was skipped when those
7354         options were added to chown, chmod, and rm.  Reported by
7355         vaqflabuopac@spammotel.com in <http://bugs.debian.org/365656>.
7356         * NEWS: Mention this.
7357
7358 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
7359
7360         * NEWS: Remove mention of --seed.  We'll replace it with something
7361         better, and don't want to indicate that it is supported.
7362         * src/sort.c (usage): Likewise.
7363
7364 2006-05-20  Jim Meyering  <jim@meyering.net>
7365
7366         * src/chmod.c (main): Use FTS_PHYSICAL here, too.
7367
7368         * src/du.c (main): Rename local, s/symlink_deref_bit/symlink_deref_bits/
7369         and arrange for -D to set fts' FTS_PHYSICAL bit as well as
7370         FTS_COMFOLLOW.  Spotted by Justin Pryzby.
7371
7372         * gnupload: Merge changes from automake, retaining the ""--to...
7373         kludge to placate overzealous `make distcheck' check.
7374
7375 2006-05-19  Jim Meyering  <jim@meyering.net>
7376
7377         * src/du.c (main): Don't let -D, -L, or -P turn off the internal
7378         FTS_TIGHT_CYCLE_CHECK directory traversal option.
7379         Reported by Justin Pryzby in http://bugs.debian.org/367691
7380
7381 2006-05-15  Jim Meyering  <jim@meyering.net>
7382
7383         * src/cp.c (usage): Correct description of -a: s/-dpR/-dpPR/.
7384         From Tomas Pospisek.
7385
7386 2006-05-13  Jim Meyering  <jim@meyering.net>
7387
7388         * tests/mv/no-target-dir: Test two more cases.
7389
7390 2006-05-11  Jim Meyering  <jim@meyering.net>
7391
7392         mv -T DIR EMPTY_DIR no longer fails unconditionally
7393         * src/copy.c (copy_internal): Don't manually prohibit a move where
7394         the destination is an existing directory.  Sometimes doing that is
7395         valid.  Let the rename system call enforce the rules.  That is
7396         allowed only when the source is a directory and the destination
7397         directory (to be replaced) is empty.  Reported by Eric Blake.
7398         * tests/mv/no-target-dir: New file/test for this.
7399         * tests/mv/Makefile.am (TESTS): Add no-target-dir.
7400         * NEWS: Mention this.
7401
7402         * tests/mv/atomic: New file/test for yesterday's fix.
7403         * tests/mv/Makefile.am (TESTS): Add atomic.
7404
7405         * tests/du/long-sloop: Avoid harmless `ambiguous redirect' diagnostic.
7406
7407 2006-05-10  Jim Meyering  <jim@meyering.net>
7408
7409         * src/copy.c (copy_internal): Don't explicitly unlink the destination
7410         when moving a symlink into the place of an existing non-directory.
7411         Reported by Joshua Hudson.
7412         * NEWS: mention this.
7413
7414 2006-05-07  Jim Meyering  <jim@meyering.net>
7415
7416         * Makefile.maint (patch-check): Fail if patch generates any output,
7417         even merely for changed offsets.
7418
7419         * src/c99-to-c89.diff: Adjust to reflect new offsets.
7420
7421         * NEWS: Mention changes affecting df, pwd, shred.
7422
7423 2006-05-06  Jim Meyering  <jim@meyering.net>
7424
7425         * tests/ls/stat-vs-dirent: New test, to detect the bogus file
7426         system condition where dirent.d_ino != stat.st_ino.
7427         * tests/ls/Makefile.am (TESTS): Add stat-vs-dirent.
7428
7429 2006-05-06  Eric Blake  <ebb9@byu.net>
7430
7431         * tests/ls/inode: Expand to test inode from readdir case.
7432         * tests/ls/follow-slink: Expand to test broken links encountered
7433         implicitly, favoring Solaris 9 and OpenBSD 3.4 behavior.
7434
7435 2006-05-06  Eric Blake  <ebb9@byu.net>
7436
7437         * tests/mv/leak-fd: Work even on case-insensitive file system.
7438
7439 2006-05-04  Jim Meyering  <jim@meyering.net>
7440
7441         * NEWS: Mention the 2006-03-19 pwd-related change that makes
7442         lib/getcwd.c work around inconsistent file system dirent.d_ino data.
7443
7444 2006-05-03  Jim Meyering  <jim@meyering.net>
7445
7446         * src/ls.c (DEFINE_SORT_FUNCTIONS, LIST_SORTFUNCTION_VARIANTS):
7447         Use better macro parameter names: s/basename/key_name/,
7448         s/basefunc/key_cmp_func.  Fix typo in comment.
7449
7450 2006-04-29  Eric Blake  <ebb9@byu.net>
7451
7452         * src/ls.c (main): On systems with d_type, directories_first only
7453         implies format_needs_type, not format_needs_stat.
7454
7455 2006-05-03  Jim Meyering  <jim@meyering.net>
7456
7457         * src/ls.c (xstrcoll_df_version, rev_xstrcoll_df_version): Add space
7458         after comma in arg list, from Eric Blake.
7459
7460 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
7461
7462         * tests/misc/date (relative-3): New test, derived from a bug
7463         report by John Thomas McDole.
7464
7465 2006-04-23  Francesco Montorsi  <fr_m@hotmail.com>
7466
7467         New option for ls: --group-directories-first.
7468         It makes ls list directories before files.
7469         * NEWS [New features]: Mention it.
7470         * src/ls.c (sort_type): Rearrange to use as an array index when
7471         choosing sort function; added new sort_numtypes member for
7472         compile-time check.
7473         (time_type): Add new time_numtypes member for compile-time check.
7474         (directories_first): New global variable.
7475         (GROUP_DIRECTORIES_FIRST_OPTION): New enum.
7476         (long_options): Add --directories-first.
7477         (main): Support new option.
7478         (is_directory): New function.
7479         (extract_dirs_from_files): Use it.
7480         (DIRFIRST_CHECK, DEFINE_SORT_FUNCTIONS)
7481         (LIST_SORTFUNCTION_VARIANTS): New macros.
7482         (sort_functions): New global variable.
7483         (sort_files): Use it.
7484         (usage): Document new option.
7485
7486 2006-04-18  Paul Eggert  <eggert@cs.ucla.edu>
7487
7488         * src/shred.c (fillrand): The assertion was way too weak, due to
7489         what must be a typo.  Strengthen it to its intended value.
7490         (dopass): Don't use alloca; it's not worth the aggravation here,
7491         since it's used only to get a page-aligned buffer, and page
7492         alignment doesn't buy us much here.  I'm suspicious that alloca
7493         causes problems on some hosts, due to a recent bug report by Adam
7494         Waltman: http://bugs.gentoo.org/130246.
7495
7496 2006-04-18  Jim Meyering  <jim@meyering.net>
7497
7498         * tests/misc/tty-eof: Add new programs, base64, sha224sum, sha256sum,
7499         sha384sum, sha512sum.
7500
7501 2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
7502
7503         * src/chmod.c (describe_change): Adjust to filemode changes.
7504         * src/ls.c (HAVE_ST_DM_MODE): Remove; moved to ../lib/filemode.c.
7505         (print_long_format): Use (new) filemodestring rather than
7506         (old) mode_string, so that we get more file types right, at least
7507         in theory.  Adjust to filemode changes.
7508         * src/stat.c (human_access): Likewise.
7509
7510 2006-04-18  Jim Meyering  <jim@meyering.net>
7511
7512         * src/ptx.c (main) [DEFAULT_IGNORE_FILE]: Remove code to use a default
7513         ignore file.  This has never been enabled.  Reported by Eric Blake.
7514
7515 2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
7516
7517         * src/ln.c (linkfunc): Remove.  This method ran into a compiler/linker
7518         bug in Interix.  Just call symlink or link directly.  All uses changed.
7519         * src/setuidgid.c (main) [! HAVE_SETGROUPS]: Don't call setgroups.
7520         * src/stat.c (USE_STATVFS): New macro.
7521         Include <sys/statvfs.h> and use statvfs only if USE_STATVFS.
7522         (NAMEMAX_FORMAT): define a bit more clearly, now that the
7523         statvfs-using code is a bit more regular.
7524         * src/system.h (sync) [!HAVE_SYNC]: New macro.
7525
7526 2006-04-11  Paul Eggert  <eggert@cs.ucla.edu>
7527
7528         * NEWS: csplit, nl, expr now conform to POSIX better, and are
7529         more-compatible with traditional Unix, with respect to regular
7530         expressions.
7531         * src/csplit.c (extract_regexp): Set re_syntax_options to a
7532         value that is compatible with what POSIX requires.
7533         * src/nl.c (build_type_arg): Likewise.
7534         * src/expr.c (docolon): Likewise.  Also, don't let anchors match
7535         newline; this fixes an incompatibility with tradition and with POSIX.
7536         Don't warn about leading ^.  POSIX says it is unspecified whether
7537         ^ is a special character, which means that implementations can
7538         either treat it as special or not, but either way a warning is not
7539         allowed (unless the regexp is otherwise invalid).  Instead, anchor
7540         the expression but treat ^ as an anchor; this is the traditional
7541         behavior (e.g., Solaris 10).
7542         (eval4, eval3, eval2): Treat non-numeric args, division by zero,
7543         and the like as invalid expressions (exit status 2), not as
7544         failure of 'expr' (exit status 3).  This is more consistent with
7545         how Solaris behaves.
7546         * tests/expr/basic (fail-a): Adjust exit status to match new expr
7547         behavior, for status 2 versus 3.
7548         (anchor): New test.
7549         (bre1, bre2, bre3, bre4, bre5, bre6, bre7, bre8, bre9, bre10):
7550         (bre11, bre12, bre13, bre14, bre15, bre16, bre17, bre18, bre19, bre20):
7551         (bre21, bre22, bre23, bre24, bre25, bre26, bre27, bre28, bre29, bre30):
7552         (bre31, bre32, bre33, bre34, bre35, bre36, bre37, bre38, bre39, bre40):
7553         (bre41, bre42, bre43, bre44, bre45, bre46, bre47, bre48, bre49, bre50):
7554         (bre51, bre52, bre53, bre54, bre55, bre56, bre57, bre58, bre59, bre60):
7555         (bre61, bre62): New tests.
7556         * tests/misc/csplit: Use \{...\} in test RE, to test that we're
7557         conforming to POSIX.
7558
7559         Port to Solaris 8.
7560         * tests/du/long-from-unreachable: Solaris 8 sh doesn't understand
7561         "if !".  Do not assume that 'sed' can handle long, newline-free input.
7562         * tests/du/long-sloop: Likewise.  Evaluate expr once, not $n times.
7563
7564 2006-04-10  Paul Eggert  <eggert@cs.ucla.edu>
7565
7566         Adjust to new regex.h API (with new fastmap type), and clean
7567         up the regex storage allocation a bit.
7568
7569         * src/csplit.c (struct control): Put re_compiled member at the
7570         end, since it's large.  Change regexpr member from char * to bool;
7571         all uses changed.  Add new member fastmap.
7572         (extract_regexp): regexp arg is now char const *, not char *.
7573         Don't bother duplicating the regular expression; it's not needed.
7574         Set fastmap from new fastmap member.  Don't bother allocating
7575         a buffer, as the regexp code does a better job than we do.
7576         * src/expr.c (docolon): Allocate and use a fastmap.
7577         Don't bother allocating a buffer.
7578         * src/nl.c (body_fastmap, header_fastmap, footer_fastmap):
7579         New vars.
7580         (build_type_arg): New fastmap arg.  All uses changed.
7581         Don't bother allocating a buffer, but set a fastmap.
7582         * src/ptx.c (context_regex_string, word_regex_string): Remove.
7583         (context_regex, word_regex): New vars, replacing the above.
7584         All uses changed.
7585         (struct regex_data): New type.
7586         (compile_regex): Renamed from alloc_and_compile_regex, since
7587         we no longer allocate storage.  Arg is now a struct regex_data *,
7588         not a const char *.  All uses changed.  Don't allocate the fastmap;
7589         instead, take it from the caller.  Don't convert size_t to int,
7590         to avoid arithmetic overflow problems.  Don't bother freeing
7591         storage afterwards; it's not worth the aggravation.
7592         * src/tac.c (compiled_separator_fastmap): New ver.
7593         (main): Use it.  Don't bother allocating a buffer.
7594
7595 2006-03-30  Jim Meyering  <jim@meyering.net>
7596
7597         * src/dd.c (iwrite): Remove assignment without effect.
7598         Reported by Felix Rauch Valenti.
7599
7600 2006-03-22  Eric Blake  <ebb9@byu.net>
7601
7602         * src/ptx.c (usage): Remove mention of --copyright/-C.
7603         (main): Alias --copyright to --version plus a deprecation warning.
7604         * NEWS: Mention this.
7605
7606 2006-03-27  Jim Meyering  <jim@meyering.net>
7607
7608         * src/Makefile.am (uptime_LDADD): Add $(POW_LIB), for uptime's
7609         use of strtod.  Tiny patch from Nickolai Zeldovich.
7610
7611 2006-03-11  Eric Blake  <ebb9@byu.net>
7612
7613         * tests/misc/dirname: New file.
7614         * tests/basename/Makefile.am: Delete.
7615         * tests/basename/basic: Move to...
7616         * tests/misc/basename: ... this new file.  Add some tests,
7617         including fixed behavior for //.
7618         * tests/misc/Makefile.am (TESTS): Sort.  Add basename, dirname.
7619         * tests/Makefile.am (SUBDIRS): Remove basename.
7620         * configure.ac (AC_CONFIG_FILES): Remove tests/basename.
7621
7622         Improvements to dirname/basename handling on platforms like
7623         cygwin with distinct // and with drive letters.
7624         * NEWS: Document new behavior.
7625         * src/basename.c (main): Don't strip suffix from file system
7626         roots.
7627         * src/cp.c (target_directory_operand): Use new last_component.
7628         (ASSIGN_BASENAME_STRDUPA): Likewise.  Reduce time spent
7629         traversing the string.
7630         * src/dircolors.c (guess_shell_syntax): Use new last_component.
7631         * src/install.c (target_directory_operand, install_file_in_dir):
7632         Likewise.
7633         * src/ln.c (target_directory_operand, main): Likewise.
7634         * src/ls.c (basename_is_dot_or_dotdot): Likewise.
7635         * src/mv.c (target_directory_operand, movefile): Likewise.
7636         * src/remove.c (rm_1): Likewise.
7637         * src/shred.c (wipename): Likewise.
7638         * src/split.c (next_file_name): Likewise.
7639         * src/su.c (log_su, run_shell): Likewise.
7640
7641 2006-03-23  Paul Eggert  <eggert@cs.ucla.edu>
7642
7643         * NEWS: nohup diagnostics are now more precise, and nohup now
7644         redirects stderr to nohup.out if stdout is closed and stderr is a tty.
7645         * src/nohup.c (main): Implement this.
7646         * tests/misc/nohup: Test the new behavior.
7647
7648 2006-03-12  Jim Meyering  <jim@meyering.net>
7649
7650         * src/copy.c (set_author): Rename function, from preserve_author.
7651
7652         * src/remove.c (AD_pop_and_chdir): Use new macro,
7653         CYCLE_CHECK_REFLECT_CHDIR_UP, rather than open-coding it.
7654
7655         * src/system.h (SAME_INODE): Remove definition.
7656         Include "same-inode.h", instead.
7657
7658 2006-03-11  Eric Blake  <ebb9@byu.net>
7659
7660         * src/pwd.c (robust_getcwd): Prepend only one slash, not two.
7661
7662 2006-03-10  Jim Meyering  <jim@meyering.net>
7663
7664         Fix a bug whereby a user with write access to a directory being removed
7665         could cause the removal of that directory to fail with an erroneous
7666         diagnostic about a directory cycle.  Reported by Vineet Chadha.
7667
7668         * NEWS: Mention this.
7669         * src/remove.c (AD_pop_and_chdir): If the directory we're about to
7670         leave (and try to rmdir) is the one whose dev_ino is being used to
7671         detect a cycle, reset cycle_check_state.dev_ino to that of the parent.
7672
7673 2006-03-08  Paul Eggert  <eggert@cs.ucla.edu>
7674
7675         * NEWS: Document dd's new 'directory' and 'nolinks' flags.
7676         * src/dd.c (set_fd_flags): Handle file-creation flags on file
7677         descriptors, rather than ignoring them.
7678         * tests/dd/misc: Add test cases for append, nofollow, directory,
7679         and nolinks flags.  Simplify redirection to /dev/null in some cases.
7680
7681         * tests/dd/misc: iflags->iflag.  This fixes a typo that meant the
7682         noatime test never tested anything.
7683
7684 2006-03-05  Paul Eggert  <eggert@cs.ucla.edu>
7685
7686         * src/dd.c (flags, usage): New flags directory, nolinks.
7687         * src/system.h (O_NOLINKS): Define to 0 if not already defined.
7688
7689         * src/ls.c (usage): Mention that -f disables --color.
7690         Problem reported by Niels Möller.
7691
7692 2006-03-03  Justin Pryzby  <pryzbyj@justinpryzby.com>
7693
7694         * man/*.x: Add references to syscalls from utilities of the same name.
7695
7696 2006-03-05  Jim Meyering  <jim@meyering.net>
7697
7698         * tests/help-version: Set SHELL, if not already set, in order to
7699         avoid failure when `make check' is run through debuild;  dircolors
7700         would fail due to lack of $SHELL.  Reported by Sven Joachim.
7701
7702         Make `base64 --wrap=N' work for N=0, and for N larger than SIZE_MAX.
7703         * src/base64.c (wrap_write, do_encode, main): Change type of
7704         parameters and locals, wrap_column, form size_t to uintmax_t.
7705         (main): Adjust to use xstrtoumax, accordingly.
7706
7707 2006-03-03  Jim Meyering  <jim@meyering.net>
7708
7709         Don't fail when run from an environment with SHELL not a Bourne
7710         shell, e.g. `env SHELL=/bin/csh make check' would fail this test.
7711         * tests/dircolors/simple: Invoke each non-failing test with -b.
7712         Reported by Michael Stone.
7713
7714 2006-02-27  Jim Meyering  <jim@meyering.net>
7715
7716         * tests/misc/base64: Derive --decode-using tests from the
7717         encode-based ones.
7718
7719         * tests/misc/base64: Factor out a long constant string.
7720         Split lines to stay within 80 columns.
7721
7722         * tests/misc/Makefile.am (TESTS): Add base64.
7723         * tests/misc/base64: Test base64.  From Simon Josefsson.
7724
7725         * src/base64.c (do_decode): Use correct type for parameter,
7726         ignore_garbage: s/size_t/bool/.
7727
7728         * src/base64.c: Don't include .h files already included by system.h:
7729         <string.h>, <stdlib.h>, <stdbool.h>, <limits.h>, <errno.h>.
7730         Include "system.h" before the other lib/*.h header files.
7731         Include <sys/types.h> before "system.h".
7732         (wrap_write): Remove declaration of unused local, initial_column.
7733         (wrap_write): Correct declaration syntax: s/size_t * V/size_t *V/.
7734
7735         * README: Add base64 to the list.
7736
7737 2006-02-17  Simon Josefsson  <jas@extundo.com>
7738
7739         New program: base64.
7740         * AUTHORS: Mention base64.
7741         * NEWS: Likewise.
7742         * man/Makefile.am: Build base64.1.
7743         * man/base64.x: New file.
7744         * src/Makefile.am (bin_PROGRAMS): Add base64.
7745         * src/base64.c: New file.
7746
7747 2006-02-25  Eric Blake  <ebb9@byu.net>
7748
7749         In ls, avoid calling stat for --inode (-i), when possible.
7750         * src/pwd.c (NOT_AN_INODE_NUMBER, D_INO): Move to ...
7751         * src/system.h: ... here, for use in ...
7752         * src/ls.c (main): ... here.  Prefer dirent.d_ino to stat when
7753         possible.
7754         (gobble_file): Add inode argument.
7755         (print_dir): Pass inode if available.
7756         (usage): Remove inaccuracy.
7757
7758 2006-02-23  Jim Meyering  <jim@meyering.net>
7759
7760         * TODO: Update/correct some obsolete entries.
7761
7762 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
7763
7764         * doc/coreutils.texi (join invocation): Mention `sort -k 1b,1'.
7765         * src/join.c (usage): Likewise.
7766         Documentation problem reported by Philip Kensche.
7767
7768 2006-02-20  Eric Blake  <ebb9@byu.net>
7769
7770         * man/rm.x: Update documentation to match previous patch.
7771
7772 2006-02-18  Eric Blake  <ebb9@byu.net>
7773
7774         New option for rm: --interactive=once (-I).
7775         * NEWS: Document it, along with change to rm --interactive.
7776         * TODO: Remove entry for implementing rm -I
7777         * src/rm.c (INTERACTIVE_OPTION): New enum value.
7778         (interactive_type): New enum.
7779         (long_opts): Let interactive take an optional argument.
7780         (interactive_args, interactive_types): New option arguments.
7781         (usage): Document -I, --interactive=WHEN.  Use program_name
7782         instead of a basename.
7783         (main): New -I option, new behavior to --interactive.
7784         * tests/rm/interactive-once: New tests.
7785         * tests/rm/interactive-always: Ditto.
7786         * tests/rm/Makefile.am (TESTS): Run them.
7787
7788 2006-02-18  Jim Meyering  <jim@meyering.net>
7789
7790         * Makefile.maint (sc_two_space_separator_in_usage): Make the regular
7791         expression match more of the target lines, e.g., those that start with
7792         `-S,' (short option followed by a comma) or that include `=[...]'.
7793         Patch by Nicolas François.
7794         Fix the four offenders thus exposed:
7795         * src/join.c (usage): Use two spaces (not one) to separate the
7796         --first-only option string from its description, so help2man formats
7797         the derived man page properly.
7798         * src/pr.c (usage): Likewise.
7799         * src/uniq.c (usage): Likewise.
7800         * src/install.c (usage): Likewise.
7801
7802 2006-02-15  Jim Meyering  <jim@meyering.net>
7803
7804         * Makefile.maint (alpha beta major): For `make major', ensure that the
7805         version string is of the form N.N[.N]*, where N is one or more digits.
7806
7807 2006-02-14  Jim Meyering  <jim@meyering.net>
7808
7809         * INSTALL: Update from gnulib.
7810
7811 2006-02-13  Jim Meyering  <jim@meyering.net>
7812
7813         * GNUmakefile (all): Emit diagnostics to stderr, not stdout.
7814
7815 2006-02-12  Jim Meyering  <jim@meyering.net>
7816
7817         * Makefile.maint (patch-check): New target.
7818         (local-checks-available): Add to the list.
7819
7820 2006-02-11  Jim Meyering  <jim@meyering.net>
7821
7822         * src/c99-to-c89.diff: New file.
7823         * src/Makefile.am (EXTRA_DIST): Add c99-to-c89.diff.
7824
7825         * .x-po-check: New file, with exclusions so that `make distcheck'
7826         passes once again.
7827         * Makefile.am (EXTRA_DIST): Add .x-po-check.
7828
7829         rm -r must remove an empty directory, even if it is inaccessible.
7830         * src/remove.c (close_preserve_errno): New function.
7831         (fd_to_subdirp): Don't print a diagnostic in this function.
7832         Do it from the callers instead, unless rmdir succeeds.
7833         (remove_cwd_entries, remove_dir): Adjust callers.
7834         * tests/rm/empty-inacc: New test for the above.
7835         * tests/rm/Makefile.am (TESTS): Add empty-inacc.
7836         * NEWS: Mention this bug fix.
7837         * tests/rm/rm2: Adjust two expected diagnostics, now that they're
7838         a tiny bit less precise: cannot remove `a/1': ... instead of
7839         cannot open directory `a/1': ...
7840
7841         * Makefile.maint (syntax-check-rules): Automatically derive this
7842         list of sc_-prefixed rule names.
7843
7844 2006-02-10  Paul Eggert  <eggert@cs.ucla.edu>
7845
7846         * Makefile.maint (CVS_LIST): Don't assume cvsu is available.
7847         (CVS_LIST_EXCEPT): New macro, to simplify exception-processing.
7848         Most uses of CVS_LIST changed to use CVS_LIST_EXCEPT.
7849         (syntax-check-rules): Bring back sc_changelong.  (Hmm, why did it
7850         go away? was that an accident?)
7851         (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
7852         (sc_cast_of_alloca_return_value, sc_space_tab, sc_prohibit_atoi_atof):
7853         (sc_error_exit_success, sc_file_system, sc_no_if_have_config_h):
7854         (sc_system_h_headers, sc_sun_os_names, sc_trailing_blank):
7855         (sc_two_space_separator_in_usage, sc_unmarked_diagnostics):
7856         (sc_obsolete_symbols, sc_changelog, sc_prohibit_jm_in_m4):
7857         (sc_useless_cpp_parens, makefile-check, m4-check, po-check):
7858         (author_mark_check, makefile_path_separator_check):
7859         Output line numbers, to simplify navigation of Emacs *compilation*
7860         buffers.
7861         (sc_prohibit_atoi_atof, sc_file_system):
7862         Rework slightly so that Makefile.maint doesn't get reported as a
7863         violation of its own syntax rules.
7864         (sc_dd_max_sym_length): Use ifneq to do nothing, instead of doing
7865         it at run-time (which didn't work with Bison).  Fix a makefile typo,
7866         caught by Makefile.maint itself: spaces where a tab should be.
7867         (po-check): Check lib/*.[ch] even if not in CVS; used by Bison,
7868         which copies from ../gnulib/lib/*.[ch] to lib/*.[ch].
7869         Ignore djgpp and man subdirectories, to avoid false matches with
7870         Bison and coreutils, respectively.  Use sort -u to remove the
7871         resulting duplicates.
7872         * gnupload: Rework slightly to avoid bogus warning from
7873         sc_two_space_separator_in_usage.
7874
7875 2006-02-10  Jim Meyering  <jim@meyering.net>
7876
7877         Use gzip's --rsyncable option only if it's available.
7878         * Makefile.maint (gzip_rsyncable): New variable.
7879         (GZIP_ENV): Use it.
7880
7881 2006-02-08  Jim Meyering  <jim@meyering.net>
7882
7883         * Makefile.maint (local-checks-available): Define in terms of
7884         the expansion, $(syntax-check-rules), rather than the single,
7885         top-level target `syntax-check', so that it's easier to exclude
7886         individual rules (via $(local-checks-to-skip)).
7887         (tgz-md5, tgz-sha1, ...): Remove now-unused definitions.
7888
7889 2006-02-07  Jim Meyering  <jim@meyering.net>
7890
7891         * src/system.h (!defined O_DIRECT): If O_DIRECTIO is defined (as it
7892         is on Tru64), define O_DIRECT to that.  Patch From James Lemley.
7893
7894         * tests/help-version (expected_failure_status_vdir):
7895         Redirect an expected disk-full diagnostic to /dev/null.
7896
7897 2006-02-06  Jim Meyering  <jim@meyering.net>
7898
7899         * src/unexpand.c (usage): Use two spaces (not one) to separate the
7900         --first-only option string from its description, so help2man formats
7901         the derived man page properly.
7902         * src/rm.c (usage): Likewise for --no-preserve-root.
7903         * src/chown.c (usage): Likewise.
7904         * src/chgrp.c (usage): Likewise.
7905
7906         Add a rule to ensure that the above doesn't happen again.
7907         * Makefile.maint (sc_two_space_separator_in_usage): New rule.
7908         (syntax-check-rules): Add it.
7909         * .x-sc_two_space_separator_in_usage: New empty file.
7910         * Makefile.am (EXTRA_DIST): Add .x-sc_two_space_separator_in_usage.
7911
7912 2006-02-06  Jim Meyering  <jim@meyering.net>
7913
7914         * src/cp.c (usage): Use two spaces (not one) to separate each
7915         option string from its description, so help2man formats the
7916         derived man page properly.
7917         * src/mv.c (usage): Likewise.
7918         Patch from Nicolas François in http://bugs.debian.org/351601.
7919
7920 2006-02-04  Jim Meyering  <jim@meyering.net>
7921
7922         * src/copy.c (copy_internal): cp -RL would fail when encountering
7923         the same directory more than once in the hierarchy beneath a single
7924         command-line argument.  That is legitimate, e.g. when there are
7925         two or more symbolic links, each pointing to some directory that
7926         would not otherwise be copied.  Reported by Christophe LYON.
7927         * tests/cp/cp-deref: New file.  Test for today's fix.
7928         * tests/cp/Makefile.am (TESTS): Add cp-deref.
7929         * NEWS: Document this.
7930
7931 2006-02-03  Jim Meyering  <jim@meyering.net>
7932
7933         * configure.ac: Require automake-1.9.6, not 1.8.3.
7934
7935 2006-02-01  Paul Eggert  <eggert@cs.ucla.edu>
7936
7937         * src/od.c (usage): Mention that -t a ignores high order bit.
7938         Documentation problem reported by Ed Avis.
7939
7940 2006-02-01  Jim Meyering  <jim@meyering.net>
7941
7942         * src/pwd.c (find_dir_entry): Remove unused local, `ent_sb_valid'.
7943
7944 2006-01-30  Paul Eggert  <eggert@cs.ucla.edu>
7945
7946         * src/head.c (main): Use a better diagnostic when someone uses a
7947         trailing numeric option in an invalid way.  Problem reported by
7948         Karl Berry.
7949         * src/tail.c (parse_options): Likewise.
7950
7951 2006-01-30  Jim Meyering  <jim@meyering.net>
7952
7953         * man/wc.x: Include `count' keyword in man page synopsis,
7954         per suggestion from http://bugs.debian.org/181585.
7955
7956 2006-01-24  Paul Eggert  <eggert@cs.ucla.edu>
7957
7958         * src/df.c (show_dev): If the file system claims to have
7959         more available than total blocks, report the number of used
7960         blocks as being total - available (a negative number) rather
7961         than as garbage.  Problem reported by Toralf Foerster.
7962
7963 2006-01-24  Jim Meyering  <jim@meyering.net>
7964
7965         * src/tail.c (tail_forever): Don't exit-nonzero when an attempt
7966         to put a regular file in O_NONBLOCK mode fails with EPERM.
7967         That happens on Linux (up to 2.6.15) when using tail -f on a file with
7968         the append-only attribute.  Reported by Dean Gaudet.  For details,
7969         see http://savannah.gnu.org/bugs/?func=detailitem&item_id=15473.
7970         * NEWS: Mention this fix.
7971         * tests/tail-2/append-only: New file.  Test for the above.
7972         * tests/tail-2/Makefile.am (TESTS): Add append-only.
7973         * tests/Makefile.am (check-root): Add tail-2/append-only
7974
7975 2006-01-21  Jim Meyering  <jim@meyering.net>
7976
7977         * NEWS: Mention fts-related improvements and bug fixes.
7978
7979 2006-01-19  Jim Meyering  <jim@meyering.net>
7980
7981         * tests/fmt/basic (pfx-1, pfx-2): New tests, to demonstrate the bug
7982         reported as http://bugs.debian.org/147577.  Forwarded by Thomas Hood.
7983
7984 2006-01-18  Jim Meyering  <jim@meyering.net>
7985
7986         * tests/du/Makefile.am (TESTS): Add long-from-unreadable.
7987
7988 2006-01-17  Jim Meyering  <jim@meyering.net>
7989
7990         Now that fts no longer changes the current working directory, adjust
7991         its clients accordingly -- note that du.c uses fts but doesn't need
7992         any adjustment, since it doesn't operate on the actual files,
7993         but rather just uses the stat buffers provided by fts.
7994
7995         * src/chown-core.c: Include "openat.h".
7996         Don't include "lchown.h".
7997         (restricted_chown): Accept a new parameter, CWD_FD, and use it in
7998         calling openat, lchownat, chownat, rather than open, lchown, chown.
7999         Update caller.
8000         * src/chmod.c: Include "openat.h".
8001         (process_file): Use chmodat (fts->fts_cwd_fd,... in place of chmod (...
8002
8003         * tests/du/long-from-unreadable: New test, to exercise one small
8004         corner of fts.c.
8005
8006 2006-01-13  Jim Meyering  <jim@meyering.net>
8007
8008         * tests/Makefile.am (SUBDIRS): Add comments discouraging the
8009         addition of new directories under tests/.
8010
8011         * tests/acl: Redirect stdin to /dev/null.  Otherwise, FreeBSD 5.0's
8012         getfacl would hang.
8013
8014 2006-01-12  Jim Meyering  <jim@meyering.net>
8015
8016         * tests/du/long-sloop: Adjust not to hard-code the expected
8017         diagnostic corresponding to ELOOP.  Solaris' diagnostic differs
8018         from that of GNU libc.  Reported by Paul Eggert.
8019
8020         * tests/du/long-sloop: Create file at end of symlink chain.
8021
8022         * tests/misc/test: New file, with a test for one of the
8023         bugs fixed by yesterday's test.c changes.
8024         * tests/misc/Makefile.am (TESTS): Add test.
8025
8026 2006-01-11  Jim Meyering  <jim@meyering.net>
8027
8028         * tests/du/long-sloop: New file.  Test for today's fts.c bug fix.
8029         That bug could make du -L, chgrp -L, or chown -L fail to diagnose
8030         a very long sequence of symbolic links (not necessarily a loop).
8031         * tests/du/Makefile.am (TESTS): Add long-sloop.
8032
8033 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
8034
8035         * src/test.c (test_syntax_error): Append a newline.  All callers
8036         changed, except for the ones that didn't already append a newline.
8037         Bug reported by Eric Blake.
8038
8039 2006-01-11  Jim Meyering  <jim@meyering.net>
8040
8041         * src/system.h (X2NREALLOC): Now that verify_true is no longer
8042         void, cast its result to void, to avoid gcc's warning that
8043         ``left-hand operand of comma expression has no effect''.
8044         (DECIMAL_DIGIT_ACCUMULATE, X2REALLOC): Likewise.
8045
8046 2006-01-10  Jim Meyering  <jim@meyering.net>
8047
8048         * tests/chmod/no-x: Add a test for today's fts.c fix.
8049
8050 2006-01-10  Jim Meyering  <jim@meyering.net>  (tiny change)
8051
8052         * src/ls.c (gobble_file): Use DTTOIF only if it's defined.
8053         This is necessary for Dragonfly.  Patch by Joerg Sonnenberger.
8054
8055 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
8056
8057         * src/system.h (X2NREALLOC, X2REALLOC, DECIMAL_DIGIT_ACCUMULATE):
8058         Use verify_true instead of verify_expr, to sync with gnulib.
8059
8060 2006-01-08  Jim Meyering  <jim@meyering.net>
8061
8062         * src/date.c (usage): Adjust the formatting of the entries for
8063         %::z and %:::z (separate with two spaces, not one) so that help2man
8064         formats them properly.  Reported by Philip Rowlands.
8065
8066 2006-01-06  Paul Eggert  <eggert@cs.ucla.edu>
8067
8068         * configure.ac (gl_IGNORE_UNUSED_LIBRARIES): Add.
8069
8070 2006-01-06  Jim Meyering  <jim@meyering.net>
8071
8072         * Makefile.maint (copyright-check): Use date +%Y in place of
8073         hard-coded 2005.
8074
8075         * src/remove.c (rm_1): Remove `static' attribute on local `status'.
8076         First off, the attribute should have been `volatile' (not static)
8077         to avoid longjmp-related risk of clobber.  Secondly, now there is
8078         no longer any risk of a local variable being clobbered, so there's
8079         no need for any attribute at all.
8080
8081 2006-01-05  Jim Meyering  <jim@meyering.net>
8082
8083         * src/remove.c: Give a few functions the inline attribute.
8084         (AD_pop_and_chdir): Use gotos to avoid some duplication.
8085         (AD_push): Rewrite an assertion so that the entire computation
8086         goes away when assertions are turned off.
8087
8088         * src/tail.c (ENOSYS) [!defined ENOSYS]: Don't define here.
8089         It's already defined in "system.h".
8090         * Makefile.maint: Add a FIXME comment.
8091
8092 2006-01-04  Jim Meyering  <jim@meyering.net>
8093
8094         * ChangeLog: Remove entries from 2005-10-22 and earlier.
8095         * ChangeLog-2005: New file, for entries up to version 5.92.
8096
8097 2006-01-03  Jim Meyering  <jim@meyering.net>
8098
8099         * tests/du/no-x: Also allow a slightly different diagnostic -- the
8100         one you get when using openat-enabled fts.c and du (coming soon).
8101         * tests/chmod/no-x: Likewise.
8102         * tests/chgrp/no-x: Likewise.
8103
8104         * src/system.h (O_DIRECTORY) [!defined O_DIRECTORY]: Define.
8105
8106 2006-01-02  Paul Eggert  <eggert@cs.ucla.edu>
8107
8108         * src/chown-core.c (RC_do_ordinary_chown): New enum value.
8109         (restricted_chown): Return it, if the file cannot be accessed due
8110         to EPERM, or if no uid or gid are required, or if the file is
8111         neither a directory nor a regular file.  Rewrite to avoid gotos.
8112         (change_file_owner): Handle RC_do_ordinary_chown case.
8113         Rewrite to avoid gotos.
8114         * tests/chgrp/basic: Make sure we can change the group of
8115         inaccessible files.
8116
8117         * src/date.c (usage): Explain %g, %G, and %V a bit better.
8118
8119 2006-01-02  Jim Meyering  <jim@meyering.net>
8120
8121         * src/copy.c (set_owner): Correct a comment.
8122
8123         * src/tail.c (parse_options): Change warning to say that --retry
8124         is useful `mainly' (not `only') when following by name.
8125         Reported here: http://bugs.debian.org/273781
8126
8127 2006-01-01  Paul Eggert  <eggert@cs.ucla.edu>
8128
8129         * NEWS: Document that mkfifo and mknod -m no longer set special bits.
8130         * src/copy.c: Include lchmod.h.
8131         (copy_internal): Use lchmod rather than chmod.
8132         * src/cp.c: Include lchmod.h.
8133         (re_protect, make_dir_parents_private): Use lchmod rather than chmod.
8134         * src/mkdir.c: Include lchmod.h.
8135         (usage): Clarify -m's operation.
8136         (main): Use lchmod rather than chmod.  Don't use lchmod unless the
8137         new mode contains bits outside the 777 range.
8138         * src/mkfifo.c (usage): Clarify -m's operation.
8139         (main): If -m is given, don't invoke chmod; use umask 0 instead.
8140         Report an error if -m asks for bits outside the 777 range.
8141         * src/mknod.c (usage, main): Likewise.
8142
8143         * src/mkdir.c, src/mkfifo.c, src/mknod.c: Undo 2005-12-19 changes.
8144
8145 2005-12-27  Jim Meyering  <jim@meyering.net>
8146
8147         * Makefile.maint (sc_obsolete_symbols): Prohibit use of O_NDELAY.
8148         (sc_prohibit_assert_without_use): New rule.
8149         (syntax-check-rules): Add it to the list.
8150         * .x-sc_prohibit_assert_without_use: New empty file.
8151         * Makefile.am (EXTRA_DIST): Add it.
8152
8153         * Makefile.maint (CVS_LIST): Define in terms of $(srcdir).
8154
8155         * cp.c, df.c, link.c, mknod.c, nice.c, sleep.c, unlink.c:
8156         Don't include <assert.h>; it wasn't used.
8157
8158 2005-12-26  Paul Eggert  <eggert@cs.ucla.edu>
8159
8160         * src/chown-core.c (restricted_chown):
8161         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
8162         * src/remove.c (fd_to_subdirp): Open with O_DIRECTORY | O_NOCTTY
8163         | O_NOFOLLOW too, for consistency with other dir-openers.
8164         Use POSIX-preferred O_NONBLOCK rather than O_NDELAY.
8165         (is_empty_dir): Likewise.
8166         * src/shred.c (wipename): Likewise.  Don't bother trying to open
8167         dir for writing, since POSIX prohibits it.
8168
8169 2005-12-22  Jim Meyering  <jim@meyering.net>
8170
8171         * tests/help-version: Redirect stderr to /dev/full, to suppress
8172         write error diagnostic.
8173
8174 2005-12-19  Jim Meyering  <jim@meyering.net>
8175
8176         * src/mkdir.c, src/mknod.c, src/mkfifo.c (main)
8177         Avoid a minor race condition when `-m MODE' is specified, by using
8178         open, fchown, and close rather than just chown.  To do that reliably --
8179         even with an overly restrictive umask -- ensure that each mkdir,
8180         mknod and mkfifo call uses a mode including at least owner-read access.
8181         * src/mknod.c (main): When `-m MODE' is specified, exit nonzero if
8182         the subsequent chown (or equivalent open,fchown,close) fails.
8183         * tests/misc/mknod: New tests.
8184         * tests/misc/Makefile.am (TESTS): Add mknod.
8185
8186 2005-12-17  Jim Meyering  <jim@meyering.net>
8187
8188         * src/remove.c (is_empty_dir): Open with O_NDELAY, so we don't hang,
8189         e.g., on a named pipe.
8190         (OPEN_NO_FOLLOW_SYMLINK): Remove definition.  Use O_NOFOLLOW in
8191         place of all uses, since it is guaranteed (system.h) to be defined.
8192
8193 2005-12-05  Andreas Gruenbacher  <agruen@suse.de>
8194
8195         Add POSIX ACL support
8196         * src/ls.c: Switch back from HAVE_ACL to USE_ACL: The acl() syscall
8197         is no requirement for ACL support; particularly, it does not exist
8198         on systems that have POSIX ACLs.
8199         * src/copy.h (cp_option_init) [umask_kill]: Remove member.
8200         * src/cp.c (umask_kill): With default acls, the umask is not to be
8201         applied.  Remove umask_kill, don't change the process umask, and let
8202         the kernel apply the umask where appropriate.
8203         * src/cp.c (make_dir_parents_private): Fix logic for POSIX ACLs.
8204         * src/copy.c (get_dest_mode): Remove; it is obsolete after removing
8205         umask_kill.
8206         (copy_reg, copy_internal): Use copy_acl and set_acl
8207         instead of fchown/chown. Fix the logic for POSIX ACLs.
8208         (chown_succeded): Remove; we now always copy acls and
8209         preserve S_ISUID, S_ISGID, and S_ISVTX when needed, no matter if we
8210         did a chown before or not.
8211         * src/mv.c, src/install.c (cp_option_init): Don't set umask_kill member.
8212         * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD, cp_LDADD,
8213         mv_LDADD, ginstall_LDADD): On systems with an ACL library, arrange
8214         to link with it via $(LIB_ACL), for the utilities that need it.
8215
8216 2005-12-16  Paul Eggert  <eggert@cs.ucla.edu>
8217
8218         * src/remove.c (OPENAT_CWD_RESTORE__REQUIRE): Remove.
8219         (OPENAT_CWD_RESTORE__ALLOW_FAILURE): Likewise.
8220         (fd_to_subdirp): Remove openat_cwd_restore_allow_failure arg; its
8221         value is now signified by whether cwd_errno is null.
8222         (fd_to_subdirp, remove_dir, rm_1); Change cwd failure indicator from
8223         pointer-to-bool to pointer-to-errno-value.  All callers changed.
8224         (rm_1): Don't bother setting a local cwd failure flag and then
8225         ORing it into the caller's.  Just set the caller's.
8226         (rm): Use cwd failure errno value to print a slightly-better
8227         diagnostic.
8228
8229 2005-12-15  Jim Meyering  <jim@meyering.net>
8230
8231         * src/stat.c (print_it): Properly handle a backslash at the
8232         end of a --printf format string.  Reported by Paul Eggert.
8233         * tests/misc/stat-printf (end-bs): Add a test for the above.
8234
8235 2005-12-15  Paul Eggert  <eggert@cs.ucla.edu>
8236
8237         * tests/acl: Port to pre-POSIX shells like Solaris 8 /bin/sh.
8238         Don't assume /etc/passwd contains user names; use 'id' instead.
8239
8240 2005-12-15  Jim Meyering  <jim@meyering.net>
8241
8242         stat: revert behavior of --format=FMT (-c)
8243         stat: add new option: --printf=FMT
8244         * NEWS: Mention this.
8245         * src/stat.c (isodigit, octtobin, hextobin): Define.
8246         (PRINTF_OPTION): Define.
8247         (interpret_backslash_escapes, trailing_delim): New globals.
8248         (usage): Document them.  Alphabetize on long option names.
8249         (print_esc_char): New function.
8250         (print_it): Rewrite, in order to handle backslash escapes.
8251         (main): Handle new option.  Set globals for --format, too.
8252
8253         * tests/misc/stat-printf: Test --printf and --format.
8254         * tests/misc/Makefile.am (TESTS): Add stat-printf.
8255
8256 2005-12-14  Paul Eggert  <eggert@cs.ucla.edu>
8257
8258         * NEWS: sort now reports incompatible options.
8259         * src/sort.c (incompatible_options, check_ordering_compatibility):
8260         New functions.
8261         (main): Use them.  Don't bother with a usage message for
8262         "sort -c a b", for consistency with other error diagnostics.
8263         * tests/sort/Test.pm (incompat1, incompat2, incompat3, incompat4):
8264         New tests.
8265
8266         * src/cat.c (main): Undo previous change.  close_stdout already
8267         does the check, so the previous change wasn't necessary.
8268
8269 2005-12-13  Paul Eggert  <eggert@cs.ucla.edu>
8270
8271         * src/cat.c (main): Check for close (STDOUT_FILENO) failure.
8272
8273 2005-12-12  Paul Eggert  <eggert@cs.ucla.edu>
8274
8275         Install a more-conservative approach for sort -R.  It's the
8276         same basic idea as the existing code, except it uses the full ISAAC
8277         approach (called the "more kosher" approach in the existing comments).
8278         This makes "sort -R" quite a bit slower (about a factor of 2 on my
8279         little tests involving 10000 lines on a 2.4 GHz P4), but I think it's
8280         better to be conservative here at first, and review any performance
8281         improvements carefully.
8282         * .x-sc_require_config_h: Add src/rand-isaac.c.
8283         * src/rand-isaac.h: Remove.  All uses now simply include rand-isaac.c.
8284         * src/Makefile.am (noinst_HEADERS): Remove rand-isaac.h.
8285         (shred_SOURCES, sort_SOURCES): Remove.
8286         (EXTRA_DIST): Add rand-isaac.c.
8287         * src/rand-isaac.c: Revert to what used to be in shred.c, without
8288         changing it to allow for varying numbers of words in the state.
8289         Alter so that we include rand-isaac.c directly rather than
8290         compiling it and linking to it.  Don't include config.h or
8291         system.h; that's the includer's responsibility.
8292         Omit functions that are specific to shred.
8293         (ISAAC_LOG, ISAAC_WORDS, ISAAC_BYTES, struct isaac_state, ind):
8294         (isaac_step, struct irand_state):
8295         Resurrect these, with the same defns that used to be in shred.c.
8296         (ISAAC_SIZE, isaac_new, isaac_copy): Remove.
8297         (isaac_refill, isaac_seed_start, isaac_seed_data, irand_init, irand32):
8298         static again.
8299         (struct isaac_state, isaac_refill, isaac_mix, isaac_init):
8300         (isaac_seed_start, isaac_seed_data, isaac_seed_finish, isaac_seed):
8301         (irand_init, irand32, irand_mod):
8302         Number of words is constant again.
8303         (struct irand_state, irand_init, irand32, irand_mod): Move to shred.c.
8304         * src/shred.c: Include rand-isaac.c rather than rand-isaac.h.
8305         * src/sort.c: Likewise.
8306         * src/shred.c (fillrand, dopass, main): Undo previous change.
8307         (struct irand_state, irand_init, irand32, irand_mod): Moved back here,
8308         from rand-isaac.c.
8309         * src/sort.c: Don't include md5.h; it wasn't needed.
8310         (struct keyfield): Rename random_hash to random, for consistency
8311         with the other member names.  All uses changed.
8312         (usage): Tweak wording to mention STRING for --seed option.
8313         (short_options): Rorder for consistency with other programs.
8314         (rand_state): Now a struct, not a pointer to one.  All uses changed.
8315         (HASH_WORDS, HASH_SIZE): Remove.
8316         (get_hash): Remove comments around resbuf size, since we can assume C89.
8317         Use a "more-kosher" (but slower) approach of invoking isaac_refill.
8318         (keycompare): Adjust to the new get_hash.
8319         Add a FIXME.
8320         (badfieldspec): Omit recently-introduced comment; it isn't needed.
8321         (main): Don't set need_random simply because gkey has it set; that
8322         doesn't necessarily mean we'll need random numbers.
8323         Redo seeding to match new get_hash approach.
8324
8325 2005-12-10  Jim Meyering  <jim@meyering.net>
8326
8327         * src/Makefile.am (noinst_HEADERS): Add rand-isaac.h.
8328
8329         Avoid shred segfault on 64-bit systems.
8330         * src/rand-isaac.c (isaac_refill): Don't try to negate a
8331         local of type uint32_t.  Make the local an `int' instead.
8332
8333         * NEWS: Mention sort's new options.
8334
8335         * src/rand-isaac.c (isaac_mix): Declare to be static.
8336         Mark all other functions as `extern' so the tight-scope
8337         part of `make distcheck' passes once again.
8338         * src/rand-isaac.h (isaac_mix): Remove declaration.
8339
8340         * src/sort.c (get_hash): Change position of `*' in parameter
8341         type to conform with convention.
8342         (main): Split a long line so it fits in 80 columns.
8343         (keycompare): Remove stray SPACE before TAB that was
8344         causing `make distcheck' to fail.
8345
8346         * src/shred.c: Don't include gethrxtime.h.  No longer needed.
8347
8348         * tests/misc/sort-rand: New file: basic tests for the new options.
8349         * tests/misc/Makefile.am (TESTS): Add sort-rand.
8350
8351 2005-12-10  Frederik Eaton  <frederik@ofb.net>
8352
8353         * src/Makefile.am (sort_LDADD): Add $(LIB_GETHRXTIME).
8354         (shred_SOURCES, sort_SOURCES): New macros, so we compile rand-isaac.c.
8355         * src/rand-isaac.c: New file, containing ISAAC code that was in shred.c.
8356         Make state size runtime-configurable.
8357         (isaac_new, isaac_copy): New functions.
8358         * src/rand-isaac.h: New file.
8359         * src/shred.c: Include rand-isaac.h.  Move ISAAC code to rand-isaac.c.
8360         (fillrand, main): Adjust to the fact that the state size is now
8361         runtime-configurable.
8362         * src/sort.c (short_options, long_options, WORDS, keycompare, main):
8363         (usage): Add options --random-sort and --seed to implement a random
8364         shuffle.
8365         Include md5.h and rand-isaac.h.
8366         (get_hash): New function.
8367         (rand_state): New var.
8368         (HASH_WORDS, HASH_SIZE): New macros.
8369
8370 2005-12-09  Paul Eggert  <eggert@cs.ucla.edu>
8371
8372         * tests/dd/misc: Add test for dd iflags=noatime.
8373
8374 2005-12-09  Jim Meyering  <jim@meyering.net>
8375
8376         * src/sort.c (usage): Mention white space vs -b and -t options.
8377         From The Wanderer.
8378
8379 2005-12-09  Eric Blake  <ebb9@byu.net>
8380
8381         * src/test.c (main): Fix misleading comment.
8382
8383 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
8384
8385         * NEWS: Mention dd's new noatime flag.
8386         * src/system.h (O_NOATIME): Define to 0 if not already defined.
8387         * src/dd.c (flags, usage): Add support for noatime flag.
8388
8389 2005-12-07  Jim Meyering  <jim@meyering.net>
8390
8391         Distribute the cvsu script, used only by `make syntax-check'.
8392         * Makefile.am (EXTRA_DIST): Add build-aux/cvsu.
8393         * Makefile.maint (CVS_LIST): Use build-aux/cvsu, now that we
8394         distribute a copy of this script.
8395         * .x-sc_unmarked_diagnostics: Add build-aux/cvsu.
8396
8397         * tests/mv/acl: exit-77 before the trap, not after, if we fail
8398         to create a temporary directory on another partition.
8399         From Andreas Gruenbacher.
8400
8401 2005-12-06  Tomas Pospisek  <tpo@sourcepole.ch>  (tiny change)
8402
8403         * man/basename.x: Cross-reference to dirname and readlink.
8404         * man/dirname.x: Cross-reference to basename and readlink.
8405
8406 2005-12-05  Andreas Gruenbacher
8407
8408         * src/copy.c [!HAVE_FCHOWN]: Define fchown(...) to -1.
8409         (set_owner, preserve_author): New functions, factored out of copy_reg.
8410         (copy_reg): Use them.
8411         (copy_internal): Use them here, too.
8412
8413 2005-12-04  Jim Meyering  <jim@meyering.net>
8414
8415         * src/sleep.c (usage): Say what happens with two or more arguments.
8416         Suggested by Justin Pryzby.
8417
8418         * src/uptime.c (print_uptime): Move decl of `upsecs' into scope
8419         where it's used.
8420
8421 2005-12-03  Jim Meyering  <jim@meyering.net>
8422
8423         * src/rm.c (long_opts): Change the name of each undocumented, for-
8424         testing-only option to start with `-', so that it cannot render
8425         ambiguous any prefix it happens to share with some other option name.
8426         Problem reported by Eric Blake.
8427         * src/head.c (long_options): Likewise.
8428         * src/tail.c (long_options): Likewise.
8429
8430         * tests/misc/head-elide-tail: Update uses of undocumented, for-
8431         testing-only --presume* options to start with `---'.
8432         * tests/rm/dangling-symlink: Likewise.
8433         * tests/rm/dir-no-w: Likewise.
8434         * tests/rm/isatty: Likewise.
8435
8436 2005-11-30  Jim Meyering  <jim@meyering.net>
8437
8438         * Makefile.maint: Add a comment about cvsu.
8439
8440 2005-11-25  Paul Eggert  <eggert@cs.ucla.edu>
8441
8442         * NEWS: df updates for "none", "proc", inaccessible file systems.
8443         * src/df.c (show_point): Ignore inaccessible file systems.
8444         (usage): -a includes dummy file systems, not size-0 file systems.
8445
8446         * src/od.c (unsigned_long_long_int): Renamed from ulonglong_t,
8447         to avoid collision with POSIX name space.  All uses changed.
8448
8449 2005-11-24  Jim Meyering  <jim@meyering.net>
8450
8451         * tests/Makefile.am (EXTRA_DIST): Add acl to the list.
8452         * tests/acl: Add `$0: ' prefix to diagnostics.
8453
8454         * .x-sc_require_config_h: Add lib/buffer-lcm.c to the list.
8455
8456 2005-11-23  Paul Eggert  <eggert@cs.ucla.edu>
8457
8458         * src/copy.c: Improve performance a bit by optimizing away
8459         unnecessary system calls and going to a block size of at least
8460         8192 (on normal hosts, anyway).  This improved performance 5% on my
8461         Debian stable host (2.4.27 kernel, x86, copying from root
8462         ext3 file system to itself).
8463         Include "buffer-lcm.h".
8464         (copy_reg): Omit last argument.  All callers changed.
8465         Use xmalloc to allocate rather than trusting alloca
8466         (which is unwise with large block sizes).
8467         Declare locals more locally, if possible.
8468         Use uintptr_t words instead of int words, for a bit more speed
8469         when looking for null blocks on 64-bit hosts.
8470         Optimize away reads of zero bytes on regular files.
8471         In the typical case, insist on 8 KiB buffers, at least.
8472         Avoid unnecessary extra call to fstat when checking for sparse files.
8473         Avoid now-unnecessary cast to off_t, and "0L".
8474         Avoid unnecessary test of *new_dst when checking for same owner
8475         and group.
8476
8477 2005-11-22  Paul Eggert  <eggert@cs.ucla.edu>
8478
8479         * src/remove.c (rm): Don't assume C99 for-loop syntax.
8480
8481 2005-11-22  Jim Meyering  <jim@meyering.net>
8482
8483         * src/remove.c (AD_push): Remove debugging cruft.
8484
8485         * tests/rm/unread2 (rm): Change expected diagnostic,
8486         `cannot open directory' to `cannot remove', to align with
8487         new version of rm.
8488         * tests/rm/rm2: Ensure that rm now continues removing entries
8489         even after certain types of failure.
8490
8491         * src/remove.c: Rewrite.  Now, this module is reentrant on systems
8492         that provide openat (Solaris), and on systems like Linux+procfs
8493         where our openat emulation code is reentrant.  This also fixes a
8494         few low-probability leaks and eliminates some code that could,
8495         in very unusual circumstances, cause rm() (via a callee) to exit.
8496         * NEWS: Mention this.
8497
8498         * configure.ac: Put copyright dates all on one line so the
8499         emacs function that updates them works properly.
8500
8501 2005-11-18  Paul Eggert  <eggert@cs.ucla.edu>
8502
8503         * configure.ac (AM_PROG_CC_C_O): Add.  Needed for CVS Automake.
8504         Problem reported by Eric Blake.
8505         (AC_PROG_CC_STDC): Use this instead of AC_PROG_CC, so that
8506         we get a standard-conforming compiler.  This relies on the new
8507         m4/c.m4 file.  Note that it's a bit tricky, since c.m4 doesn't
8508         define AC_PROG_CC_STDC; we are relying on Autoconf 2.59 internals.
8509         m4/c.m4 can go away with Autoconf 2.60 comes out.
8510
8511 2005-11-17  Jim Meyering  <jim@meyering.net>
8512
8513         * src/remove.c (AD_mark_helper): Make a `char *' parameter `const'.
8514         (AD_mark_current_as_unremovable): Likewise, but for a local.
8515         (rm_1): Likewise.
8516
8517         * tests/mv/acl: Let traps handle removing temporary directories.
8518
8519         Expect acl-related tests to fail, until the corresponding
8520         patches are committed.
8521         * tests/mv/Makefile.am (XFAIL_TESTS): Add acl.
8522         * tests/cp/Makefile.am (XFAIL_TESTS): Likewise.
8523
8524         ACL tests, from Andreas Gruenbacher.
8525         * tests/acl, tests/mv/acl, tests/cp/acl: New files.
8526         * tests/mv/Makefile.am (TESTS): Add acl.
8527         * tests/cp/Makefile.am (TESTS): Add acl.
8528
8529         * src/ls.c (basename_is_dot_or_dotdot): Correct wording in comment.
8530
8531 2005-11-16  Paul Eggert  <eggert@cs.ucla.edu>
8532
8533         * NEWS: Improve quality of ln's diagnostics.
8534         * src/ln.c (do_link, usage): Likewise.
8535         (do_link): Don't use alloca on a buffer of unbounded size.
8536
8537 2005-11-16  Jim Meyering  <jim@meyering.net>
8538
8539         * tests/cp/fail-perm: Accommodate HPUX.  It appears to fail
8540         with EACCES rather than EPERM.  Reported by Peter O'Gorman here:
8541         http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/5766
8542         This also affects AIX 4.3.3, according to Ralf Wildenhues, in
8543         http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html
8544
8545 2005-11-14  Jim Meyering  <jim@meyering.net>
8546
8547         * NEWS (sort): Mention consequences of today's mkstemp-safer.c fix.
8548
8549 2005-11-13  Jim Meyering  <jim@meyering.net>
8550
8551         * announce-gen: Accept new option, --gpg-key-id=ID and
8552         emit a blurb telling how to use the .sig files.
8553         * Makefile.cfg (gpg_key_ID): Define.
8554         * Makefile.maint (announcement): Use new option and key.
8555
8556         Require that most .c files include <config.h>.
8557         * Makefile.maint (sc_require_config_h): New rule.
8558         (syntax-check-rules): Add it.
8559         * .x-sc_require_config_h: New file listing exceptions to the
8560         above rule.  Some are legit, others are simply grandfathered in.
8561         * Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h here, too.
8562
8563 2005-11-12  Jim Meyering  <jim@meyering.net>
8564
8565         * src/checksum.h, src/md5.c, src/sha1sum.c: Remove now-unused files.
8566
8567 2005-11-11  Jim Meyering  <jim@meyering.net>
8568
8569         * NEWS: Mention `readlink -f' bug fix in 5.3.0 news.
8570         Mention new readlink options in 5.3.0's `New features' section.
8571         Spotted by Thomas Hood.
8572
8573 2005-11-08  Jim Meyering  <jim@meyering.net>
8574
8575         * NEWS: Merge in changes from b5_9x branch.
8576
8577 2005-11-08  Paul Eggert  <eggert@cs.ucla.edu>
8578
8579         * NEWS: ls now defaults to --time-style='locale', which in turn acts
8580         like --time-style='posix-long-iso' if the locale settings are messed up.
8581         * src/ls.c (decode_switches): Implement this.
8582
8583 2005-11-08  Jim Meyering  <jim@meyering.net>
8584
8585         * tests/du/2g: s/expensive/very expensive/ in a comment.
8586         From Paul Townsend.
8587
8588 2005-10-17  Eric Blake  <ebb9@byu.net>
8589
8590         * src/ls.c (usage): Fix descriptions of --sort, --time.
8591         Reported by Vitaly A. Ostanin.
8592
8593 2005-11-04  Paul Eggert  <eggert@cs.ucla.edu>
8594
8595         * src/ln.c: Include filenamecat.c.
8596         (FILE_BASENAME_CONCAT): Remove.
8597         (do_link): Remove last arg DEST_IS_DIR.  All callers changed.
8598         (main): Use file_name_concat, base_name, and strip_trailing_slashes
8599         instead of FILE_BASENAME_CONCAT.  This simplifies the code, and avoids
8600         the use of alloca.
8601
8602 2005-11-04  Jim Meyering  <jim@meyering.net>
8603
8604         * src/du.c (process_file): Don't overflow for files of size >= 2^31
8605         on systems with stat.st_blocks of a signed 32-bit type.
8606         This bug causes trouble on some AIX 5.1 systems.
8607         Report and trivial patch from Paul Townsend:
8608         <http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00033.html>
8609         * NEWS: Mention this.
8610
8611         * tests/du/2g: New (very-expensive) test for the above-fixed bug.
8612         * tests/du/Makefile.am (TESTS): Add it here.
8613         * tests/very-expensive: New file.
8614         * tests/Makefile.am (EXTRA_DIST): Add it here.
8615         * tests/cp/perm: Mark this test as `very-expensive', too.
8616
8617 2005-11-02  Paul Eggert  <eggert@cs.ucla.edu>
8618
8619         * NEWS: Mention that rm -d and maybe ln -d are scheduled for
8620         removal in 2006.
8621         * src/remove.h (struct rm_options): Remove unlink_dirs.  All uses
8622         removed.
8623         * src/rm.c (usage): Don't mention rm -d.
8624
8625 2005-11-02  Jim Meyering  <jim@meyering.net>
8626
8627         * tests/dd/skip-seek: Fix typo in comment: s/fileutils/coreutils.
8628         From Andreas Schwab.
8629
8630         * tests/dd/unblock-sync: Redirect stderr to /dev/null so the
8631         `M+N records in/out' lines don't pollute `make check' output.
8632
8633         * tests/dd/skip-seek (sk-seek4): New test, to exercise the bug
8634         fixed on 2005-10-31.  This test uses the new, IN_PIPE specifier.
8635         * tests/Coreutils.pm: Accept a new type of input specifier: IN_PIPE,
8636         to indicate that the input file should be piped into the command
8637         under test (via `cat FILE | $prog ...').
8638
8639         * src/remove.c (remove_entry): Emit a better diagnostic when rm
8640         (without -r) fails to remove a directory on a non-Linux system.
8641         This change affects only newer Solaris systems (with priv_*
8642         functions like priv_allocset).  Reported by Keith Thompson.
8643
8644         * tests/rm/dir-nonrecur: New file/test for the above fix.
8645         * tests/rm/Makefile.am (TESTS): Add dir-nonrecur.
8646
8647 2005-11-01  Paul Eggert  <eggert@cs.ucla.edu>
8648
8649         * NEWS: "tail -c 2 FILE" and "touch 0101000000" now operate as
8650         POSIX 1002.1-2001 requires.
8651         * src/tail.c (parse_obsolete_option): Implement this.
8652         Problem reported by Vincent Lefevre.
8653         * src/touch.c (main): Pass PDS_PRE_2000 to posixtime.
8654         * tests/tail/Test.pm (c-2, c-2-minus, c2, c2-minus): New tests.
8655         (test_vector): Add special cases for _POSIX2_VERSION, and
8656         regularize the old ones a bit.
8657         * tests/touch/obsolescent: Add y2000 test.
8658
8659 2005-10-31  Paul Eggert  <eggert@cs.ucla.edu>
8660
8661         * src/dd.c (skip): Fix off-by-one error reported by
8662         Theodoros V. Kalamatianos.
8663
8664 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
8665
8666         * tests/mkdir/p-3: Require that the test be run as non-root.
8667         Problem and trivial fix reported by Theodoros V. Kalamatianos.
8668
8669 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
8670
8671         * src/ln.c (FILE_BASENAME_CONCAT): Omit unnecessary slashes in the
8672         boundary between DEST and SOURCE in the result.
8673
8674 2005-10-26  Dmitry V. Levin  <ldv@altlinux.org>
8675
8676         * src/md5sum.c (main) [!O_BINARY]: Changed default read mode
8677         back to text, to sync with documentation and for backwards
8678         compatibility.
8679
8680 2005-10-25  Jim Meyering  <jim@meyering.net>
8681
8682         * tests/dircolors/simple (other-wr): Add an explicit test for
8683         the dircolors bug (NULL-dereference) fixed yesterday.
8684
8685 2005-10-24  Jim Meyering  <jim@meyering.net>
8686
8687         * src/tac.c (tac_file): When determining whether a file is seekable,
8688         also test whether it is a tty.  Using only the lseek-based test would
8689         give a false positive on Solaris.  Reported by Peter Fales.
8690
8691 2005-10-24  Dmitry V. Levin  <ldv@altlinux.org>
8692
8693         * tests/install/d-slashdot: New test, for "install -d" failure.
8694         * tests/install/Makefile.am (TESTS): Add d-slashdot.
8695         * tests/mkdir/p-slashdot: New test, for "mkdir -p" failure.
8696         * tests/mkdir/Makefile.am (TESTS): Add p-slashdot.
8697
8698 2005-10-24  Jim Meyering  <jim@meyering.net>
8699
8700         * src/dircolors.c (ls_codes): Add missing comma.
8701         Anonymous report and patch from
8702         http://savannah.gnu.org/bugs/?func=detailitem&item_id=14849
8703
8704         * src/dircolors.c: Add compile-time assertion that the slack_codes
8705         and ls_codes arrays have the same number of elements.  This would
8706         have prevented the above-fixed bug.
8707
8708         * src/expand.c (parse_tab_stops): Add a comment to make this function
8709         identical to the one in unexpand.c.
8710         * src/unexpand.c (parse_tab_stops): Adjust syntax to make this function
8711         identical to the one in expand.c.
8712
8713         * src/expand.c (next_file): Don't assume fopen cannot return stdin.
8714
8715 2005-10-23  Jim Meyering  <jim@meyering.net>
8716
8717         * src/md5sum.c (digest_check, main): Use ptr_align rather than
8718         a dangerous pointer-value-to-`unsigned' cast.
8719         * NEWS: mention the new sha* programs.
8720         * AUTHORS: Add new sha* programs.
8721
8722 2005-08-28  David Madore  <david.madore@ens.fr>
8723
8724         Add new programs: sha224sum, sha256sum, sha384sum, sha512sum.
8725         * README: Add their names to the list.
8726         * src/md5sum.c: Provide framework for computing sha-2 hashes.
8727         * src/Makefile.am (sha224sum, sha256sum, sha384sum, sha512sum):
8728         Rules for compiling sha-2 utilities
8729         (noinst_HEADERS): Remove checksum.h.
8730         * man/sha512sum.x, man/sha384sum.x, man/sha256sum.x, man/sha224sum.x:
8731         New files.
8732         * man/Makefile.am (dist_man_MANS): Add the corresponding .1 names.
8733         (sha224sum.1, sha256sum.1, sha384sum.1, sha512sum.1): New dependencies.
8734         * tests/misc/sha224sum, tests/misc/sha256sum: New files.
8735         * tests/misc/sha384sum, tests/misc/sha512sum: New files.
8736         * tests/misc/Makefile.am (TESTS): Add new sha224sum, sha256sum,
8737         sha384sum, sha512sum test scripts here rather that each in its
8738         own directory.
8739
8740 2005-08-28  David Madore  <david.madore@ens.fr>
8741
8742         * tests/sha1sum/basic-1 (million-a): Add the "million a's" test (one
8743         of the FIPS test vectors).
8744
8745 2005-10-23  Jim Meyering  <jim@meyering.net>
8746
8747         * configure.ac: Use 6.0-cvs as the version string.
8748         * NEWS: Adjust accordingly.
8749
8750
8751         -----
8752
8753         Copyright (C) 2005, 2006 Free Software Foundation, Inc.
8754
8755         Copying and distribution of this file, with or without
8756         modification, are permitted provided the copyright notice
8757         and this notice are preserved.