platform/upstream/coreutils.git
16 years agoPrevent "make check" from leaving mktemp /tmp/tmp.* files behind.
Bob Proulx [Sat, 20 Oct 2007 06:26:57 +0000 (08:26 +0200)]
Prevent "make check" from leaving mktemp /tmp/tmp.* files behind.

* tests/misc/help-version (mktemp_args): Tell mktemp to create
its temporary file in the current directory.

16 years agoShow how to make tee redirect to multiple processes.
Jim Meyering [Tue, 9 Oct 2007 10:24:14 +0000 (12:24 +0200)]
Show how to make tee redirect to multiple processes.

16 years agoPull all TESTS_ENVIRONMENT settings "up" into tests/check.mk.
Jim Meyering [Sun, 14 Oct 2007 19:47:08 +0000 (21:47 +0200)]
Pull all TESTS_ENVIRONMENT settings "up" into tests/check.mk.

* tests/Makefile.am.in (TESTS_ENVIRONMENT): Remove definition.
* tests/chgrp/Makefile.am: Likewise.
* tests/chmod/Makefile.am: Likewise.
* tests/chown/Makefile.am: Likewise.
* tests/cp/Makefile.am: Likewise.
* tests/dd/Makefile.am: Likewise.
* tests/du/Makefile.am: Likewise.
* tests/install/Makefile.am: Likewise.
* tests/ln/Makefile.am: Likewise.
* tests/ls/Makefile.am: Likewise.
* tests/misc/Makefile.am: Likewise.
* tests/mkdir/Makefile.am: Likewise.
* tests/mv/Makefile.am: Likewise.
* tests/readlink/Makefile.am: Likewise.
* tests/rm/Makefile.am: Likewise.
* tests/rmdir/Makefile.am: Likewise.
* tests/tail-2/Makefile.am: Likewise.
* tests/touch/Makefile.am: Likewise.
* tests/check.mk (TESTS_ENVIRONMENT) [EXEEXT, EGREP, MAKE, PERL]:
[CONFIG_HEADER, build_programs, host_os, host_triplet, PATH]:
[REPLACE_GETCWD, CU_TEST_NAME]: Add definitions here.
* tests/misc/pwd-long: Use $abs_top_builddir/src, not $BUILD_SRC_DIR.
* tests/dd/skip-seek: Don't use $ENV{PROG}.
* tests/rm/empty-name: Likewise.
* tests/rm/unreadable: Likewise.
* tests/mv/i-1: Likewise.

16 years agoFix a minor typo.
Jim Meyering [Sun, 14 Oct 2007 11:35:34 +0000 (13:35 +0200)]
Fix a minor typo.

* configure.ac (AC_INIT): Fix a typo (s/9.6/6.9/) that makes a
difference only when running "make dist" without a .git/ subdir.

16 years agoMove the help-version test into misc/.
Jim Meyering [Tue, 9 Oct 2007 15:12:45 +0000 (17:12 +0200)]
Move the help-version test into misc/.

* tests/help-version: Move to...
* tests/misc/help-version: ...here.
Source test-lib.sh, as usual.
Use $abs_top_builddir, rather than ".." and "../..".

16 years agoMake the runcon-no-reorder test slightly more general.
Jim Meyering [Tue, 9 Oct 2007 13:48:51 +0000 (15:48 +0200)]
Make the runcon-no-reorder test slightly more general.

* tests/misc/runcon-no-reorder: Don't hard-code "unconstrained_t".
Use slightly more general "runcon $(id -Z)".
Suggestion from Stephen Smalley.

16 years agoSkip the chcon test on a system with no SELinux support.
Jim Meyering [Tue, 9 Oct 2007 07:58:27 +0000 (09:58 +0200)]
Skip the chcon test on a system with no SELinux support.

* tests/test-lib.sh (require_selinux_): New function.
* tests/misc/chcon: Use it.
* tests/misc/selinux: Use it here, too.
* tests/cp/cp-a-selinux: and here.
* tests/selinux: Remove file.
* tests/Makefile.am (EXTRA_DIST): Remove selinux.
Reported by Mike Frysinger and Bauke Jan Douma.

16 years ago* src/dircolors.hin: Recognize .lzma as a compressed-file suffix.
Jim Meyering [Tue, 9 Oct 2007 07:39:13 +0000 (09:39 +0200)]
* src/dircolors.hin: Recognize .lzma as a compressed-file suffix.

16 years ago* configure.ac (AM_INIT_AUTOMAKE): Use dist-lzma, rather than dist-bzip2.
Jim Meyering [Tue, 9 Oct 2007 07:37:43 +0000 (09:37 +0200)]
* configure.ac (AM_INIT_AUTOMAKE): Use dist-lzma, rather than dist-bzip2.

16 years agoNow that we don't install su, don't make misleading suggestions.
Jim Meyering [Tue, 9 Oct 2007 07:33:48 +0000 (09:33 +0200)]
Now that we don't install su, don't make misleading suggestions.

* src/Makefile.am (install-exec-local) [$(INSTALL_SU) != yes]:
Don't suggest running "make install-root".
(uninstall-local) [$(INSTALL_SU) != yes]: Don't even check
the installed binary.

16 years agoWhen forming a truncated name, use the "[...]" prefix even for
Jim Meyering [Mon, 8 Oct 2007 08:34:04 +0000 (10:34 +0200)]
When forming a truncated name, use the "[...]" prefix even for
an extremely long name in the current directory.

