2484 Commits

Author SHA1 Message Date
b38464865a build: fix linking on AIX7.2
Linking on AIX7.2 fails:
  ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
  ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock

Bruno Haible noticed that $(LIB_MBRTOWC) and $(LIB_SETLOCALE_NULL)
expand to -lpthread on that platform, so let's add them to LDADD.

Maybe we should better depend on a 'gnulib.mk' file generated by
'gnulib-import' in the long run, but let's fix this issue with the
simpler solution for now.

* find/Makefile.am (LDADD): Add $(LIB_SETLOCALE_NULL) and $(LIB_MBRTOWC).
* locate/Makefile.am (LDADD): Likewise.
* xargs/Makefile.am (LDADD): Likewise.
* lib/Makefile.am (regexprops_LDADD): Add definition.
v4.8.0
2021-01-09 17:06:23 +01:00
192c5b2f0c NEWS: update before release
* NEWS: Prepare for the 4.8.0 release: minor re-ordering, and update
entries with bug numbers.
2021-01-09 17:06:15 +01:00
325422e668 maint: fix GCC format attribute of checked_fprintf
* gnulib-local/lib/gcc-function-attributes.h: Rename
_GL_ATTRIBUTE_FORMAT_PRINTF to _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD
following gnulib's change:
https://git.sv.gnu.org/cgit/gnulib.git/commit/?id=387d654c
* find/print.c (checked_fprintf): Use it.
2021-01-09 13:48:20 +01:00
8e1ffd8186 maint: update gnulib to latest
Run 'make update-gnulib-to-latest'.  Let's use this latest version
for the imminent 4.8.0 release.

* bootstrap: Sync from gnulib/build-aux/bootstrap.
* gnulib: Update to latest.
2021-01-09 13:41:46 +01:00
Andreas Metzler
ee402bdd3a xargs: warn on conflicting options -L, -I, -n
* xargs/xargs.c (warn_mutually_exclusive): Add function to output the
new warning diagnostic.
(main): Call the above new function in order to show a warning message
if conflicting options (-L -l -I -i -n) are specified.
* xargs/xargs.1: Explicitly document the fact that -L -l -I -i -n
options are mutually exclusive and how xargs behaves when more than one
of these options are specified.
* doc/find.texi (node Conflicting xargs options): Likewise, add this
section with examples.
* xargs/testsuite/config/unix.exp (xargs_start): Replace the full path
of the xargs executable in the stderr output file by its basename.
* xargs/testsuite/xargs.gnu/P3-n1-IARG.xe: Add file containing the
expected output with the new warning diagnostic.
* xargs/testsuite/xargs.posix/L2-n2.xe: Likewise.
* xargs/testsuite/xargs.posix/rc-123.xe: Likewise.
* xargs/testsuite/xargs.sysv/l1n4.xe: Likewise.
* xargs/testsuite/xargs/testsuite/xargs.gnu/P3-n1-IARG.exp: Ensure the
error diagnostic is in C locale to avoid false positives in other locales.
* xargs/testsuite/xargs.posix/L2-n2.exp: Likewise.
* xargs/testsuite/xargs.posix/rc-123.exp: Likewise.
* xargs/testsuite/xargs.sysv/l1n4.exp: Likewise.
* tests/xargs/conflicting_opts.sh: Add test coverage for combinations
of the mutually exclusive options -I -L and -n.
* xargs/testsuite/Makefile.am (EXTRA_DIST_EXP): Reference the new tests.
(EXTRA_DIST_XO): Reference the new *.xo files.
(EXTRA_DIST_XE): Reference the new *.xe files.
* NEWS (Improvements): Mention the change.

Co-authored-by: Bernhard Voelker <mail@bernhard-voelker.de>

Discussed at https://savannah.gnu.org/bugs/?52137
Duplicate of https://savannah.gnu.org/bugs/?58156
2021-01-07 18:28:00 +01:00
62b59ea8b7 maint: avoid warning for printing pid_t on Solaris 11
The type pid_t is defined as long on Solaris 11.  Therefore, GCC
issued a -Wformat warning there when attempting to print as %d.

* find/exec.c: (launch): When writing the debug message, treat child_pid
as the wider long type.
2021-01-07 01:20:29 +01:00
21e23d1e60 tests: avoid FP on Solaris 11
'ls -i' outputs leading blanks before the inode number on Solaris 11.
The 'exp' reference file should not contain them.

* tests/find/printf_inode.sh (make_canonical): Strip off leading
blanks.
2021-01-07 01:20:22 +01:00
1b38632207 doc: avoid overfull \hbox issues in find.texi
"Overfull \hbox" results lines exceeding the page width, and therefore
may not even be readable.  At least they are ugly.

