platform/upstream/coreutils.git
16 years agoRemove xdelta support, clean up distcheck process.
Jim Meyering [Wed, 20 Feb 2008 11:08:53 +0000 (12:08 +0100)]
Remove xdelta support, clean up distcheck process.
* Makefile.maint (writable-files): Don't create $(release_archive_dir).
(my-distcheck): Don't depend on prev-tgz.
Remove xdelta-related variables and uses.
(alpha beta major): Skip steps if $(release_archive_dir) doesn't exist.

16 years ago* bootstrap: Remove dangling symlinks before invoking aclocal.
Jim Meyering [Wed, 20 Feb 2008 07:16:38 +0000 (08:16 +0100)]
* bootstrap: Remove dangling symlinks before invoking aclocal.

16 years agosort: add --sort=... option.
Andreas Schwab [Wed, 20 Feb 2008 07:36:56 +0000 (08:36 +0100)]
sort: add --sort=... option.

* src/sort.c (SORT_OPTION): New enum.
(sort_args, sort_types): Define.
(usage, long_options, main): New option --sort.
* tests/sort/Test.pm: Test it.
* doc/coreutils.texi (sort invocation): Document --sort option.
* NEWS: Mention this.

16 years ago2008-02-19 Jim Meyering <meyering@redhat.com>
Jim Meyering [Tue, 19 Feb 2008 17:20:46 +0000 (18:20 +0100)]
2008-02-19  Jim Meyering  <meyering@redhat.com>

* TODO: Remove final seq-related item.

16 years ago* src/c99-to-c89.diff: Adjust seq.c offsets. Accommodate a new C99-ism.
Jim Meyering [Mon, 18 Feb 2008 22:52:26 +0000 (23:52 +0100)]
* src/c99-to-c89.diff: Adjust seq.c offsets.  Accommodate a new C99-ism.

16 years agoseq: give better diagnostics for invalid formats.
Steven Schubiger [Mon, 18 Feb 2008 21:39:22 +0000 (22:39 +0100)]
seq: give better diagnostics for invalid formats.

* src/seq.c: (validate_format): New function.
(main): Use it.
* tests/misc/seq (fmt-d, fmt-e): Test for expected diagnostics with
invalid formats.
* NEWS: Mention this change.
* TODO: Remove this item.
[jm: src/seq.c: make diagnostics more consistent
 tests/misc/seq (fmt-eos1): adjust the expected diagnostic ]

16 years agojoin: new options: --check-order and --nocheck-order.
James Youngman [Tue, 19 Feb 2008 13:13:00 +0000 (14:13 +0100)]
join: new options: --check-order and --nocheck-order.

* src/join.c: Support --check-order and --nocheck-order.
New variables check_input_order, seen_unpairable and
issued_disorder_warning[]. For --check-order, verify that the
input files are in sorted order.  For the default case, check the
order only if there are unpairable lines.
(join): Perform ordering checks after reaching EOF on either
input.
(usage): Mention --check-order and --nocheck-order.
(dupline): Save a copy of the previously-read input line so that
we can detect disorder on the input.
(get_line): Temporarily save a copy of the previous line (by
calling dupline) and check relative ordering (by calling
checkorder) before returning the newly-read line.
(getseq, join): Tell get_line which file we are reading from.
(advance_seq): New function, factoring out some of the code
commonly surrounding calls to getseq.
(checkorder): New function.  Verifies that a pair of consecutive
input lines are in sorted order.
* doc/coreutils.texi (join invocation): Document the new options
--check-order and --nocheck-order.
* tests/join/Test.pm (tv): Added tests for --check-order and
--nocheck-order.
* NEWS: Mention this new feature.

16 years agoFix non-srcdir "make distcheck" failure.
James Youngman [Tue, 19 Feb 2008 12:27:39 +0000 (13:27 +0100)]
Fix non-srcdir "make distcheck" failure.

* Makefile.am (check-ls-dircolors): Look for sources under
$(srcdir), not under ".".

16 years agoseq: give a proper diagnostic for an invalid --format=% option
Jim Meyering [Mon, 18 Feb 2008 17:38:52 +0000 (18:38 +0100)]
seq: give a proper diagnostic for an invalid --format=% option

* src/seq.c (long_double_format): Handle '%' at end of string.
* tests/misc/seq [fmt-eos1, fmt-eos2]: New tests for the bug.
* NEWS: Mention this.
Reported by Pádraig Brady.

16 years ago.gitignore, src/.gitignore: ignore more
Jim Meyering [Sun, 17 Feb 2008 10:12:38 +0000 (11:12 +0100)]
.gitignore, src/.gitignore: ignore more

16 years agoClean up Makefile.maint.
Jim Meyering [Sat, 16 Feb 2008 23:26:03 +0000 (00:26 +0100)]
Clean up Makefile.maint.

* Makefile.maint: Remove obsolete comments.
(local-checks-available): Remove changelog-check.

16 years agoClean up ls.c.
Jim Meyering [Tue, 12 Feb 2008 17:13:09 +0000 (18:13 +0100)]
Clean up ls.c.

* src/ls.c (put_indicator): Use fwrite, not a loop.

16 years agoEnsure that dircolors.c and ls.c remain in sync.
Jim Meyering [Wed, 13 Feb 2008 13:33:02 +0000 (14:33 +0100)]
Ensure that dircolors.c and ls.c remain in sync.

* Makefile.am (check-ls-dircolors): New rule.
(distcheck-hook): Depend on it.