* src/remove.c (full_filename_): Rename a local variable.
Use two separate "truncated" variables, in case the second
call to right_justify does not indicate any truncation -- which
would happen only if the single component FILENAME were longer
than 511 bytes and DIR_NAME were empty.

16 years agorm could malfunction under unusual circumstances:
Jim Meyering [Sun, 7 Oct 2007 20:58:29 +0000 (22:58 +0200)]
rm could malfunction under unusual circumstances:

When operating on a relative name longer than 511 bytes,
and (when either processing a directory that is neither writable
nor readable (but still searchable) or when determining whether
to prompt), and encountering an ENOMEM error while forming the
file name, rm would operate on a truncated-to-511-byte name
starting with "[...]" rather than the intended one.
* NEWS: Describe the bugs.
* src/remove.c: Correct two misuses of full_filename:
(full_filename0, xfull_filename): New functions.
(full_filename_): Rewrite to use full_filename0.
(AD_pop_and_chdir): Use xfull_filename, not full_filename.
(write_protected_non_symlink): Likewise.

16 years agoDon't let a helper function modify errno.
Jim Meyering [Sun, 7 Oct 2007 19:55:42 +0000 (21:55 +0200)]
Don't let a helper function modify errno.

* src/remove.c (full_filename_): Save and restore errno.
Spotted by Bruno Haible.

16 years agoReflect 2->3 GPL copyright version update in gnulib.
Jim Meyering [Sun, 7 Oct 2007 19:04:14 +0000 (21:04 +0200)]
Reflect 2->3 GPL copyright version update in gnulib.

* gl/lib/tempname.h: Update copyright from gnulib.
* gl/lib/tempname.c: Likewise.
* .x-sc_GPL_version: Don't make an exception for those two files.

16 years ago* configure.ac (AM_INIT_AUTOMAKE): Don't use dist-lzma just yet.
Jim Meyering [Sun, 7 Oct 2007 18:33:57 +0000 (20:33 +0200)]
* configure.ac (AM_INIT_AUTOMAKE): Don't use dist-lzma just yet.

16 years agoNew program: mktemp.
Jim Meyering [Sat, 2 Jun 2007 21:04:10 +0000 (23:04 +0200)]
New program: mktemp.

* NEWS: Mention this.
* README: Add mktemp to the list.
* AUTHORS: Add this: mktemp: Jim Meyering
* src/mktemp.c: New file.
* src/Makefile.am (bin_PROGRAMS): Add mktemp.
(mktemp_LDADD): Add $(LIB_GETHRXTIME).
* man/mktemp.x: New file.
* man/Makefile.am (dist_man_MANS): Add mktemp.1.
(mktemp.1): New dependency.
* man/.cvsignore: Add mktemp.1.
* man/.gitignore: New file.
* src/.cvsignore, src/.gitignore: Add mktemp.
* tests/misc/mktemp: New file.
* tests/misc/Makefile.am (TESTS): Add mktemp.
* tests/Coreutils.pm (run_tests): Give the POST-test function
access to stdout and stderr contents, so it can verify that
the named-on-stdout file/dir does indeed exist and has proper
permissions, etc.
[po/ChangeLog]
* POTFILES.in: Add src/mktemp.c.

16 years agoMake tempname more random, via the randint module.
Jim Meyering [Sat, 1 Sep 2007 08:33:33 +0000 (10:33 +0200)]
Make tempname more random, via the randint module.

* gl/modules/tempname (Depends-on): Add randint and stdbool.
* gl/lib/tempname.c: Include randint.h and stdbool.h.
(uint64_t): Remove definition.  Not needed.
[_LIBC] (RANDOM_BITS): Remove this block, now that we have proper random bits.
(check_x_suffix): New function.
(gen_tempname_len): Rename from __gen_tempname.
Add a parameter, x_suffix_len, telling how many X's there must be at
the end of the template.
Use pseudo-random numbers all the way, rather than adding 7777
from one iteration to the next.
(__gen_tempname): New function, to call gen_tempname_len, requiring a
suffix length of 6.
* gl/lib/tempname.h: Add prototype for gen_tempname_len.

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years agoConvert coreutils' rand*.{c,h,m4} into modules.
Jim Meyering [Sat, 1 Sep 2007 07:54:45 +0000 (09:54 +0200)]
Convert coreutils' rand*.{c,h,m4} into modules.

First step: move these files to gl/lib:
* lib/rand-isaac.c, lib/rand-isaac.h
* lib/randint.c, lib/randint.h
* lib/randperm.c, lib/randperm.h
* lib/randread.c, lib/randread.h

Step 2: add modules/rand* and remove now-unneeded .m4 files.
* gl/modules/randint: New file.
* gl/modules/randperm: New file.
* gl/modules/randread: New file.
* m4/randint.m4: Remove file.
* m4/randperm.m4: Remove file.
* m4/randread.m4: Remove file.

Step 3: use the new modules
* bootstrap.conf (gnulib_modules): Add randint and randperm.
* m4/prereq.m4 (gl_RANDINT, gl_RANDREAD, gl_RANDPERM): Don't require;
These have been removed.
(gl_ROOT_DEV_INO): Don't require; already handled via bootstrap.conf.

16 years agoCopy from gnulib the parts of tempname that we'll modify.
Jim Meyering [Sat, 1 Sep 2007 09:33:00 +0000 (11:33 +0200)]
Copy from gnulib the parts of tempname that we'll modify.

* gl/lib/tempname.c: Copy from gnulib.
* gl/lib/tempname.h: Likewise.
* gl/modules/tempname: Likewise.

Allow GPLv2 on temporarily(?)-imported file from gnulib/libc.
* .x-sc_GPL_version: New file.
* Makefile.am (EXTRA_DIST): Add .x-sc_GPL_version

