Commit Graph

2433 Commits

Author SHA1 Message Date
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
2f9fff9e1f tests: avoid FP when run as root
Test 'sv-bug-54171' produced a false-positive error as 'find' would
not fail for an unreadable directory when run as root.
Migrate the test to the newer shell-based tests, and add the
'skip_if_root_' guard to avoid a false-positive.

* find/testsuite/find.posix/sv-bug-54171.exp: Remove.
* find/testsuite/find.posix/sv-bug-54171.xo: Remove.
* find/testsuite/Makefile.am (EXTRA_DIST_XO, EXTRA_DIST_EXP): Remove the
above deleted test.
* tests/find/depth-unreadable-dir.sh: Add test.
* tests/local.mk (all_tests): Reference it.

Test FP introduced in commit v4.6.0-178-gdf4610d0.
Fixes https://savannah.gnu.org/bugs/?57762
and https://bugzilla.redhat.com/1799064
2020-02-10 18:54:40 +01:00
28f11d689d maint: update gnulib to latest
Run 'make update-gnulib-to-latest', mainly to avoid a gnulib test failure.

  > tests: Avoid GCC over-optimization caused by _GL_ARG_NONNULL attributes.

* gnulib: Update to latest.

Fixes: https://sv.gnu.org/bugs/index.php?57277
2020-01-06 01:53:37 +01:00
15528055c5 maint: avoid error from sc_prohibit_gnu_make_extensions
Since last gnulib update, the above syntax-check rule fails:

  Error: doc/Makefile: $< in a non implicit rule
  find_mono.html: find.texi
  ...
  make: *** [maint.mk:439: sc_prohibit_gnu_make_extensions] Error 1

* doc/Makefile.am (find_mono.html): Avoid $< in plain rules.
(findutils.texi_html_node.tar.gz): Likewise.

See also: <https://lists.gnu.org/r/bison-patches/2019-05/msg00017.html>
2020-01-01 17:45:20 +01:00
9820a15a43 maint: adjust to split out xstrtol-error gnulib module
* bootstrap.conf (gnulib_modules): Add the new module split from xstrtol.
* locate/locate.c: Include "xstrtol-error.h" for xstrtol_fatal.
2020-01-01 17:44:30 +01:00
d2d6c7abfe maint: update gnulib to latest
Run 'make update-gnulib-to-latest', mainly to update the copyright
year numbers with:

  > maint: update copyright notices

* bootstrap: Sync from gnulib/build-aux/bootstrap.
* gnulib: Update to latest.
* tests/init.sh: Sync from 'gnulib/tests/init.sh'.
2020-01-01 17:42:40 +01:00
f7ea96d2b8 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Likewise, here to avoid starting a year number range.
* All other files: Update copyright years via the above make run.
2020-01-01 16:22:52 +01:00
2497c63a29 maint: add entries to 'doc/.gitignore'
* doc/.gitignore (/find.html/, /find-maint.html/): Add entries for
HTML output directories.
(/find.pdf, /find-maint.pdf): Add entries for PDF files.
(/find-maint.dvi, /find-maint.ps): Add entries for other formats.
2020-01-01 16:22:48 +01:00
6ee9097249 parser.c: avoid "Condition 'nflags' is always false" in parse_version
* find/parser.c (parse_version): Remove 'nflags' variable.

Found by cppcheck.
2019-11-30 21:53:37 +01:00
3edff92a45 maint: adjust exemption list for sc_trailing_blanks
* cfg.mk (exclude_file_name_regexp--sc_trailing_blank): Remove the
regex part for 'find/testsuite/test_escapechars.golden' as that file
was removed in commit v4.6.0-214-g3f6b28c4.
2019-11-25 22:39:42 +01:00
6e55ad98b1 xargs: avoid trailing blank in -t,--verbose output
'xargs -t' had a trailing blank in the output, e.g.:
  $ echo a b | xargs -t 2>&1 | cat -e
  echo a b $
  a b$
POSIX mandates that the constructed command line "shall be written
to standard error, as it will be invoked", so avoid outputting the
trailing blank.
FWIW: This change still plays well with -p,--interactive, because
POSIX says to just output "?..." as a prompt after the -t output.

* xargs/xargs.c (print_args): Instead of outputting a blank after each
cmd_argv[i], output a blank before each item unless for the first one.
* tests/xargs/verbose-quote.sh: Remove trailing blanks from expected
stderr.
* xargs/testsuite/xargs.gnu/space-t-0.xe: Likewise.
* xargs/testsuite/xargs.sysv/empty-t.xe: Likewise.
* xargs/testsuite/xargs.sysv/empty_def-t.xe: Likewise.
* xargs/testsuite/xargs.sysv/s25-t.xe: Likewise.
* xargs/testsuite/xargs.sysv/space-t.xe: Likewise.
* xargs/testsuite/xargs.sysv/trace.xe: Likewise.
* NEWS: Mention the change.

Reported by 積丹尼 Dan Jacobson <jidanni@jidanni.org> in:
    https://bugs.gnu.org/?57291
2019-11-25 22:39:33 +01:00
a0169f9aac doc: use "symbolic link" instead of "symlink" consistently
* doc/find.texi (-printf): Change the shorter term "symlink" to
"symbolic link" for consistency with the rest of the Texinfo manual
and the man page.
(%Y): Likewise.
* find/find.1 (%Y): Likewise.