16 years agoExpand "ls --color" tests to also use the dircolors defaults.
Jim Meyering [Sat, 16 Feb 2008 21:57:15 +0000 (22:57 +0100)]
Expand "ls --color" tests to also use the dircolors defaults.

* tests/misc/ls-misc: Adjust this test so each is run twice.  First, as usual,
and the second time with LS_COLORS set using the default settings
produced by running dircolors.
* tests/Coreutils.pm: See below.

This required some changes:
  - save and restore $ENV{LS_COLORS} for each individual test
  that requires a specific value.
  - Since this is the first test to call the run_tests command more
  than once, it has exposed that that function erroneously modifies
  the \@Tests array.  Fix that in tests/Coreutils.pm.

16 years agoAdjust dircolors to match ls.c.
Jim Meyering [Sat, 16 Feb 2008 22:06:12 +0000 (23:06 +0100)]
Adjust dircolors to match ls.c.

* src/dircolors.hin: comment out NORMAL and FILE, define RESET.
* src/dircolors.c (slack_codes) Add "RESET".
(ls_codes): Add "rs".

16 years agols --color no longer outputs unnecessary escape sequences
Ed Avis [Tue, 12 Feb 2008 11:22:35 +0000 (12:22 +0100)]
ls --color no longer outputs unnecessary escape sequences

In --color mode, plain files do not get any color, not even white.
When no highlighting is required, ls outputs no escape sequence at all.
* src/ls.c (print_with_color):
(used_color): New global.
(indicator_no) [C_RESET]: New enum value.
(indicator_name) ["rs"]: Corresponding new string.
(color_indicator): Make the 'normal' and 'file' markers be NULL.
Use "rs" (C_RESET) to reset to ordinary colors.
(process_signals): Restore default colors only if necessary.
(main): Don't call prep_non_filename_text here.
(print_name_with_quoting): Call it here, instead.
(prep_non_filename_text): Use C_RESET, not C_NORM.
(print_color_indicator): Return bool, not void.
Print nothing, when possible.
(put_indicator): Call prep_non_filename_text the first time.
* tests/misc/ls-misc: Test for above.
* tests/ls/color-dtype-dir: Adapt: no escapes around regular file name.
* TODO: Remove item.
* NEWS: Mention this.

16 years agols: Improve description of --group-directories-first.
Dan Jacobson [Tue, 12 Feb 2008 08:18:11 +0000 (09:18 +0100)]
ls: Improve description of --group-directories-first.

* src/ls.c (usage) [--group-directories-first]: Improve description.
* doc/coreutils.texi (Which files are listed): Likewise.

16 years agoAvoid tests/cp/acl test failure.
Jim Meyering [Sat, 16 Feb 2008 22:10:15 +0000 (23:10 +0100)]
Avoid tests/cp/acl test failure.

* tests/check.mk (TESTS_ENVIRONMENT) [CONFIG_HEADER]: Define
to an absolute name, so it can be used from any point in the
test hierarchy.  Reported by James Youngman.

16 years agoUse the gettime module in ls.c.
James Youngman [Sat, 16 Feb 2008 18:29:52 +0000 (19:29 +0100)]
Use the gettime module in ls.c.

Implement TODO list item to make ls.c use the gettime module.
* TODO (ls): Now that we use gettime, remove the TODO entry.
* src/ls.c: Use timespec.h and the gettime module.
(current_time): Change type from time_t to struct timespec.
(current_time_ns): Removed.
(get_current_time): Removed.
(print_long_format): Remove when and when_ns, since we have
when_timespec anyway.  Change type of variable six_months_ago from
time_t to struct timespec.

16 years agogroups: don't test printf and putchar calls for failure
Jim Meyering [Sun, 27 Jan 2008 23:08:32 +0000 (00:08 +0100)]
groups: don't test printf and putchar calls for failure

They are unnecessary, since we use gnulib's closeout module.
* src/group-list.c (print_group): Remove explicit error tests.
* src/groups.c (main): Likewise.
(write_error): Remove function.

16 years agoReplace groups.sh with groups.c.
James Youngman [Fri, 25 Jan 2008 16:05:52 +0000 (16:05 +0000)]
Replace groups.sh with groups.c.

* src/groups.c (main): New file, replacing groups.sh.
* src/group-list.c, src/group-list.h: New files, factored out of id.c,
implementing the functionality that "id" and "groups" have in common.
* src/id.c (print_full_info): Avoid a segfault when trying to print
an error message if getgroups fails.
(print_group_list): Move to group-list.c.
(print_group): Likewise.
* man/Makefile.am: When building groups.1, obtain the help text
from src/groups.c, not src/groups.sh.
(noinst_HEADERS): Add group-list.h.
(group): Remove rule.
(dist_man_MANS): Remove groups.1.
* doc/coreutils.texi (groups: Print group names a user is in):
Explain why "groups" and "groups $(id -un)" give different results
in existing login sessions after you change the group database.
(id: Print user identity): Likewise for "id".
* po/POTFILES.in: Add src/group-list.c and src/groups.c.
* NEWS: mention this.
* AUTHORS: Update.

16 years agoMove more test_skip_-using code to follow ". test-lib.sh".
Jim Meyering [Tue, 12 Feb 2008 17:45:54 +0000 (18:45 +0100)]
Move more test_skip_-using code to follow ". test-lib.sh".

