408 Commits

Author SHA1 Message Date
Lukáš Zaoral
cd8568758a find: make -mount POSIX 2024 compliant
* find/defs.h (struct options): Add mount member and rename
stay_on_filesystem to xdev.
* find/ftsfind.c (find): Set FTS_MOUNT flag when -mount is enabled.
* find/parser.c (parse_table): Use a separate parser for -mount.
(parse_mount): Declare and define function.
(parse_xdev): Use xdev option flag.
* find/util.c (set_option_defaults): Initialize new struct members.
* doc/find.texi (node Filesystems): Add new section describing the new
behaviour of -mount and specify the current behaviour of -xdev.
* find/find.1: Document the new -mount behaviour and specify current
behaviour of -xdev.
* NEWS (Changes in find): Mention the -mount behaviour change.
2026-01-02 11:48:31 +01:00
Bernhard Voelker
733bb9a054 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Adjust to use the single most recent year.
* All other files: Update copyright years via the above make run.
2026-01-02 11:46:15 +01:00
Bernhard Voelker
499e792fc0 maint: do not produce DVI-format manual anymore
The GNU standards don't require DVI-format documentation anymore:
https://lists.gnu.org/archive/html/bug-standards/2025-07/msg00011.html

* build-aux/update-online-manual.sh: Remove DVI format.
* doc/.gitignore: Remove ignore entries for DVI files.
2025-11-15 19:39:43 +01:00
Bernhard Voelker
deb3f7066d maint: use consistent references to standard files in messages
Use standard input instead of stdin, standard output instead of stdout,
and standard error instead of stderr in messages and documentation.
Inspired by coreutils commit:
https://cgit.git.sv.gnu.org/cgit/coreutils.git/commit/?id=c9a30d6781

* cfg.mk (sc_standard_outputs): Add syntax-check rule.
* doc/find.texi: Do the above.
* find/find.1: Likewise.
* locate/locate.1: Likewise.
* locate/locate.c: Likewise.
* xargs/xargs.1: Likewise.
* xargs/xargs.c: Likewise.
2025-11-15 19:39:43 +01:00
Bernhard Voelker
c41a617953 doc: clarify that POSIX Issue 8 is "IEEE Std 1003.1-2024"
* doc/find.texi: Do the above in various places.
* find/find.1:  Likewise.
* xargs/xargs.1: Likewise.
2025-11-15 19:39:43 +01:00
Bernhard Voelker
56a376a26d doc: state that POSIX from Issue 8 specifies 'find -iname'
* doc/find.texi (-iname): Document POSIX compliance.
* find/find.1 (COMPATIBILITY): Mark POSIX compliance of -iname.
2025-11-15 19:39:43 +01:00
Collin Funk
c18bba5c59 maint: ensure that new "make syntax-check"-run sc_codespell passes
* cfg.mk (codespell_ignore_words_list): Ignore false-positives.
(exclude_file_name_regexp--sc_codespell): Skip some file names.
* NEWS: Fix typos.
* README-hacking: Likewise.
* doc/find-maint.texi: Likewise.
* doc/find.texi: Likewise.
* bootstrap.conf: Fix typos in comments.
* find/ftsfind.c: Likewise.
* find/parser.c: Likewise.
* find/print.c: Likewise.
* find/testsuite/find.gnu/exec-one-rtn-fail.exp: Likewise.
* find/testsuite/find.posix/bracket-depth.exp: Likewise.
* find/testsuite/find.posix/exec-nogaps.exp: Likewise.
* find/testsuite/find.posix/files-not-expressions1.exp: Likewise.
* find/testsuite/find.posix/files-not-expressions2.exp: Likewise.
* find/testsuite/find.posix/files-not-expressions3.exp: Likewise.
* find/util.c: Likewise.
* init.cfg: Likewise.
* lib/regextype.h: Likewise.
* lib/splitstring.h: Likewise.
* locate/locate.c: Likewise.
* locate/updatedb.sh: Likewise.
* tests/find/exec-plus-last-file.sh: Likewise.
* tests/find/files0-from.sh: Likewise.
* tests/xargs/test-sigusr.c: Likewise.
* tests/xargs/verbose-quote.sh: Likewise.
* xargs/xargs.c: Likewise.
2025-11-15 19:39:02 +01:00
James Youngman
0cac25f6e7 doc: minor shell coding improvements in examples.
- Use -type f so that the timestamp of `subdir` is not relevant.
- Use LC_ALL=C with sort, tail, cut (as file names are not text).
- Use "$(...)" instead of just $(...).

