2388 Commits

Author SHA1 Message Date
de9f5bf4b2 NEWS: update version to 4.7.0 v4.7.0 2019-08-29 21:49:58 +02:00
333ce56380 find: improve warning when global option is specified after other argument
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
2019-08-29 21:10:57 +02:00
James Youngman
278e8fbb12 doc: add some previously-missing steps to the release instructions.
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.
2019-08-29 19:55:05 +01:00
James Youngman
0acf198f36 Fix missing word in NEWS.
NEWS: add missing "the" in description of GNU_FINDUTILS_FD_LEAK_CHECK
for xargs.
2019-08-29 19:44:07 +01:00
eeefd1dc72 xargs: in -t,-p output, quote the command to be executed when needed
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.
2019-07-29 08:44:29 +02:00
f2542a4fe3 gnulib: update to the latest
Run 'make update-gnulib-to-latest'.

* gnulib: Update.
* tests/init.sh: Sync from 'gnulib/tests/init.sh'.
2019-05-11 22:08:06 +02:00
c07f6924c8 maint: change from gettext to gettext-h gnulib module
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/
2019-05-11 21:34:26 +02:00
54b543a8ff maint: bump build prerequisite versions
* bootstrap.conf (buildreq): Require at least autoconf-2.59,
automake-1.11.2, and gettext-0.19.2.
2019-05-11 21:34:21 +02:00
9930316f51 doc: add PDF file to the online manual
* build-aux/update-online-manual.sh: Add the PDF file.
While at it, properly close the <LI> tags with </LI>.
2019-05-10 08:05:30 +02:00
6743fefc3a find.1: correct description about -prune when -depth is in effect
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
2019-05-10 08:05:08 +02:00
James Youngman
cc130437f0 Fixes for 'make syntax-check'.
* doc/Makefile.am: Remove trailing newlines.
2019-05-05 18:53:15 +01:00
Pavel Modilaynen
5699fb78d4 xargs: use GNU_FINDUTILS_FD_LEAK_CHECK as for find
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
2019-05-05 18:10:40 +01:00
James Youngman
755a22b982 doc: add a tool for updating the online manual.
* 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.
2019-05-05 17:32:05 +01:00
James Youngman
e599052685 doc: fix bug #56142 by specifying which actions inhibit the default -print
* find/find.1: specify which actions inhibit the default -print
action.
* doc/find.texi (find Expressions): Likewise.
2019-05-04 00:46:42 +01:00
161b838754 doc: clarify find options -newer, -anewer, -cnewer
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
2019-04-14 20:59:08 +02:00
235f21673c find: make pred_empty safer and avoid fd leaks
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.
2019-02-09 15:57:19 +01:00
8ff1a199f3 build: ensure no VLA is used
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
2019-01-22 23:20:45 +01:00
64b802e568 gnulib: update to the latest
Run 'make update-gnulib-to-latest'.

* gnulib: Update to a version supporting GNULIB_NO_VLA.
2019-01-22 23:14:55 +01:00
0b483d326c tests: remove last traces of old shell tests
* find/testsuite/Makefile.am (test_shell_progs): Remove.
(EXTRA_DIST): Remove $(test_shell_progs) and 'binary_locations.sh'.
(TESTS): Remove.
* find/testsuite/binary_locations.sh: Remove utility script.
2019-01-09 00:24:34 +01:00
b9604dc2b2 tests: migrate 'type_list' to the new testsuite
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.
2019-01-09 00:24:34 +01:00
8b1bb60543 tests: migrate 'debug-missing-arg' to the new testsuite
* 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.
2019-01-09 00:24:34 +01:00
fb99de8a29 tests: migrate 'refuse-noop' to the new testsuite
* 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.
2019-01-09 00:24:34 +01:00
dbc218f5f5 tests: migrate 'exec-plus-last-file' to the new testsuite
* 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.
2019-01-09 00:24:34 +01:00
1027613d0f tests: migrate 'execdir-fd-leak' to the new testsuite
* 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.
2019-01-09 00:24:34 +01:00
c809ce8fa2 tests: migrate 'printf_inode' to the new testsuite
* 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.
2019-01-09 00:24:34 +01:00
1cc45855e5 tests: migrate 'printf_escape_c' to the new testsuite
* 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.
2019-01-09 00:24:34 +01:00
3f6b28c4fb tests: migrate test 'printf_escapechars' to the new testsuite
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.
2019-01-09 00:24:34 +01:00
77df15aa8b tests: migrate 'name-lbracket-literal' to the new testsuite
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.
2019-01-09 00:24:34 +01:00
8a2f24d5ff tests: migrate 'many-dir-entries-vs-OOM' to the new testsuite
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
2019-01-09 00:24:34 +01:00
f72b299cdd tests: add shell-style test framework
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.
2019-01-09 00:24:34 +01:00
763c4725fc maint: add NEWS entry for bug #55272
* NEWS (Bug Fixes): Add news entry for the change in commit 66174c10c6.
2019-01-08 11:34:27 +01:00
2758f513f0 build: work around dependency issue of 'make' on the BSDs
'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'.
2019-01-05 16:45:36 +01:00
66174c10c6 find: improve warning diagnostic for the -name/-iname with '/' in pattern
* 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
2019-01-05 12:57:11 +01:00
04f1fbee5d maint: fix typo in comment
* find/parser.c (found_parser): s/fid/find/ in a comment.
2019-01-05 01:20:21 +01:00
487d0701c5 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* All other files: Update copyright years via the above make run.
2019-01-04 23:47:26 +01:00
c53c52827c maint: update gnulib to latest
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.
2019-01-04 22:57:53 +01:00
b23a2693c8 gnulib: use https URL scheme instead of git
This is apparently more secure (against MITM attacks).

