Commit Graph

2462 Commits

Author SHA1 Message Date
ee76276833 find.1: set filenames in italics
man-pages(7) says:
  Filenames [...] are always in italics, except in the SYNOPSIS
  section, [...]

Set filenames in italics, respectively change from boldface to italics.
While at it, mark whitespaces in commands as non-breakable via '\ '
to avoid unwanted hyphenation in the middle of commands.

* find/find.1 (-regex): Do the above.
(-exec,-execdir,-fprint): Likewise.
2020-12-30 19:11:18 +01:00
37079c08f2 doc: avoid starting sentences with an option
A sentence starting with an option looks odd:
  "... starting-points.  -maxdepth 0 means only apply ..."

* doc/find.texi (-maxdepth): Add "Using " to avoid having an option
at the start of the sentence.
(-mindepth): Likewise.
* find/find.1: Likewise.
While at it, mark the whitespace as non-breakable via '\ '.

Reported by Helge Kreutzmann in
https://savannah.gnu.org/bugs/?59745
2020-12-30 19:11:18 +01:00
5582094307 locate.1: improve formatting in BUGS section
* locate/locate.1 (.SH "BUGS"): Set 'locate' in bold, and the -z option
in italic.
2020-12-30 19:11:18 +01:00
ab3bb081ba doc: harmonize the end of the man pages
The "BUGS" section also documented how to report bugs.  This is better
done in a separate "REPORTING BUGS" section.  Add this section where
missing.  In it, redirect the user to the "How to get help" section
("#get-help") of the GNU findutils online page; also mention where
to report translation issues.

Bring the sections "SEE ALSO" and "COPYRIGHT" into the correct order,
which is: "REPORTING BUGS", "COPYRIGHT" and finally "SEE ALSO".
See 'man-pages(7)'.

The "SEE ALSO" section now refers to both the corresponding node in
the online HTML version of the Texinfo manual and lists the 'info' command.
Sort the entries referring to other man pages: first by their manual
section numbers, then alphabetically.

While at it, add an empty line (directive '.') before all '.SH' section
headers.

* find/find.1: Do the above.
* locate/locate.1: Likewise.
* locate/locatedb.5: Likewise.
* locate/updatedb.1: Likewise.
* xargs/xargs.1: Likewise.
2020-12-30 19:11:18 +01:00
90e60a2003 updatedb.1: avoid Texinfo macro in man page
* locate/updatedb.1 (DESCRIPTION): Replace @samp{} macro by .B setting,
introduced in commit v4.6.0-44-g89ec0211.
2020-12-30 19:11:18 +01:00
2ac3be4c99 xargs.1: remove deprecated .PD macro
Use of the .PD macro is discouraged, see:
https://man7.org/linux/man-pages/man7/groff_man_style.7.html

* xargs/xargs.1 (.SH OPTIONS): Remove all uses of the .PD macro.
2020-12-30 19:11:18 +01:00
83ca662d42 xargs.1: improve indentation of list of exit statuses
* xargs/xargs.1 (EXIT STATUS): Use .RS + .IP + .RE to get a nicer
indentation of the list of exit values.
2020-12-30 19:11:18 +01:00
dc1a69f6dc maint: use gnulib *_safer functions consistently
Avoid using fopen_safer and opendir_safer directly in favor of
letting gnulib transparently doing the work via "dirent--.h" and
"stdio--.h".

* find/oldfind.c (dirent-safer.h): Replace include ...
(dirent--.h): ... by this.
(process_dir): Change opendir_safer to the regular opendir call.
* find/sharefile.c (stdio-safer.h): Replace include ...
(stdio--.h): ... by this.
(sharefile_fopen): Change fopen_safer to regular fopen call.
* lib/fdleak.c (dirent-safer.h): Replace include ...
(dirent--.h): ... by this.
(get_proc_max_fd): Change opendir_safer to regular opendir call.
2020-12-02 02:14:00 +01:00
160e2f8258 maint: use more *-safer gnulib modules
See section "Handling closed standard file descriptors" in the gnulib
manual.