Also mention that Issue 8 of the POSIX standard has been published
now.
2025-10-15 05:55:05 +01:00
James Youngman
cabfc3b184 find: point out that -newer is false when timestamps are equal. 2025-10-15 05:55:05 +01:00
danny mcClanahan
fbbda507c6 doc: fix typo in symbolics links node
* doc/find.texi (node Symbolic Links): s/directoires/directories/
* find/testsuite/find.gnu/execdir-hier.exp: Likewise here in a comment.

Copyright-paperwork-exempt: Yes
2025-08-24 14:19:50 +02:00
Bernhard Voelker
facc27e180 doc: regenerate regexprops.texi
* doc/regexprops.texi: Regenerate due to recent changes in gnulib regex.h
to align with current Emacs behavior (gnulib commit efd5c380ff), and also
due to the change of the node sort order in regextype.c in the previous
commit.

Reported by Collin Funk in
  https://lists.gnu.org/r/bug-gnulib/2025-07/msg00037.html
2025-07-09 20:53:21 +02:00
raf
1ef8d7c2cf doc: supplement list of actions that suppress default -print
* find/find.1 (EXPRESSION): Add missing -print0 and -fprint0 to
the list of actions that suppress the default -print action.
Sort items.
* doc/find.texi (find Expressions): Likewise.
* NEWS: Mention the fix.
2025-04-18 13:01:22 +02:00
raf
45530ee875 doc: fix the "Finding the Shallowest Instance" example in Texinfo manual
* doc/find.texi (Finding the Shallowest Instance): Add surrounding \(
and \) around the 3x -exec actions to correctly group them with higher
priority than the implicit '-a' for the following '-print'.  Otherwise,
only the SCM roots matching the last test, "CVS", would be printed.
Improve indentation of the multi-line command.
Add sample output for clarity.
While at it, fix a minor typo.

This bug was present since adding that example in 2008.
The very same issue was already fixed for the man page in commit
v4.6.0-55-g47d8fd38.

Fixes https://sv.gnu.org/bugs/?62259
2025-04-18 12:56:23 +02:00
Bernhard Voelker
85c67e9c3c doc: mention default command of xargs in 'Invoking xargs'
* doc/find.texi (node Invoking xargs): Add sentence about default
command 'echo'.

Reported by <toomas@rosin.ee> in
https://savannah.gnu.org/bugs/?66591
2025-01-05 22:00:00 +01:00
Bernhard Voelker
f1f6471ae8 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Adjust to use the single most recent year.
* All other files: Update copyright years via the above make run.
2025-01-04 11:43:53 +01:00
Christoph Anton Mitterer
a78812c62e doc: state that -execdir prepends the base names with "./"
The '{}' replacement done by the -execdir action prepends each entry,
i.e., the base names, with "./" unless for the root directory "/".

* doc/find.texi (-execdir): Document that behavior.
* find/find.1: Likewise.

Discussed at: https://sv.gnu.org/bugs/?66568

Copyright-paperwork-exempt: Yes
2024-12-24 14:07:30 +01:00
Bernhard Voelker
1da19bdba7 doc: maint: break lines at sentences in a paragraph to change
As the texinfo renderer is caring about proper layout, we can let sentences
start at the beginning of the line, thus making further changes easier
to review.

* doc/find.texi (-execdir): Break lines at the end of sentences.
2024-12-24 13:35:10 +01:00
Bernhard Voelker
ea9288c6be doc: fix typo in Texinfo manual
* doc/find.texi (node Leaf Optimisation): s/filssytems/filesystems/
Bug introduced in v4.5.10-9-gb28cc8c4 in 2011.

