* 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>
Dash as /bin/sh apparently does not know $'\n' syntax.
* tests/xargs/verbose-quote.sh: Define NL variable for newline character;
change from $'\n' syntax to the above variable when generating input
for xargs.
Fixes https://sv.gnu.org/bugs/?63934
There have been 626 commits on gnulib since the last update.
* bootstrap: Auto-update.
* bootstrap-funclib.sh: Likewise.
* gnulib: Update to latest.
* tests/init.sh: Likewise.
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>
* 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.
* 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.
The error diagnostic for wrong invocations with option that require
numeric arguments (-inum, -links, -gid, -uid) was wrong and not helpful:
$ find -gid
find: invalid argument `-gid' to `-gid'
* find/parser.c (parse_gid): Remove changing back of the ARG_PTR in
the error case; thus simplify.
(parse_inum,parse_links,parse_uid): Likewise.
(get_num): While at it, mention -gid and -uid in the comment as well.
(insert_num): Also improve the error diagnostic in the case the user
has provided a non-numeric argument. Previously, it was just "invalid
argument".
* tests/find/opt-numeric-arg.sh: Add test.
* tests/local.mk: Reference it.
* NEWS (Bug Fixes): Mention the fix.
Reported by Andreas Schwab <schwab@linux-m68k.org> in
<https://lists.gnu.org/r/bug-findutils/2023-01/msg00001.html>
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.
Run 'make update-gnulib-to-latest', mainly to update the copyright
year numbers with:
> maint: run 'make update-copyright'
This also pulls in the splitting of bootstrap into autopull.sh,
autogen.sh and bootstrap.
* autogen.sh: Add file.
* autopull.sh: Likewise.
* bootstrap-funclib.sh: Likewise.
* bootstrap: Auto-update.
* gnulib: Update to latest.
* tests/init.sh: Sync from 'gnulib/tests/init.sh'.
* tests/find/newer.sh: Add to improve test coverage.
* tests/local.mk (all_tests): Reference the test.
Co-authored-by: Bernhard Voelker <mail@bernhard-voelker.de>
Copyright-paperwork-exempt: Yes
Avoid the following warning:
configure.ac:208: warning: The macro `AC_HEADER_STDC' is obsolete.
* configure.ac (AC_HEADER_STDC): Remove, and ...
(AC_CHECK_INCLUDES_DEFAULT): ... add this instead.
findutils failed to build from source on musl-libc, because it failed
to detect gettext availability. Newer gettext fixes this:
Version 0.19.8 - June 2016
[...]
- The AM_GNU_GETTEXT Autoconf macro can now detect musl-libc's
gettext as a compatible implementation.
* configure.ac (AM_GNU_GETTEXT_VERSION): Update from 0.19.3 to 0.19.8.
(AM_GNU_GETTEXT_REQUIRE_VERSION): Add to make autopoint pull the latest
available version instead of the exact specified version.
* NEWS: Mention the change.
Reported via Andreas Metzler <ametzler@bebt.de> at:
https://sv.gnu.org/patch/?10203
Fixes: https://bugs.debian.org/1009874
Copyright-paperwork-exempt: Yes
Detected by `make findutils-check-smells` (ironically for itself):
error: ./Makefile.am:88: Spaces at start of makefile line
* Makefile.am (findutils-check-smells): Fix tab indentation of the
recipe, and re-indent for better reading.
Although usually a pattern containing a directory separator does not match
anything, a pattern solely consisting of one '/' still does (and has to)
for the root directory "/".
* find/parser.c (check_name_arg): Omit the warning in the case the
given pattern equals "/".
find/find.1 (-name): Clarify better that the pattern "/" is valid to
match the "/" directory.
* init.cfg (find_emits_warnings_): Add utility function.
* tests/find/name-slash.sh: Add test.
* tests/local.mk (all_tests): Reference it.
* MEWS (Bug Fixes): Mention the fix.
Fixes https://savannah.gnu.org/bugs/?62227
In the above build environment, HAVE_ENDPWENT seems to be defined to 0
instead of being #undef'ed. Hence the build fails:
parser.c: In function 'parse_user':
parser.c:75:20: error: expected expression before ')' token
75 | # define endpwent ()
| ^
parser.c:2463:7: note: in expansion of macro 'endpwent'
2463 | endpwent ();
| ^~~~~~~~
* find/parser.c (HAVE_ENDGRENT,HAVE_ENDPWENT): Change from #ifndef to
"#if !", and define the replacement code to "(void) 0".
Fixes https://github.com/openwrt/packages/issues/17912
Run 'make update-gnulib-to-latest' in order to use the latest version
for the imminent release.
* bootstrap: Sync from gnulib/build-aux/bootstrap.
* gnulib: Update to latest.
* doc/find.texi (Action -delete): Improve and re-structure:
Mention that -delete is able to remove directories (if they are empty),
that failure to delete a file changes the exit code to nonzero, and
clarify better the relation between -delete, -depth and -prune.
* find/find.1 (-delete): Align with the above mentioned section in the
Texinfo manual.
Fixes https://savannah.gnu.org/bugs/?61774
Originally reported by Chris Davies in
https://bugs.debian.org/1003339
Co-authored-by: Bernhard Voelker <mail@bernhard-voelker.de>
https://sparse.docs.kernel.org/
Running the tool against unviled the following warnings:
find/parser.c:328:7: warning: Using plain integer as NULL pointer
find/parser.c:328:10: warning: Using plain integer as NULL pointer
find/parser.c:328:13: warning: Using plain integer as NULL pointer
find/parser.c:466:49: warning: Using plain integer as NULL pointer
find/parser.c:656:45: warning: Using plain integer as NULL pointer
find/print.c:1024:30: warning: Using plain integer as NULL pointer
lib/regexprops.c:531:7: warning: symbol 'options' shadows an earlier one
lib/regextype.c:48:24: warning: symbol 'regex_map' was not declared. Should it be static?
locate/locate.c:131:25: warning: symbol 'check_existence' was not declared. Should it be static?
locate/locate.c:207:12: warning: symbol 'metacharacters' was not declared. Should it be static?
xargs/xargs.c:902:24: warning: symbol 'state' shadows an earlier one
xargs/xargs.c:542:23: warning: Using plain integer as NULL pointer
The fixes for these findings are all trivial, so let's apply them.
* find/parser.c (parse_table): Initialize pointer-type members of
the last element with NULL instead of 0.
(get_noop): Compare to NULL as end condition of for-loop.
(find_parser): Likewise.
* find/print.c (do_fprintf): Initialize linkname with NULL instead of 0.
* lib/regexprops.c (describe_all): Rename local variable options
to regopts to avoid name shadowing.
* lib/regextype.c (regex_map): Declare static.
* locate/locate.c (check_existence): Likewise.
(metacharacters): Likewise.
* xargs/xargs.c (main): Set eof_str to NULL instead of 0.
Run 'make update-gnulib-to-latest', mainly due to:
> license: fix GPLv3 texts to use a comma instead of semicolon.
* bootstrap: Sync from gnulib/build-aux/bootstrap.
* gnulib: Update to latest.
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: Adjust to use the single most recent year.
* All other files: Update copyright years via the above make run.
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'.
doc/find.texi (xargs options): Change 'grep -lz' to 'grep -lZ' as
input for 'xargs -0o' as only the latter will write a NUL after
each file name. Add -n1 to the xargs call.
Reported by Robin A. Meade in
https://savannah.gnu.org/bugs/?61341
On most modern systems like GNU/Linux, read(2)-ing from a directory file
descriptor will fail with EISDIR, but it succeeds e.g. on GNU/Hurd and
AIX-7.1/AIX-7.2.
tests/find/files0-from.sh: Skip the test case excercising a directory
argument for the -files0-from option when the system allows reading
from a directory.
On GNU/Hurd, the value 0 is a valid inode number, and is e.g. used
for /dev/console and /dev/tty. The find(1) program aborted on this
platform when the user specified the -inum test and when the search
visited such a file.
$ find /dev/null /dev/tty -inum 40799 -printf '%i:%p\n'
40799:/dev/null
find: util.c:330: get_info: Assertion `p->st_ino' failed.
Aborted
Likewise, 'find -printf %i' aborted when hitting such a file.
* find/defs.h (get_info): Remove declaration.
* find/pred.c (pred_inum): Remove the redundant assert for ST_INO
as parse_inum sets need_inum=true which ensures that the inode number
is known.
* find/util.c (get_info): Declare static, and simplify: remove the
assertions for the inode number and file type.
While at it, add condition !state.have_stat in the need_stat case
for consistency.
* tests/find/inode-zero.sh: Add test.
* tests/local.mk (all_tests): Reference it.
Problem introduced by the inum optimisation in commit 2bf001636e6.
Reported by Andrea Monaco <andrea.monaco@autistici.org> in
https://lists.gnu.org/r/bug-findutils/2021-12/msg00008.html
With the '-D stat' debugging option turned on, 'find -L' determined the
SELinux context information as if the -L (or -H) option was not given:
$ strace -ve getxattr,lgetxattr find -L . -maxdepth 0 -printf '%Z:%p\n'
getxattr(".", "security.selinux", 0x55b29a2b2d40, 255) = -1 ENODATA (No data available)
...
$ strace -ve getxattr,lgetxattr find -D stat -L . -maxdepth 0 -printf '%Z:%p\n'
lgetxattr(".", "security.selinux", 0x5649c91d8d40, 255) = -1 ENODATA (No data available)
...
* find/parser.c (set_follow_state): Move the DebugStat handling after
the switch statement, thus eliminating the if/else.
Bug present since adding the SELinux implementation in v4.5.5-42-g1a05af6a.
find(1) supports both searching for and printing of the birth time
of a file since 2007, but the documenation lacked the description
for the latter.
* doc/find.texi (node Time Directives): Add item for %B.
(node Time Formats): Mention that the described formats also apply to
the %B directive.
* find/find.1 (-printf format): Add description of %B.
* NEWS (Documentation Changes): Mention the change.
Fixes https://savannah.gnu.org/bugs/?61327
Do no longer output an error diagnostic when the input file of
the -files0-from option is empty.
* find/ftsfind.c (process_all_startpoints): Remove error diagnostic.
* doc/find.texi (node Starting points): Adjust documentation.
* find/find.1: Likewise.
* tests/find/files0-from.sh: Adjust test.
Suggested by Stephane Chazelas in
https://savannah.gnu.org/bugs/?60383#comment11
* find/testsuite/find.gnu/sv-bug-27563-execdir.exp: Guard test by
'safe_path' condition to avoid false-positive failures in case the
PATH variable contains the current directory '.' ... which lets the
`find -execdir` action fail with an error diagnostic.
Reported by Paxsali <akis.kapo@googlemail.com> in
https://savannah.gnu.org/bugs/?60383
Run 'make update-gnulib-to-latest' - thus pulling in 357 commits,
including the following which was also discussed in:
https://savannah.gnu.org/bugs/?60383
> test-framework-sh: remove unsafe entries from PATH
* gnulib: Update to latest.
* cfg.mk (local-checks-to-skip): Add and therefore disable sc_indent
as auto indent is too invasive for now.
* m4/mkinstalldirs.m4: Fix repeated word: s/can can/can/. Reported by
a new rule in sc_prohibit_doubled_word.
* m4/noreturn.m4: Likewise.
* tests/init.sh: Likewise.
The script to copy the documentation for the web to the CVS checkout
directory took the files from 'doc'. But as those files do not
reference the GNU stylesheet, the resulting online documentation
didn't look as fancy as usual.
Instead, copy the files from 'doc/manual' which gets created by the make
target 'web-manual'.
* build-aux/update-online-manual.sh: Call the 'web-manual' make target
instead of building the documentation files in 'doc/' explicitly.
Adjust the commands to copy the just-generated files accordingly.
Remove the PostScript format as that does not get generated by the
'web-manual' target; it is probably no longer used nowadays anyway.
* NEWS (Documentation Changes): Mention the change.
Reported by Charles Burkitt <cecburkitt@gmail.com> in
https://lists.gnu.org/r/bug-findutils/2021-10/msg00008.html