summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* find: add -files0-from optionBernhard Voelker2021-05-0810-25/+542
| | | | | | | | | | | | | | | | | | | | | | | | * bootstrap.conf (gnulib_modules): Add argv-iter and same-inode. * find/defs.h (struct options): Add files0_from and ok_prompt_stdin members. * find/ftsfind.c (argv-iter.h, same-inode.h, xalloc.h): Add #include for gnulib headers. (process_all_startpoints): Change loop over starting point arguments to a loop using the argv_iter gnulib module. * find/parser.c (parse_table): Add option. (parse_files0_from): Declare and define function. (insert_exec_ok): Set options flag ok_prompt_stdin to true for the -ok and -okdir action. * find/util.c (usage): Add new option. (set_option_defaults): Initialize new struct members. * doc/find.texi (node Starting points): Add new section describing the regular processing of starting points, and that with the new option. Also mention in the description of -ok and -okdir that they conflict with the new option. * find/find.1: Document the new option here as well. * tests/find/files0-from.sh: Add test. * tests/local.mk (all_tests): Reference it. * NEWS (New features in find): Mention the new option.
* maint: update gnulib to latestBernhard Voelker2021-05-082-2/+14
| | | | | | | Run 'make update-gnulib-to-latest'. * bootstrap: Sync from gnulib/build-aux/bootstrap. * gnulib: Update to latest.
* maint: fix typo in commentBernhard Voelker2021-05-041-1/+1
| | | | * xargs/testsuite/xargs.posix/rc-125.exp: s/compinent/component/
* README: add GNU Project noticeBernhard Voelker2021-05-041-0/+18
| | | | | | * README: Add section to attract more people towards the GNU project. Inspired by a suggestion from Jose E. Marchesi <jemarch@gnu.org> on the gnu-prog-discuss mailing list.
* maint: fix typo in comments in parser.cBernhard Voelker2021-04-231-2/+2
| | | | * find/parser.c: s/fnd/find/; s/consiming/consuming/
* updatedb: exclude s3fs filesystems by defaultAndrew Gaul2021-02-232-0/+6
| | | | | | | | | | | s3fs is a popular way to access S3-compatible object storage. Its users have reported many bugs being surprised that updatedb crawls these remote storage systems which causes poor performance: https://github.com/s3fs-fuse/s3fs-fuse/issues?q=is%3Aissue+updatedb * locate/updatedb.sh (PRUNEFS): Add 'fuse.s3fs'. Copyright-paperwork-exempt: Yes
* doc: show environment variables in a consistent styleBernhard Voelker2021-01-313-72/+106
| | | | | | | | | | | | | In manual pages, set environment variables in bold; in the texinfo manual, use the @env{} macro consistently. Additionally, talk about PATH instead of $PATH in all manuals. * doc/find.texi: Do the above. * find/find.1: Likewise. * NEWS (Documentation Changes): Mention the fix. Reported by Helge Kreutzmann in https://savannah.gnu.org/bugs/?59963
* find.1: fix some formatting issuesHelge Kreutzmann2021-01-311-5/+3
| | | | | | | | | | | | * find/find.1 (Safer `...` approach): When referring to stat(2), change the formatting so that only the function name 'stat' is set in bold, not the '(2)'. (Pruning ...): Change formatting of the tilde backup suffix in the example to use simple quoting without additional markup. Fixes https://savannah.gnu.org/bugs/?59963 Copyright-paperwork-exempt: Yes
* xargs.1: clarify 'echo' as the default commandBernhard Voelker2021-01-311-1/+1
| | | | | | | | The default command changed from '/bin/echo' to 'echo' in version 4.5.11, but the commit 804ff7b90e only adjusted the Texinfo manual. * xargs/xargs.1 (.SH DESCRIPTION): Change the default command here in the man page as well.
* maint: post-release administrativaBernhard Voelker2021-01-091-0/+3
| | | | * NEWS: Add new dummy release header.
* build: fix linking on AIX7.2v4.8.0Bernhard Voelker2021-01-094-3/+4
| | | | | | | | | | | | | | | | | | 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.
* NEWS: update before releaseBernhard Voelker2021-01-091-15/+24
| | | | | * NEWS: Prepare for the 4.8.0 release: minor re-ordering, and update entries with bug numbers.
* maint: fix GCC format attribute of checked_fprintfBernhard Voelker2021-01-092-6/+7
| | | | | | | | * 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.
* maint: update gnulib to latestBernhard Voelker2021-01-092-4/+7
| | | | | | | | 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.
* xargs: warn on conflicting options -L, -I, -nAndreas Metzler2021-01-0716-18/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* maint: avoid warning for printing pid_t on Solaris 11Bernhard Voelker2021-01-071-2/+4
| | | | | | | | 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.
* tests: avoid FP on Solaris 11Bernhard Voelker2021-01-071-1/+5
| | | | | | | | '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.
* doc: avoid overfull \hbox issues in find.texiBernhard Voelker2021-01-071-4/+6
| | | | | | | | | | "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.
* pred.c: remove unused codeBernhard Voelker2021-01-051-69/+0
| | | | | * find/pred.c (struct pred_assoc): Remove. (pred_table): Remove.
* xargs: mention in --help that -I splits input at newlinesBernhard Voelker2021-01-052-2/+5
| | | | | | | | * 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
* maint: update gnulib to latestBernhard Voelker2021-01-041-0/+0
| | | | | | | | | 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.
* tests/find/used.sh: make more robustBernhard Voelker2021-01-041-42/+49
| | | | | | | | | 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.
* maint: update gnulib to latestBernhard Voelker2021-01-023-6/+20
| | | | | | | | | | | 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'.
* maint: update copyright year number rangesBernhard Voelker2021-01-02107-108/+109
| | | | | | | | | | 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.
* maint: exempt 'doc/fdl.texi' from 'make update-copyright'Bernhard Voelker2021-01-021-0/+1
| | | | | | | 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.
* NEWS: mention the recent documentation changesBernhard Voelker2020-12-301-0/+9
| | | | | * NEWS (Documentation Changes): Document the changes of the previous couple of man page and Texinfo manual changes.
* find.1: remove vague mentioning of "Finding Files" from BUGS sectionBernhard Voelker2020-12-301-2/+1
| | | | | | | | | 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.
* find.1: fix various other issuesAndreas Metzler2020-12-301-19/+31
| | | | | | | | | | | | | | 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
* find.1: avoid confusing brackets a sentenceBernhard Voelker2020-12-301-5/+4
| | | | | | | | | | | | 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
* doc: minor grammar change about a change in the pastBernhard Voelker2020-12-302-4/+4
| | | | | | | | | | | 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.
* find.1: improve formatting of EXAMPLES sectionBernhard Voelker2020-12-301-136/+252
| | | | | | | | | | | 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.
* find.1: fix and improve some more markupsBernhard Voelker2020-12-301-50/+47
| | | | | | | | | | | | | | | | | 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.
* find.1: set filenames in italicsBernhard Voelker2020-12-301-13/+13
| | | | | | | | | | | | | 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.
* doc: avoid starting sentences with an optionBernhard Voelker2020-12-302-6/+6
| | | | | | | | | | | | | | 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
* locate.1: improve formatting in BUGS sectionBernhard Voelker2020-12-301-2/+5
| | | | | * locate/locate.1 (.SH "BUGS"): Set 'locate' in bold, and the -z option in italic.
* doc: harmonize the end of the man pagesBernhard Voelker2020-12-305-153/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* updatedb.1: avoid Texinfo macro in man pageBernhard Voelker2020-12-301-2/+6
| | | | | * locate/updatedb.1 (DESCRIPTION): Replace @samp{} macro by .B setting, introduced in commit v4.6.0-44-g89ec0211.
* xargs.1: remove deprecated .PD macroBernhard Voelker2020-12-301-14/+0
| | | | | | | 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.
* xargs.1: improve indentation of list of exit statusesBernhard Voelker2020-12-301-9/+17
| | | | | * xargs/xargs.1 (EXIT STATUS): Use .RS + .IP + .RE to get a nicer indentation of the list of exit values.
* maint: use gnulib *_safer functions consistentlyBernhard Voelker2020-12-023-6/+6
| | | | | | | | | | | | | | | | 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.
* maint: use more *-safer gnulib modulesBernhard Voelker2020-12-025-0/+8
| | | | | | | | | | | | | | 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().
* doc: relate -anewer, -cnewer, and -newer to their -newerXY equivalentsBernhard Voelker2020-11-221-0/+2
| | | | | | | * doc/find.texi (Comparing Timestamps): Clarify that the above options are equivalent to the options -neweram, -newercm and -newermm. Suggested by Reuben Thomas.
* maint: fix bug URL in ChangeLog entryBernhard Voelker2020-10-301-0/+5
| | | | | | | | | * 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
* updatedb.1: fix formattingAndreas Metzler2020-10-251-1/+1
| | | | * locate/updatedb.1 (--prunepaths): Use apostrophe instead of acute accent.
* find.1: fix typo "onthe"Andreas Metzler2020-10-251-1/+1
| | | | * find/find.1 (-quit): Change to "on the".
* maint: update gnulib to latestBernhard Voelker2020-10-211-0/+0
| | | | | | | | 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.
* build: disable -Wformat-nonliteralBernhard Voelker2020-10-191-0/+2
| | | | | | | | | | | 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.
* find: avoid deprecation warnings with libselinux 3.1Bernhard Voelker2020-10-194-9/+8
| | | | | | | | | | | | | | | | | | | | 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.
* find: add error handling for strdup in the '-print %h' caseBernhard Voelker2020-10-191-1/+1
| | | | | | | * 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
* doc: avoid misunderstanding of '-printf %Ak' descriptionKamil Dudka2020-10-073-7/+17
| | | | | | | | | | | * 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