Reported by <firasuke@gmail.com> in
https://savannah.gnu.org/bugs/?66418
2024-11-10 16:35:17 +01:00
James Youngman
1dcdf3de8e find: -exec is terminated by + only if the prior arg is exactly '{}'
A "+" only terminates -exec when it immediately follows an argument
which is exactly "{}" (and not, for example, "{}x").  This fixes
Savannah bug 66365.

* NEWS: explain this change.
* doc/find.texi: update one place which omitted the '{}' before '+'.
* find/parser.c (insert_exec_ok): consider + to be special ony if it
  follows an argument which is exactly '{}'.
* tests/find/sv-bug-66365-exec.sh: test for this bug.
* tests/local.mk: add the new test file.
2024-11-02 18:42:35 +00:00
Bernhard Voelker
b94986a897 doc: avoid sc_prohibit_unhyphenated_eof failure
'make syntax-check' complains:
  maint.mk: use "end-of-file", not "end of file"
  make: *** [cfg.mk:273: sc_prohibit_unhyphenated_eof] Error 1

* doc/find.texi (xargs options): Change as suggested by the SC rule.
2024-06-24 14:33:09 +02:00
James Youngman
76ddbb913e doc: State that find -print0 and xargs -0 are in POSIX from Issue 8.
The forthcoming Issue 8 of the POSIX standard includes find -print0
and xargs -0.
* doc/find.texi: find -print0 is no longer GNU-specific.  Similarly
for xargs -0.
* xargs/xargs.1: Likewise.
* NEWS: mention these changes.
2024-06-03 12:40:42 +01:00
James Youngman
dafd09f386 Standardize on "optimize" rather than "optimise".
While this is often described as a UK/US spelling difference, the
"-ise" spelling is described as a variant by the Oxford English
Dictionary.  Therefore we prefer the "-ize" spelling.

* doc/find.texi: standardize on optimize.
* find/find.1: Likewise.
* find/parser.c: Likewise.
* find/pred.c: Likewise.
* find/tree.c: Likewise.
* NEWS: Likewise (except for historical entries).
2024-05-27 20:11:31 +01:00
James Youngman
81c1ec3dca find: by default, disable the cost-based optimiser.
The cost-based optimiser re-orders predicates based on their expected
cost.  This re-ordering (as currently implemented) results in
user-visible changes to the order of operations.  An optimiser should
not do that.  For example, "-empty -readable" and "-readable -empty"
don't actually have the same effect since "-empty" fails on an
unreadable directory.  This fixes savannah bug #58427 (unless the user
specifies -O2).

* find/util.c(set_option_defaults): set default optimisation level to
1 instead of 2.
* find/tree.c(build_expression_tree): call do_arm_swaps (i.e. apply
cost-based optimisations) only at optimisation level 2 and above.
* find/find.1(-O): explain this change.
* doc/find.texi(Optimisation Options): explain this change.
* NEWS: mention this change.
2024-05-27 19:50:11 +01:00
James Youngman
b12fb8c216 Fix sv bug #51926: -xtype l fails on symlinks that have a loop
* find/pred.c (pred_xtype): if lstat fails with ELOOP, -xtype should
behave in the same way as -type.
(err_signals_broken_link): new function, true for ENOENT and ELOOP.
* doc/find.texi: document the fact that the "infinite loop" case is
handled like the "symbolic link target does not exist" case.
* find/find.1: Likewise.
2024-05-26 19:34:45 +01:00
James Youngman
9fed05088f [doc] Mention the changes to xargs -P
* doc/find.texi: explain how xargs -P affects the handling of the
SIGUSR1 and SIGUSR2 signals.
* xargs/xargs.1: Likewise.
2024-05-19 11:27:46 +01:00
James Youngman
ad636eae01 xargs: Wait for all children even if one exited with 255.
* xargs/xargs.c: fix Savannah bug #64451 (xargs -P exits before all
children have exited if one exits with status 255).
* xargs/xargs.1 (BUGS): mention this bug and the corrected behaviour.
* doc/find.texi: Likewise.
* NEWS: mention this bugfix.
2024-05-18 10:59:52 +01:00
James Youngman
8368fd0b2a [doc] add missing "-" to "-regextype". 2024-05-18 08:10:15 +01:00
James Youngman
b6fc295bfb [doc] -regextype is also a positional option. 2024-05-17 09:54:40 +01:00
James Youngman
9cbbb20bd5 [doc] Explain how locate's and find's default matching differ.
Example: The output of "locate foo" would include /home/james/foo/bar
while the output of "find /home -name foo" would not.
2024-05-17 09:45:46 +01:00
James Youngman
0582f8057e [doc] Explain that find defaults to GNU Emacs regexes.
This fixes Savannah bug #65297.
2024-05-17 09:29:17 +01:00
James Youngman
e549900aa6 [doc] Use @var{name}, not NAME or @var{NAME} in "Hard Links".
The @var{name} renders as NAME in Info, to this inconsistency is hard
to spot there.  The inconsistency is easier to spot in the typeset
output (e.g. PDF, Postscript).