* tests/mv/acl: Likewise.
* tests/cp/acl: Likewise.

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years agotests/touch/not-owner: Source test-lib.sh before using skip_test_.
Peter Fales [Tue, 12 Feb 2008 17:15:29 +0000 (18:15 +0100)]
tests/touch/not-owner: Source test-lib.sh before using skip_test_.

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years ago* tests/Makefile.am (EXTRA_DIST): Remove strace.
Jim Meyering [Mon, 11 Feb 2008 23:10:06 +0000 (00:10 +0100)]
* tests/Makefile.am (EXTRA_DIST): Remove strace.

16 years agotests: Migrate sourced strace file into a function, require_strace_.
Jim Meyering [Mon, 11 Feb 2008 19:54:38 +0000 (20:54 +0100)]
tests: Migrate sourced strace file into a function, require_strace_.

* tests/strace: Remove file.
* tests/test-lib.sh (require_strace_): New function.
* tests/mv/atomic: Use require_strace_, rather than ". strace".
* tests/ls/stat-free-symlinks: Likewise.
Peter Fales reported that stat-free-symlinks failed without strace.

16 years ago* tests/rm/inaccessible: Source test-lib.sh *before* using skip_test_.
Jim Meyering [Mon, 11 Feb 2008 19:47:26 +0000 (20:47 +0100)]
* tests/rm/inaccessible: Source test-lib.sh *before* using skip_test_.

Reported by Peter Fales.

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years agoEnsure there are no removable (useless) if-before-free tests.
Jim Meyering [Sun, 10 Feb 2008 16:18:03 +0000 (17:18 +0100)]
Ensure there are no removable (useless) if-before-free tests.

* bootstrap.conf (gnulib_modules): Add useless-if-before-free.
* Makefile.maint (sc_avoid_if_before_free): New rule.

16 years agoUse a better dirname emulation.
Jim Meyering [Sun, 10 Feb 2008 12:52:47 +0000 (13:52 +0100)]
Use a better dirname emulation.

* build-aux/check.mk (_dirname): Define.
(am__check_pre): Use it.

16 years agoAvoid test failure when run with risky PATH ("." before /usr/bin).
Jim Meyering [Sun, 10 Feb 2008 10:26:57 +0000 (11:26 +0100)]
Avoid test failure when run with risky PATH ("." before /usr/bin).

* build-aux/check.mk (approx_dirname_filter): Define.
(am__check_pre): Emulate dirname using sed.
Report and suggested fix from Bruno Haible in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12587/focus=12590

16 years ago* build-aux/.gitignore: Remove file from version control. It's generated.
Jim Meyering [Sun, 10 Feb 2008 09:34:31 +0000 (10:34 +0100)]
* build-aux/.gitignore: Remove file from version control. It's generated.

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years agoGenerate ChangeLog from git log.
Jim Meyering [Sun, 10 Feb 2008 09:27:42 +0000 (10:27 +0100)]
Generate ChangeLog from git log.

* bootstrap.conf (gnulib_modules): Add gitlog-to-changelog.
Ensure that ChangeLog exists, for automake.
* Makefile.am (gen-ChangeLog): New rule.
(dist-hook): Depend on it.
(EXTRA_DIST): Add ChangeLog-2006, ChangeLog-2007, ChangeLog-2008.

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years agoRemove ChangeLog, dividing its content into ChangeLog-200?
Jim Meyering [Sun, 10 Feb 2008 09:23:46 +0000 (10:23 +0100)]
Remove ChangeLog, dividing its content into ChangeLog-200?

* ChangeLog: Remove file.
* ChangeLog-2005: Prepend the 2005 entries.
* ChangeLog-2006: New file.
* ChangeLog-2007: New file.
* ChangeLog-2008: New file.

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years ago* ChangeLog: Manually update copyright notice at *bottom*.
Jim Meyering [Sun, 10 Feb 2008 09:07:52 +0000 (10:07 +0100)]
* ChangeLog: Manually update copyright notice at *bottom*.

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years agotests: rm/fail-eperm: require-non-root in perl, not sh
Jim Meyering [Tue, 11 Dec 2007 14:06:29 +0000 (15:06 +0100)]
tests: rm/fail-eperm: require-non-root in perl, not sh

Since it creates no temporaries and since it requires non-root,
do the require-non-root bit in perl, rather than using test-lib.sh.

16 years agotests: Remove priv-check. Use new require_root_ function instead.
Jim Meyering [Sat, 8 Dec 2007 11:29:25 +0000 (12:29 +0100)]
tests: Remove priv-check.  Use new require_root_ function instead.

* tests/priv-check: Remove file.
* tests/Makefile.am (EXTRA_DIST): Remove priv-check.
* tests/test-lib.sh (require_root_): New function.
Use this function rather than sourcing the priv-check file.
* tests/sample-test: Use require_root_ rather than priv-check.
* tests/chown/basic: Likewise.
* tests/cp/cp-a-selinux: Likewise.
* tests/cp/preserve-gid: Likewise.
* tests/cp/special-bits: Likewise.
* tests/ls/nameless-uid: Likewise.
* tests/misc/chcon: Likewise.
* tests/mkdir/writable-under-readonly: Likewise.
* tests/mv/sticky-to-xpart: Likewise.
* tests/rm/fail-2eperm: Likewise.
* tests/rm/no-give-up: Likewise.
* tests/rm/one-file-system: Likewise.
* tests/tail-2/append-only: Likewise.
* tests/touch/now-owned-by-other: Likewise.
* tests/rm/fail-eperm: Use skip_if_root_ rather than priv-check.
* Makefile.maint (sc_root_tests): Reflect this change:
search for the new function name.