* bootstrip.conf (gnulib_modules): Add fcntl-safer, openat-safer
and unistd-safer.
* find/exec.c: Include "fcntl--.h" to use the *-safer variant of open()
or openat().
* find/pred.c: Likewise.
* locate/locate.c: Likewise.
* xargs/xargs.c: Likewise, and include "unustd--.h" to use the *-safer
variant of pipe().
2020-12-02 01:12:16 +01:00
f65445d23c doc: relate -anewer, -cnewer, and -newer to their -newerXY equivalents
* doc/find.texi (Comparing Timestamps): Clarify that the above options
are equivalent to the options -neweram, -newercm and -newermm.

Suggested by Reuben Thomas.
2020-11-22 16:08:18 +01:00
cc5d59382f maint: fix bug URL in ChangeLog entry
* build-aux/git-log-fix (v4.7.0-15-g6e55ad98): Tweak ChangeLog entry
for this commit during 'make dist' to reference the bug system on
Savannah instead of that on debbugs.gnu.org.

Reported by Axel Beckert in
    https://sv.gnu.org/bugs/?57291
2020-10-30 11:53:05 +01:00
Andreas Metzler
003c590ae8 updatedb.1: fix formatting
* locate/updatedb.1 (--prunepaths): Use apostrophe instead of acute accent.
2020-10-25 09:53:11 +01:00
Andreas Metzler
a9ac804528 find.1: fix typo "onthe"
* find/find.1 (-quit): Change to "on the".
2020-10-25 09:49:03 +01:00
fda5f28453 maint: update gnulib to latest
Run 'make update-gnulib-to-latest', mainly for these two commits:
  > selinux-at, selinux-h: port to SELinux 3.1
  > parse-datetime: Make the build rule work with parallel 'make'.

* gnulib: Update to latest.
2020-10-21 09:11:32 +02:00
51f2b26edd build: disable -Wformat-nonliteral
GCC-10.2.1 complains about format strings it was not able to check:

  print.c:529:11: warning: format not a string literal, format string not \
                           checked [-Wformat-nonliteral]
    529 |           strftime (altbuf, buf_size, timefmt, &altered_time);
        |           ^~~~~~~~

* configure.ac (compiler-warnings): Add -Wformat-nonliteral.
2020-10-19 23:58:14 +02:00
68c1a06f34 find: avoid deprecation warnings with libselinux 3.1
Libselinux 3.1 deprecates typedef 'security_context_t', leading to
several warnings like:

  defs.h:330:5: warning: ‘security_context_t’ is deprecated [-Wdeprecated-declarations]
    330 |     security_context_t scontext; /* security context */
        |     ^~~~~~~~~~~~~~~~~~

Replace all matches of 'security_context_t' by 'char *'.

* find/defs.h (struct predicate.args.scontext): Change to 'char *'.
(x_getfilecon): Adjust type of 3rd parameter.
* find/parser.c (fallback_getfilecon): Adjust type of 3rd parameter.
(optionh_getfilecon): Likewise.
(optionl_getfilecon): Likewise.
(optionp_getfilecon): Likewise.
* find/pred.c (pred_context): Adjust type of 'scontext' variable.
* find/print.c (do_fprintf): Likewise.
2020-10-19 23:57:22 +02:00
b818a7086b find: add error handling for strdup in the '-print %h' case
* find/print.c (do_fprintf): Change strdup call to xstrdup to ensure
proper error handling.  Reported by Infer.

Fixes https://sv.gnu.org/bugs/?59133
2020-10-19 19:02:07 +02:00
Kamil Dudka
efa4554930 doc: avoid misunderstanding of '-printf %Ak' description
* find/find.1 (-printf): Make it clear that the list of conversion
specification characters of '%Ak' is incomplete; refer to the
strftime() documentation.  While at it, document the F conversion
character which yields 'yyyy-mm-dd'.
* doc/find.texi (Time Formats): Likewise.
* NEWS: Mention the improvement.

Suggested in https://bugzilla.redhat.com/1882695
2020-10-07 00:31:16 +02:00
2035073c76 find: improve '-D exec' debug output
Previously, 'find -D exec' only gave helpful output right before the
invocation of complete_pending_execdirs, i.e., not for every child
execution of the -exec, -execdir, -ok and -okdir predicates.
Make the 'exec' debug output more useful and consistent.

* find/exec.c (launch): Output DebugExec diagnostics right before spawning
the child process, and after getting its exit status (unless we already
have regular error diagnotstic anyway, e.g. if the child has been
terminated by a signal).
* find/ftsfind.c (show_outstanding_execdirs): Remove.
(find): Remove invocation of the above function, and simplify.
* NEW: Mention the improvement.