Our solution is to use @var{name} even inside @samp, since that
works (and is intended to, according to the documentation).

This fixes Savannah bug #65305.
2024-05-17 08:42:07 +01:00
Bernhard Voelker
3df6a55800 maint: doc: warn about consistency of node menu entries
* doc/Makefile.am (AM_MAKEINFOFLAGS): Add configuration variable
CHECK_NORMAL_MENU_STRUCTURE=1 to warn about inconsistent menu structure
again: makeinfo >=6.8 would not do this anymore.
2024-04-15 18:58:11 +02:00
Bernhard Voelker
360b9b1ea8 doc: use upper-case 'B' as birthtime for -newerXY consistently
* doc/find.texi (deffn Test -newerXY reference): Change lower-case
'b' to upper-case 'B' as only the latter is recognized in the code.
* NEWS (Documentation Changes): Document the fix.

Documentation bug introduced with commit f361af57cdb3 in 2007.
Fixes https://savannah.gnu.org/bugs/?65378
2024-02-28 08:23:40 +01:00
Bernhard Voelker
ea1abfa968 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Adjust to use the single most recent year.
* All other files: Update copyright years via the above make run.
2024-01-02 09:13:29 +01:00
Bernhard Voelker
da8b3e965c doc/find.texi: avoid 'update-copyright' changing code sample output
* doc/find.texi (@node O_NOFOLLOW): Add a grep filter to 'find --version'
to only get the wanted "Features" line, thus avoiding to have a regular
Copyright line in the texi file.  Previously, that place always had to
be reverted after 'make update-copyright'.
2024-01-02 09:06:52 +01:00
Bernhard Voelker
e6e2d10a8b doc: fix description of xargs options -i, --replace
The description of the --replace/-i options of xargs in the Reference
chapter said that the replace-str would only be allowed to be omitted
for -i while this holds also true for the long option --replace.

A similar description of the same options in Interspersing File Names
was missing the '[]' to mark the REPLACE-STR as optional for -i.

* doc/find.texi (xargs options): Document that omitting the REPLACE-STR
is allowed for --replace, too.  Further align the description with
that in ...
(Interspersing File Names): ... here.  Mark the replace-str as optional
for -i by surrounding with '[]'.
2023-10-02 08:51:56 +02:00
Bernhard Voelker
3acecd2153 doc: use option --replace instead of deprecated -i in xargs example
* doc/find.texi (subsection Coping with odd filenames too):
Change the deprecated -i option to --replace.
* NEWS (Documentation Changes): Document the change.
2023-10-02 08:49:10 +02:00
Bernhard Voelker
ad4e2bdde0 doc: use option -L instead of deprecated -l in xargs examples
* doc/find.texi: Change the deprecated -l option to -L 1 in various
xargs(1) examples.
* NEWS (Documentation Changes): Document the change.

Reported by Sebastian Carlos in
Fixes https://savannah.gnu.org/bugs/?64480
2023-10-01 15:11:11 +02:00
Bernhard Voelker
bbd06d8e06 doc: document double dash "--" option delimiter for xargs
* doc/find.texi (node xargs options): Add description of the "--"
option delimiter.
* xargs/xargs.1 (OPTIONS): Likewise.
* NEWS (Documentation Changes): Document the change.