* .gitmodules (gnulib): Change url scheme from "git://" to "https://".

Discussed at:
https://lists.gnu.org/r/bug-gnulib/2018-12/msg00051.html
2018-12-12 01:18:49 +01:00
042afd9f00 maint: avoid non-portable C99 printf size specifiers %z and %j
* cfg.mk (sc_prohibit-c99-printf-format): Add SC rule.
* find/parser.c (parse_time): Change %ju to PRIuMAX.
(insert_num): Likewise.
* xargs/xargs.c (xargs_do_exec): Change %zu to PRIuMAX.
2018-12-02 15:52:53 +01:00
4c5cebf4eb maint: avoid continued strings
* 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.
2018-12-02 15:52:49 +01:00
bac58c5178 maint: adjust preprocessor indentation via cppi
Run 'cppi -a' for all *.[ch] files, and add a syntax-check rule for it.

* cfg.mk (sc_preprocessor_indentation): Add rule.
* find/defs.h: Run 'cppi -a' on this file.
* find/fstype.c: Likewise.
* find/oldfind.c: Likewise.
* find/parser.c: Likewise.
* find/pred.c: Likewise.
* find/print.h: Likewise.
* find/sharefile.h: Likewise.
* gnulib-local/lib/gcc-function-attributes.h: Likewise.
* lib/bugreports.h: Likewise.
* lib/buildcmd.c: Likewise.
* lib/buildcmd.h: Likewise.
* lib/extendbuf.h: Likewise.
* lib/fdleak.h: Likewise.
* lib/findutils-version.h: Likewise.
* lib/listfile.c: Likewise.
* lib/printquoted.h: Likewise.
* lib/regextype.h: Likewise.
* lib/safe-atoi.h: Likewise.
* lib/splitstring.h: Likewise.
* lib/system.h: Likewise.
* locate/locatedb.h: Likewise.
* xargs/xargs.c: Likewise.
2018-12-02 15:52:44 +01:00
74534e07a7 doc: remove configure option --enable-id-cache from README
* README (--enable-id-cache): Remove here, as the option has already
been removed in commit v4.6.0-11-gbcd85897.
2018-12-02 15:52:38 +01:00
e3fc99dbda doc: fix grammar issue in texinfo manual
* doc/find.texi (Systems without O_NOFOLLOW): Remove superfluous 'the'.

Reported by Martin Castillo in https://sv.gnu.org/bugs/?55022
2018-11-14 22:48:22 +01:00
815c737b42 maint: fix typo in comment in safe-atoi.c
* lib/safe-atoi.c (safe_atoi): s/chack/check/
2018-11-10 23:42:28 +01:00
e3a1254e5c doc: remove already retired configure --enable-debug from README
That configure option has been removed with commit 9951518076,
so also remove it from README.

* README (Special configure options): Do the above.
2018-11-10 23:36:08 +01:00
9b6fe18848 maint: update gnulib to latest
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".
2018-11-02 23:05:54 +01:00
42e134a484 maint: provide make target to update gnulib to latest
* 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.
2018-11-02 21:35:17 +01:00
e8599a9e33 find: add '-D all' to enable all debug flags
* 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.
2018-11-02 15:53:19 +01:00
8fc3403211 doc: use portable 'tail' call in texinfo example
* doc/find.texi (node Updating A Timestamp File): Use more portable
'tail -n1' instead of the deprecated form 'tail -1'.
2018-11-02 15:50:28 +01:00
7741d79fa3 doc: fix typo in 'xargs -l' examples in texinfo manual
* 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
2018-10-18 13:19:32 +02:00
013054ffc2 doc: fix the examples of the -perm option in the texinfo documentation
* 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
2018-10-15 08:46:04 +02:00