16 years agotests: factor out the perl-requiring code in many test scripts
Jim Meyering [Thu, 6 Dec 2007 13:21:51 +0000 (14:21 +0100)]
tests: factor out the perl-requiring code in many test scripts

* tests/require-perl: New file.
* tests/Makefile.am (EXTRA_DIST): Add require-perl.
* tests/dd/skip-seek: Use it, and remove manual tests.
* tests/du/files0-from: Likewise.
* tests/ls/nameless-uid: Likewise.
* tests/misc/base64: Likewise.
* tests/misc/basename: Likewise.
* tests/misc/cut: Likewise.
* tests/misc/date: Likewise.
* tests/misc/dircolors: Likewise.
* tests/misc/dirname: Likewise.
* tests/misc/expand: Likewise.
* tests/misc/expr: Likewise.
* tests/misc/factor: Likewise.
* tests/misc/fmt: Likewise.
* tests/misc/fold: Likewise.
* tests/misc/head-elide-tail: Likewise.
* tests/misc/ls-misc: Likewise.
* tests/misc/md5sum: Likewise.
* tests/misc/md5sum-newline: Likewise.
* tests/misc/mktemp: Likewise.
* tests/misc/od: Likewise.
* tests/misc/paste-no-nl: Likewise.
* tests/misc/pr: Likewise.
* tests/misc/pwd-long: Likewise.
* tests/misc/seq: Likewise.
* tests/misc/sha1sum: Likewise.
* tests/misc/sha1sum-vec: Likewise.
* tests/misc/sha224sum: Likewise.
* tests/misc/sha256sum: Likewise.
* tests/misc/sha384sum: Likewise.
* tests/misc/sha512sum: Likewise.
* tests/misc/sort-merge: Likewise.
* tests/misc/stat-printf: Likewise.
* tests/misc/sum: Likewise.
* tests/misc/sum-sysv: Likewise.
* tests/misc/test-diag: Likewise.
* tests/misc/tsort: Likewise.
* tests/misc/tty-eof: Likewise.
* tests/misc/unexpand: Likewise.
* tests/misc/wc-files0-from: Likewise.
* tests/misc/xstrtol: Likewise.
* tests/mv/i-1: Likewise.
* tests/rm/empty-name: Likewise.
* tests/rm/fail-eperm: Likewise.
* tests/rm/unreadable: Likewise.

(EXTRA_DIST): *do* require require-perl as a stand-alone, 'source'able script.

16 years agotests: call skip_test_ in place of echo+exit 77
Jim Meyering [Thu, 29 Nov 2007 08:21:22 +0000 (09:21 +0100)]
tests: call skip_test_ in place of echo+exit 77

* tests/mv/no-target-dir: Likewise.
* tests/other-fs-tmpdir: Likewise.
* tests/rm/empty-name: Likewise.
* tests/rm/fail-eperm: Likewise.
* tests/rm/inaccessible: Likewise.
* tests/rm/isatty: Likewise.
* tests/rm/unreadable: Likewise.
* tests/setgid-check: Likewise.
* tests/sparse-file: Likewise.
* tests/strace: Likewise.
* tests/tail-2/append-only: Likewise.
* tests/tail-2/big-4gb: Likewise.
* tests/tail-2/tail-n0f: Likewise.
* tests/touch/dangling-symlink: Likewise.
* tests/touch/fifo: Likewise.
* tests/touch/not-owner: Likewise.
* tests/mv/i-3: Likewise.
* tests/umask-check: Likewise.
* tests/mv/acl: Likewise.
* tests/cp/acl: Likewise.
* tests/chgrp/deref: Likewise.
* tests/chmod/setgid: Likewise.
* tests/cp/existing-perm-race: Likewise.
* tests/cp/file-perm-race: Likewise.
* tests/cp/parent-perm-race: Likewise.
* tests/du/2g: Likewise.
* tests/du/8gb: Likewise.
* tests/du/long-from-unreadable: Likewise.
* tests/du/long-sloop: Likewise.
* tests/du/slink: Likewise.
* tests/ls/nameless-uid: Likewise.
* tests/ls/stat-dtype: Likewise.
* tests/misc/cat-proc: Likewise.
* tests/misc/md5sum-newline: Likewise.
* tests/misc/nice: Likewise.
* tests/misc/od-x8: Likewise.
* tests/misc/pwd-unreadable-parent: Likewise.
* tests/misc/selinux: Likewise.
* tests/misc/stty-row-col: Likewise.
* tests/misc/tac-continue: Likewise.
* tests/misc/arch: Likewise, and source $srcdir/../test-lib.sh *before*
the use of skip_test_.

16 years agotests: move the very-expensive file into test-lib.sh
Jim Meyering [Fri, 30 Nov 2007 22:22:21 +0000 (23:22 +0100)]
tests: move the very-expensive file into test-lib.sh

* tests/very-expensive: Remove file.
* tests/test-lib.sh (very_expensive_): New function.
* tests/Makefile.am (EXTRA_DIST): Remove very-expensive.
* tests/cp/perm: Call the new function, rather than sourcing the file.
* tests/tail-2/assert: Likewise.
* tests/tail-2/assert-2: Likewise.
* tests/du/2g: Likewise.

16 years agotests: start migrating sourced-file function-like tests into test-lib.sh.
Jim Meyering [Thu, 29 Nov 2007 07:55:47 +0000 (08:55 +0100)]
tests: start migrating sourced-file function-like tests into test-lib.sh.