Suggested by Dan Jacobson <jidanni@jidanni.org> in
<https://lists.gnu.org/r/bug-findutils/2023-04/msg00009.html>
2023-05-23 22:17:07 +02:00
Bernhard Voelker
277de38d4b doc: add 'bugs, reporting' to primary index
* doc/find.texi: Do the above.

Suggested by Dan Jacobson in:
<https://lists.gnu.org/r/bug-findutils/2023-04/msg00013.html>
2023-05-23 01:14:46 +02:00
Bernhard Voelker
db175578e3 doc: change find enty point to "Finding Files"
The previous entry point for 'info find' was "Invoking find" which
is not that enlightening for the user.   Change to the better choice.

* doc/find.texi (@direntry): Change target for 'find' to the
chapter "Finding Files".

Discussed at:
<https://lists.gnu.org/r/bug-findutils/2023-04/msg00006.html>
2023-05-22 23:15:34 +02:00
James Youngman
fc47dadea9 doc: describe history of find, xargs and locate. 2023-03-18 20:23:43 +00:00
Bernhard Voelker
7836aa1def doc: use "end-of-file" with hyphenation consistently
* cfg.mk (sc_prohibit_unhyphenated_eof): Add syntax-check rule.
* doc/find.texi: Change "end of file" to "end-of-file" in several places.
* xargs/xargs.1: Likewise.
* xargs/xargs.c (eof_str): Change comment to adhere to the new rule.
2023-02-13 20:46:48 +01:00
Bernhard Voelker
da65ab1e69 doc: improve description about when xargs stops processing
* doc/find.texi (Multiple Files): Clarify better that xargs will stop when
reading the EOF marker string specified with the --eof option, or when a
launched command exists with status 255.  Switch the two termination
conditions to reflect the behavior.

Fixes RT #1912852.
2023-02-13 20:46:42 +01:00
Bernhard Voelker
73d020f472 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Adjust to use the single most recent year.
* All other files: Update copyright years via the above make run.
2023-01-01 23:51:15 +01:00
Bernhard Voelker
5c43cfb05c maint: avoid unportable 'grep -q'
The upcoming gnulib update comes with the new syntax-check named
'sc_unportable_grep_q':

  maint.mk: unportable 'grep -q', use >/dev/null instead
  make: *** [maint.mk:1377: sc_unportable_grep_q] Error 1

Fix offending places.

* cfg.mk (sc_prohibit_test_calls_print_ver_with_irrelevant_argument):
Replace unportable '-q' by redirecting grep output to /dev/null.
* doc/find.texi (node Adding Tests): Likewise.
* init.cfg (find_emits_warnings_): Likewise.
2023-01-01 23:15:36 +01:00
Bernhard Voelker
4391e438a4 doc: generate manuals with makeinfo --no-split
* doc/Makefile.am (AM_MAKEINFOFLAGS): Add for --no-split option.
(find_mono.html): Remove --no-split from makeinfo invocation.
* NEWS (Documentation Changes): Document the change.
* doc/.gitignore (/find.info-1,/find.info-2): Remove entries.

Suggested by Antonio Diaz Diaz <antonio@gnu.org> in
https://lists.gnu.org/r/bug-findutils/2022-11/msg00001.html
2022-11-16 01:12:40 +01:00
Antonio Diaz Diaz
f9f1ffc850 doc: fix typo in maintainer manual
* doc/find-maint.texi (chapter Security): s/p[art/part/

Copyright-paperwork-exempt: Yes
2022-11-16 00:30:47 +01:00
Antonio Diaz Diaz
8ff8307fd6 doc: remove redundant @deffnx for option -files0-from from manual
* doc/find.texi (section Starting points): Remove @deffnx; the @deffn
above it is sufficient.

Copyright-paperwork-exempt: Yes
2022-11-16 00:27:06 +01:00
Bernhard Voelker
d3097b3325 doc: fix formatting typo in Texinfo manual
* doc/find.texi (LC_COLLATE): Change man-style `\-name' to @samp{-name}.
2022-04-24 13:37:26 +02:00