Suggested by 積丹尼 Dan Jacobson <jidanni@jidanni.org> in:
  https://lists.gnu.org/r/bug-findutils/2019-11/msg00003.html
2019-11-13 00:17:36 +01:00
4f8b9c3bc8 maint: fix typos in configure.ac
* configure.ac: Fix 2 typos in comments.
2019-09-13 20:06:48 +02:00
6975a373c1 doc: fix the command for pushing the tag in the release instructions
* doc/find-maint.texi (Making Releases): When pushing the tag, refer to
the remote name 'origin'.  Also avoid the --tags option because that
would publish all local tags, i.e., not only the given one.  Use RELTAG
instead of 'the-tag-name'.
2019-09-06 21:55:44 +01:00
74d0afd581 tests: output PATH value in log files
Adjust the PATH variable for the test setup a bit later, i.e., after
'tests/init.sh' has turned on 'set -x', so that the PATH value appears
in the test logfiles.

* init.cfg (fu_path_prepend_): Wrap immediate path_prepend_ call into
this new function.
* tests/find/debug-missing-arg.sh: Use it - right after sourcing in
'tests/init.sh'.
* tests/find/exec-plus-last-file.sh: Likewise.
* tests/find/execdir-fd-leak.sh: Likewise.
* tests/find/many-dir-entries-vs-OOM.sh: Likewise.
* tests/find/name-lbracket-literal.sh: Likewise.
* tests/find/printf_escape_c.sh: Likewise.
* tests/find/printf_escapechars.sh: Likewise.
* tests/find/printf_inode.sh: Likewise.
* tests/find/refuse-noop.sh: Likewise.
* tests/find/type_list.sh: Likewise.
* tests/misc/help-version.sh: Likewise.
* tests/sample-test: Likewise.
* tests/xargs/verbose-quote.sh: Likewise.
2019-09-03 21:13:30 +02:00
James Youngman
617e1392d2 doc: add missing newline in find.1, making some text non-bold. 2019-09-01 22:54:05 +01:00
James Youngman
a55895c183 doc: Add instructions on how to access source via git in README. 2019-09-01 22:43:44 +01:00
James Youngman
855dbdadbf find: Clarify description of %f and %h.
Fix https://savannah.gnu.org/bugs/index.php?35253
* doc/find.texi (Name Directives): Clarify description of %f and %h.
* find/find.1 (-printf): Likewise.
* NEWS: mention this change.
2019-09-01 14:55:57 +01:00
James Youngman
45d1608eb4 Fix Savannah bug 54730: additional examples for -quit.
* doc/find.texi (-quit): add another example.
* find/find.1 (-quit): add another example.
(-exec): Point out that -exec my-command {} + -quit
may not result in my-command being run.
(EXAMPLES): add an example for -quit.
* NEWS: mention this change.
2019-09-01 12:59:12 +01:00
Andreas Metzler
c31ef28989 Fix testsuite error on hurd and BSD related to ln
* find/testsuite/find.gnu/samefile-p-brokenlink.exp: Pass "-P" option to
enforce generation of hard link to symlink. link() behavior is
"implementation-defined" by POSIX and BSD/hurd chose a different behavior
than Linux.
This fixes http://bugs.debian.org/826357, https://savannah.gnu.org/bugs/index.php?48135
Also fix ln -s invocation to generate a valid symlink.
* NEWS: Mention that Savannah bug #48135 is fixed.
2019-09-01 09:22:56 +01:00
James Youngman
13c1d7faa5 gnulib: update to current. 2019-08-30 20:14:02 +01:00
James Youngman
416113ee3f gnulib: use nstrftime module instead of strftime.
These modules are actually synonymous, it's just that the module name
strftime is deprecated in favour of nstrftime.
2019-08-30 19:57:51 +01:00
James Youngman
7ada6ad941 doc: updates to release instructions.
Some additions to the release instructions:
 - Run bootstrap to update .po files
 - Enable fatal compiler warnings when performing the final build
 - Set RUN_EXPENSIVE_TESTS when running tests
 - Point out that configure.ac no longer contains the version.
 - Add a new Savannah "Release" value for the new release.
2019-08-30 19:46:43 +01:00
9ad78c90c7 find: fix minor memory leak in sharefile handling
When sharefile_fopen fails to open the given file, e.g. due to the lack
of permissions, then the name of the file is not freed.

$ valgrind -v --leak-check=full find/find . -maxdepth 0 -fprint /
...
==28139== 2 bytes in 1 blocks are definitely lost in loss record 2 of 11
==28139==    at 0x483677F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28139==    by 0x4923DBA: strdup (strdup.c:42)
==28139==    by 0x409E80: sharefile_fopen (sharefile.c:150)
==28139==    by 0x40CCA0: open_output_file (parser.c:3390)
==28139==    by 0x40CFA8: parse_fprint (parser.c:1010)
==28139==    by 0x408341: build_expression_tree (tree.c:1295)
==28139==    by 0x403AF7: main (ftsfind.c:712)

This memory leak is a trivial issue because find will terminate anyway
due to the error.

* find/sharefile.c (sharefile_open): Call entry_free instead of simple
free to also free the strdup-ed filename.
2019-08-30 00:24:27 +02:00
fe33eaa06c maint: post-release administrativa
* NEWS: Add new dummy release header.
2019-08-29 22:46:51 +02:00
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