* tests/acl: Remove file.
* tests/test-lib.sh (require_acl_): New function.
* tests/cp/acl: Use require_acl_ instead.
* tests/mv/acl: Likewise.
* tests/Makefile.am (EXTRA_DIST): Remove acl.

16 years agotests: mv/acl: Don't mention "yes" as a partition name in diagnostic.
Jim Meyering [Thu, 29 Nov 2007 08:05:17 +0000 (09:05 +0100)]
tests: mv/acl: Don't mention "yes" as a partition name in diagnostic.

16 years agoWe *do* need two different version files.
Jim Meyering [Thu, 7 Feb 2008 22:30:07 +0000 (23:30 +0100)]
We *do* need two different version files.

One for tarball-only, the other to be updated any time we
get a new value of $(VERSION).
* Makefile.am (dist-hook): Create .tarball-version in dist tarball.
* GNUmakefile (_curr-ver): Make git-version-gen use it.
* .gitignore: Ignore it.

16 years agoFix a typo in description of size suffixes: s/GB/G/.
Jim Meyering [Thu, 7 Feb 2008 22:05:00 +0000 (23:05 +0100)]
Fix a typo in description of size suffixes: s/GB/G/.

* doc/coreutils.texi (od invocation, head invocation, tail invocation):
Spotted by Bert Wesarg.

16 years agoNEWS [6.9.90]: head, od, split and tail accept the standard size suffixes
Jim Meyering [Thu, 7 Feb 2008 21:57:50 +0000 (22:57 +0100)]
NEWS [6.9.90]: head, od, split and tail accept the standard size suffixes

16 years agomkdir, split: write --verbose output to stdout, not stderr.
Steven Schubiger [Wed, 6 Feb 2008 07:25:24 +0000 (08:25 +0100)]
mkdir, split: write --verbose output to stdout, not stderr.

* src/mkdir.c (verbose_output): New function.
(announce_mkdir): Use it.
* src/split.c (usage): Update.
* src/split.c (cwrite): Write to stdout, not stderr.
* doc/coreutils.texi (split invocation): Remove the mention
of --verbose output being printed to stderr.
* tests/mkdir/p-v: Redirect stdout, not stderr.
* tests/misc/split-a: Likewise.
* NEWS: Mention this change.
* TODO: Remove this item.

16 years agoMakefile.maint (announcement): Remove stale comment.
Jim Meyering [Mon, 4 Feb 2008 12:23:56 +0000 (13:23 +0100)]
Makefile.maint (announcement): Remove stale comment.

16 years agoClarify a comment.
Jim Meyering [Sat, 2 Feb 2008 08:04:24 +0000 (09:04 +0100)]
Clarify a comment.

* tests/sort/Test.pm: Replace a vague ChangeLog reference with a URL.

16 years agoImprove wording of date and time man page.
Bob Proulx [Wed, 30 Jan 2008 22:31:37 +0000 (15:31 -0700)]
Improve wording of date and time man page.

* man/date.x: Improve compact description of the --date=STRING.
* man/touch.x: Likewise.
Suggested by A. Costa.

16 years agoRemove alignment constraint from the sha*_read_ctx functions.
Jim Meyering [Thu, 31 Jan 2008 12:51:10 +0000 (13:51 +0100)]
Remove alignment constraint from the sha*_read_ctx functions.

* lib/sha256.c (set_uint32): New function.
(sha256_read_ctx, sha224_read_ctx): Use it.
* lib/sha512.c (set_uint64): New function.
(sha512_read_ctx, sha384_read_ctx): Use it.
* lib/sha256.h: Remove warning about alignment constraint.
* lib/sha512.h: Likewise.
Prompted by similar changes in gnulib's sha1 and md[45] modules.

16 years agoAdapt to new version of vc-list-files.
Jim Meyering [Thu, 31 Jan 2008 12:25:13 +0000 (13:25 +0100)]
Adapt to new version of vc-list-files.

* tests/check.mk (vc_exe_in_TESTS): Adapt to new constraint
that vc-list-files be run only from $(top_srcdir).

16 years agoPull vc-list-files from gnulib.
Jim Meyering [Thu, 31 Jan 2008 10:27:15 +0000 (11:27 +0100)]
Pull vc-list-files from gnulib.

* bootstrap.conf (gnulib_modules): Add vc-list-files.
* build-aux/vc-list-files: Remove file.

16 years agoImprove the cp/parent-perm test.
Jim Meyering [Fri, 11 Jan 2008 14:10:02 +0000 (15:10 +0100)]
Improve the cp/parent-perm test.

* tests/cp/parent-perm: Also check that perms of existing dest
dirs are changed to match those of corresponding src dir

16 years agoDon't modify argv in dd due to ',' in arguments.
Paul Eggert [Thu, 31 Jan 2008 08:22:49 +0000 (09:22 +0100)]
Don't modify argv in dd due to ',' in arguments.

* src/dd.c: Include quotearg.h.
(operand_matches): New function.
(parse_symbols, operand_is): Use it.
(parse_symbols): 1st arg is now const pointer.  Don't modify it.
msgid arg is now just the message, not a format.
(scanargs): Add some 'const's to check for problems like the above.

16 years ago* src/c99-to-c89.diff: Adjust remove.c offsets, again.
Jim Meyering [Wed, 30 Jan 2008 18:37:07 +0000 (19:37 +0100)]
* src/c99-to-c89.diff: Adjust remove.c offsets, again.

