platform/upstream/coreutils.git
16 years agood: align multiple -t specs
Eric Blake [Wed, 11 Jun 2008 15:14:26 +0000 (09:14 -0600)]
od: align multiple -t specs

* src/od.c (struct tspec): Add pad_width field, and adjust
print_function prototype.
(decode_one_format): Rewrite all fmt_string values to account for
pad width.
(FMT_BYTES_ALLOCATED): Adjust to new format style.
(main): Compute pad width per spec.
(write_block): Account for pad width.
(dump): Don't print padding-only fields.
(PRINT_TYPE, print_named_ascii, print_ascii): All print functions
adjusted to use variable pad width.
* tests/Makefile.am (TESTS): Add test.
* tests/misc/od-multiple-t: New file.
* THANKS: Update.
* NEWS: Mention the improvement.
Reported by Gary Johnson.

16 years agood: use gnulib printf replacement as necessary
Eric Blake [Wed, 11 Jun 2008 21:02:20 +0000 (15:02 -0600)]
od: use gnulib printf replacement as necessary

* src/od.c (includes): Add xprintf.h.
(PRINT_TYPE): New macro, using xprintf instead of printf.
(print_s_char, print_char, print_s_short, print_short, print_int)
(print_long, print_long_long, print_float, print_double)
(print_long_double): Factor into PRINT_TYPE macro.
(print_named_ascii, print_ascii): Use xprintf.
* NEWS: Mention this as a bug fix.

16 years agood: simplify long double support
Eric Blake [Wed, 11 Jun 2008 17:45:16 +0000 (11:45 -0600)]
od: simplify long double support

* m4/jm-macros.m4 (gl_CHECK_ALL_TYPES): Remove obsolete check for
AC_C_LONG_DOUBLE.
* src/od.c (LONG_DOUBLE): Delete.
(width_bytes, MAX_FP_TYPE_SIZE, decode_one_format, main): Just use
'long double' directly.
(print_long_double): No longer protect by HAVE_LONG_DOUBLE.

16 years agodoc: od defaults to -toS, not -td2
Eric Blake [Wed, 11 Jun 2008 14:01:31 +0000 (08:01 -0600)]
doc: od defaults to -toS, not -td2

* src/od.c (usage): Correct description of default.