16 years agoAvoid a pseudo-leak in sort.
Jim Meyering [Sun, 7 Oct 2007 16:41:33 +0000 (18:41 +0200)]
Avoid a pseudo-leak in sort.

* src/sort.c (main) [lint]: Avoid a nominal leak.

16 years agoUse puts, rather than printf ("%s\n". Slightly cleaner.
Jim Meyering [Sun, 7 Oct 2007 16:16:00 +0000 (18:16 +0200)]
Use puts, rather than printf ("%s\n".  Slightly cleaner.

* src/tsort.c (tsort): ...and more efficient.

16 years agoAvoid seq malfunction on non-POSIX systems: mingw, BeOS, Interix.
Jim Meyering [Sun, 7 Oct 2007 14:15:49 +0000 (16:15 +0200)]
Avoid seq malfunction on non-POSIX systems: mingw, BeOS, Interix.

* bootstrap.conf (gnulib_modules): Add vasprintf-posix.
Suggestion from Bruno Haible.

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years agoAvoid a used-uninitialized error.
Jim Meyering [Sun, 7 Oct 2007 14:06:59 +0000 (16:06 +0200)]
Avoid a used-uninitialized error.

* src/copy.c (copy_internal): Don't overload "use_stat".

16 years agoMake a failing cross-partition mv give a sensible diagnostic.
Jim Meyering [Fri, 5 Oct 2007 08:55:26 +0000 (10:55 +0200)]
Make a failing cross-partition mv give a sensible diagnostic.

A cross-partition move of a file in a sticky tmpdir and owned by
another user would evoke an invalid diagnostic after copying it:

  mv: cannot remove `x': Operation not permitted

Either of the following (mv.c, remove.c) changes would fix the bug by
itself.  I think it's slightly better to use both; the added cost is
minimal: mv: an extra lstat-per-mv-cmdline-arg-that-goes-cross-partition,
rm: an extra lstat-per-unlink-that-fails-w/EPERM.
* src/remove.c (remove_entry): Also lstat the file upon EPERM.
* src/mv.c (rm_option_init): Initialize root_dev_ino just as is done
in rm, so that a cross-partition invoked remove.c:rm call works the
same way as one invoked from the command-line use of "rm".  That
setting of root_dev_ino makes rm() do the equivalent of an additional
lstat for each argument, which in turn gives rm enough information to
issue the right diagnostic.
* tests/mv/sticky-to-xpart (version): New file.  Test for the above.
* tests/mv/Makefile.am (TESTS): Add sticky-to-xpart.
Arrange for "make check-root" to run the new root-only test.
* tests/Makefile.am (tb): New target, to run the new root-only test.
(all_t): Add tb.
* src/c99-to-c89.diff: Adjust offsets.

16 years agoAdd PACKAGE_VERSION to TESTS_ENVIRONMENT via check.mk.
Jim Meyering [Fri, 5 Oct 2007 10:14:16 +0000 (12:14 +0200)]
Add PACKAGE_VERSION to TESTS_ENVIRONMENT via check.mk.

* tests/check.mk (TESTS_ENVIRONMENT): Add PACKAGE_VERSION here,
rather than in every Makefile.am that needs it.
* tests/rm/Makefile.am (TESTS_ENVIRONMENT): Remove PACKAGE_VERSION.
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Likewise.

16 years agoList two systems on which chroot works when run by non-root.
Jim Meyering [Fri, 5 Oct 2007 06:58:22 +0000 (08:58 +0200)]
List two systems on which chroot works when run by non-root.

16 years agoAdapt to new gnulib naming scheme.
Jim Meyering [Thu, 4 Oct 2007 10:26:38 +0000 (12:26 +0200)]
Adapt to new gnulib naming scheme.
* gl/lib/se-context.in.h: Rename from gl/lib/se-context_.h.
* gl/lib/se-selinux.in.h: Rename from gl/lib/se-selinux_.h.
* gl/m4/selinux-context-h.m4: Remove use of AC_LIBSOURCES.
* gl/m4/selinux-selinux-h.m4: Likewise.
* gl/modules/selinux-h (Files, Makefile.am): Reflect renaming.
(Makefile.am) [lib_SOURCES]: Add se-context.in.h and se-selinux.in.h.

16 years agolib/search_.h: Remove unused file.
Jim Meyering [Thu, 4 Oct 2007 10:20:27 +0000 (12:20 +0200)]
lib/search_.h: Remove unused file.

16 years ago* bootstrap (update_po_files): Work also when there are no .po files in po/.
Jim Meyering [Thu, 4 Oct 2007 09:55:31 +0000 (11:55 +0200)]
* bootstrap (update_po_files): Work also when there are no .po files in po/.

16 years ago* bootstrap (slurp): Adapt to _.h -> .in.h name change.
Jim Meyering [Thu, 4 Oct 2007 09:41:48 +0000 (11:41 +0200)]
* bootstrap (slurp): Adapt to _.h -> .in.h name change.

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years agoRemove test program: lib/t-fpending.c.
Jim Meyering [Thu, 4 Oct 2007 08:26:05 +0000 (10:26 +0200)]
Remove test program: lib/t-fpending.c.

* lib/t-fpending.c: Remove file.  Now, this test is in gnulib.
* lib/Makefile.am: Remove associated rules.
* .gitignore: Remove lib/t-fpending.

16 years ago* tests/misc/selinux: Skip this test if the initial chcon fails.
Jim Meyering [Wed, 3 Oct 2007 10:56:32 +0000 (12:56 +0200)]
* tests/misc/selinux: Skip this test if the initial chcon fails.

16 years agoNever copy through a symlink that cp has just created.
Jim Meyering [Tue, 2 Oct 2007 09:10:22 +0000 (11:10 +0200)]
Never copy through a symlink that cp has just created.

* src/copy.c (copy_internal): When same-file detection requires
'stat'ing the destination file, also 'lstat' it and ensure that
it wasn't the destination of a preceding copy operation.
This bug was introduced on 2007-06-18.
* tests/cp/abuse: New test for the above.
* tests/cp/Makefile.am (TESTS): Add abuse.

16 years agocp: do not abbreviate in --help output.
Jim Meyering [Sun, 30 Sep 2007 07:05:10 +0000 (09:05 +0200)]
cp: do not abbreviate in --help output.

* src/cp.c (usage): Don't abbreviate: s/=link/=links/.
Reported by Géraud Meyer in <http://bugs.debian.org/444137>.

Signed-off-by: Jim Meyering <jim@meyering.net>
16 years agoFix testsuite on cygwin.
Eric Blake [Sat, 29 Sep 2007 14:56:50 +0000 (08:56 -0600)]
Fix testsuite on cygwin.

* check.mk (%.log): Also allow suffix-less tests, on platforms
where $(EXEEXT) is not empty.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoTest previous patch.
Eric Blake [Sat, 29 Sep 2007 14:49:20 +0000 (08:49 -0600)]
Test previous patch.

* tests/misc/groups-dash: New test.
* tests/misc/Makefile.am (TESTS): Add it.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years ago* src/groups.sh: Don't ignore first argument if later argument is --.
Eric Blake [Fri, 28 Sep 2007 23:09:30 +0000 (23:09 +0000)]
* src/groups.sh: Don't ignore first argument if later argument is --.

Signed-off-by: Eric Blake <ebb9@byu.net>
16 years agoAvoid spurious test failure when SELinux stats "selinux/class".
Jim Meyering [Thu, 27 Sep 2007 20:37:23 +0000 (22:37 +0200)]
Avoid spurious test failure when SELinux stats "selinux/class".

* tests/ls/stat-free-symlinks: Grep for more precise /^stat("x"/.

16 years agoMove file-set and hash-triple modules to gnulib.
Jim Meyering [Tue, 25 Sep 2007 20:24:21 +0000 (22:24 +0200)]
Move file-set and hash-triple modules to gnulib.

* bootstrap.conf (gnulib_modules): Remove file-set, now that
it's in gnulib, and the canonicalize module requires it there.
* gl/lib/file-set.c, gl/lib/file-set.h, gl/modules/hash-triple: Remove.
* gl/lib/hash-triple.c, gl/lib/hash-triple.h, gl/modules/file-set: Remove.

16 years agoAdd a test to exercise a readlink bug.
Jim Meyering [Mon, 24 Sep 2007 07:53:57 +0000 (09:53 +0200)]
Add a test to exercise a readlink bug.

* tests/misc/readlink-fp-loop: New file.  Test for the readlink bug
fixed through today's change to Gnulib's canonicalize module.
* tests/misc/Makefile.am (TESTS): Add readlink-fp-loop.
Bug report and a test case from mpb.mail@gmail.com.

16 years agoMake "Date input formats" easier to find in info file
Pádraig Brady [Tue, 25 Sep 2007 17:00:04 +0000 (18:00 +0100)]
Make "Date input formats" easier to find in info file

* doc/coreutils.texi (date invocation):
`man date` gives all options for the date command except
the description of the date input formats. Therefore it
should be easy to browse to this info using `info date`.

Signed-off-by: Pádraig Brady <P@draigBrady.com>
16 years agoUse XOR, not OR to combine bits.
Jim Meyering [Tue, 25 Sep 2007 19:27:14 +0000 (21:27 +0200)]
Use XOR, not OR to combine bits.

* gl/lib/hash-triple.c (triple_hash): Use XOR (^), not OR (|), to
combine the bits from hashing the name and those of the inode number.
Add a few comments and remove out-of-context ones.

16 years ago* NEWS: The recent rm-diagnostic fix also affects cross-partition "mv".
Jim Meyering [Mon, 24 Sep 2007 14:33:35 +0000 (16:33 +0200)]
* NEWS: The recent rm-diagnostic fix also affects cross-partition "mv".

16 years agocopy.c: Remove definitions of factored-out functions.
Jim Meyering [Mon, 24 Sep 2007 13:09:17 +0000 (15:09 +0200)]
copy.c: Remove definitions of factored-out functions.

* src/copy.c: Include "file-set.h".
(seen_file, record_file): Remove functions that I factored
out on 2007-08-23.

16 years agoDon't print the commands of a 10-line script that's run in each subdir.
Jim Meyering [Sat, 22 Sep 2007 21:26:37 +0000 (23:26 +0200)]
Don't print the commands of a 10-line script that's run in each subdir.

* tests/check.mk (vc_exe_in_TESTS): Add a leading "@", to reduce noise.

16 years agorm: give a sensible diagnostic when failing to remove a symlink
Jim Meyering [Sat, 22 Sep 2007 08:02:09 +0000 (10:02 +0200)]
rm: give a sensible diagnostic when failing to remove a symlink

On some systems (those with openat et al), when rm would fail to
remove a symlink, it would fail with the misleading diagnostic,
"Too many levels of symbolic links".
* NEWS: Mention the bug fix.
* src/remove.c (is_nondir_lstat): New function.
(remove_entry): Use it to catch failed-to-remove symlink (and any
other non-dir) here so that we don't fall through and try to treat
it as directory, which -- with a symlink -- would provoke the bogus
ELOOP failure.
* tests/rm/fail-eacces: Add a test for the above.
* src/c99-to-c89.diff: Adjust offsets.

16 years agorm: fix a tiny, nearly inconsequential bug.
Jim Meyering [Sat, 22 Sep 2007 06:40:47 +0000 (08:40 +0200)]
rm: fix a tiny, nearly inconsequential bug.

Don't perform a "."-relative lstat, when the file in question
may well not be in ".".  Although this is a bug, a few attempts
to exercise it on a linux-2.6.22 system failed.  You probably need
a pre-openat system to trigger the failure.  The consequence of this
bug would be a lower-quality diagnostic upon failed dir removal.
* src/remove.c (is_dir_lstat): Add a parameter, fd_cwd.
Use it instead of hard-coding AT_FDCWD.
(remove_entry): Call is_dir_lstat with fd_cwd.

Signed-off-by: Jim Meyering <jim@meyering.net>
16 years agoTODO: It'd be nice to add renice.
Karl Berry [Sat, 22 Sep 2007 06:28:21 +0000 (08:28 +0200)]
TODO: It'd be nice to add renice.

Signed-off-by: Jim Meyering <jim@meyering.net>
16 years agoAvoid a test failure due to now-parallelized tests.
Jim Meyering [Fri, 21 Sep 2007 06:30:26 +0000 (08:30 +0200)]
Avoid a test failure due to now-parallelized tests.

* tests/du/two-args: Run "du .." from a sub-directory one level deeper.

16 years agoFix typo in previous change.
Jim Meyering [Wed, 19 Sep 2007 09:13:46 +0000 (11:13 +0200)]
Fix typo in previous change.

Spotted by Andreas Schwab.

16 years ago* coreutils.texi (expr invocation): Correct description of relative
Jim Meyering [Wed, 19 Sep 2007 08:25:40 +0000 (10:25 +0200)]
* coreutils.texi (expr invocation): Correct description of relative
operator precedence.  Reported by hanpingtian@gmail.com.

16 years agotests/misc/tac-continue: Arrange to remove a temporary file.
Jim Meyering [Sun, 16 Sep 2007 09:26:24 +0000 (11:26 +0200)]
tests/misc/tac-continue: Arrange to remove a temporary file.

Signed-off-by: Jim Meyering <jim@meyering.net>
16 years agotests/check.mk (vc_exe_in_TESTS): Don't rely on the value of $(TESTS),
Jim Meyering [Sun, 16 Sep 2007 09:20:55 +0000 (11:20 +0200)]
tests/check.mk (vc_exe_in_TESTS): Don't rely on the value of $(TESTS),

so that "make check TESTS=test-name" works once again.

Signed-off-by: Jim Meyering <jim@meyering.net>
16 years agotests/CuTmpdir.pm: Use File::Find + chmod syscall, not chmod -R.
Jim Meyering [Sun, 16 Sep 2007 09:07:59 +0000 (11:07 +0200)]
tests/CuTmpdir.pm: Use File::Find + chmod syscall, not chmod -R.

Signed-off-by: Jim Meyering <jim@meyering.net>
16 years agoRevamp most test scripts.
Jim Meyering [Sat, 15 Sep 2007 23:24:37 +0000 (01:24 +0200)]
Revamp most test scripts.

Add a ChangeLog entry summarizing the preceding 30+ change sets.

16 years ago* tests/rm/v-slash: Avoid test failure with non-C locale.
Jim Meyering [Sat, 15 Sep 2007 23:06:16 +0000 (01:06 +0200)]
* tests/rm/v-slash: Avoid test failure with non-C locale.
Reported by Michael Stone.

16 years agoEnable some previously omitted test scripts. Add a test cross-check.
Jim Meyering [Thu, 13 Sep 2007 10:13:35 +0000 (12:13 +0200)]
Enable some previously omitted test scripts.  Add a test cross-check.

* tests/rm/Makefile.am (TESTS): Add empty-name and unreadable.
* tests/rm/empty-name: Likewise.
* tests/rm/unreadable: Reenable this test.  Adjust for new rm.
* tests/mkdir/Makefile.am: Add writable-under-readonly.
* tests/mkdir/writable-under-readonly: Add some comments.
This test is always skipped, for now.
* tests/Makefile.am (ta): Hook up the new root-only script.
* tests/tail-2/infloop-1: Make this test pass.
* tests/tail-2/Makefile.am (TESTS): Add infloop-1.
* tests/tail-2/fflush: Remove unused file.
* tests/check.mk (vc_executable_is_in_TESTS): More portable.
* tests/check.mk (check): Depend on the above.
* build-aux/check.mk: Remove comment mentioning AUTHORS file.

16 years agoFactor out definitions in TESTS_ENVIRONMENT of srcdir, top_srcdir, etc.
Jim Meyering [Thu, 13 Sep 2007 08:04:35 +0000 (10:04 +0200)]
Factor out definitions in TESTS_ENVIRONMENT of srcdir, top_srcdir, etc.

tests/check.mk (top_srcdir): Define.
tests/*/Makefile.am: Remove definitions of $(srcdir), $(top_srcdir),
$(abs_top_srcdir), and $(abs_top_builddir), since they're
defined via the included tests/check.mk.

16 years agotests/general: Remove from VC, this long-unused directory and contents.
Jim Meyering [Thu, 13 Sep 2007 07:22:39 +0000 (09:22 +0200)]
tests/general: Remove from VC, this long-unused directory and contents.

16 years agoAdapt tests/tail-2/ to use test-lib.sh.
Jim Meyering [Thu, 13 Sep 2007 06:44:26 +0000 (08:44 +0200)]
Adapt tests/tail-2/ to use test-lib.sh.

16 years agoAdapt tests/readlink/ to use test-lib.sh.
Jim Meyering [Wed, 12 Sep 2007 16:14:36 +0000 (18:14 +0200)]
Adapt tests/readlink/ to use test-lib.sh.

16 years agoMove the sole test in tests/ls-2/ to tests/misc/.
Jim Meyering [Wed, 12 Sep 2007 13:55:54 +0000 (15:55 +0200)]
Move the sole test in tests/ls-2/ to tests/misc/.

* tests/ls-2/basic-1: Move this file to ...
* tests/misc/ls-misc: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add ls-misc.
* tests/Makefile.am (SUBDIRS): Remove ls-2.
* tests/ls-2: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/ls-2/Makefile.

16 years agoMore misc, test-related changes. (some to allow running tests as root)
Jim Meyering [Wed, 12 Sep 2007 12:52:26 +0000 (14:52 +0200)]
More misc, test-related changes. (some to allow running tests as root)

16 years agoMove all tests from test/{od,sha1sum,shred,stty} to tests/misc/.
Jim Meyering [Tue, 11 Sep 2007 21:30:49 +0000 (23:30 +0200)]
Move all tests from test/{od,sha1sum,shred,stty} to tests/misc/.

Reflect these renamings:
od/od-N             misc/od-N
od/x8               misc/od-x8
sha1sum/basic-1     misc/sha1sum
sha1sum/sample-vec  misc/sha1sum-vec
shred/exact         misc/shred-exact
shred/remove        misc/shred-remove
stty/basic-1        misc/stty
stty/invalid        misc/stty-invalid
stty/row-col-1      misc/stty-row-col

* tests/misc/Makefile.am (TESTS): Add the new files.
* tests/Makefile.am (SUBDIRS): Remove the dir names.
* tests/od, tests/sha1sum, tests/shred, tests/stty: Remove the directories.
* configure.ac (AC_CONFIG_FILES): Remove the corresponding Makefile names.

16 years agoMove the two tests in tests/tee to tests/misc/.
Jim Meyering [Tue, 11 Sep 2007 21:30:09 +0000 (23:30 +0200)]
Move the two tests in tests/tee to tests/misc/.

* tests/tee/basic: Move this file to ...
* tests/misc/tee: ...here.  Don't rely on $PROG in env.
* tests/tee/dash: Move this file to ...
* tests/misc/tee-dash: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add tee.
* tests/Makefile.am (SUBDIRS): Remove tee.
* tests/tee: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/tee/Makefile

16 years agoMove the two tests in tests/sum/ to tests/misc/.
Jim Meyering [Mon, 10 Sep 2007 22:43:05 +0000 (00:43 +0200)]
Move the two tests in tests/sum/ to tests/misc/.

* tests/sum/basic-1: Move this file to ...
* tests/misc/sum: ...here.  Don't rely on $PROG in env.
* tests/sum/sysv: Move this file to ...
* tests/misc/sum-sysv: ...here.  Adapt it to use test-lib.sh.
* tests/misc/Makefile.am (TESTS): Add sum and sum-sysv.
* tests/Makefile.am (SUBDIRS): Remove sum.
* tests/sum: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/sum/Makefile.

16 years agoMove the sole test in tests/tsort/ to tests/misc/tsort.
Jim Meyering [Mon, 10 Sep 2007 19:29:46 +0000 (21:29 +0200)]
Move the sole test in tests/tsort/ to tests/misc/tsort.

* tests/tsort/basic-1: Move this file to ...
* tests/misc/tsort: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add tsort.
* tests/Makefile.am (SUBDIRS): Remove tsort.
* tests/tsort: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/tsort/Makefile.

16 years agoMove the sole test in tests/unexpand to tests/misc/unexpand.
Jim Meyering [Mon, 10 Sep 2007 17:08:31 +0000 (19:08 +0200)]
Move the sole test in tests/unexpand to tests/misc/unexpand.

* tests/unexpand/basic-1: Move this file to ...
* tests/misc/unexpand: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add unexpand.
* tests/Makefile.am (SUBDIRS): Remove unexpand.
* tests/unexpand: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/unexpand/Makefile.

16 years agoMove the sole test in tests/seq to tests/misc/seq.
Jim Meyering [Mon, 10 Sep 2007 17:01:39 +0000 (19:01 +0200)]
Move the sole test in tests/seq to tests/misc/seq.

* tests/seq/basic: Move this file to ...
* tests/misc/seq: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add seq.
* tests/Makefile.am (SUBDIRS): Remove seq.
* tests/seq: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/seq/Makefile

16 years agoConvert tests/mkdir/ to use test-lib.sh.
Jim Meyering [Mon, 10 Sep 2007 06:00:39 +0000 (08:00 +0200)]
Convert tests/mkdir/ to use test-lib.sh.

16 years agoMove the two tests in tests/md5sum to tests/misc/md5sum.
Jim Meyering [Sat, 8 Sep 2007 13:51:25 +0000 (15:51 +0200)]
Move the two tests in tests/md5sum to tests/misc/md5sum.

* tests/md5sum/basic-1: Move this file to ...
* tests/misc/md5sum: ...here.  Don't rely on $PROG in env.
* tests/md5sum/newline-1: Move this file to ...
* tests/misc/md5sum-newline: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add md5sum.
* tests/Makefile.am (SUBDIRS): Remove md5sum.
* tests/md5sum: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/md5sum/Makefile

16 years agotests/sample-test: Update to use test-lib.sh.
Jim Meyering [Sat, 8 Sep 2007 13:47:16 +0000 (15:47 +0200)]
tests/sample-test: Update to use test-lib.sh.

16 years agoConvert tests/misc/ to use test-lib.sh, too.
Jim Meyering [Sat, 8 Sep 2007 10:26:55 +0000 (12:26 +0200)]
Convert tests/misc/ to use test-lib.sh, too.

16 years agoConvert tests/ls/, too.
Jim Meyering [Sat, 8 Sep 2007 08:09:19 +0000 (10:09 +0200)]
Convert tests/ls/, too.

16 years agoConvert tests/ln/, too.
Jim Meyering [Sat, 8 Sep 2007 07:35:04 +0000 (09:35 +0200)]
Convert tests/ln/, too.

16 years agoConvert tests/install/, too.
Jim Meyering [Sat, 8 Sep 2007 07:22:49 +0000 (09:22 +0200)]
Convert tests/install/, too.

16 years agoMove the two tests in tests/fmt to tests/misc/fmt.
Jim Meyering [Sat, 8 Sep 2007 06:57:42 +0000 (08:57 +0200)]
Move the two tests in tests/fmt to tests/misc/fmt.

* tests/fmt/basic: Move this file to ...
* tests/misc/fmt: ...here.  Don't rely on $PROG in env.
* tests/fmt/long-line: Move this file to ...
* tests/misc/fmt-long-line: ...here.
* tests/misc/Makefile.am (TESTS): Add fmt.
* tests/Makefile.am (SUBDIRS): Remove fmt.
* tests/fmt: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/fmt/Makefile

16 years agoMove the sole test in tests/factor to tests/misc/factor.
Jim Meyering [Fri, 7 Sep 2007 21:54:49 +0000 (23:54 +0200)]
Move the sole test in tests/factor to tests/misc/factor.

* tests/factor/basic: Move this file to ...
* tests/misc/factor: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add factor.
* tests/Makefile.am (SUBDIRS): Remove factor.
* tests/factor: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/factor/Makefile

16 years agoMove the sole test in tests/expr to tests/misc/expr.
Jim Meyering [Fri, 7 Sep 2007 20:46:52 +0000 (22:46 +0200)]
Move the sole test in tests/expr to tests/misc/expr.

* tests/expr/basic: Move this file to ...
* tests/misc/expr: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add expr.
* tests/Makefile.am (SUBDIRS): Remove expr.
* tests/expr: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/expr/Makefile

16 years agoConvert tests/du/*, too.
Jim Meyering [Fri, 7 Sep 2007 13:25:23 +0000 (15:25 +0200)]
Convert tests/du/*, too.

16 years agoMove the sole test in tests/dircolors to tests/misc/dircolors.
Jim Meyering [Fri, 7 Sep 2007 12:34:37 +0000 (14:34 +0200)]
Move the sole test in tests/dircolors to tests/misc/dircolors.

* tests/dircolors/simple: Move this file to...
* tests/misc/dircolors: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add dircolors.
* tests/Makefile.am (SUBDIRS): Remove dircolors.
* tests/dircolors: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/dircolors/Makefile

16 years agoConvert tests/dd/*, too.
Jim Meyering [Fri, 7 Sep 2007 12:28:47 +0000 (14:28 +0200)]
Convert tests/dd/*, too.

16 years agoConvert tests/mv, too.
Jim Meyering [Thu, 6 Sep 2007 21:05:16 +0000 (23:05 +0200)]
Convert tests/mv, too.

* tests/other-fs-tmpdir: Before, all callers would exit 77 upon failure to
find the required dir.  Now, exit 77 in this script so callers don't have to.
Adjust callers.

16 years agoAdjust chgrp, chmod, chown, cp tests to use test-lib.sh.
Jim Meyering [Thu, 6 Sep 2007 15:34:49 +0000 (17:34 +0200)]
Adjust chgrp, chmod, chown, cp tests to use test-lib.sh.

* tests/check.mk: Also define abs_top_builddir.

16 years agoParallel "make check" support.
Jim Meyering [Thu, 16 Aug 2007 14:28:11 +0000 (16:28 +0200)]
Parallel "make check" support.

* build-aux/check.mk: New file, from The Vaucanson Group.
* .x-sc_GPL_version: New file, to allow "version 2 or later"
in build-aux/check.mk.
* Makefile.am (EXTRA_DIST): Add .x-sc_GPL_version.
* tests/check.mk: New file.
* tests/Makefile.am (EXTRA_DIST): Add check.mk, mkdtemp and test-lib.sh.

Begin factoring "sample-test" out of test scripts.
* tests/test-lib.sh: New file, to be sourced by all tests that
were previously derived from the "sample-test" template.
* tests/mkdtemp: New file.
* tests/touch/dir-1: Use test-lib.sh.
* tests/touch/empty-file: Likewise.
* tests/touch/fail-diag: Likewise.
* tests/touch/fifo: Likewise.
* tests/touch/no-create-missing: Likewise.
* tests/touch/no-rights: Likewise.  Also, don't sleep.
* tests/touch/not-owner: Likewise.
* tests/touch/obsolescent: Likewise.
* tests/touch/read-only: Likewise.
* tests/touch/relative: Likewise.
* tests/touch/Makefile.am: Include $(top_srcdir)/tests/check.mk,
to get the parallel-"make check" bits.

Move a slow test into tests/misc.

* tests/check.mk: Wrapper.
* tests/ls/time-1: Move this file to tests/misc/ls-time.
* tests/misc/ls-time: New file.  From tests/ls/time-1.
* tests/ls/Makefile.am (TESTS): Remove time-1.
* tests/misc/Makefile.am (TESTS): Add ls-time.

16 years agoAdd support for parallel "make check" (in tests/misc, for now)
Jim Meyering [Tue, 14 Aug 2007 08:21:48 +0000 (10:21 +0200)]
Add support for parallel "make check" (in tests/misc, for now)

16 years ago* vc-list-files: Remove mercurial support.
Jim Meyering [Sat, 15 Sep 2007 06:39:53 +0000 (08:39 +0200)]
* vc-list-files: Remove mercurial support.
Check for CVS first.  Adjust comments.

16 years agoAccommodate gnulib's renaming: __fpending.h -> fpending.h.
Jim Meyering [Sat, 8 Sep 2007 19:35:23 +0000 (21:35 +0200)]
Accommodate gnulib's renaming: __fpending.h -> fpending.h.

* lib/t-fpending.c: Include "fpending.h", not "__fpending.h".

16 years agochmod: don't ignore a dangling symlink
Jim Meyering [Fri, 7 Sep 2007 08:37:08 +0000 (10:37 +0200)]
chmod: don't ignore a dangling symlink

* NEWS: Mention the bug fix.
* src/chmod.c (process_file): Handle the case of FTS_SLNONE,
i.e., give a diagnostic saying we cannot operate on such a file.
* tests/chmod/thru-dangling: Compare new stderr output with expected.

16 years agoAdd a test: demonstrate that chmod ignores a dangling symlink
Bob Proulx [Fri, 7 Sep 2007 08:29:32 +0000 (10:29 +0200)]
Add a test: demonstrate that chmod ignores a dangling symlink

* tests/chmod/thru-dangling: New test.  Fails.
* tests/chmod/Makefile.am (TESTS): Add thru-dangling.

16 years agoAdapt to new SELinux behavior: "?" vs. new "unlabeled"
Jim Meyering [Wed, 5 Sep 2007 08:57:54 +0000 (10:57 +0200)]
Adapt to new SELinux behavior: "?" vs. new "unlabeled"

* src/ls.c (gobble_file): Interpret the new "unlabeled" indicator
from getfilecon/lgetfilecon the same way we interpret a negative
return value: no security context.  So we don't print the "+".
* tests/selinux: Recognize that "unlabeled" means insufficient
support for SELinux, just like "?".

16 years agoRun autoconf manually, if needed to get an updated version string.
Jim Meyering [Mon, 3 Sep 2007 08:52:49 +0000 (10:52 +0200)]
Run autoconf manually, if needed to get an updated version string.

* GNUmakefile: Don't actually touch configure.ac.
That would make git-version-gen always print "...-dirty".

16 years agoDon't change '-'s to '.'s in the string from git-describe.
Jim Meyering [Mon, 3 Sep 2007 08:38:14 +0000 (10:38 +0200)]
Don't change '-'s to '.'s in the string from git-describe.

* build-aux/git-version-gen: Leave '-'s in the string from git-describe.
Otherwise, s/-/./g would make it too hard to distinguish the base
version number from the appended .DD suffixes.

2007-09-03  Jim Meyering  <jim@meyering.net>

16 years agoREADME-hacking: Require rsync, rather than wget.
Jim Meyering [Mon, 3 Sep 2007 07:06:10 +0000 (09:06 +0200)]
README-hacking: Require rsync, rather than wget.

16 years ago* bootstrap (WGET_COMMAND): Remove code to set this variable.
Jim Meyering [Sun, 2 Sep 2007 11:49:49 +0000 (13:49 +0200)]
* bootstrap (WGET_COMMAND): Remove code to set this variable.

16 years agoEnsure that $(VERSION) is up to date for dist-related targets.
Jim Meyering [Sun, 2 Sep 2007 09:37:57 +0000 (11:37 +0200)]
Ensure that $(VERSION) is up to date for dist-related targets.

* GNUmakefile: Arrange to rerun autoconf, if the version reported
by git-version-gen doesn't match $(VERSION), but only for dist targets.

Signed-off-by: Jim Meyering <jim@meyering.net>
16 years agobootstrap: uses rsync to download the .po files
Jim Meyering [Sun, 2 Sep 2007 07:38:39 +0000 (09:38 +0200)]
bootstrap: uses rsync to download the .po files

* bootstrap (po_download_command_format): New global.
(download_po_files): Use rsync.
(update_po_files): Don't remove .po files after download,
so future rsync runs can take advantage of the copies.

16 years ago* bootstrap (gnulib_tool): Make sha1sum check quietly.
Jim Meyering [Sat, 1 Sep 2007 17:00:09 +0000 (19:00 +0200)]
* bootstrap (gnulib_tool): Make sha1sum check quietly.

Signed-off-by: Jim Meyering <jim@meyering.net>
16 years agoEnsure that snapshot version changes make it to groups, too.
Jim Meyering [Sat, 1 Sep 2007 09:20:53 +0000 (11:20 +0200)]
Ensure that snapshot version changes make it to groups, too.

* src/Makefile.am (groups): Depend on Makefile.

16 years agoMake groups-version executable,
Jim Meyering [Sat, 1 Sep 2007 09:20:42 +0000 (11:20 +0200)]
Make groups-version executable,

* tests/misc/groups-version: ... as it was in the patch.