16 years agoNow that system.h defines is_empty_dir, include "openat.h".
Jim Meyering [Wed, 30 Jan 2008 18:29:01 +0000 (19:29 +0100)]
Now that system.h defines is_empty_dir, include "openat.h".

* src/system.h: Include "openat.h" here, ...
* src/chcon.c: ... not here.
* src/chmod.c: Likewise.
* src/chown-core.c: Likewise.
* src/remove.c: Likewise.

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years ago* src/c99-to-c89.diff: Adjust remove.c offsets.
Jim Meyering [Wed, 30 Jan 2008 15:15:18 +0000 (16:15 +0100)]
* src/c99-to-c89.diff: Adjust remove.c offsets.

16 years agoImprove "rmdir --ignore-fail-on-non-empty"
Jim Meyering [Wed, 30 Jan 2008 12:43:15 +0000 (13:43 +0100)]
Improve "rmdir --ignore-fail-on-non-empty"

* src/rmdir.c (remove_parents, main): With --ignore-fail-on-non-empty,
suppress a diagnostic also for other errno values, which can arise
with read-only media or when the parent directory has the immutable
attribute (set via chattr +i).
(errno_may_be_empty, ignorable_failure): New functions.
* src/remove.c (is_empty_dir): Move function to ...
* src/system.h (is_empty_dir): ...here, and make it inline.
Suggested by Josselin Mouette in <http://bugs.debian.org/363011>
via Bob Proulx.
* NEWS: Mention the improvement.

16 years agoDon't modify argv in dd.
Paul Eggert [Wed, 30 Jan 2008 06:33:01 +0000 (07:33 +0100)]
Don't modify argv in dd.

* src/dd.c (operand_is): New function.
(scanargs): Use it so that we don't need to modify argv, as a nicety.
Problem reported by Adam Goode in
<http://lists.gnu.org/archive/html/bug-coreutils/2008-01/msg00264.html>.

16 years ago* Makefile.am (BUILT_SOURCES): Ensure that .version exists.
Jim Meyering [Tue, 29 Jan 2008 16:19:29 +0000 (17:19 +0100)]
* Makefile.am (BUILT_SOURCES): Ensure that .version exists.

Reported by Bob Proulx.

16 years agoImprove the man pages of --date=STRING for 'date' and 'touch'.
Bob Proulx [Tue, 29 Jan 2008 05:19:21 +0000 (22:19 -0700)]
Improve the man pages of --date=STRING for 'date' and 'touch'.

* man/date.x: Add a compact description of the --date=STRING.
* man/touch.x: Likewise.
Reported by A. Costa in http://bugs.debian.org/363011

16 years agoImprove the description of when dd outputs its final statistics.
Michael Stone [Tue, 29 Jan 2008 13:12:22 +0000 (14:12 +0100)]
Improve the description of when dd outputs its final statistics.