Suggested by Philip Rowlands in https://sv.gnu.org/bugs/?59083
2020-09-17 00:39:13 +02:00
9f950b67bc find.1: use consistent quoting in example
* find/find.1 (EXAMPLES): Use (aq...(aq consistently around the -exec
arguments containing the placeholder '{}/...'.

Suggested in https://sv.gnu.org/bugs/?59012
2020-09-17 00:37:50 +02:00
319a65893c maint: fix typo in comment
* find/util.c: s/insure/ensure/
2020-09-16 23:52:37 +02:00
2c15992f51 doc: add examples for -maxdepth, -mindepth
* doc/find.texi (-maxdepth): Add examples.
(-mindepth): Reference them.

Suggested by 積丹尼 Dan Jacobson <jidanni@jidanni.org> in
https://lists.gnu.org/r/bug-findutils/2020-07/msg00006.html
2020-08-14 00:09:22 +02:00
0da0554e49 doc: clarify that 'find -perm +MODE' is unrelated to umask
* doc/find.texi (Test -perm pmode): Do the above.
* NEWS: Mention the change.

Reported by Mohamed Akram in
    https://sv.gnu.org/bugs/?58654
2020-08-14 00:09:17 +02:00
b9ddd2bca1 doc: enhance description of tests accepting numeric arguments in find.1
* find/find.1 (TESTS): Improve the description of tests accepting a
numeric argument that they match "less than, more than or exactly" the
given 'n', thus helping the user to remind to use '-n', '+n' or a bare
'n' (as decribed at the top).
* doc/find.texi (section find Expressions): Move section from chapter
"Introduction" to "Finding Files".  The description about the general
syntax of a find expression fits more naturally there, including the
already existing part about numeric arguments.
* NEWS: Mention the change.
Suggested in https://sv.gnu.org/bugs/?57025 .
2020-08-14 00:09:13 +02:00
2faa781ec9 find.1: clarify double dash '--' option
* find/find.1: Document that the '--' option is not much useful for
find, because if a path name following that would start with a `-',
then find would treat it as an expression argument.
* NEWS: Mention it.

Reported by Andreas Metzler <ametzler@bebt.de> in
https://sv.gnu.org/bugs/?58205
2020-08-14 00:09:09 +02:00
f2878945ac doc: display version of the GNU findutils on the title page
The first page of the Texinfo documentation should display the package
version the documentation corresponds to.  Also change the title
from "Finding Files" to "GNU Findutils ..." to better reflect the
package name.  These changes align the documentation better with
that of other GNU packages like e.g. grep.

* doc/find.texi: Do the above.  Furthermore, display the VERSION also
in the first sentence after the @direntry list.
While at it, enclose the FDL licence text in a @quotation block.
* doc/find-maint.texi: Likewise.
2020-08-14 00:09:03 +02:00
c0827572fd maint: explicitly copy fdl-1.3 from gnulib
* Makefile.am (update-gnulib-to-latest): Prompted by a probably
accidental difference between gnulib's fdl.texi and fdl-1.3.texi
(to be fixed in GNU standards first), change the command to
explicitly copy version 1.3 of the FDL.
* doc/fdl.texi: Update from 'gnulib/doc/fdl-1.3.texi'.

See https://lists.gnu.org/r/bug-standards/2020-08/msg00000.html
and https://lists.gnu.org/r/bug-gnulib/2020-07/msg00185.html
2020-08-14 00:08:42 +02:00
ce6d2b7a1b doc: change "allows to <verb>" to "allows <verb>ing"
* doc/find.texi: Use gerund after "allows".
As a side effect, this also avoids passive voice in some cases;
active voice is usually clearer.
2020-08-13 00:06:14 +02:00
9be67ec6f4 maint: fix typo in comment
* find/ftsfind.c (inside_dir): s/currentl/currently/
2020-08-13 00:06:06 +02:00
dff4077ecd doc: modernize example list of filesystem types for -fstype
* doc/find.texi (-fstype): Mention more common types.
2020-08-13 00:04:18 +02:00
777035bb3c doc: remove fts from configuration chapter
The corresponding configure option was removed with commit 42a28b0dfb.

* doc/find.texi (node fts): Remove section.
2020-07-20 23:47:20 +02:00
Bjarni Ingi Gislason
de3c6279f2 doc: fix warnings from "mandoc -Tlint" in man pages
mandoc: ./find/find.1:313:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./find/find.1:607:1: WARNING: skipping paragraph macro: sp after PP
mandoc: ./find/find.1:606:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./find/find.1:1678:2: WARNING: skipping paragraph macro: PP after SS
mandoc: ./find/find.1:2063:2: STYLE: fill mode already enabled, skipping: fi
mandoc: ./find/find.1:2302:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./find/find.1:2400:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./find/find.1:2455:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./locate/locate.1:282:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./locate/locatedb.5:153:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./locate/updatedb.1:128:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./xargs/xargs.1:316:2: STYLE: fill mode already enabled, skipping: fi
mandoc: ./xargs/xargs.1:327:2: STYLE: fill mode already enabled, skipping: fi

* find/find.1: Remove superfluous paragraph macros.
Remove superfluous requests ".fi".
* locate/locate.1: Likewise.
* locate/locatedb.5: Likewise.
* locate/updatedb.1: Likewise.
* xargs/xargs.1: Likewise.
2020-06-22 21:28:02 +02:00
Bjarni Ingi Gislason
8bff322b56 doc: fix warnings from "test-groff" in man pages
Output is from: test-groff -b -mandoc -T utf8 -rF0 -t -w w -z

  [ "test-groff" is a developmental version of "groff" ]
  Input file is ././find/find.1
  <./find/find.1>:365 (macro BR): only 1 argument, but more are expected
  <./find/find.1>:380 (macro BR): only 1 argument, but more are expected
  <./find/find.1>:1494 (macro BR): only 1 argument, but more are expected
  <./find/find.1>:1496 (macro BR): only 1 argument, but more are expected
  <./find/find.1>:1513 (macro BR): only 1 argument, but more are expected
  [...]
  Input file is ././locate/locate.1
  troff: <./locate/locate.1>:167: warning: trailing space

* find/find.1: Use a one-font (single letter) macro for a single argument.
* locate/locate.1: Remove a trailing space in a "string".
2020-06-22 21:23:36 +02:00
7c72d72838 doc: improve section 'Hard links' and fix 'find -L -samefile' description
* doc/find.texi (Hard links): Clarify that 'find -L -samefile FILE'
returns both hard links and symbolic links to FILE, and why.
Further attempt to improve the wording of the whole section by
avoiding wording like "you can ...", and instead describing more
how find works and behaves for the -samefile, -inum and -links
options.  Especially mention that -inum potentially returns files
with the given inode number but yet are no hard links per definition:
this happens if they are on a different file system, i.e., if they
have a different device number.

Fixes https://sv.gnu.org/bugs/?58458
2020-06-21 19:40:11 +02:00
f066937370 maint: copy FDL from gnulib instead of using it as module
Since the previous gnulib update, bootstrap outputs this warning:

  Notice from module fdl:
    Don't use this module! Instead, copy the referenced license file \
    into your version control repository.

See gnulib commit:
  https://git.sv.gnu.org/cgit/gnulib.git/commit/?id=88fc5afbccc9

* bootstrap.conf (gnulib_modules): Remove 'fdl'.
* doc/fdl.texi: Add file as a copy of 'gnulib/doc/fdl.texi'.
* doc/.gitignore (/fdl.texi): Remove to no longer ignore that file.
* Makefile.am (update-gnulib-to-latest): Add command to sync the file.
While at it, add the command to show the git status for
'tests/init.sh' as well.
2020-05-25 18:05:55 +02:00
b72ba2e332 maint: update gnulib to latest
Run 'make update-gnulib-to-latest', mainly for some performance
improvement for FTS with -L:

  > Tune fts for FTS_LOGICAL+FTS_NOSTAT

* gnulib: Update to latest.
2020-05-25 18:05:05 +02:00
2915d367aa maint: fix typo in comment
* find/tree.c (do_arm_swaps): s/evauating/evaluating/.
2020-05-23 17:05:13 +02:00
c1dd7c8a94 maint: bootstrap gnulib with --symlink
* bootstrap.conf (gnulib_tool_option_extras): Add --symlink option.
2020-04-22 19:38:19 +02:00
7642d172e1 find: fix -used predicate
* find/pred.c (pred_used): Reverse the check for the delta between
the atime and ctime of the file to accomodate to how pred_timewindow
is working.
Also return false if atime < ctime.
Bug introduced in FINDUTILS_4_3_3-1 in commit a4718831e1.
* tests/find/used.sh: Add test.
* tests/local.mk (all_tests): Reference the test.
* NEWS (Bug Fixes): Mention the fix.

Reported by Martin Schulte in
<https://lists.gnu.org/r/bug-findutils/2019-11/msg00010.html>
2020-04-22 19:35:13 +02:00
abec46d204 maint: update gnulib to latest, to avoid FTS crash on XFS
Run 'make update-gnulib-to-latest', mainly to pull in a fix for FTS
to avoid a crash when traversing a heavily changed XFS file system:

> fts: remove NOSTAT_LEAF_OPTIMIZATION

* NEWS (Bug fixes): Mention the fix.
* gnulib: Update to latest.
* bootstrap: Sync from gnulib/build-aux/bootstrap.

Discussed at:
<https://lists.gnu.org/r/bug-gnulib/2020-04/msg00068.html>
2020-04-19 09:17:29 +02:00
Kim Thor
44e995915f xargs.1: fix grammar issue
* xargs/xargs.1 (BUGS): Remove extra "the".
Fixes https://sv.gnu.org/bugs/?58193

Copyright-paperwork-exempt: Yes
2020-04-17 08:52:24 +02:00
e6149e4014 build: remove 'withfts.m4' from distribution
* m4/Makefile.am (EXTRA_DIST): Remove 'withfts.m4'; that file was removed
with commit 42a28b0dfb.
2020-03-20 08:18:41 +01:00
73734a24cf maint: fix clean rule in doc/ directory
'make clean' removed the file 'doc/find.texi' which is version controlled.

* doc/Makefile.am (CLEANFILES): Remove 'find.texi' to avoid that the
'clean' target removes that file.
Bug introduced in commit v4.6.0-228-g755a22b9.
2020-03-15 11:37:03 +01:00
6154e419b9 maint: ensure .deps/ in the project root is ignored by git
* .gitignore (.deps/): Add entry.
* find/.gitignore (/.deps/): Remove here.
* lib/.gitignore: Likewise.
* locate/.gitignore: Likewise.
* xargs/.gitignore: Likewise.
2020-03-15 11:07:13 +01:00
42a28b0dfb build: remove --without-fts configure option
Trying to use this option lead to this error since v4.5.17-6-gfc260795:
  configure: error: Using --without-fts is not longer supported

* configure.ac (FIND_WITH_FTS): Remove.
* m4/withfts.m4: Remove file.
* NEWS: Document this build-related change.
2020-03-15 10:57:15 +01:00
8f4dd0f712 doc: prefer https:// over http:// in more places
Use HTTPS for GNU, FSF, OpenGroup and Google URLs.

* build-aux/update-online-manual.sh: Switch to HTTPS.
* doc/find.texi (node Further Reading on Security): Likewise.
* lib/buildcmd.c: Likewise in a comment.
* NEWS: Likewise, and shorten a debbugs URL.
2020-03-15 10:54:36 +01:00
9282ea9e16 maint: fix issue in syntax-check
* cfg.mk (sc_prohibit_colon_redirection): Don't expect `|` to denote
the pipe character in git grep.
Sync fix from:
https://git.sv.gnu.org/cgit/coreutils.git/commit/?id=0e2d4e1425
2020-03-14 19:58:03 +01:00
7d226e6a45 maint: add sc_prohibit_or_fail syntax-check
The shell tests should use `cmd ... || fail=1` for detecting errors.
Add a syntax-check to ensure they don't use `cmd ... || fail` which
is a noop.

* cfg.mk (sc_prohibit_or_fail): Add syntax-check, borrowed from coreutils.
2020-03-14 19:51:33 +01:00
Peter Frost
10635bb14a doc: fix typo
* doc/find.texi (Name Directives): s/eample/example/
* find/find.1 (EXAMPLES): Likewise.

Fixes https://sv.gnu.org/bugs/?57807

Copyright-paperwork-exempt: Yes
2020-02-14 14:00:08 +01:00
Hugo Gabriel Eyherabide
ed1496f176 find.1: fix grammar issue in the description of -P
* find/find.1 (-P): Add "about".
Fixes https://savannah.gnu.org/bugs/?57775

Copyright-paperwork-exempt: Yes
2020-02-10 18:55:23 +01:00