* doc/find.texi (node O_NOFOLLOW): Break long example lines into
the next lines.  While at it, update the version in that example to
4.8.0 (in good faith we'll have it in 2021), because we shouldn't
have a "*-git" version there.
2021-01-07 01:20:13 +01:00
75dd3bbfe2 pred.c: remove unused code
* find/pred.c (struct pred_assoc): Remove.
(pred_table): Remove.
2021-01-05 18:31:46 +01:00
41fc1218cb xargs: mention in --help that -I splits input at newlines
* xargs/xargs.c (usage): Amend the -I description to mention that
the input is split at newlines.
* NEWS: Mention the change.

Fixes https://savannah.gnu.org/bugs/?58149
2021-01-05 16:40:22 +01:00
792dda71c3 maint: update gnulib to latest
Run 'make update-gnulib-to-latest', mainly for these two commits:

  > free-posix: Work around GCC mis-optimization bug.
  > getgroups test: Avoid warning with glibc >= 2.32 and gcc >= 10.

* gnulib: Update to latest.
2021-01-04 01:24:15 +01:00
1c061fb003 tests/find/used.sh: make more robust
This test was prone to false-positive errors due to sub-second rounding
issues.  Failures have been seen on openSUSE's build system.

* tests/find/used.sh: Use larger time intervals for the future access
times of the test files (compared to the '-used N' search), and adjust
the expected output accordingly.
2021-01-04 01:21:27 +01:00
1ca94cd43b 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.
* tests/init.sh: Sync from 'gnulib/tests/init.sh'.
2021-01-02 01:46:55 +01:00
c5da48bcff maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
The format of the copyright year number range in Texinfo files is
"YEAR1--YEAR2" now, i.e., with 2x '-'.
* tests/sample-test: Likewise, here to avoid starting a year number range.
* All other files: Update copyright years via the above make run.
2021-01-02 01:46:51 +01:00
ddc53014ad maint: exempt 'doc/fdl.texi' from 'make update-copyright'
This file is a copy from gnulib and therefore should not get changed
by the yearly update.

* .x-update-copyright: Add pattern for that file.
2021-01-02 01:46:47 +01:00
d7ababc405 NEWS: mention the recent documentation changes
* NEWS (Documentation Changes): Document the changes of the previous
couple of man page and Texinfo manual changes.
2020-12-30 19:35:29 +01:00
e3a0d170fc find.1: remove vague mentioning of "Finding Files" from BUGS section
The user probably doesn't know that the reference to "Finding Files"
means to consult the Texinfo manual.  It seems to be sufficient to
note that -exec is more insecure than -execdir, so remove the reference,

* find/find.1 (.SH BUGS): Remove reference as described above.
While at it, remove the empty .P and the end of the section.
2020-12-30 19:19:40 +01:00
Andreas Metzler
7b1df8c514 find.1: fix various other issues
Namely:
- When referencing C system or library functions, refer to their
  man pages.
- Avoid oddly boldfaced ',' after a filename value.
- Remove superfluous ',' in the description of %h.
- Avoid extra space before comme after a boldfaced value.

* find/find.1: Do the above.

Reported by Helge Kreutzmann in
https://savannah.gnu.org/bugs/?59745
2020-12-30 19:19:38 +01:00
8dd1c99cc0 find.1: avoid confusing brackets a sentence
Two side notes in brackets in one sentence are disturbing the
reading flow.

* find/find.1 ("-exec command {} +"): Avoid having two bracketed side
notes in one sentence; borrow the better description from the Texinfo
manual.

Reported by Helge Kreutzmann in
https://savannah.gnu.org/bugs/?59745
2020-12-30 19:19:35 +01:00
9b7edc6884 doc: minor grammar change about a change in the past
In the description of -name patterns matching "hidden" files, i.e.,
those beginning with a dot, avoid talking in the future.
The change was back in version 4.2.2.
Maybe we should drop this hint about historic behavior at all.

* doc/find.texi (Base Name Patterns): Remove the word "will".
* find/find.1 (.SH STANDARDS CONFORMANCE): Likewise.
(.SH HISTORY): Likewise.
2020-12-30 19:19:32 +01:00
9302afb984 find.1: improve formatting of EXAMPLES section
The EXAMPLES sesction was hard to read because it was not clear to
which sentence a sample command belonged.  Use '.SS' and '.IP' markup,
and also indent the sample commands nicer.
Furthermore, change the formatting of file names as italice consistently.
Avoid empty lines, by either explicitly marking as empty via '.', or
by adding the invisible zero-width character '\&'.

* find/find.1 (.SH EXAMPLES): Do the above.
2020-12-30 19:19:22 +01:00
0e82bbc40c find.1: fix and improve some more markups
Mark whitespace in commands as non-breakable in more cases to avoid
unwanted hyphenation in the middle of commands.  For this to work,
some cases need to have some consecutive lines joined into one '.B'
or '.BR', the latter may require quoting the first argument within "...".

* find/find.1: Do the above.
(.IP -path): Improve indentation using '.in +4m', and set filename
as italic.
(.BR "ls -l"): Escape the minus of the option.
(.BR "\-size\ \-1\|048\|576c"): Add space before dot '.', the 2nd arg.
(.B \-exec ... \e+): No need to escape '+': remove '\e'.
(.B \-execdir ... \e+): Likewise.
(POSIXLY_CORRECT): Set the strings '+zzz' and '/zzz' in the -perm
description as italic.
2020-12-30 19:11:18 +01:00
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