* doc/coreutils.texi (dd invocation): Say that dd prints stats
upon normal termination and upon SIGINT.

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years agoAvoid "make distcheck" failure: newly-created man/*.1 files not removed
Jim Meyering [Mon, 28 Jan 2008 14:16:17 +0000 (15:16 +0100)]
Avoid "make distcheck" failure: newly-created man/*.1 files not removed

* Makefile.am (EXTRA_DIST): Add .version.
(.version): New rule.
(dist-hook): Don't create $(distdir)/.version here, now that it's
being distributed.
* man/Makefile.am (common_dep): Use ../.version, not ../VERSION.
(../VERSION): Remove rule.
* GNUmakefile (dummy): Create .version, not VERSION.
Add an extra "...:= $(shell..." statement to ensure that
.version exists even when the preceding code is not run.
* .gitignore: Remove both .version and VERSION.

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years agols: don't segfault on files in /proc with an old libselinux
Jim Meyering [Tue, 29 Jan 2008 07:56:48 +0000 (08:56 +0100)]
ls: don't segfault on files in /proc with an old libselinux

* src/ls.c (gobble_file): Work around a bug in libselinux1-2.0.15
whereby getfilecon returns 0 yet sets the context to NULL.
Reported by Jan Moringen via Michael Stone in
http://bugs.debian.org/463043
* tests/ls/Makefile.am (TESTS): Add proc-selinux-segfault.
* tests/ls/proc-selinux-segfault: Test for the above fix.
* NEWS: Mention the fix.

16 years agoWork around Darwin9's set-GID-like group ownership inheritance.
Jim Meyering [Sat, 26 Jan 2008 17:28:43 +0000 (18:28 +0100)]
Work around Darwin9's set-GID-like group ownership inheritance.

This avoids another spurious Mac OS 10.5.1 (Darwin 9.1) test failure.
* tests/cp/preserve-gid: Accept a group ID of 0, as well.
Reported by Elias Pipping.

16 years agoEmit "info coreutils 'PROG invocation'" into the man page,
Jim Meyering [Sat, 26 Jan 2008 18:37:23 +0000 (19:37 +0100)]
Emit "info coreutils 'PROG invocation'" into the man page,

rather than just "info PROG".  The latter would often fail
or simply display the man page.
* man/help2man: Change the template.
Prompted by http://bugs.debian.org/399684

16 years agochcon: correct description of --no-dereference (-h) option.
Jim Meyering [Sat, 26 Jan 2008 16:40:28 +0000 (17:40 +0100)]
chcon: correct description of --no-dereference (-h) option.

* src/chcon.c (usage): Remove invalid reference to lchown.
Reported by Göran Uddeborg.

16 years agoEnsure that each version string change propagates to man pages.
Jim Meyering [Sat, 26 Jan 2008 14:48:53 +0000 (15:48 +0100)]
Ensure that each version string change propagates to man pages.

* man/Makefile.am (common_dep): Don't depend on configure.ac for
version changes.  Instead, depend on ../VERSION.
(../VERSION): New rule.
* Makefile.am (DISTCLEANFILES): Define.
* GNUmakefile: Update ./VERSION.
* .gitignore: List VERSION.
Reported by Sven Joachim.

16 years agoAvoid cp/preserve-gid test failure on Mac OS 10.5.1 (Darwin 9.1)
Jim Meyering [Sat, 26 Jan 2008 14:38:39 +0000 (15:38 +0100)]
Avoid cp/preserve-gid test failure on Mac OS 10.5.1 (Darwin 9.1)

* tests/cp/preserve-gid: Set group as well as owner on ".".
Reported by Elias Pipping.

16 years agoImprove a warning about non-portable "mv" usage.
Jim Meyering [Sat, 26 Jan 2008 11:29:41 +0000 (12:29 +0100)]
Improve a warning about non-portable "mv" usage.

* doc/coreutils.texi (mv invocation): Adjust the warning: moving a
dir-symlink-specified-with-a-trailing-slash works in a surprising
manner only on some systems.  Reported by Tomas Pospisek in
http://bugs.debian.org/343652.

16 years agosrc/dircolors.hin (TERM): Add jfbterm.
Mike Frysinger [Sat, 26 Jan 2008 09:09:59 +0000 (10:09 +0100)]
src/dircolors.hin (TERM): Add jfbterm.

16 years agoClean up build-related rules.
Jim Meyering [Fri, 25 Jan 2008 18:26:08 +0000 (19:26 +0100)]
Clean up build-related rules.

* Makefile.cfg (gnulib_dir): Update comment.
* Makefile.maint (announcement) [cl_date, utc_date]: Don't set
now-unused variables.

16 years agoTODO: Update the note on getgrouplist.
Jim Meyering [Wed, 23 Jan 2008 21:47:44 +0000 (22:47 +0100)]
TODO: Update the note on getgrouplist.

16 years agoAdd a ";", so "make install" works with --enable-install-program=su.
Zvi Har'El [Wed, 23 Jan 2008 13:26:47 +0000 (14:26 +0100)]
Add a ";", so "make install" works with --enable-install-program=su.

* src/Makefile.am (install_su): Add a semicolon.

16 years agoAvoid misinterpreting mgetgroups failure in running root-only tests.
Jim Meyering [Wed, 23 Jan 2008 13:12:04 +0000 (14:12 +0100)]
Avoid misinterpreting mgetgroups failure in running root-only tests.

* src/setuidgid.c (main): Don't misinterpret as size_t an error
return from mgetgroups.  Reported by Theodoros V. Kalamatianos.

16 years ago* README: Remove/convert a few stray mentions of CVS.
Jim Meyering [Tue, 22 Jan 2008 23:18:24 +0000 (00:18 +0100)]
* README: Remove/convert a few stray mentions of CVS.

16 years agoRequire automake-1.10.1, for its support of dist-lzma.
Jim Meyering [Tue, 22 Jan 2008 22:03:48 +0000 (23:03 +0100)]
Require automake-1.10.1, for its support of dist-lzma.

* configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1.

16 years ago.prev-version: Record version: 6.10.
Jim Meyering [Tue, 22 Jan 2008 07:12:02 +0000 (08:12 +0100)]
.prev-version: Record version: 6.10.

16 years agoVersion 6.10 v6.10
Jim Meyering [Mon, 21 Jan 2008 23:31:02 +0000 (00:31 +0100)]
Version 6.10

16 years ago* NEWS: Record release date.
Jim Meyering [Mon, 21 Jan 2008 23:30:14 +0000 (00:30 +0100)]
* NEWS: Record release date.

16 years ago* README-hacking: Update to reflect existence of automake-1.10.1.
Jim Meyering [Mon, 21 Jan 2008 23:28:23 +0000 (00:28 +0100)]
* README-hacking: Update to reflect existence of automake-1.10.1.

16 years agoUpdate README.
Jim Meyering [Fri, 18 Jan 2008 08:26:49 +0000 (09:26 +0100)]
Update README.

* README: Remove a note about failing tests on SunOS 4.
On Mac OS 10.5.1 (Darwin 9.1), you'll need --disable-acl.
(Running tests as root): Recommend using "check-root", not "check".

16 years agoDo not define-away __attribute__ when __STRICT_ANSI__ is set.
Jim Meyering [Thu, 17 Jan 2008 09:20:24 +0000 (10:20 +0100)]
Do not define-away __attribute__ when __STRICT_ANSI__ is set.

* src/system.h (__attribute__): Remove the __STRICT_ANSI__ disjunct.
It has been unnecessary since approximately gcc-2.6, and now, leaving
it would cause gcc -Werror -ansi to fail to compile csplit.c.
* gl/lib/randread.c (__attribute__): Likewise.

16 years agoNEWS: Mention the configure.ac fix.
Jim Meyering [Wed, 16 Jan 2008 20:20:20 +0000 (21:20 +0100)]
NEWS: Mention the configure.ac fix.

16 years ago* TODO: Add an introduction.
Jim Meyering [Wed, 16 Jan 2008 19:18:47 +0000 (20:18 +0100)]
* TODO: Add an introduction.

Remove a few entries.  Update a few others.

16 years agoRemove each output redirection target before writing to it.
Jim Meyering [Sun, 13 Jan 2008 11:44:53 +0000 (12:44 +0100)]
Remove each output redirection target before writing to it.

* tests/check.mk (vc_exe_in_TESTS): Remove t1 and t2 _first_,
in case they exist beforehand and are not writable.
* build-aux/check.mk (am__check_pre): Likewise, remove $@-t.

16 years ago* configure.ac: Correct a non-portable use of sed.
Elias Pipping [Sun, 13 Jan 2008 08:16:09 +0000 (09:16 +0100)]
* configure.ac: Correct a non-portable use of sed.

16 years ago* src/dircolors.hin (image formats): Add the .svg suffix.
Mike Frysinger [Sat, 12 Jan 2008 15:21:04 +0000 (16:21 +0100)]
* src/dircolors.hin (image formats): Add the .svg suffix.

16 years agoUse new version of announce-gen.
Jim Meyering [Sat, 12 Jan 2008 08:55:29 +0000 (09:55 +0100)]
Use new version of announce-gen.

* Makefile.maint (announcement): Remove use of the
--gnulib-snapshot-time-stamp option.
Use new --gnulib-version option instead.
(gnulib-version): New variable.

16 years ago.prev-version: Record previous version: 6.9.92.
Jim Meyering [Sat, 12 Jan 2008 00:17:10 +0000 (01:17 +0100)]
.prev-version: Record previous version: 6.9.92.

16 years agoVersion 6.9.92 v6.9.92
Jim Meyering [Fri, 11 Jan 2008 08:10:50 +0000 (09:10 +0100)]
Version 6.9.92

16 years agotests/tr/Test.pm: Prefer en_US.ISO-8859-1 to en_US.iso88591.
Jim Meyering [Fri, 11 Jan 2008 09:06:36 +0000 (10:06 +0100)]
tests/tr/Test.pm: Prefer en_US.ISO-8859-1 to en_US.iso88591.

Suggestions from James Youngman and Pádraig Brady in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12218/focus=12227

16 years ago* README-hacking: Add Git to the list of required tools.
Jim Meyering [Thu, 10 Jan 2008 13:43:17 +0000 (14:43 +0100)]
* README-hacking: Add Git to the list of required tools.

16 years agoFix a minor race condition when using cp -p --parents.
Paul Eggert [Wed, 9 Jan 2008 10:24:12 +0000 (11:24 +0100)]
Fix a minor race condition when using cp -p --parents.

* src/cp.c (make_dir_parents_private): If stat fails on the parent
directory, do not add it to the list of directories whose modes
might need fixing later.  Also, do not bother invoking 'stat'
unless the stat results might be needed later.

16 years agoparent-perm: avoid a bizarre test failure.
Jim Meyering [Tue, 8 Jan 2008 14:50:51 +0000 (15:50 +0100)]
parent-perm: avoid a bizarre test failure.

* tests/cp/parent-perm: Accommodate the situation in which
chmod ("dir", 02755) returns 0 yet fails to set the S_ISGID bit.

16 years agoRemove uses of now-undefined Makefile variable.
Jim Meyering [Tue, 8 Jan 2008 09:34:56 +0000 (10:34 +0100)]
Remove uses of now-undefined Makefile variable.

* src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Remove uses
of no-longer-defined variable, $(LIB_ACL_TRIVIAL).

16 years agocp (but not copy.c): plug a small leak.
Jim Meyering [Mon, 7 Jan 2008 16:10:07 +0000 (17:10 +0100)]
cp (but not copy.c): plug a small leak.

* src/cp.c (do_copy) [--parents]: Free the attribute list.

16 years agoMake a racy test failure less likely to happen.
Jim Meyering [Mon, 7 Jan 2008 13:21:34 +0000 (14:21 +0100)]
Make a racy test failure less likely to happen.

* tests/misc/tty-eof: Uncomment a debug "warn".
This change happens to make this test far less likely to fail.
With that statement commented out, this test would fail about
20% of the time on my desktop.  Now, it's gone 100 iterations
in a row with no failure.

16 years agoNEWS: Mention the cp bug fix.
Jim Meyering [Mon, 7 Jan 2008 11:17:52 +0000 (12:17 +0100)]
NEWS: Mention the cp bug fix.

16 years agocp --parents: don't use uninitialized memory when restoring permissions
Jan Blunck [Mon, 7 Jan 2008 11:13:42 +0000 (12:13 +0100)]
cp --parents: don't use uninitialized memory when restoring permissions

* src/cp.c (make_dir_parents_private): Always stat each source
directory, in case its permissions are required in re_protect,
when setting permissions of a just-created destination directory.

16 years agocp: add a test for today's bug fix.
Jim Meyering [Mon, 7 Jan 2008 10:57:27 +0000 (11:57 +0100)]
cp: add a test for today's bug fix.

* tests/cp/parent-perm: New script.  Test today's change.
Based on reproducer from Jan Blunck.
* tests/cp/Makefile.am (TESTS): Add parent-perm.

16 years agotouch: add a test for today's change.
Jim Meyering [Sun, 6 Jan 2008 11:38:18 +0000 (12:38 +0100)]
touch: add a test for today's change.

* tests/touch/now-owned-by-other: New script.  Test today's change.
* tests/touch/Makefile.am (TESTS): Add now-owned-by-other.
* tests/Makefile.am (all_t): Add td, a new root-only test.
(td): New target.
* NEWS: Mention the improvement.