16 years agoskip (don't fail) root-only tests for common set-up failures
Jim Meyering [Fri, 13 Jun 2008 20:26:15 +0000 (22:26 +0200)]
skip (don't fail) root-only tests for common set-up failures

Address 2 of 4 failures reported by Jarod Wilson in
http://bugzilla.redhat.com/442352.  More details here:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13803
* tests/cp/cp-a-selinux: Skip the test if "mkfs -t ext2" fails.
* tests/rm/fail-2eperm: Skip the test if "rm" is not accessible.

16 years agotweak to conform with syntax policy
Jim Meyering [Thu, 12 Jun 2008 19:38:17 +0000 (21:38 +0200)]
tweak to conform with syntax policy

Use "<" or "<=" rather than ">" or ">=".
Use "Type const *", rather than "const Type *".

16 years agocomm: accept new option: --output-delimiter=STR
Bo Borgerson [Wed, 23 Apr 2008 03:47:42 +0000 (23:47 -0400)]
comm: accept new option: --output-delimiter=STR

* src/comm.c (delimiter): New global.
(writeline): Use delimiter string instead of single TAB character.
(main): Initialize delimiter.
* tests/misc/comm: Add tests for comm output delimiter specification.
* doc/coreutils.texi: Document new option.
* NEWS: Advertise new option.
* TODO: Remove associated item.

16 years agocomm: ensure that input files are sorted
Bo Borgerson [Mon, 21 Apr 2008 01:24:16 +0000 (21:24 -0400)]
comm: ensure that input files are sorted

* NEWS: List new behavior.
* doc/coreutils.texi (checkOrderOption) New macro for
describing `--check-order' and `--nocheck-order', used in
both join and comm.
* src/comm.c (main): Initialize new options.
(usage): Describe new options.
(compare_files): Keep an extra pair of buffers for the previous
line from each file to check the internal order.
(check_order): If an order-check is required, compare and handle
the result appropriately.
(copylinebuffer): Copy a linebuffer; used for copy before read.
* tests/misc/Makefile.am: List new test.
* tests/misc/comm: Tests for the comm program, including the
new order-checking functionality and attendant command-line options.

16 years agofix another unportable use of 'tr'
Jim Meyering [Wed, 11 Jun 2008 12:04:45 +0000 (14:04 +0200)]
fix another unportable use of 'tr'

* configure.ac [EXTRA_PROGRAMS]: Add omitted space in tr's STRING2.
Spotted by Denis Excoffier, upon Solaris 8 build failure.

16 years agotests: skip a chown test on FreeBSD 6.x
Jim Meyering [Wed, 11 Jun 2008 09:52:03 +0000 (11:52 +0200)]
tests: skip a chown test on FreeBSD 6.x

* tests/chown/separator: Skip this test if is likely to fail
due to the combination of a bogus group name and a broken
getgrnam function.

16 years agotests: remove duplicate mention of misc/selinux
Jim Meyering [Wed, 11 Jun 2008 09:02:32 +0000 (11:02 +0200)]
tests: remove duplicate mention of misc/selinux

* tests/Makefile.am (TESTS): Remove misc/selinux, since it's
already listed in $(root_tests).

16 years agofix build failure on AIX 4
Bruno Haible [Wed, 11 Jun 2008 06:06:56 +0000 (08:06 +0200)]
fix build failure on AIX 4

* configure.ac: Fix unportable invocation of 'tr', introduced on
2008-04-22.  Affects tr from at least AIX 4.3.2.

16 years agoremove test for specific diagnostic when truncating missing directory
Pádraig Brady [Mon, 9 Jun 2008 15:36:38 +0000 (16:36 +0100)]
remove test for specific diagnostic when truncating missing directory

Solaris 10 returns ENOTDIR when truncating a nonexistent directory,
whereas Linux returns EISDIR (because it has a trailing /).
* tests/misc/truncate-fail-diag: Remove the test for the specific error.

16 years agotimeout: use system-independent exit values
Pádraig Brady [Mon, 9 Jun 2008 15:10:47 +0000 (16:10 +0100)]
timeout: use system-independent exit values

Change exit values from ETIMEDOUT and ECANCELED,
the values of which are system dependent, to
124 and 125 respectively.
* src/timeout.c (EXIT_TIMEDOUT, EXIT_CANCELED): Define.
(usage, main): Adjust.
* coreutils.texi (timeout invocation): Update.
* tests/misc/timeout: Adjust.

16 years agoenforce the proper_name_utf8-requires-ICONV link rule
Jim Meyering [Mon, 9 Jun 2008 08:52:20 +0000 (10:52 +0200)]
enforce the proper_name_utf8-requires-ICONV link rule

* maint.mk (sc_proper_name_utf8_requires_ICONV): New rule.
* src/Makefile.am (timeout_LDADD, truncate_LDADD): Add $(LIBICONV).

16 years ago* NEWS (Improvements): Mention improved (via gnulib) ACL support.
Bruno Haible [Mon, 9 Jun 2008 07:10:06 +0000 (09:10 +0200)]
* NEWS (Improvements): Mention improved (via gnulib) ACL support.

16 years agomaint.mk: my-distcheck runs $(MAKE) syntax-check once again
Jim Meyering [Sun, 8 Jun 2008 10:33:28 +0000 (12:33 +0200)]
maint.mk: my-distcheck runs $(MAKE) syntax-check once again

* maint.mk (my-distcheck): Run $(MAKE) syntax-check once again.
Run "$(MAKE) check" _after_ the less expensive syntax-check.

16 years agostandardize some error messages
Bo Borgerson [Fri, 4 Apr 2008 15:13:13 +0000 (11:13 -0400)]
standardize some error messages

* maint.mk: (sc_error_message_warn_fatal, sc_error_message_uppercase):
(sc_error_message_period): Add automatic checks for non-standard error
messages.
* .x-sc_error_message_uppercase: explicit exclusion for this check
* src/cp.c: Standardize some error messages.
* src/date.c: Likewise.
* src/dircolors.c: Likewise.
* src/du.c: Likewise.
* src/expr.c: Likewise.
* src/install.c: Likewise.
* src/join.c: Likewise.
* src/ln.c: Likewise.
* src/mv.c: Likewise.
* src/od.c: Likewise.
* src/pr.c: Likewise.
* src/split.c: Likewise.
* src/truncate.c: Likewise.
* src/wc.c: Likewise.
* tests/du/files0-from: Expect new error message.
* tests/misc/join: Likewise.
* tests/misc/split-a: Likewise.
* tests/misc/wc-files0-from: Likewise.
* tests/misc/xstrtol: Likewise.
* lib/xmemxfrm.c: Likewise.

16 years agosyntax-check: detect anachronistic Perl-based tests
Jim Meyering [Sun, 8 Jun 2008 08:30:50 +0000 (10:30 +0200)]
syntax-check: detect anachronistic Perl-based tests

* maint.mk (sc_no_exec_perl_coreutils): Rename and rewrite.

16 years agoAdd new program: truncate
Pádraig Brady [Fri, 28 Mar 2008 22:55:31 +0000 (22:55 +0000)]
Add new program: truncate

* AUTHORS: Register as the author
* NEWS: Mention this change
* README: Add truncate command to list
* src/truncate.c: New command
* src/Makefile.am: Add truncate command to list to build
* src/.gitignore: Add truncate binary to list to ignore
* doc/coreutils.texi (truncate invocation): Add truncate info
* man/Makefile.am: Add truncate man page to list to build
* man/truncate.x: Add truncate man page template
* po/POTFILES.in: Add truncate to list to translate
* tests/Makefile.am: Add truncate tests
* tests/misc/help-version: Add support for new truncate command
* tests/misc/truncate-dangling-symlink: check dangling link ok
* tests/misc/truncate-dir-fail: ensure dirs fail
* tests/misc/truncate-fail-diag: validate messages for missing paths
* tests/misc/truncate-fifo: ensure fifos ignored
* tests/misc/truncate-no-create-missing: ensure -c option honoured
* tests/misc/truncate-overflow: check signed integer overflows
* tests/misc/truncate-owned-by-other: root permissions check
* tests/misc/truncate-parameters: check invalid parameter combinations
* tests/misc/truncate-relative: check invalid relative sizes

16 years agoimprove 'date +%C' documentation
Eric Blake [Fri, 6 Jun 2008 00:33:26 +0000 (18:33 -0600)]
improve 'date +%C' documentation

* src/date.c (usage): Use 20, not 21, for current century.
* THANKS: Update.
Reported by Dameon G. Rogers, fix suggested by Philip Rowlands.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agonice.c: avoid a cast
Jim Meyering [Tue, 3 Jun 2008 11:58:07 +0000 (13:58 +0200)]
nice.c: avoid a cast

* src/nice.c (main): Use argv[0], rather than
"program_name with a cast".  Suggestion from Eric Blake.

16 years agoadjust c99-to-c89 patch as well as the code to generate it
Jim Meyering [Tue, 3 Jun 2008 08:33:17 +0000 (10:33 +0200)]
adjust c99-to-c89 patch as well as the code to generate it

* maint.mk (patch-check) [REGEN_PATCH]: Eliminate date-related
differences in generated diffs.
* src/c99-to-c89.diff: Adjust offsets.

16 years agouse gnulib's progname module
Jim Meyering [Tue, 3 Jun 2008 06:34:09 +0000 (08:34 +0200)]
use gnulib's progname module

* bootstrap.conf (gnulib_modules): Add progname.
* src/*.c (program_name): Remove declaration.
* (main): Call set_program_name rather than setting program_name.
* src/nice.c (main): Cast program_name to "(char *)".
* src/prog-fprintf.c: Include "system.h"
* src/system.h: Include "progname.h".
* maint.mk (sc_program_name): Adjust rule.
Suggestion from Eric Blake.

16 years agoremove duplicate definition of matchpathcon_init_prefix
Jim Meyering [Tue, 3 Jun 2008 05:44:09 +0000 (07:44 +0200)]
remove duplicate definition of matchpathcon_init_prefix

* gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Remove definition.
It is already defined there.  Reported by Eric Blake.

16 years agofix cpp indentation policy violations
Jim Meyering [Mon, 2 Jun 2008 19:47:19 +0000 (21:47 +0200)]
fix cpp indentation policy violations

* src/copy.c (mkfifo): Indent nested "# define".
* src/timeout.c (ECANCELED): Likewise.

16 years agoaccommodate older SELinux which lacks matchpathcon_init_prefix
Jim Meyering [Mon, 2 Jun 2008 19:17:57 +0000 (21:17 +0200)]
accommodate older SELinux which lacks matchpathcon_init_prefix

* m4/jm-macros.m4: Check for matchpathcon_init_prefix.
* src/install.c [!HAVE_MATCHPATHCON_INIT_PREFIX]
(matchpathcon_init_prefix): Define away.
* gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Define.
Reported by Ilya N. Golubev in
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13686>.

16 years agoeach file with a "main" must also declare program_name
Jim Meyering [Mon, 2 Jun 2008 15:48:11 +0000 (17:48 +0200)]
each file with a "main" must also declare program_name

* maint.mk (sc_program_name): New rule.
* .x-sc_program_name: New file.
* Makefile.am (EXTRA_DIST): Add .x-sc_program_name.

16 years agodeclare program_name consistently
Jim Meyering [Mon, 2 Jun 2008 15:47:32 +0000 (17:47 +0200)]
declare program_name consistently

* src/base64.c: Likewise.
* src/basename.c: Likewise.
* src/cat.c: Likewise.
* src/chcon.c: Likewise.
* src/chgrp.c: Likewise.
* src/chmod.c: Likewise.
* src/chown.c: Likewise.
* src/chroot.c: Likewise.
* src/cksum.c: Likewise.
* src/comm.c: Likewise.
* src/cp.c: Likewise.
* src/csplit.c: Likewise.
* src/cut.c: Likewise.
* src/date.c: Likewise.
* src/dd.c: Likewise.
* src/df.c: Likewise.
* src/dircolors.c: Likewise.
* src/dirname.c: Likewise.
* src/du.c: Likewise.
* src/echo.c: Likewise.
* src/env.c: Likewise.
* src/expand.c: Likewise.
* src/expr.c: Likewise.
* src/factor.c: Likewise.
* src/fmt.c: Likewise.
* src/fold.c: Likewise.
* src/groups.c: Likewise.
* src/head.c: Likewise.
* src/hostid.c: Likewise.
* src/hostname.c: Likewise.
* src/id.c: Likewise.
* src/install.c: Likewise.
* src/join.c: Likewise.
* src/kill.c: Likewise.
* src/link.c: Likewise.
* src/ln.c: Likewise.
* src/logname.c: Likewise.
* src/ls.c: Likewise.
* src/md5sum.c: Likewise.
* src/mkdir.c: Likewise.
* src/mkfifo.c: Likewise.
* src/mknod.c: Likewise.
* src/mktemp.c: Likewise.
* src/mv.c: Likewise.
* src/nice.c: Likewise.
* src/nl.c: Likewise.
* src/nohup.c: Likewise.
* src/od.c: Likewise.
* src/paste.c: Likewise.
* src/pathchk.c: Likewise.
* src/pinky.c: Likewise.
* src/pr.c: Likewise.
* src/printenv.c: Likewise.
* src/printf.c: Likewise.
* src/ptx.c: Likewise.
* src/pwd.c: Likewise.
* src/readlink.c: Likewise.
* src/rm.c: Likewise.
* src/rmdir.c: Likewise.
* src/runcon.c: Likewise.
* src/seq.c: Likewise.
* src/setuidgid.c: Likewise.
* src/shuf.c: Likewise.
* src/sleep.c: Likewise.
* src/sort.c: Likewise.
* src/split.c: Likewise.
* src/stat.c: Likewise.
* src/stty.c: Likewise.
* src/su.c: Likewise.
* src/sum.c: Likewise.
* src/sync.c: Likewise.
* src/tac.c: Likewise.
* src/tail.c: Likewise.
* src/tee.c: Likewise.
* src/test.c: Likewise.
* src/timeout.c: Likewise.
* src/touch.c: Likewise.
* src/tr.c: Likewise.
* src/true.c: Likewise.
* src/tsort.c: Likewise.
* src/tty.c: Likewise.
* src/uname.c: Likewise.
* src/unexpand.c: Likewise.
* src/uniq.c: Likewise.
* src/unlink.c: Likewise.
* src/uptime.c: Likewise.
* src/users.c: Likewise.
* src/wc.c: Likewise.
* src/who.c: Likewise.
* src/whoami.c: Likewise.
* src/yes.c: Likewise.

16 years agoexport program_name, required by gnulib
Eric Blake [Mon, 2 Jun 2008 13:53:26 +0000 (07:53 -0600)]
export program_name, required by gnulib

* src/timeout.c (program_name): Export.

16 years agorevert inadvertent change in last patch
Jim Meyering [Mon, 2 Jun 2008 13:05:38 +0000 (15:05 +0200)]
revert inadvertent change in last patch

* configure.ac (AM_INIT_AUTOMAKE): Restore accidentally-modified
options.  Spotted by Eric Blake.

16 years agonew program: timeout
Pádraig Brady [Fri, 28 Mar 2008 11:05:55 +0000 (11:05 +0000)]
new program: timeout

* AUTHORS: Register as the author.
* NEWS: Mention this change.
* README: Add timeout command to list.
* src/timeout.c: New file.
* src/kill.c (operand2sig): Move function to its own file,
now that timeout.c will also use it.
* src/operand2sig.c (operand2sig): New file, extracted from kill.c.
* src/operand2sig.h (operand2sig): Declare.
* src/Makefile.am (EXTRA_PROGRAMS): Add timeout.
* src/.gitignore: Add timeout binary to list to ignore.
* doc/coreutils.texi (timeout invocation): Add timeout info.
(Signal specifications): New section, also referenced by kill.
* man/Makefile.am (timeout.1): Add dependency.
* man/timeout.x: New file.
* po/POTFILES.in: Add timeout.c and operand2sig.c to list to translate.
* tests/Makefile.am (TESTS): Add the two new tests.
* tests/misc/help-version: Add support for new timeout command.
* tests/misc/invalid-opt: Add support for new timeout command.
* tests/misc/timeout: New file: check basic timeout operation.
* tests/misc/timeout-parameters: New file: check invalid parameter
combinations.

16 years agospell author names consistently
Jim Meyering [Mon, 2 Jun 2008 12:12:59 +0000 (14:12 +0200)]
spell author names consistently

* src/comm.c (AUTHORS): Use RMS' middle initial.
* src/ls.c (AUTHORS): Likewise.
* src/rm.c (AUTHORS): Likewise.
* src/uniq.c (AUTHORS): Likewise.
* src/cut.c (AUTHORS): Use David M. Ihnat's middle initial.
* AUTHORS: Update to match.
Reported by Michael Piefel.

16 years agodoc: adjust base64 documentation
Simon Josefsson [Sun, 1 Jun 2008 11:51:14 +0000 (13:51 +0200)]
doc: adjust base64 documentation

* coreutils.texi (base64 invocation): Use RFC 4648 as the specification.
Move the URL down a bit in the text.

16 years agomd5sum: new option, --quiet, to suppress OK messages
Erik Auerswald [Sun, 1 Jun 2008 10:40:40 +0000 (12:40 +0200)]
md5sum: new option, --quiet, to suppress OK messages

sha1sum, sha224sum, sha384sum, and sha512sum accept it, too.
* src/md5sum.c: add option --quiet to suppress OK messages
* doc/coreutils.texi: document option --quiet
* tests/misc/md5sum: add test for option --quiet
* NEWS: mention new option --quiet for md5sum+sha*sum in "New
  features" section

16 years agoadd rules to commit three post-release changes automatically
Jim Meyering [Sun, 1 Jun 2008 12:48:07 +0000 (14:48 +0200)]
add rules to commit three post-release changes automatically

* maint.mk (noteworthy): Define.
(emit-commit-log): Define.
(alpha beta major): Also update NEWS and cfg.mk automatically,
and commit all three changes at once.

16 years agoupdate old_NEWS_hash
Jim Meyering [Sun, 1 Jun 2008 12:44:50 +0000 (14:44 +0200)]
update old_NEWS_hash

* cfg.mk (old_NEWS_hash): Update by running "make update-NEWS-hash".
Reported by Erik Auerswald.

16 years agosrc/base64.c: Improve comments.
Simon Josefsson [Sun, 1 Jun 2008 11:08:20 +0000 (13:08 +0200)]
src/base64.c: Improve comments.

16 years ago* NEWS: add header line for next release
Jim Meyering [Sun, 1 Jun 2008 09:00:51 +0000 (11:00 +0200)]
* NEWS: add header line for next release

16 years agoadjust format of .prev-version commit message
Jim Meyering [Sun, 1 Jun 2008 08:39:13 +0000 (10:39 +0200)]
adjust format of .prev-version commit message

* maint.mk (alpha beta major): Start with "*", omit version number.

16 years ago* .prev-version: Record previous version.
Jim Meyering [Sun, 1 Jun 2008 08:11:01 +0000 (10:11 +0200)]
* .prev-version: Record previous version.

16 years agoVersion 6.12. v6.12
Jim Meyering [Sat, 31 May 2008 21:20:56 +0000 (23:20 +0200)]
Version 6.12.

* NEWS: Record release date.

16 years agoinstall: reenable matchpathcon-related code
Jim Meyering [Sat, 31 May 2008 20:42:20 +0000 (22:42 +0200)]
install: reenable matchpathcon-related code

The underlying performance problem is being dealt with in Automake
by limiting the number of install invocations, and in SELinux with
incremental changes as well as a potential new implementation.
* src/Makefile.am (ginstall_CPPFLAGS) [ENABLE_MATCHPATHCON]: Define.
* src/install.c [ENABLE_WHEN_MATCHPATHCON_IS_MORE_EFFICIENT]:
Rename to ENABLE_MATCHPATHCON.
* NEWS: mention this change

16 years agoconfigure.ac: remove explicit use of AB_INIT
Jim Meyering [Fri, 30 May 2008 12:14:43 +0000 (14:14 +0200)]
configure.ac: remove explicit use of AB_INIT

* configure.ac: Don't invoke AB_INIT directly, now that it's
done automatically via gl_INIT.

16 years agotests: ignore known failure on all Darwin 8.x / Mac OS X v10.4.x
Jim Meyering [Fri, 30 May 2008 08:45:45 +0000 (10:45 +0200)]
tests: ignore known failure on all Darwin 8.x / Mac OS X v10.4.x

* tests/chgrp/basic: Update comment and host_triplet version test.

16 years agotests: avoid failure with older version of Perl's File::Temp
Jim Meyering [Fri, 30 May 2008 07:45:53 +0000 (09:45 +0200)]
tests: avoid failure with older version of Perl's File::Temp

* tests/CuTmpdir.pm (import): Use &File::Temp::cleanup only
if it is defined.  Reported by Bruno Haible in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13652

16 years agoNEWS: mention that cp -p copies permissions more portably
Jim Meyering [Fri, 30 May 2008 07:08:51 +0000 (09:08 +0200)]
NEWS: mention that cp -p copies permissions more portably

Based on wording suggested by Bruno Haible.

16 years agoimprove description of du's--separate-dirs option
Jim Meyering [Thu, 29 May 2008 19:32:40 +0000 (21:32 +0200)]
improve description of du's--separate-dirs option

* coreutils.texi (du invocation): Prompted by Volker Badziong's
report in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13646

16 years agodu.c: tiny cleanup (no semantic change)
Jim Meyering [Thu, 29 May 2008 16:01:05 +0000 (18:01 +0200)]
du.c: tiny cleanup (no semantic change)

* src/du.c (process_file): Use "file", rather than
equivalent "ent->fts_path".

16 years agoin 280+ tests/* files, use $srcdir, not $top_srcdir/tests
Jim Meyering [Tue, 27 May 2008 11:45:44 +0000 (13:45 +0200)]
in 280+ tests/* files, use $srcdir, not $top_srcdir/tests

16 years agoprefer abs_srcdir over abs_top_srcdir, ...
Jim Meyering [Tue, 27 May 2008 11:24:20 +0000 (13:24 +0200)]
prefer abs_srcdir over abs_top_srcdir, ...

so that e.g., tests/* may refer to absolute names without
hard-coding the name of the containing directory (tests/, here).
* tests/check.mk (TESTS_ENVIRONMENT): Define abs_srcdir.
* tests/pr/pr-tests: Use $abs_srcdir/pr not $abs_top_srcdir/tests/pr.
* tests/chmod/c-option: Use $abs_srcdir, not $abs_top_srcdir/tests.
* tests/cp/cp-parents: Likewise.
* tests/mkdir/parents: Likewise.
* tests/mkdir/perm: Likewise.
* tests/mv/acl: Likewise.
* tests/mv/backup-is-src: Likewise.
* tests/mv/hard-link-1: Likewise.
* tests/mv/into-self-2: Likewise.
* tests/mv/leak-fd: Likewise.
* tests/mv/mv-special-1: Likewise.
* tests/mv/part-fail: Likewise.
* tests/mv/part-hardlink: Likewise.
* tests/mv/part-rename: Likewise.
* tests/mv/part-symlink: Likewise.
* tests/mv/partition-perm: Likewise.
* tests/mv/sticky-to-xpart: Likewise.
* tests/mv/to-symlink: Likewise.
* tests/rm/one-file-system: Likewise.
* tests/sample-test: Likewise.

16 years agotests: generalize my-distcheck
Jim Meyering [Tue, 27 May 2008 10:29:57 +0000 (12:29 +0200)]
tests: generalize my-distcheck

* maint.mk (my-distcheck): Accommodate missing gnulib-tests.

16 years agoreflect renaming of acl.c in gnulib
Jim Meyering [Mon, 26 May 2008 12:35:56 +0000 (14:35 +0200)]
reflect renaming of acl.c in gnulib

* POTFILES.in: s/acl.c/set-mode-acl.c/

16 years agotest installation results more thoroughly
Jim Meyering [Wed, 21 May 2008 21:08:11 +0000 (23:08 +0200)]
test installation results more thoroughly

* maint.mk (my-distcheck): Ensure that properly-named binaries
are installed.  Also check all man pages, except [.1.
Move configure-time --prefix= to install-time prefix=.
(my-instcheck, install-transform-check): Define.

16 years agoinstall many binaries at once, when possible
Jim Meyering [Wed, 21 May 2008 21:08:11 +0000 (23:08 +0200)]
install many binaries at once, when possible

* src/Makefile.am (install-exec-am): Override the standard
automake-generated target, so we can decide whether to use
the usual install-one-by-one rule, or whether we can use
the new install-many-at-once rule:
(cu-install-binPROGRAMS): New rule.

16 years ago* src/runcon.c: Add copyright comment.
Jim Meyering [Mon, 19 May 2008 15:02:12 +0000 (17:02 +0200)]
* src/runcon.c: Add copyright comment.

16 years agoadjust AUTHORS and check-AUTHORS rule to accommodate
Jim Meyering [Mon, 19 May 2008 17:39:30 +0000 (19:39 +0200)]
adjust AUTHORS and check-AUTHORS rule to accommodate

* AUTHORS: Add coding: utf-8 comment at end.
Spell François' and Torbjörn's names properly.
* src/Makefile.am: Parse AUTHORS file more carefully.
Use perl to join now-split lines.
Use en_US.UTF-8 to generate --version output.

16 years ago* src/c99-to-c89.diff: Adjust offsets.
Jim Meyering [Mon, 19 May 2008 15:34:56 +0000 (17:34 +0200)]
* src/c99-to-c89.diff: Adjust offsets.

16 years agoadjust copyright dates
Jim Meyering [Mon, 19 May 2008 14:49:35 +0000 (16:49 +0200)]
adjust copyright dates

16 years agoconvert the rest to use proper_name -- manually
Jim Meyering [Mon, 19 May 2008 14:43:32 +0000 (16:43 +0200)]
convert the rest to use proper_name -- manually

* src/base64.c (AUTHORS): Rename from AUTHOR, for consistency.

16 years agoconvert 3-author programs to use proper_name
Jim Meyering [Mon, 19 May 2008 14:28:14 +0000 (16:28 +0200)]
convert 3-author programs to use proper_name

g grep -E -l 'define AUTHORS "[^,]+", "[^,]+", "[^,]+"$'|xargs perl -pi -e \
  's/(define AUTHORS) ("[^,]+"), ("[^,]+"), ("[^,]+")$/$1 \\\n  proper_name ($2), \\\n  proper_name ($3), \\\n  proper_name ($4)/'

16 years agoconvert 2-author programs to use proper_name
Jim Meyering [Mon, 19 May 2008 14:26:25 +0000 (16:26 +0200)]
convert 2-author programs to use proper_name

g grep -E -l 'define AUTHORS "[^,]+", "[^,]+"$'|xargs perl -pi -e \
  's/(define AUTHORS) ("[^,]+"), ("[^,]+")$/$1 \\\n  proper_name ($2), \\\n  proper_name ($3)/'

16 years agoconvert single-author programs to use proper_name
Jim Meyering [Mon, 19 May 2008 14:24:27 +0000 (16:24 +0200)]
convert single-author programs to use proper_name

g grep -E -l 'define AUTHORS "[^,]+"$'|xargs perl -pi -e \
  's/(define AUTHORS) ("[^,]+")$/$1 proper_name ($2)/'

16 years agouse gnulib's proper_name_utf8 function, but *not* proper_name
Jim Meyering [Mon, 19 May 2008 14:14:13 +0000 (16:14 +0200)]
use gnulib's proper_name_utf8 function, but *not* proper_name

* bootstrap.conf (gnulib_modules): Add propername.
(XGETTEXT_OPTIONS): Add options to tell xgettext about the functions.
* src/cat.c, src/cp.c, src/df.c, src/du.c, src/split.c:
Mark Torbjörn Granlund's name.
* src/ptx.c: Mark François Pinard's name.
Use "TRANSLATORS:" comment marker, rather than "Note to translators:".
* src/system.h: Include propername.h.
(proper_name): Define away.
* src/Makefile.am (cat_LDADD, df_LDADD, du_LDADD, ptx_LDADD, split_LDADD):
Initialize, so we can...
(cat_LDADD, cp_LDADD, df_LDADD, du_LDADD, ptx_LDADD, split_LDADD):
...Use "+=" to append $(LIBICONV) for each program that uses
proper_name_utf8.

16 years ago* POTFILES.in: Add lib/copy-acl.c.
Jim Meyering [Thu, 22 May 2008 22:30:46 +0000 (00:30 +0200)]
* POTFILES.in: Add lib/copy-acl.c.

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years agoinstall: avoid a leak in currently-ifdef'd-out code
Jim Meyering [Tue, 20 May 2008 15:58:42 +0000 (17:58 +0200)]
install: avoid a leak in currently-ifdef'd-out code

* src/install.c (setdefaultfilecon)
[ENABLE_WHEN_MATCHPATHCON_IS_MORE_EFFICIENT]:
Call matchpathcon_init_prefix only once.
Suggestion from Stephen Smalley.  Reported by Ben Webb in
<http://bugzilla.redhat.com/447410>.

16 years agouse gnulib's base64 module, now that it's sync'd to match this one
Jim Meyering [Mon, 19 May 2008 17:50:34 +0000 (19:50 +0200)]
use gnulib's base64 module, now that it's sync'd to match this one

* gl/lib/base64.c: Remove file.
* gl/lib/base64.h: Remove file.

16 years agodoc: clarify field delimiter description in uniq --help output
Pádraig Brady [Mon, 19 May 2008 06:54:07 +0000 (07:54 +0100)]
doc: clarify field delimiter description in uniq --help output

* src/uniq.c: Clarify in help output that field delimiters are
blanks and not the larger set of whitespace characters.

16 years agotests: skip when a debian libc6-2.7-11 bug makes printf segfault
Jim Meyering [Fri, 16 May 2008 20:55:27 +0000 (22:55 +0200)]
tests: skip when a debian libc6-2.7-11 bug makes printf segfault

* tests/misc/printf-surprise: Detect case of a low-memory-provoked
segfault and skip the test (this is actually a bug in snprintf).
For details, see http://bugs.debian.org/481543

16 years agotests: sync and update wc and du --files0-from tests
Jim Meyering [Thu, 15 May 2008 09:43:18 +0000 (11:43 +0200)]
tests: sync and update wc and du --files0-from tests

* tests/du/files0-from: Sync from tests/misc/wc-files0-from.
(minus-in-minus): New test.
Adjust for new diagnostics.
* tests/misc/wc-files0-from: Adjust for new diagnostics.

16 years agodu, wc: merge improved --files0-from=F-related diagnostics
Jim Meyering [Thu, 15 May 2008 09:19:44 +0000 (11:19 +0200)]
du, wc: merge improved --files0-from=F-related diagnostics

du gave a better diagnostic for one unusual case,
and wc gave a better diagnostic for a different one.
Now each diagnoses both unusual cases.
* src/du.c (main): Disallow '-' as file name when reading from stdin.
* src/wc.c (main): Give a better diagnostic for a zero-length file name.

16 years agotest invalid-option handling in all programs
Jim Meyering [Mon, 12 May 2008 12:43:23 +0000 (14:43 +0200)]
test invalid-option handling in all programs

* tests/Makefile.am (TESTS): Add misc/invalid-opt.
* tests/misc/invalid-opt: New file.

16 years agotests: remove ugly /bin/sh wrapper around each perl-based test script
Jim Meyering [Wed, 14 May 2008 07:37:02 +0000 (09:37 +0200)]
tests: remove ugly /bin/sh wrapper around each perl-based test script

* tests/check.mk (TESTS_ENVIRONMENT): Save and restore TMPDIR around
envvar-check, so that the few scripts that require $TMPDIR don't fail.
This is also good to let a user's default TMPDIR setting be used e.g.,
in the search for an 'other-partition'.
FIXME: this is pretty ugly.  maybe undo it and find a better way.
(TESTS_ENVIRONMENT): Invoke perl scripts with $(PERL), and use -T
if the script requires that.  Otherwise, use $(SHELL).

* tests/misc/md5sum-newline: Create a file whose name contains
a newline in Perl (resort to using "system", since open refuses).

Fix old brokenness exposed by this change:
* tests/du/files0-from: Correct test not to rely on stdin
being attached to a non-tty.
* tests/misc/sort (3g, 3h, 3i): Likewise: add explicit empty input file.
Avoid warnings about using qw()-around-commas.

* tests/rm/fail-eperm: Now that this test is run from a temporary
subdirectory, adjust the full name of the "rm" program we're going
to run.

Change #!/bin/sh to #!/usr/bin/perl, and factor out the few lines
of boilerplate code to invoke perl.  Do not "require 5.00x";
a configure-time Perl test handles that
* tests/dd/skip-seek:
* tests/misc/base64:
* tests/misc/basename:
* tests/misc/cut:
* tests/misc/date:
* tests/misc/dircolors:
* tests/misc/dirname:
* tests/misc/expand:
* tests/misc/expr:
* tests/misc/factor:
* tests/misc/fmt:
* tests/misc/fold:
* tests/misc/head:
* tests/misc/head-elide-tail:
* tests/misc/join:
* tests/misc/ls-misc:
* tests/misc/md5sum:
* tests/misc/md5sum-newline:
* tests/misc/mktemp:
* tests/misc/od:
* tests/misc/paste:
* tests/misc/pr:
* tests/misc/printf-cov:
* tests/misc/seq:
* tests/misc/sha1sum:
* tests/misc/sha1sum-vec:
* tests/misc/sha224sum:
* tests/misc/sha256sum:
* tests/misc/sha384sum:
* tests/misc/sha512sum:
* tests/misc/sort-merge:
* tests/misc/stat-printf:
* tests/misc/sum:
* tests/misc/tac:
* tests/misc/tail:
* tests/misc/test:
* tests/misc/test-diag:
* tests/misc/tr:
* tests/misc/tsort:
* tests/misc/tty-eof:
* tests/misc/unexpand:
* tests/misc/uniq:
* tests/misc/wc:
* tests/misc/wc-files0-from:
* tests/misc/xstrtol:
* tests/mv/i-1:
* tests/pr/pr-tests:
* tests/rm/empty-name:
* tests/rm/fail-eperm:
* tests/rm/unreadable:

16 years agotests: allow to run Perl tests more cleanly
Jim Meyering [Mon, 12 May 2008 12:39:55 +0000 (14:39 +0200)]
tests: allow to run Perl tests more cleanly

Before this change, perl tests were run via a #!/bin/sh script
in which perl was invoked via $(PERL) ... -- - <<\EOF.
That made some stty tests fail due to the way stdin was usurped.
* build-aux/check.mk (am__check_pre): Don't append $(SHELL) to this
nominally automake-internal variable.
* tests/check.mk (TESTS_ENVIRONMENT): Instead, define a shell function
here, and append it to the more user-visible $(TESTS_ENVIRONMENT).

16 years agotests: env-related clean up
Jim Meyering [Mon, 12 May 2008 06:49:58 +0000 (08:49 +0200)]
tests: env-related clean up

* tests/Coreutils.pm: tiny clean-up: s/env/env --/
* tests/misc/help-version: Use "env" rather than an absolute file
name prefix.
* tests/misc/printf-surprise: Likewise.

16 years agotests: improve coverage of printf.c
Jim Meyering [Sun, 11 May 2008 22:27:37 +0000 (00:27 +0200)]
tests: improve coverage of printf.c

* tests/misc/printf-cov: New file.
* tests/Makefile.am (TESTS): Add misc/printf-cov.
* tests/misc/help-version: Use env rather than abs file name prefix.

16 years agomake HACKING slightly more generic
Jim Meyering [Sun, 11 May 2008 22:28:28 +0000 (00:28 +0200)]
make HACKING slightly more generic

* HACKING: remove some uses of "coreutils"
Point to git's own SubmittingPatches URL.

16 years agodoc: some Unicode characters cannot be specified via \u or \U
Bruno Haible [Thu, 15 May 2008 07:32:07 +0000 (09:32 +0200)]
doc: some Unicode characters cannot be specified via \u or \U

* doc/coreutils.texi (printf invocation): Clarify invalid ranges for
Unicode character escape syntax.

16 years agomove sha256 and sha512 modules to gnulib
Jim Meyering [Sun, 11 May 2008 07:00:59 +0000 (09:00 +0200)]
move sha256 and sha512 modules to gnulib

* bootstrap.conf (gnulib_modules) [sha256, sha512]: Add "crypto/"
prefix to module name, now that they come from gnulib.
* gl/lib/sha256.c: Remove file.
* gl/lib/sha256.h: Likewise.
* gl/lib/sha512.c: Likewise.
* gl/lib/sha512.h: Likewise.
* gl/lib/u64.h: Likewise.
* gl/m4/sha256.m4: Likewise.
* gl/m4/sha512.m4: Likewise.
* gl/modules/sha256: Likewise.
* gl/modules/sha512: Likewise.

16 years agonow that the last of the mk-script-using tests is gone...
Jim Meyering [Sat, 10 May 2008 09:57:22 +0000 (11:57 +0200)]
now that the last of the mk-script-using tests is gone...

* tests/Makefile.am (EXTRA_DIST): Remove Makefile.am.in and mk-script.
Move/adjust SUBDIRS-related comments.
* tests/Makefile.am.in: Remove file, no longer used.
* tests/mk-script: Likewise.
* bootstrap: Remove coreutils-specific SUBDIRS-related code.

16 years agotests: remove directory, tests/join/
Jim Meyering [Sat, 10 May 2008 10:11:52 +0000 (12:11 +0200)]
tests: remove directory, tests/join/

* configure.ac (AC_CONFIG_FILES): Remove tests/join/Makefile.
* tests/misc/join: New file, with tests from...
* tests/join/Test.pm: ...here.  Remove file.
* tests/Makefile.am (SUBDIRS): Remove definition.

16 years ago* tests/misc/tac: Also perform stdin and piped tests.
Jim Meyering [Sat, 10 May 2008 09:50:04 +0000 (11:50 +0200)]
* tests/misc/tac: Also perform stdin and piped tests.

16 years agotests: convert pr tests
Jim Meyering [Sat, 10 May 2008 09:38:07 +0000 (11:38 +0200)]
tests: convert pr tests

* configure.ac (AC_CONFIG_FILES): Remove tests/pr/Makefile.
* tests/Makefile.am (SUBDIRS): Remove pr.
* tests/pr/pr-tests: New file, with tests from...
* tests/pr/Test.pm: ...here.  Remove file.
* tests/Makefile.am (EXTRA_DIST): Add $(pr_data).
(pr_data): List all of the pr's test-related data files.

16 years agotests: remove directory, tests/tail/
Jim Meyering [Sat, 10 May 2008 08:11:45 +0000 (10:11 +0200)]
tests: remove directory, tests/tail/

* configure.ac (AC_CONFIG_FILES): Remove tests/tail/Makefile.
* tests/Makefile.am (SUBDIRS): Remove tail.
* tests/misc/tail: New file, with tests from...
* tests/tail/Test.pm: ...here.  Remove file.

16 years agodoc: improve description of "niceness" values
Bernhard Marx [Fri, 9 May 2008 06:50:46 +0000 (08:50 +0200)]
doc: improve description of "niceness" values

* doc/coreutils.texi (nice invocation):

16 years agotests: remove directory, tests/sort/
Jim Meyering [Fri, 9 May 2008 06:04:59 +0000 (08:04 +0200)]
tests: remove directory, tests/sort/

* configure.ac (AC_CONFIG_FILES): Remove tests/sort/Makefile.
* tests/Makefile.am (SUBDIRS): Remove sort.
* tests/misc/sort: New file, with tests from...
* tests/sort/Test.pm: ...here.  Remove file.

16 years agoSpeed up "wc -m" and "wc -w" in multibyte case.
Bruno Haible [Thu, 8 May 2008 21:15:36 +0000 (23:15 +0200)]
Speed up "wc -m" and "wc -w" in multibyte case.

* src/wc.c: Include mbchar.h.
(wc): New variable in_shift. Use it to avoid calling mbrtowc for most
ASCII characters.  Reported via Jan Engelhardt in
http://bugzilla.novell.com/381873 with discussion here
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13520

16 years agotests: remove directory, tests/tac/
Jim Meyering [Thu, 8 May 2008 08:33:15 +0000 (10:33 +0200)]
tests: remove directory, tests/tac/

* configure.ac (AC_CONFIG_FILES): Remove tests/tac/Makefile.
* tests/Makefile.am (SUBDIRS): Remove tac.
* tests/misc/tac: Many new tests, from...
* tests/tac/Test.pm: ...here.  Remove file.

16 years agotests: remove directory, tests/test/
Jim Meyering [Wed, 7 May 2008 23:23:32 +0000 (01:23 +0200)]
tests: remove directory, tests/test/

* configure.ac (AC_CONFIG_FILES): Remove tests/test/Makefile.
* tests/Makefile.am (SUBDIRS): Remove test.
* tests/misc/test: Many new tests, from...
* tests/test/Test.pm: ...here.  Remove file.

16 years agotests: Coreutils.pm: support running a program that is a shell built-in
Jim Meyering [Wed, 7 May 2008 23:22:37 +0000 (01:22 +0200)]
tests: Coreutils.pm: support running a program that is a shell built-in

* tests/Coreutils.pm (run_tests): Add support for running a
program like 'test', that is a shell built-in.

16 years ago* TODO: Bo Borgerson is rewriting support for cp --recursive
Jim Meyering [Tue, 6 May 2008 12:29:57 +0000 (14:29 +0200)]
* TODO: Bo Borgerson is rewriting support for cp --recursive

16 years agotests: remove directory, tests/tr/
Jim Meyering [Tue, 6 May 2008 08:12:42 +0000 (10:12 +0200)]
tests: remove directory, tests/tr/

* configure.ac (AC_CONFIG_FILES): Remove tests/tr/Makefile.
* tests/Makefile.am (SUBDIRS): Remove tr.
* tests/misc/tr: Many new tests, from...
* tests/tr/Test.pm: ...here.  Remove file.
* tests/tr/failures: Remove file.
* tests/tr/TODO: Remove file.

16 years agotests: skip another test if mcstransd is running
Jim Meyering [Mon, 5 May 2008 13:17:42 +0000 (15:17 +0200)]
tests: skip another test if mcstransd is running

* tests/test-lib.sh (skip_if_mcstransd_is_running_): New function,
extracted from...
* tests/misc/chcon: ...here.  Use function, not open-coded test.
* tests/misc/selinux: Use the function here, too.
Require root, not non-root.
* tests/Makefile.am (root_tests): Add misc/selinux.

16 years agotests: translate uniq-z-test-adding code to new framework
Jim Meyering [Mon, 5 May 2008 08:11:59 +0000 (10:11 +0200)]
tests: translate uniq-z-test-adding code to new framework

* tests/misc/uniq (add-z-variants): New function.
Use it.

16 years agotests: remove directory, tests/uniq/
Jim Meyering [Sun, 4 May 2008 20:30:26 +0000 (22:30 +0200)]
tests: remove directory, tests/uniq/

* configure.ac (AC_CONFIG_FILES): Remove tests/uniq/Makefile.
* tests/Makefile.am (SUBDIRS): Remove uniq.
* tests/misc/uniq: Many new tests, from...
* tests/uniq/Test.pm: ...here.  Remove file.

16 years agotests: remove directory, tests/cut/
Jim Meyering [Sun, 4 May 2008 19:31:10 +0000 (21:31 +0200)]
tests: remove directory, tests/cut/

* configure.ac (AC_CONFIG_FILES): Remove tests/cut/Makefile.
* tests/Makefile.am (SUBDIRS): Remove cut.
* tests/misc/cut: Many new tests, from...
* tests/cut/Test.pm: ...here.  Remove file.

16 years agotests: remove directory, tests/head/
Jim Meyering [Sun, 4 May 2008 09:38:31 +0000 (11:38 +0200)]
tests: remove directory, tests/head/

* configure.ac (AC_CONFIG_FILES): Remove tests/head/Makefile.
* tests/Makefile.am (SUBDIRS): Remove head.
* tests/misc/head: New file, derived from ...
* tests/head/Test.pm: ...this.  Remove file.
* tests/head/in: Remove file.
* tests/head/in-1024: Remove file.
* tests/Coreutils.pm (triple_test): New function.

16 years agotests: Coreutils.pm improvements
Jim Meyering [Sun, 4 May 2008 19:36:00 +0000 (21:36 +0200)]
tests: Coreutils.pm improvements

* tests/Coreutils.pm: Allow test names longer than 12.
Print a useful diagnostic for bogus spec entry.

Handle the combination of IN_PIPE and ENV properly.
* tests/Coreutils.pm (run_tests): Put ENV right before command,
not before the "cat INPUT_FILE |" prefix.

16 years agotests: move "sparse-file" into test-lib.sh
Jim Meyering [Sat, 3 May 2008 13:46:41 +0000 (15:46 +0200)]
tests: move "sparse-file" into test-lib.sh

* tests/sparse-file: Remove file  Move contents into ...
* tests/test-lib.sh (require_sparse_support_): ...here.  New function.
* tests/cp/sparse: Use the function, not the file.
* tests/du/8gb: Likewise.
* tests/Makefile.am (EXTRA_DIST): Remove sparse-file.

16 years agotests: move "group-names" into test-lib.sh
Jim Meyering [Sat, 3 May 2008 13:43:13 +0000 (15:43 +0200)]
tests: move "group-names" into test-lib.sh

* tests/group-names: Remove file  Move contents into ...
* tests/test-lib.sh (require_membership_in_two_groups_): ...here.  New function.
* tests/chgrp/basic: Use the function, not the file.
* tests/chgrp/default-no-deref: Likewise.
* tests/chgrp/deref: Likewise.
* tests/chgrp/no-x: Likewise.
* tests/chgrp/posix-H: Likewise.
* tests/chgrp/recurse: Likewise.
* tests/cp/existing-perm-race: Likewise.
* tests/Makefile.am (EXTRA_DIST): Remove group-names.