Global options like -maxdepth should be specified before other arguments
like tests, operators, etc. The corresponding warning diagnostic was
obviously misleading, so that at least the French and the German
translations - and maybe even the English original - were not well
understood by users.
* find/parser.c (found_parser): Improve diagnostic, thus hopefully
also avoiding translation issues. Remove extra newline.
Fixes https://sv.gnu.org/bugs/?56820
doc/find-maint.texi: point out that the version number in
configure.ac also needs to be updated. Point out that if you did the
release update on a branch it needs to be merged and in any case that
these changes need to be pushed to origin/master. Also prompt the
maintainer to check that the FTP upload actually worked.
To improve readability for the user, xargs(1) shall quote each part
of the command to be executed when printing it to stderr, i.e. for
the -t (--verbose) and -p (--interactive) options. Example:
$ echo "some file" | ../xargs -p -I'{}' rm '{}.c' '{}.o'
rm 'some file.c' 'some file.o' ?...
* xargs/xargs.c (print_args): Apply "shell-escape" quoting.
* xargs/testsuite/xargs.gnu/space-t-0.xe: Adjust test.
* tests/xargs/verbose-quote.sh: Add test.
* tests/local.mk: Reference it.
* README (Improvements): Mention the change.
This avoids this bootstrap warning:
Notice from module gettext:
This module is obsolete. Use the module 'gettext-h' instead to make
your program capable of internationalization, when GNU gettext is also
used.
* bootstrap.conf (gnulib_modules): s/gettext/&-h/
The -prune action always returns true, also if -depth is in effect.
* find/find.1 (-prune): Remove the wrong statement that -prune would
return false when -depth is given. Furthermore, move the example down
from -path.
Reported by Cristian Zoicas in
https://lists.gnu.org/r/bug-findutils/2019-04/msg00024.html
Utilize GNU_FINDUTILS_FD_LEAK_CHECK environment variable
to enable/disable fd leak check for xargs the same way as
for find.
* find/defs.h: Remove prototype for fd_leak_check_is_enabled().
* find/util.c: Remove implementation of fd_leak_check_is_enabled().
* lib/fdleak.c: Add implementation of fd_leak_check_is_enabled().
* lib/fdleak.h: Add prototype for fd_leak_check_is_enabled().
* xargs/testsuite/config/unix.exp: Enable GNU_FINDUTILS_FD_LEAK_CHECK
for all tests.
* xargs/xargs.c: Execute complain_about_leaky_fds when
fd_leak_check_is_enabled returns true.
* NEWS (Improvements): Document support of GNU_FINDUTILS_FD_LEAK_CHECK
by xargs.
Copyright-paperwork-exempt: Yes
* build-aux/update-online-manual.sh: add a script (originally
written in 2005 but not previously included in the source
distribution) which automates the updating of the online manual.
* doc/Makefile.am: Add some targets useful for update-online-manual.sh.
* doc/find-maint.texi (Documentation): Explain how to check out
the web pages and how to update the findutils documentation there.
The previous description "File was modified more recently than file."
was hard to understand without markup, e.g. over the phone.
Furthermore, the description for symbolic links as reference file was
wrong in the man page for the -anewer and -cnewer options: in fact,
find(1) always uses the mtime of the reference file.
* doc/find.texi (Comparing Timestamps): Improve the wording for the
-anewer/-cnewer/-newer options. Use 'reference' as the argument name.
Add the note from find.1 that the -H/-L options make find(1) use
the data modification time of the file being referenced.
* find/find.1 (-anewer,-cnewer,-newer): Improve the wording, and use
'reference' as argument name.
Fix the description for -anewer/-cnewer: when -H/-L is used with a
symbolic link as reference, then find always uses the mtime of that,
not atime or ctime.
Reported by Dan Jacobson <jidanni@jidanni.org> in
https://lists.gnu.org/r/bug-findutils/2019-04/msg00002.html
There is a small race condition between the previous stat call
and openat/fdopendir (which cannot be avoided): if the directory
got replaced by another file type, then openat would succeed but the
subsequent fdopendir would fail with ENOTDIR. Detect this earlier
by passing the O_DIRECTORY flag.
Furthermore, the opened file descriptor was leaked in that case
(bug introduced in FINDUTILS_4_3_2-1-80-gb46b0d89 in 2007).
Later on, after a readdir error, also the directory stream was leaked
(bug introduced by myself in commit 7a6e548690).
* find/pred.c (pred_empty): Add more flags to the openat call,
especially O_DIRECTORY; inspired by gnulib's opendirat module.
Close the file descriptor when fdopendir failed.
Close the directory stream when readdir failed.
Cause developer builds to fail for any use of a VLA.
VLAs (variable length arrays) limit portability.
* configure.ac (findutils_gnulib_noise_warnings): Remove as the only
suppressed warning for gnulib was -Wvla, thus enabling the warning
when configured with --enable-compiler-warnings.
(compiler-warnings-are-errors): Likewise.
(GNULIB_NO_VLA) Define, disabling use of VLAs in gnulib. This commit
is functionally equivalent to coreutils' v8.30-44-gd26dece5d
Discussed for other GNU packages in:
https://lists.gnu.org/r/coreutils/2019-01/msg00058.html
Make this test a "check-root" test to increase test coverage.
This test runs for non-privileged users as well, but skips the tests
for block and character devices as mknod(1) will fail with EPERM.
* find/testsuite/test_type-list.sh: Move to ...
* tests/find/type_list.sh: ... this, and apply the above.
Simplify, and make more robust.
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_root_tests): ... and add it here.
* find/testsuite/sv-52220.sh: Move to ...
* tests/find/debug-missing-arg.sh: ... this, and apply the above.
Simplify, and make more robust.
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_tests): .. and add it here.
* find/testsuite/sv-48180-refuse-noop.sh: Move to ...
* tests/find/refuse-noop.sh: ... this, and apply the above.
Simplify, and make more robust.
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_tests): .. and add it here.
* find/testsuite/sv-48030-exec-plus-bug.sh: Move to ...
* tests/find/exec-plus-last-file.sh: ... this, and apply the above.
Simplify, and make more robust.
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_tests): .. and add it here.
* find/testsuite/sv-34976-execdir-fd-leak.sh: Move to ...
* tests/find/execdir-fd-leak.sh: ... this, and apply the above.
Simplify, and make more robust.
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_tests): .. and add it here.
* find/testsuite/test_inode.sh: Move to ...
* tests/find/printf_inode.sh: ... this, and apply the above. Simplify.
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_tests): .. and add it here.
* find/testsuite/test_escape_c.sh: Move to ...
* tests/find/printf_escape_c.sh: ... this, and apply the above. Simplify.
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_tests): .. and add it here.
For migrating, merge with the basic structure from 'tests/sample-test',
i.e., source in 'tests/init.sh', call 'print_ver_', "Exit $fail", etc.
Also remove now-common functions like die() and framework_failure_().
* find/testsuite/test_escapechars.golden: Remove, as the axpected output
is created on the fly by the new test.
* find/testsuite/test_escapechars.sh: Move to ...
* tests/find/printf_escapechars.sh: ... this, and apply the above.
Create the expected output on the fly, and also check for the expected
error diagnostic on stderr.
* find/testsuite/Makefile.am (EXTRA_DIST_GOLDEN): Remove.
(EXTRA_DIST): Remove $(EXTRA_DIST_GOLDEN).
(tests_shell_progs): Remove the reference to this test ...
* tests/local.mk (all_tests): .. and add it here.
For migrating, merge with the basic structure from 'tests/sample-test',
i.e., source in 'tests/init.sh', call 'print_ver_', "Exit $fail", etc.
Also remove now-common functions like die() and framework_failure_().
* find/testsuite/sv-bug-32043.sh: Move to ...
* tests/find/name-lbracket-literal.sh: ... this, and apply the above.
Simplify.
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_tests): .. and add it here.
For migrating, merge with the basic structure from 'tests/sample-test',
i.e., source in 'tests/init.sh', call 'print_ver_', "Exit $fail", etc.
Also remove now-common functions like die() and framework_failure_().
* find/testsuite/sv-34079.sh: Move to ...
* tests/find/many-dir-entries-vs-OOM.sh: ... this, and apply the above.
While at it, loosely pull in changes from the related test in the
GNU coreutils [1]:
Create only 200,000 files, rather than 4 million. The latter was overkill,
and was too likely to fail due to inode exhaustion. Now that this test
doesn't take so long, label it as merely "expensive", rather than
"very expensive".
Furthermore, simplify the test data creation, and use the ulimit specifically
for each program under test (find, oldfind).
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_tests): .. and add it here.
[1]
https://git.sv.gnu.org/cgit/coreutils.git/tree/tests/rm/many-dir-entries-vs-OOM.sh?id=4711c49312d5
Borrow the 'tests' framework from GNU coreutils. This allows better
shell-style tests with more control over stdin, stdout, stderr, signals,
preparatory steps, cleanup, return code verification, root-only tests,
etc.
* .gitignore: Add entries for per-test *.log and *.trs files, and the
'test-suite.log'.
* .x-update-copyright: Exempt 'tests/init.sh' as this comes from gnulib.
* Makefile.am: Include 'tests/local.mk'.
(EXTRA_DIST): Add 'tests/GNUmakefile'.
(SUBDIRS): Move 'gnulib-tests' to the end, i.e., run our own tests first.
(ALL_RECURSIVE_TARGETS): Initialize.
(update-gnulib-to-latest): Copy 'tests/init.sh' from gnulib.
* cfg.mk: Add some syntax-check rules.
* init.cfg: Add file.
* tests/GNUmakefile: Likewise.
* tests/envvar-check: Likewise.
* tests/init.sh: Likewise.
* tests/lang-default: Likewise.
* tests/local.mk: Likewise.
* tests/misc/help-version.sh: Likewise.
* tests/other-fs-tmpdir: Likewise.
* tests/sample-test: Likewise.
* tests/.gitignore: Likewise.
* NEWS (Changes to the build process): Mention the new test framework.
'make' on all of FreeBSD, NetBSD and OpenBSD fails to understand that
'./libfindtools.a' and 'libfindtools.a' are the same, and - unless one
builds that target manually - fails with:
make[3]: don't know how to make ./libfindtools.a. Stop
* find/Makefile.am (LDADD): Change './libfindtools.a' to 'libfindtools.a'.
* find/parser.c (check_name_arg): Add parameter ALT for the alternative
option to suggest. Avoid confusing quoting in the warning by making
the message more terse.
(parse_iname): Pass "-iwholename" as alternative parameter.
(parse_name): Pass "-wholename" as alternative parameter.
Reported by Andreas Metzler in
https://sv.gnu.org/bugs/?55272
Run 'make update-copyright'.
* lib/regexprops.c (copying): Update the year number manually.
* All other files: Update copyright years via the above make run.
Run 'make update-gnulib-to-latest', mainly to update the copyright
year numbers with:
> maint: Run 'make update-copyright'
* bootstrap: Sync from gnulib/build-aux/bootstrap.
* gnulib: Update to latest.
* lib/bugreports.c (explain_how_to_report_bugs): Avoid continued strings
by using multi-part strings, one per line.
* cfg.mk (sc_prohibit_continued_string_alpha_in_column_1): Add SC rule.
Run 'make update-gnulib-to-latest'.
* bootstrap: Sync from gnulib/build-aux/bootstrap.
* gnulib: Update to latest.
* configure.ac (AC_PREREQ): Change from very old 2.59 to current 2.69
to avoid gnulib-tool complaining about "minimum supported autoconf
version is 2.63".
* Makefile.am (gnulib-sync, update-gnulib-to-latest): Add targets to
pull the latest commit of the gnulib submodule, and also to copy over
the files we keep in sync.
* doc/find-maint.texi (How to update Gnulib to latest): Add section.
* find/defs.h (DebugOption): Add DebugAll, which includes all other
debug options but DebugHelp.
* find/util.c (debugassoc): Add an entry for DebugAll, and move DebugHelp
to the end.
* doc/find.texi (node Debug Options): Document the new option.
* find/find.1: Likewise.
* NEWS (Improvements): Likewise.
* doc/find.texi (node Controlling Parallelism): Change from 'xargs -1'
(minus one) to 'xargs -l' (minus El) in three places.
Reported by Ahmad ElKomey in
https://sv.gnu.org/bugs/index.php?54859
* doc/find.texi (Mode Bits): Move the misplaced '-perm -g+w,o+w' example
up to the '-perm -022' example to where it belongs. The former got
accidentally separated from the latter in commit 7ade936bc2: the patch
proposed in https://sv.gnu.org/bugs/?14619 was applied in the wrong place.
* NEWS (Bug fixes): Mention the fix.
Reported by Ahmad ElKomey in https://sv.gnu.org/bugs/?54838