Copy the 'bootstrap' script from the 'build-aux' directory in gnulib
instead of from the 'top' directory. The former one already contains
the 'bootstrap-funclib.sh' code which can then be removed as well here.
Finally, remove the obsolete 'autogen.sh' and 'autopull.sh' scripts.
* autogen.sh: Remove.
* autopull.sh: Remove.
* bootstrap-funclib.sh: Remove.
* bootstrap: Update from 'gnulib/build-aux/bootstrap'.
* Makefile.am (gnulib-sync): Change the source dirsctory of 'bootstrap'
from 'top' to 'build-aux', and remove the copying of above obsolete
files.
NULL is best for C as discussed - for coreutils - at:
https://bugs.gnu.org/66221#53
* bootstrap.conf: Remove dependency on nullptr.
* s/nullptr/NULL/.
This effectively reverts 93ce19f0d5a1.
The sed(1) implementations at least on Solaris and the BSD familiy OSes do
not support the -i flag, and latest POSIX 2024 still does not specify it.
* tests/find/user-group-max.sh: Avoid 'sed -i' by redirecting to
another file ERR2.
This test failed on non-Linux systems:
- On Solaris 11, the output of the native df(1) tool has a different order,
and hence the detection of a usable mount point for the test fails.
Verify that df(1) is from GNU coreutils, or fall back to 'gdf',
else skip the test.
- On a FreeBSD system where /home was a symlink to /usr/home, the code
for finding a usable mount point failed, because the symlink itself
is on the '/' file system.
Ensure that the found mount point is identical to the original test
directory like /home etc.
* tests/find/mount-vs-xdev.sh: Try harder to use a GNU df(1) tool.
Check whether the found mount point is identical to the original
directory name, thus avoiding symlinks.
The .HP macro introduced only recently triggers a 'make check' errors:
env GROFF=groff ../build-aux/man-lint.sh . find.1
check_manpages_format_without_error_messages ( find.1): OK
check_manpages_with_groff_checkstyle_2 ( find.1): FAILED
an.tmac:./find.1:23: style: use of deprecated macro: .HP
make[3]: *** [Makefile:3112: findutils-check-manpages] Error 1
and
env GROFF=groff ../build-aux/man-lint.sh . locate.1 updatedb.1 locatedb.5
check_manpages_format_without_error_messages ( locate.1): OK
check_manpages_format_without_error_messages ( updatedb.1): OK
check_manpages_format_without_error_messages ( locatedb.5): OK
check_manpages_with_groff_checkstyle_2 ( locate.1): FAILED
an.tmac:./locate.1:18: style: use of deprecated macro: .HP
make[3]: *** [Makefile:3287: findutils-check-manpages] Error 1
make[3]: Target 'check-local' not remade because of errors.
The HP hanging paragraph would work nicely, but is marked as deprecated
in groff-1.23; the deprecations warning will disappear in groff-1.24.
Until then, use .TP instead to avoid the check errors.
* find/find.1: Change '.HP' to the '.TP' tagged paragraph macro.
Add a FIXME for 2027 to switch to .HP when groff-1.24 is more commonly
available.
* locate/locate.1: Likewise.
* xargs/xargs.1:
- Migrate from comma-separated to "stacked tag" formatting for command
options. This is easier to read and understand when option syntax is
complex, and eliminates the problem of the comma being misinterpreted.
Setting the comma in bold, not roman, might have increased this risk.
Stacking tags--without direct recourse to formatter requests--however
requires the use of a groff man(7) extension macro, `TQ` (from groff
1.20, 2009). Because this page needs to be portable to non-groff
formatters, define a page-local version after testing for its
nonexistence using other GNU troff extensions (the `do` request and
the `d` conditional expression operator). (Actually, the method here
is to test for `TQ`'s existence and then ignore the macro definition
if the test succeeds; the token `..` terminates whichever eventuates.)
- Use the `TQ` macro to stack paragraph tags presenting synonymous
options to xargs(1).
- Use the page-local `~~` string to put unbreakable spaces (where
supported) between short options and their arguments. (On the other
hand, if a paragraph tag breaks across lines, the document likely
requires revision.)
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
* xargs/xargs.1: Consistently use empty request before paragraphing macros
to aid document maintainers. This was already done, inconsistently.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
groff_man(7):
History
M. Douglas McIlroy ⟨m.douglas.mcilroy@dartmouth.edu⟩ designed,
implemented, and documented the AT&T man macros for Unix Version 7
(1979) and employed them to edit Volume 1 of its Programmer’s
Manual, a compilation of all man pages supplied by the system. The
package supported the macros listed in this page not described as
extensions, except P and the deprecated AT and UC. It documented
no registers and defined only R and S strings.
UC appeared in 3BSD (1980). Unix System III (1980) introduced P
and exposed the registers IN and LL, which had been internal to
Seventh Edition Unix man. PWB/Unix 2.0 (1980) added the Tm string.
4BSD (1980) added lq and rq strings. SunOS 2.0 (1985) recognized
C, D, P, and X registers. 4.3BSD (1986) added AT and P. Ninth
Edition Unix (1986) introduced EX and EE. SunOS 4.0 (1988) added
SB. Unix System V (1988) incorporated BSD’s lq and rq strings.
Except for EX/EE, James Clark implemented the foregoing features in
early versions of groff. Later, groff 1.20 (2009) resurrected
EX/EE and originated SY/YS, TQ, MT/ME, and UR/UE. Plan 9 from User
Space’s troff introduced MR in 2020.
* xargs/xargs.1: Favor `P` macro, which the page predominantly uses, over
`PP` (`LP` is not observed). `P` has been universally portable since 1986.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
* xargs/xargs.1:
Favor man(7) font macros over *roff font selection escape sequences.
Macros are (a) visually less cluttered, (b) interfere less with spell
checking, and (c), in groff man(7), automatically apply italic
corrections, which otherwise requires explicit use of GNU troff
extension escape sequences (`\/` and `\,`).
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
...not roman.
groff_man_style(7):
Font style macros
...
.I [text]
Set text in an italic or oblique face. Given no argument, I
plants a one‐line input trap; text on the next line, which
can be further formatted with a macro, is set in an italic
or oblique face.
Use italics for file and path names, for environment
variables, for C data types, for enumeration or preprocessor
constants in C, for variant (user‐replaceable) portions of
syntax synopses, for the first occurrence (only) of a
technical concept being introduced, for names of journals
and of literary works longer than an article, and anywhere a
parameter requiring replacement by the user is encountered.
An exception involves variant text in a context already
typeset in italics, such as file or path names with
replaceable components; in such cases, follow the convention
of mathematical typography: set the file or path name in
italics as usual but use roman for the variant part (see IR
and RI below), and italics again in running roman text when
referring to the variant material.
* xargs/xargs.1: Do the above.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
* xargs/xargs.1: Also set the braces in `-I{}` in bold, not roman,
since they are literal.
The `lq` and `rq` strings are widely portable.
groff_man_style(7):
Strings
\*(lq
\*(rq interpolate special character escape sequences for left and
right double‐quotation marks, \(lq and \(rq, respectively.
...
A contemporary man page needs none of the above. \*S is
superfluous; type size changes are invisible on terminals, and
macros that change it restore its original value afterward. Better
alternatives exist for the rest; simply use the \[rg], \[lq],
\[rq], and \[tm] special character escape sequences directly.
Unless you are aiming for a pathological level of portability——
perhaps composing a man page for consumption on simulators of 1980s
Unix systems (or Solaris 10 troff, though even it supports
“\(rg”)——avoid using the above strings.
...
Notes
Some tips on composing and troubleshooting your man pages follow.
...
• When and how should I use quotation marks?
As noted above in subsection “Font style macros”, apply quotation
marks to “brief specimens of literal text, such as article
titles, inline examples, mentions of individual characters or
short strings, and (sub)section headings in man pages”. Multi‐
word literals, such as Unix commands with arguments, when set
inline (as opposed to displayed between EX and EE), should be
quoted to ensure that the boundaries of the literal are clear
even when the material is stripped of font styling by, for
example, copy‐and‐paste operations. groff, Heirloom Doctools
troff, neatroff, and mandoc support all of the special characters
\[oq], \[cq], \[lq], \[rq], \[aq], and \[dq] described in
subsection “Portability” above. DWB, Plan 9, and Solaris 10
troffs do not. Interpolating the strings \*(lq and \*(rq
portably yields directional double quotation marks, if available,
in all these formatters (though neatroff does not supply a man
macro package), but they cannot reliably be used in macro
arguments.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
...for consistency with existing practice in findutils man pages.
* xargs/xargs.1: Set "find" (the command) and "-print0" in bold, not roman.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
Warnings from `groff -C -ww -man` in the forthcoming groff 1.24:
troff:xargs/xargs.1:295: warning: an escaped '~' is not portable to AT&T troff
troff:xargs/xargs.1:296: warning: an escaped '~' is not portable to AT&T troff
troff:xargs/xargs.1:296: warning: an escaped '~' is not portable to AT&T troff
troff:xargs/xargs.1:298: warning: an escaped '~' is not portable to AT&T troff
groff_man_style(1):
Portability
...
\~ Adjustable non‐breaking space. Use this escape sequence
to prevent a break inside a short phrase or between a
numerical quantity and its corresponding unit(s).
Before starting the motor,
set the output speed to\~1.
There are 1,024\~bytes in 1\~KiB.
CSTR\~#8 documents the B\~language.
\~ is a GNU extension also supported by Heirloom Doctools
troff 050915 (September 2005), mandoc 1.9.14
(2009‐11‐16), neatroff (commit 1c6ab0f6e, 2016‐09‐13),
and Plan 9 from User Space troff (commit 93f8143600,
2022‐08‐12), but not by DWB or Solaris 10 troffs.
* xargs/xargs.1:
Define a string to indirect use of `\~` escape sequence. On formatters
that don't support groff extensions, use the AT&T troff `\ `
(backslash-space) escape sequence, which isn't quite as good because it
is a space that is not only unbreakable, but unadjustable--which,
however, doesn't matter when formatting man pages with adjustment
disabled, as some implementations do (and which groff makes
configurable).
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
These instances represent hyphen-minus characters, so should be spelled
in man(7) source as `\-`.
* locate/locatedb.5: Do the above.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
...not roman, and protect them from hyphenation.
GNU troff, Heirloom Doctools troff, and mandoc all support use of the
`\%` hyphenation control escape sequence at the _beginning_ of a word
suppress its hyphenation. Other troffs do not. Indirect this
application of the escape sequence through a string, interpolating
nothing on formatters that don't advertise GNU compatibility via the
`.g` register. (This means that literals can hyphenate undesirably on
DWB, Solaris, and Plan 9 troffs.)
GNU troff, Heirloom Doctools troff, and mandoc all also support the GNU
`\:` extension to mark break points that should not produce hyphens.
Apply the same technique to avoid undesired formatting of a ':'
character on DWB, Solaris, and Plan 9 troffs.
* find/find.1: Do the above.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
The `\(lq` and `\(rq` and special character escape sequences are not
universally portable.
Traditionally, AT&T troff did not bother to identify these special
characters at all; it was apparently felt that adjacently setting
directional single quotes sufficed. You can discern this fact in
materials typeset by AT&T troff by observing what one might call
generous kerning of these glyphs when used as "double" quotes.
However, someone at the Berkeley CSRG had a brainwave, and for 4BSD in
1980, added strings named `lq` and `rq` to the man(7) package so that
man pages could access double quotes by whatever means the underlying
implementation had for realizing them. This excellent idea made it into
Unix System V (1988/9), so that every surviving troff implementation
known to me, including DWB and Solaris 10, supports them--save one. The
exception is Plan 9. Fortunately, the Plan 9 from User Space
("plan9port") project accepted a patch from me on 10 October to add
support there as well.[1]
Like the \*" string, \*(lq and \*(rq should not be used in quoted macro
arguments if one desires portability to AT&T troff-descended formatters
(other than Heirloom Doctools troff); if the implementation defines
these strings such that their interpolations contain `"`, undesired
output is the likely result.
[1] https://github.com/9fans/plan9port/pull/735
* find/find.1: Do the above.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
The `\(en` special character escape sequence is not universally
portable. Indirect it through a string definition.
* find/find.1:
* locate/locate.1:
* locate/locatedb.5:
* locate/updatedb.1:
* xargs/xargs.1: Do the above.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
An em dash is the more orthographically correct dash for a couple of
contexts where the page had been using an en dash (which denotes a
range), and its special character escape sequence is universally
portable to boot.
* find/find.1: \Replace "(en" by "\(em".
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
When using ` as the Unix shell's command output substitution operator,
use the portable *roff `\(ga` special character escape sequence to
ensure that we really format a grave accent rather than a typographer's
single quotation mark (‘).
* find/find.1: Do the above.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
The `\(dq` special character escape sequence is not universally
portable. Indirect it through a string definition. (GNU Bash also uses
this technique.[1])
Unfortunately, `"` is one of the worst-behaved and least-accessible
characters in AT&T troff; a pleasant Dr. Jekyll when used on text lines,
its Mr. Hyde persona erupts when used in macro calls, and is wholly
unpredictable to non-experts when appearing in request arguments.[2]
_Some_ AT&T troffs offer `\(dq` on _some_ output devices. AT&T troff
also has no mechanism for a document to define its own special character
escape sequences. GNU troff offers `\(dq` on all output devices.
[1] a8a1c2fac0/doc/bash.1 (L26)
[2] "For the (neutral) double quote, you have recourse to an obscure
syntactical feature of AT&T troff. Because a double quote can begin
a macro argument, the formatter keeps track of whether the current
argument was started thus, and doesn’t require a space after the
double quote that ends it. In the argument list to a macro, a
double quote that isn’t preceded by a space doesn’t start a macro
argument. If not preceded by a double quote that began an argument,
this double quote becomes part of the argument. Furthermore, within
a quoted argument, a pair of adjacent double quotes becomes a
literal double quote."
https://www.gnu.org/software/groff/manual/groff.html.node/Calling-Macros.html
* find/find.1: Do the above.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
* find/find.1:
- Use paragraphing macros to put vertical space above and below the
tables (where not already present) so that they looks more like
typographical "displays".[1]
- Simplify "XY" table definition (see groff's tbl(1) man page). This
simpler definition has the same result (and is more adaptable in the
event the text of the table is revised).
- Put horizontal rule below column headings in table that uses them.
- Use thin space escape sequences `\|` between the dots of an ellipsis;
the effect is visible only on typesetting devices.[2] I left the
dummy character escape sequence `\&` trailing it intact, but observe
for the edification of nit-pickers that it has no effect in this
context.[3]
[1] man(7) implementations are historically inconsistent with respect to
whether a `TS` macro call should put any vertical space on the
output, and compositional practices on the part of man page authors
have thus been, to quote Ingo Schwarze, "wildly inconsistent".
https://savannah.gnu.org/bugs/?62841
[2] groff_man_style(7):
Examples of ellipsis usage are shown above, in subsection
“Synopsis macros”. The idiomatic roff ellipsis is three dots
(periods) with thin space escape sequences \| internally
separating them.
[3] tbl(1):
Ordinarily, a table entry is typeset rigidly. It is not filled,
broken, hyphenated, adjusted, or populated with supplemental inter‐
sentence space.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
The man(7) macro package from AT&T troff and most of its descendants,
including those in DWB, Plan 9, and Solaris troffs, support at most six
arguments to any macro call.
* find/find.1: Quote all multi-word arguments to these macros, not just those
in excess of six arguments, as a reminder of defensive practice to document
maintainers.
Before and after on Plan 9 from User Space troff:
$ diff -b -U0 find-plan9port-[12].txt
--- find-plan9port-1.txt 2025-11-18 20:20:08.388887375 -0600
+++ find-plan9port-2.txt 2025-11-18 20:20:14.712881949 -0600
@@ -2068 +2068 @@
- Safer `find -print0 | xargs -0`
+ Safer `find -print0 | xargs -0` approach
@@ -2129 +2129,2 @@
- Traversing the filesystem just once en
+ Traversing the filesystem just once en for 2 different actions
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
* locate/locate.1 (HISTORY):
- Use paragraphing macro to put vertical space above the table so that
it looks more like a typographical "display".[1]
- Set table cells that overset the line on AT&T nroff (where the line
length is 65n) using text blocks.
- Issue `na` request in these text blocks to prevent the cell contents
from adjusting in the event the formatter/package/user has configured
man pages to employ adjustment by default. (Practices vary; it's a
long story.[2])
- Remove spaces around the configured tbl(1) tab character of `|`. This
certainly does make the table uglier in source form. Unfortunately,
AT&T tbl(1) takes those spaces deadly seriously and they impact the
computed cell (and therefore column) widths. GNU tbl has for decades
supported a "nospaces" region option to address precisely this
problem; unfortunately it is not portable to DWB 3.3, Plan 9, or
Solaris 10 troffs, and I suspect not to _any_ surviving System V
troff.
Fixes warning from tbl(1) in groff 1.23.0:
locate/locate.1:289: warning: table wider than line length minus indentation
[1] man(7) implementations are historically inconsistent with respect to
whether a `TS` macro call should put any vertical space on the
output, and compositional practices on the part of man page authors
have thus been, to quote Ingo Schwarze, "wildly inconsistent".
https://savannah.gnu.org/bugs/?62841
[2] "Some people do hate adjustment of nroff output, though, which is
why I added a feature to groff man(7) to support disabling it.
The history of this practice is inconsistent. Seventh Edition Unix
(1979) disabled adjustment of man pages when rendering in nroff
mode,[3] and BSD retained that disablement until death. SunOS
commented it as early as SunOS 2.0 (1985), thus restoring adjustment
in nroff mode, and retained that all the way through Solaris 10
(2005). When James Clark wrote groff starting in about 1989, his
man(7) implementation closely emulated SunOS. With the Solaris 11
release in 2010, Oracle discarded its AT&T-descended troff in favor
of the then-current groff release. [That's not quite true--see
below.] They're still on groff 1.22.2 (2013) today, and so they've
been adjusting their man pages in nroff mode for at least 40 years,
as has groff for about 35[]. I don't know what other System V
Unices did."
https://lists.gnu.org/archive/html/groff/2025-05/msg00001.html
(I made an incorrect claim in the foregoing; Solaris 11 still has
its AT&T troff around, but its man page rendering is now performed
by [an old version of] groff.)
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
* find/find.1:
* locate/locate.1: Use unbreakable spaces between options and their
arguments, potentially improving legibility.
The existing synopses are short enough that they don't break in such a
way as to promote confusion even on old-fashioned AT&T troffs that use a
line length of 65n in nroff mode (vs. groff man(7)'s historical 78n and
present-day 80n). Thus this change merely makes the synopses robust to
future changes.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
* find/find.1:
* locate/locate.1: Use `HP` hanging paragraph macro to indent
non-initial lines of synopsis. Temporarily disable adjustment.
An alternative approach would be to use groff man(7)'s `SY` and `YS`
extension macros; each man page would then need to define local versions
for portability to DWB 3.3, Plan 9, and Solaris 10 troffs.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
* find/find.1:
* locate/locate.1: Place thin space escape sequences between ellipsis
dots for more pleasant output when typesetting.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
* find/find.1:
* locate/locate.1:
* locate/updatedb.1:
* xargs/xargs.1: Favor man(7) font alternation macros over *roff font
escape sequences. When typesetting with groff(1), the macros
automatically apply italic corrections.
* locate/locate.1: Protect long option name literals from hyphenation.
GNU troff, Heirloom Doctools troff, and mandoc all support use of the
`\%` hyphenation control escape sequence at the _beginning_ of a word
suppress its hyphenation. Other troffs do not. Indirect this
application of the escape sequence through a string, interpolating
nothing on formatters that don't advertise GNU compatibility via the
`.g` register. (This means that literals can hyphenate undesirably on
DWB, Solaris, and Plan 9 troffs.)
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
Before and after, using DWB 3.3 troff (Plan 9 and Solaris 10 troffs are
similar):
$ diff -U0 find.1.dwb-[12].txt|head -n 19
--- find.1.dwb-1.txt 2025-10-13 10:09:17.024054824 -0500
+++ find.1.dwb-2.txt 2025-10-13 10:09:24.764012282 -0500
@@ -2039 +2039 @@
- [bu]
+ o Find files named core in or below the directory /tmp and
@@ -2054 +2053,0 @@
- Find files named core in or below the directory /tmp and
@@ -2064,2 +2063 @@
- [bu]
- Find files named core in or below the directory /tmp and
+ o Find files named core in or below the directory /tmp and
@@ -2080,2 +2078 @@
- [bu]
- Given that another program proggy pre-filters and cre-
+ o Given that another program proggy pre-filters and cre-
@@ -2097,2 +2094 @@
- [bu]
- Run file on every file in or below the current direc-
+ o Run file on every file in or below the current direc-
Further changes in the diff appear because the document now paginates
differently with these troffs. That's because a one-en-wide mark 'o'
(the ASCII representation of a bullet) fits within the 4n space allotted
by the document's `IP` calls, whereas "[bu]" does not.
Fixes warnings from "nroff -C -ww -man" in the forthcoming groff 1.24:
troff:./find/find.1:2260: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2277: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2305: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2326: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2349: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2372: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2392: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2402: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2415: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2431: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2442: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2459: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2471: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2498: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2542: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2597: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2618: warning: an escaped '[' is not portable to AT&T troff
troff:./find/find.1:2630: warning: an escaped '[' is not portable to AT&T troff
* find/find.1: Replace '\[bu]' by '\(bu'.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
* find/find.1:
* xargs/xargs.1: Replace blank lines with empty requests or paragraphing
macro calls as seems to be intended.
* find/find.1: Delete blank lines preceding paragraphing or sectioning
macros that serve only to put excess vertical space in the output.
* locate/locatedb.5: Replace blank lines with a dummy character
producing a blank output line as _might_ be intended.
groff_man_style(7):
? The empty request (.), which does nothing, vertically spaces the
input file for readability by the document maintainer. Do not
put blank (empty) lines in a man page source document. Some
man(1) programs ?squeeze? multiple blank output lines into one.
Fixes style warnings from `groff -rCHECKSTYLE=3 -man`:
an.tmac:/.../share/man/man1/find.1:87: style: blank line in input
...
an.tmac:/.../share/man/man1/xargs.1:231: style: blank line in input
...
an.tmac:/.../share/man/man5/locatedb.5:118: style: blank line in input
...
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
Style warning from `groff -rCHECKSTYLE=3 -man`:
an.tmac:/.../share/man/man1/find.1:9: style: 1 leading space(s) on input line
* find/find.1 (SYNOPSIS): Make an intended empty request work that way.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
Style warnings from `groff -rCHECKSTYLE=3 -man`.
an.tmac:/.../share/man/man1/locate.1:1: style: .TH missing third argument; \
consider document modification date in ISO 8601 format (YYYY-MM-DD)
an.tmac:/.../share/man/man1/locate.1:1: style: .TH missing fourth argument; \
consider package/project name and version (e.g., "groff 1.23.0")
...and similar.
groff_man_style(7):
.TH identifier section [footer‐middle [footer‐inside [header‐
middle]]]
...
By convention, footer‐middle is the date of the most recent
modification to the man page source document, and footer‐
inside is the name and version or release of the project
providing it.
* find/find.1:
* locate/locate.1:
* locate/locatedb.5:
* locate/updatedb.1:
* xargs/xargs.1: Add appropriate third and fourth arguments to `TH` macro calls.
To determine the revision date to include in the page, I used the Git
"AuthorDate" of the last commit consituting anything but a "bump" to the
copyright notice.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
Plan 9 and Solaris tbl, like Seventh Edition Unix tbl, do not support
the 'x' column modifier. This extension appeared in DWB tbl by version
3.3 and early in GNU troff development (both circa 1990). I suspect,
but do not know, that other System V Unix tbl programs don't support it
either.
These old tbl programs are brutal when they encounter an unsupported
column modifier--they abort the preprocessor altogether ("tbl quits")
without attempting recovery.[1] Because tbl works as a filter, like
eqn, pic, soelim, or more familiar Unix tools (cat, sed, nl), this means
that tbl truncated the entire remainder of the input at that point. GNU
tbl is more robust, and discards input only until the next `.TE` token.
Due to this rudeness it's impossible to portably use 'x' without
rewriting the page text, and I know of no good way to parameterize a
table format. (tbl(1) doesn't have variables or anything like a macro
preprocessor. *roff strings are no use because tbl is a _pre_processor
for troff.)
To portably use 'x' requires a man page to test the underlying
implementation and potentially rewrite the page prior to installing it.
See a recent patch of mine to ncurses (merged in its 20251115 release)
for an approach potentially adaptable to findutils.
https://lists.gnu.org/archive/html/bug-ncurses/2025-11/msg00035.html
[1] I've proposed a merge request to Plan 9 from User Space to make its
tbl less intolerant. Even if accepted, that won't help anyone who
uses other "legacy" troffs.
https://github.com/9fans/plan9port/pull/739
* find/find.1 (Functional Changes): Drop 'x' table modifier.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
Add some more tests exercising bind mounts on the same device which
should not be affected by -mount or -xdev, and tests with a loopback
file system and a bind mount from there.
* tests/find/mount-vs-xdev-bind.sh: Add test.
* tests/find/mount-vs-xdev-other-fs.sh: Likewise.
* tests/local.mk (all_root_tests): Reference them.
* NEWS (Changes in find): Clarify better what is the difference between
the -mount and -xdev options including an example. Also move the
topic to the top of the section due to its importance.
* find/defs.h (struct options): Add mount member and rename
stay_on_filesystem to xdev.
* find/ftsfind.c (find): Set FTS_MOUNT flag when -mount is enabled.
* find/parser.c (parse_table): Use a separate parser for -mount.
(parse_mount): Declare and define function.
(parse_xdev): Use xdev option flag.
* find/util.c (set_option_defaults): Initialize new struct members.
* doc/find.texi (node Filesystems): Add new section describing the new
behaviour of -mount and specify the current behaviour of -xdev.
* find/find.1: Document the new -mount behaviour and specify current
behaviour of -xdev.
* NEWS (Changes in find): Mention the -mount behaviour change.
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'; there have been 135 commits on gnulib
since the last update.
This is mainly for the following change making sc_copyright_check pass
again, but there are also other useful fixes and improvements:
> maint: run 'make update-copyright'
* gnulib: Update to latest.
* autogen.sh: Likewise.
* autopull.sh: Likewise.
* bootstrap: Likewise.
* bootstrap-funclib.sh: Likewise.
From a suggestion by G. Branden Robinson to use `groff -t -z -ww
-rCHECKSTYLE=2 -man`, by pointing to and example in
https://lists.gnu.org/archive/html/bug-findutils/2025-11/msg00004.html.
* configure.ac: discover the location of the groff binary.
* build-aux/man-lint.sh: also run groff with -rCHECKSTYLE=2. Use
groff at the path discovered during configuration.
* find/Makefile.am: Lint-check manpages during "make check",
not "make dist". Set the environment variable GROFF to the
location of the groff binary.
* locate/Makefile.am: Likewise.
* xargs/Makefile.am: Likewise.
Without this fix, we get this error from `groff -C -t -z -ww
-rCHECKSTYLE=2 -man find/find.1`:
troff: find/find.1:2255: warning: macro '."' not defined
troff: find/find.1:2255: warning: number register '[' not defined
* find/find.1: revert a change which caused a lint warning from
troff.
Prompted by the following bootstrap notice:
Notice from module ctype:
This module is deprecated. Use the module 'ctype-h' instead.
* bootstrap.conf (gnulib_modules): ctype -> ctype-h
Run 'make update-gnulib-to-latest'; there have been 450 commits on gnulib
since the last update.
This pulls in the new FTS_MOUNT flag needed for the upcoming changes
to -mount vs. -xdev mandated by POSIX Issue 8 (IEEE Std 1003.1-2024),
thanks to Lukáš Zaoral <lzaoral@redhat.com>:
> fts: Introduce the FTS_MOUNT flag.
* gnulib: Update to latest.
* bootstrap-funclib.sh: Likewise.
Avoid macro preprocessing when filling the parse_table for better
readability.
* find/parser.c (PASTE, PARSE_OPTION, PARSE_POSOPT, PARSE_TEST,
PARSE_TEST_NP, PARSE_ACTION, PARSE_PUNCTUATION): Remove macros.
(parse_table): Replace macro-based filling with regular structure entries.
Group entries by types: regular options, positional options, punctuation,
tests and actions; loosely sort within each group.
Remove duplicate "atime" entry introduced in commit 7102a229fa.
While at it, change -help and -version from ARG_TEST to ARG_OPTION.
As reported in <https://savannah.gnu.org/bugs/?67432>, it is easy to
confuse -0 with -O. Give a hint to translators.
* xargs/xargs.c (main): Add TRANSLATORS hints.
* bootstrap.conf (gnulib_modules): Add nullptr.
In code, prefer nullptr to NULL where either will do.
* cfg.mk (sc_prohibit_NULL): Direct to use nullptr instead.
(begword, endword): Add regex helper macros.
Use standard input instead of stdin, standard output instead of stdout,
and standard error instead of stderr in messages and documentation.
Inspired by coreutils commit:
https://cgit.git.sv.gnu.org/cgit/coreutils.git/commit/?id=c9a30d6781
* cfg.mk (sc_standard_outputs): Add syntax-check rule.
* doc/find.texi: Do the above.
* find/find.1: Likewise.
* locate/locate.1: Likewise.
* locate/locate.c: Likewise.
* xargs/xargs.1: Likewise.
* xargs/xargs.c: Likewise.
- Use -type f so that the timestamp of `subdir` is not relevant.
- Use LC_ALL=C with sort, tail, cut (as file names are not text).
- Use "$(...)" instead of just $(...).
Also mention that Issue 8 of the POSIX standard has been published
now.
* doc/find.texi (node Symbolic Links): s/directoires/directories/
* find/testsuite/find.gnu/execdir-hier.exp: Likewise here in a comment.
Copyright-paperwork-exempt: Yes
* doc/regexprops.texi: Regenerate due to recent changes in gnulib regex.h
to align with current Emacs behavior (gnulib commit efd5c380ff), and also
due to the change of the node sort order in regextype.c in the previous
commit.
Reported by Collin Funk in
https://lists.gnu.org/r/bug-gnulib/2025-07/msg00037.html
Commit '1b53838ddf' has changed the order of the nodes, yet not
quite well. Let's use alphabetical sort order.
* lib/regextype.c (regex_map): Move 'awk' and 'egrep' entries up.
Run 'make update-gnulib-to-latest'; there have been 645 commits on gnulib
since the last update.
* gnulib: Update to latest.
* bootstrap: Likewise.
* bootstrap-funclib.sh: Likewise.
* find/find.1 (EXPRESSION): Add missing -print0 and -fprint0 to
the list of actions that suppress the default -print action.
Sort items.
* doc/find.texi (find Expressions): Likewise.
* NEWS: Mention the fix.
* find/find.1 (EXAMPLES): Fix the Pruning SCM example by changing the
attribution of the list from "Sample output" to "Sample directories".
The wrong attribution was made in commit v4.7.0-76-g9302afb9.
Then, add the output for clarity.
Fixes https://sv.gnu.org/bugs/?62259
* doc/find.texi (Finding the Shallowest Instance): Add surrounding \(
and \) around the 3x -exec actions to correctly group them with higher
priority than the implicit '-a' for the following '-print'. Otherwise,
only the SCM roots matching the last test, "CVS", would be printed.
Improve indentation of the multi-line command.
Add sample output for clarity.
While at it, fix a minor typo.
This bug was present since adding that example in 2008.
The very same issue was already fixed for the man page in commit
v4.6.0-55-g47d8fd38.
Fixes https://sv.gnu.org/bugs/?62259
Passing -files0-from several times silently overrides the previously given
file names, and only takes the last one. This behavior is quite common
and has precedence e.g. in 'du --files0-from ...'.
Add a test to document the current behavior.
* tests/find/files0-from.sh: Add a test passing -files0-from 3 times.
Discussed at:
https://sv.gnu.org/bugs/?66965
Reported at:
https://lists.gnu.org/r/bug-findutils/2025-03/msg00002.html
Output from "mandoc -T lint find.1": (shortened list)
1 input text line longer than 80 bytes: Some of the conversi...
1 missing date, using "": TH
1 unterminated quoted argument
-.-.
Output from "test-nroff -mandoc -t -ww -z find.1": (shortened list)
1 Use macro '.B' for one argument or split argument.
1 Use macro '.I' for one argument or split argument.
1 .BR is for at least 2 arguments, got 1
1 .IR is for at least 2 arguments, got 1
-.-.
Change a HYPHEN-MINUS (code 0x2D) to a minus(-dash) (\-),
if it
is in front of a name for an option,
is a symbol for standard input,
is a single character used to indicate an option,
or is in the NAME section (man-pages(7)).
N.B. - (0x2D), processed as a UTF-8 file, is changed to a hyphen
(0x2010, groff \[u2010] or \[hy]) in the output.
73:until an expression argument comes (which also starts with a `-').
74:Now, if a path argument would start with a `-', then
875:An exception to this is when using only a slash as \fIpattern\fR (`-name /'),
878:A warning is issued if you try to pass a pattern containing a - but not
879:consisting solely of one - slash, unless the environment variable
1095:The + and - prefixes signify greater than and less than, as usual;
1832:find / -name needle -print -quit
2252:.SS Safer `find -print0 | xargs -0` approach
2324:.SS Traversing the filesystem just once - for 2 different actions
2473:Pruning - omitting files and subdirectories
2590:.B $ find / -name needle -print -quit
2607:.B $ find . .. / /tmp /tmp/TRACE compile compile/64/tests/find -maxdepth 0 -printf '[%h][%f]\en'
2654:.B find -print0
2656:.B xargs -0
2743:find: possible unquoted pattern after predicate `-name'?
-.-.
Add a "\&" (or a comma (Oxford comma)) after "e.g." and "i.e.",
or use English words
(man-pages(7)).
Abbreviation points should be marked as such and protected against being
interpreted as an end of sentence, if they are not, and that independent
of the current place on the line.
546:and e.g. from a pipe.
565:The processing of the starting points is otherwise as usual, e.g.
-.-.
Wrong distance (not two spaces) between sentences in the input file.
Separate the sentences and subordinate clauses; each begins on a new
line. See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").
The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.
Remember coding: Only one command ("sentence") on each (logical) line.
E-mail: Easier to quote exactly the relevant lines.
Generally: Easier to edit the sentence.
Patches: Less unaffected text.
Search for two adjacent words is easier, when they belong to the same line,
and the same phrase.
The amount of space between sentences in the output can then be
controlled with the ".ss" request.
Mark a final abbreviation point as such by suffixing it with "\&".
Some sentences (etc.) do not begin on a new line.
Split (sometimes) lines after a punctuation mark; before a conjunction.
Lines with only one (or two) space(s) between sentences could be split,
so latter sentences begin on a new line.
Use
sed -e '/^\./n' \
-e 's/\([[:alpha:]]\)\. */\1.\n/g' $1
to split lines after a sentence period.
Check result with the difference between the formatted outputs.
See also the attachment "general.bugs"
[List of affected lines removed.]
-.-.
Split lines longer than 80 characters into two or more lines.
Appropriate break points are the end of a sentence and a subordinate
clause; after punctuation marks.
Add "\:" to split the string for the output, "\<newline>" in the source.
Line 1546, length 86
Some of the conversion specification characters might not be available on all systems,
Line 2487, length 82
.B $ find . \-name .snapshot \-prune \-o \e( \e! \-name \(aq*~\(aq \-print0 \e) \e
Line 2607, length 96
.B $ find . .. / /tmp /tmp/TRACE compile compile/64/tests/find -maxdepth 0 -printf '[%h][%f]\en'
Line 2645, length 87
.I A Research UNIX Reader: Annotated Excerpts from the Programmerâs Manual, 1971-1986
-.-.
Use \(en (en-dash) for a dash at the beginning (end) of a line,
or between space characters,
not a minus (\-) or a hyphen (-), except in the NAME section.
find.1:2324:.SS Traversing the filesystem just once - for 2 different actions
find.1:2473:Pruning - omitting files and subdirectories
-.-.
Remove reverse slash (\) in front of a period (.) that is to be printed
as such, and can not come a control character in the first column of a line.
Use "\&" to protect the period to avoid that.
This is a sign, that the man page was transformed from another source
file with a program, whose name is NOT mentioned in a comment.
2715:\.B \-perm +MODE
2717:\.B \-perm
-.-.
Split a punctuation mark from a single argument for a two-font macro
1048:.IR ./fubar3,
-.-.
Put a parenthetical sentence, phrase on a separate line,
if not part of a code.
See man-pages(7), item "semantic newline".
[List of affected lines removed.]
-.-.
One space only after an end of sentence.
find.1:339:no error message will be issued. This is the reason why such operation
find.1:546:and e.g. from a pipe.
find.1:960:find . \-path \(dq./sr*sc\(dq
find.1:1797:find . \-path ./src/emacs \-prune \-o \-print
find.1:1896:.B find . \-name afile \-o \-name bfile \-print
find.1:2309:.B $ find . \-type f \-exec file \(aq{}\(aq \e;
find.1:2384:.B $ find . \-perm 664
find.1:2399:.B $ find . \-perm \-664
find.1:2413:.B $ find . \-perm /222
find.1:2423:.B $ find . \-perm /220
find.1:2424:.B $ find . \-perm /u+w,g+w
find.1:2425:.B $ find . \-perm /u=w,g=w
find.1:2440:.B $ find . \-perm \-220
find.1:2441:.B $ find . \-perm \-g+w,u+w
find.1:2452:.B $ find . \-perm \-444 \-perm /222 \e! \-perm /111
find.1:2453:.B $ find . \-perm \-a+r \-perm /a+w \e! \-perm /a+x
find.1:2467:.RB ( "! \-perm /111"
find.1:2469:.B ! \-perm /a+x
find.1:2487:.B $ find . \-name .snapshot \-prune \-o \e( \e! \-name \(aq*~\(aq \-print0 \e) \e
find.1:2607:.B $ find . .. / /tmp /tmp/TRACE compile compile/64/tests/find -maxdepth 0 -printf '[%h][%f]\en'
find.1:2727:.B find . \-name afile \-o \-name bfile \-print
find.1:2731:.BR "find . \-name afile \-o \e( \-name bfile \-a \-print \e)" .
find.1:2741:.B $ find . \-name *.c \-print
find.1:2754:.B find . \-name frcode.c locate.c word_io.c \-print
find.1:2766:.B $ find . \-name \(aq*.c\(aq \-print
find.1:2767:.B $ find . \-name \e*.c \-print
-.-.
Put a subordinate sentence (after a comma) on a new line.
[List of affected lines removed.]
-.-.
Remove quotes when there is a printable
but no space character between them
and the quotes are not for emphasis (markup),
for example as an argument to a macro.
find.1:638:.IP "\-noleaf"
find.1:1154:.IP "\-writable"
find.1:1196:.IP "\-delete\fR"
find.1:1802:.IP "\-quit"
find.1:2233:.SH "EXAMPLES"
find.1:2638:.SH "HISTORY"
find.1:2659:.SH "COMPATIBILITY"
find.1:2724:.SH "NON-BUGS"
find.1:2770:.SH "BUGS"
-.-.
Section headings (.SH and .SS) do not need quoting their arguments.
1968:.SH "STANDARDS CONFORMANCE"
2120:.SH "ENVIRONMENT VARIABLES"
2233:.SH "EXAMPLES"
2638:.SH "HISTORY"
2659:.SH "COMPATIBILITY"
2724:.SH "NON-BUGS"
2770:.SH "BUGS"
2788:.SH "REPORTING BUGS"
2811:.SH "SEE ALSO"
-.-.
Space after an end of sentence.
temp.table:25:\-exec ... + 4.2.12 POSIX
-.-.
Output from "test-groff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z ":
an.tmac:<stdin>:2: style: .TH missing third argument; consider document modification date in ISO 8601 format (YYYY-MM-DD)
an.tmac:<stdin>:2: style: .TH missing fourth argument; consider package/project name and version (e.g., "groff 1.23.0")
an.tmac:<stdin>:690: misuse, warning: .BR is for at least 2 arguments, got 1
Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:1048: misuse, warning: .IR is for at least 2 arguments, got 1
Use macro '.I' for one argument or split argument.
-.-.
Additionally:
Change "1\ KB" to "1\ KiB"
Change indent "4m" to "4n". "4m" is too wide in troff-mode.
Inhibit hyphenation of "strftime" once (based on an A4 page size).
Create a "space" between some tags and the its following text by adding
" \&" to the tag.
Decrease indent after a bullet in lists.
Generally:
Split (sometimes) lines after a punctuation mark; before a conjunction.
* find/find.1: Change as described above.
Only user was inside a an #ifdef DEBUG / #endif block.
Introduced with -context in commit v4.5.5-42-g1a05af6a.
* find/parser.c (parse_context): Remove #ifdef/#endif block.
* find/defs.h (find_pred_name): Remove declaration.
In the current implementation, GNU find accepts the operators '!', ',',
'(' and ')' with a leading dash, e.g. '-!'.
Let's issue a warning to see if anyone relies on that odd behavior.
With a later release, let's fix the parser, and not accept these anymore.
* find/parser.c (find_parser): Issue a warning in the case one of the
above operators has been passed with a leading '-'.
* tests/find/operators-wrong-with-dash.sh: Add test.
* tests/local.mk (sh_tests): Reference it.
* NEWS (Changes in find): Mention the change in behavior.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-03/msg00005.html
When gnulib's FTS returns FTS_DC indicating a directory cycle, then the
struct member 'fts_cycle' is not guaranteed to contain valid data.
Avoid dereferencing it when diagnosing the file system loop.
* find/ftsfind.c (issue_loop_warning): Change the error message to avoid
mentioning the other entry involved in the loop anymore.
(partial_quotearg_n): Remove now-unused function.
* NEWS (Bug Fixes): Mention the fix.
Reported by Dietmar Hahn in
<https://lists.gnu.org/r/bug-findutils/2025-01/msg00013.html>
Several predicate tests perform a numerical comparison based on the
comparison_type (COMP_GT, COMP_LT, COMP_EQ).
Factor that out into a utility function.
* find/pred.c (compare_num): Add static function.
(pred_gid, pred_inum, pred_links, pred_size, pred_uid): Use it.
* xargs/xargs.c (usage): Fix synopsis by wrapping COMMAND in '[...]',
because it is in fact optional. Also add a sentence that the default
COMMAND is 'echo'.
Seen on GCC 14:
getlimits.c:73:3: warning: stack-based buffer overflow [CWE-121] \
[-Wanalyzer-out-of-bounds]
73 | sprintf (limit + 1, "%" "ju", (uintmax_t) TYPE##_MAX); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... while limit is defined more than large enough.
* find/getlimits.c: Add pragma for GCC version >= 14.
The gnulib/NEWS file states:
SAFE_READ_ERROR and SAFE_WRITE_ERROR are now
obsolescent; callers can just check for < 0.
* xargs/xargs.c (xargs_do_exec): Adjust error handling of safe_read
accordingly.
Run 'make update-gnulib-to-latest'; there have been 1127 commits on gnulib
since the last update.
* gnulib: Update to latest.
* bootstrap: Likewise.
* bootstrap-funclib.sh: Likewise.
* cfg.mk (exclude_file_name_regexp--sc_fsf_postal): Add to exempt the
script build-aux/src-sniff.py from this syntax-check.
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.
The '{}' replacement done by the -execdir action prepends each entry,
i.e., the base names, with "./" unless for the root directory "/".
* doc/find.texi (-execdir): Document that behavior.
* find/find.1: Likewise.
Discussed at: https://sv.gnu.org/bugs/?66568
Copyright-paperwork-exempt: Yes
As the texinfo renderer is caring about proper layout, we can let sentences
start at the beginning of the line, thus making further changes easier
to review.
* doc/find.texi (-execdir): Break lines at the end of sentences.
Similar to commit 889d001ab750 which handles vanished files better,
also fix the race for subdirectories (FTS_DNR).
Reproducer:
In average, the following produced 6-10 failures out of 1000 runs:
$ mkdir testdir
$ while :; do mkdir testdir/foo; rmdir testdir/foo; done &
$ for f in $(seq 1000); do \
find testdir -ignore_readdir_race -ls ; done >/dev/null
find: 'testdir/foo': No such file or directory
find: 'testdir/foo': No such file or directory
* find/ftsfind.c (consider_visiting): Return when FTS returned ENOENT
for FTS_DNR, i.e., unreadable directory, with -ignore_readdir_race.
* tests/find/readdir_race.sh: Add test.
* tests/local.mk (sh_tests): Reference it.
* NEWS (Bug Fixes): Amend and improve description of the previous fix.
See also https://savannah.gnu.org/bugs/?45930
Like in the recent commit, also change the following variables to follow
the renaming done in gnulib:
- LIB_SETLOCALE_NULL -> SETLOCALE_NULL_LIB,
- LIB_MBRTOWC -> MBRTOWC_LIB,
- LIB_EACCESS -> EUIDACCESS_LIBGEN.
* find/Makefile.am (LDADD): Change as described above.
* lib/Makefile.am: Likewise.
* locate/Makefile.am: Likewise.
* xargs/Makefile.am: Likewise.
* locate/Makefile.am (LDADD): Remove $(LIB_CLOSE) as it is no longer
required per Gnulib NEWS 2009-03-20.
* xargs/Makefile.am (LADD): Likewise.
* find/Makefile.am (LDADD): Likewise. Change $(LIB_EACCESS) to
$(EUIDACCESS_LIBGEN) per Gnulib NEWS 2023-01-07.
POSIX marked gettimeofday obsolete in POSIX.1-2017 and removed it in
POSIX.1-2024. Prefer Gnulib functions which use nanosecond resolution if
supported by the operating system.
* bootstrap.conf (gnulib_extra_files): Remove gettimeofday. Add gettime.
* find/util.c (now): Remove function.
(set_option_defaults): Use current_timespec.
* find/Makefile.am (LDADD): Rename $(LIB_CLOCK_GETTIME) to
$(CLOCK_TIME_LIB) per Gnulib NEWS 2023-01-07.
* doc/find.texi (node Leaf Optimisation): s/filssytems/filesystems/
Bug introduced in v4.5.10-9-gb28cc8c4 in 2011.
Reported by <firasuke@gmail.com> in
https://savannah.gnu.org/bugs/?66418
With newer gnulib, the sc_prohibit_always_true_header_tests check
fails with:
find/fstype.c:30:#if HAVE_MNTENT_H
maint.mk: do not test the above HAVE_<header>_H symbol(s);
with the corresponding gnulib module, they are always true
make: *** [maint.mk:969: sc_prohibit_always_true_header_tests] Error 1
* find/fstype.c (#include <mntent.h>): Remove as it is not actually used.
Now that <endian.h> is a part of POSIX 2024 it should become more
portable than <byteswap.h>.
* bootstrap.conf (gnulib_modules): Remove byteswap; add endian.
* locate/word_io.c: Include endian.h instead of byteswap.h.
(decode_value): Use htobe32 instead of bswap_32.
To avoid that new tests copied from the template sample-test lack the
executable bit, add the executable bit to that file.
* tests/sample-test: Set executable permission bit.
A "+" only terminates -exec when it immediately follows an argument
which is exactly "{}" (and not, for example, "{}x"). This fixes
Savannah bug 66365.
* NEWS: explain this change.
* doc/find.texi: update one place which omitted the '{}' before '+'.
* find/parser.c (insert_exec_ok): consider + to be special ony if it
follows an argument which is exactly '{}'.
* tests/find/sv-bug-66365-exec.sh: test for this bug.
* tests/local.mk: add the new test file.
The libgnulib.a library isn't (necessarily) below $(top_srcdir), it's
below $(top_builddir). This fixes a bug introduced in commit
85fc8966e5912390ad220d03b188dd319c85ed1e.
Seen on GCC 14.2.0:
tests/xargs/test-sigusr.c: In function 'run_xargs':
tests/xargs/test-sigusr.c:159:43: warning: declaration of 'optarg' \
shadows a global declaration [-Wshadow]
159 | run_xargs(const char *option, const char *optarg, int send_signal)
| ~~~~~~~~~~~~^~~~~~
...
/usr/include/bits/getopt_core.h:36:14: note: shadowed declaration is here
36 | extern char *optarg;
| ^~~~~~
* tests/xargs/test-sigusr.c (run_xargs): Rename 'optarg' parameter
to 'opt_arg'.
The postal address of the FSF has changed from Franklin Street to
Milk Street in Boston, yet according to RMS we shall better avoid
the postal address.
* build-aux/update-online-manual.sh (Copyright): Change from postal
address to the FSF URL.
Reproducer:
# Spin up lots of short-living processes.
$ while env true; do sleep .001; done &
# Invoke 'find' on the /proc file system;
# this pretty reliably gives the following error:
$ find /proc -ignore_readdir_race -maxdepth 3 > /dev/null
find: '/proc/845078': No such file or directory
* find/ftsfind.c (consider_visiting): Return when FTS returned ENOENT
with the option -ignore_readdir_race.
* NEWS (Bug Fixes): Mention the fix.
Fixes https://savannah.gnu.org/bugs/?45930
Building from git without bison available would result in
cc1: fatal error: ./parse-datetime.c: No such file or directory
which is not a very helpful error message.
Let gnulib bootstrap check for bison much earlier.
* README-hacking (Prerequisites): Add Bison explicitly.
* bootstrap.conf (buildreq): Add bison.
* cfg.mk (bootstrap-tools): Add gnulib variable with tools including
bison.
Co-authored-by: Bernhard Voelker <mail@bernhard-voelker.de>
Copyright-paperwork-exempt: Yes
'make syntax-check' complains:
maint.mk: use "end-of-file", not "end of file"
make: *** [cfg.mk:273: sc_prohibit_unhyphenated_eof] Error 1
* doc/find.texi (xargs options): Change as suggested by the SC rule.
The forthcoming Issue 8 of the POSIX standard includes find -print0
and xargs -0.
* doc/find.texi: find -print0 is no longer GNU-specific. Similarly
for xargs -0.
* xargs/xargs.1: Likewise.
* NEWS: mention these changes.
This check does not apply to gnulib code.
* cfg.mk (sc_spaces_not_tabs): add syntax check prohibiting
the use of tabs in Findutils code.
* build-aux/tabs-to-spaces.sh: Add small tool for converting
source file tabs to spaces.
The recent commit removed the variable 'all_tests' which is used by
sc_tests_list_consistency in cfg.mk.
* tests/local.mk (all_tests): Re-introduce and ...
(TESTS): ... use it here.
The ERE used lacks the grouping of the extensions and therefore would
also match files where the first two patterns are not at the end of
the line:
grep -E '\.sh|\.c$'
* cfg.mk (sc_tests_list_consistency): Add grouping (...) around the
sub-patterns. While at it, also remove the redundant escaping, i.e.,
\$$ -> $$ to be consistent with the rest of this file.
Run 'make update-gnulib-to-latest'; there have been 219 commits on gnulib
since the last update.
* gnulib: Update to latest.
* bootstrap-funclib.sh: Likewise.
While this is often described as a UK/US spelling difference, the
"-ise" spelling is described as a variant by the Oxford English
Dictionary. Therefore we prefer the "-ize" spelling.
* doc/find.texi: standardize on optimize.
* find/find.1: Likewise.
* find/parser.c: Likewise.
* find/pred.c: Likewise.
* find/tree.c: Likewise.
* NEWS: Likewise (except for historical entries).
The cost-based optimiser re-orders predicates based on their expected
cost. This re-ordering (as currently implemented) results in
user-visible changes to the order of operations. An optimiser should
not do that. For example, "-empty -readable" and "-readable -empty"
don't actually have the same effect since "-empty" fails on an
unreadable directory. This fixes savannah bug #58427 (unless the user
specifies -O2).
* find/util.c(set_option_defaults): set default optimisation level to
1 instead of 2.
* find/tree.c(build_expression_tree): call do_arm_swaps (i.e. apply
cost-based optimisations) only at optimisation level 2 and above.
* find/find.1(-O): explain this change.
* doc/find.texi(Optimisation Options): explain this change.
* NEWS: mention this change.
* find/pred.c (pred_xtype): if lstat fails with ELOOP, -xtype should
behave in the same way as -type.
(err_signals_broken_link): new function, true for ENOENT and ELOOP.
* doc/find.texi: document the fact that the "infinite loop" case is
handled like the "symbolic link target does not exist" case.
* find/find.1: Likewise.
This improved message is intended to help diagnose Savannah bug #65796.
* tests/misc/help-version.sh: when the --version ouptut of some
findutils program doesn't match the value of the VERSION environment
variable during "make check", issue a more detailed error message.
The syntax-check complains:
$ make syntax-check -k
...
maint.mk: the above files do not call bindtextdomain
make: *** [maint.mk:869: sc_bindtextdomain] Error 1
...
maint.mk: the above files do not include <config.h>
make: *** [maint.mk:509: sc_require_config_h] Error 1
...
maint.mk: use EXIT_* values rather than magic number
make: *** [maint.mk:411: sc_prohibit_magic_number_exit] Error 1
...
maint.mk: found unmarked diagnostic(s)
make: *** [maint.mk:916: sc_unmarked_diagnostics] Error 1
...
make: *** [cfg.mk:111: sc_tests_list_consistency] Error 1
...
maint.mk: Please make test executable: tests/xargs/test-sigusr.c
make: *** [cfg.mk:124: sc_tests_executable] Error 1
* cfg.mk (exclude_file_name_regexp--sc_bindtextdomain): Add test-sigusr.
(exclude_file_name_regexp--sc_unmarked_diagnostics): Define with the
pattern of the test-sigusr source file.
(sc_tests_list_consistency): Strip off ".c" suffix.
(sc_tests_executable): Exempt C source from this rule.
* tests/local.mk (TEST_EXTENSIONS): Add .c sources, needed also for
sc_tests_list_consistency to work.
* tests/xargs/test-sigusr.c (#include <config.h>): Add to avoid
sc_require_config_h failure.
(verify_signal_ignored): Call exit with EXIT_FAILURE instead of 1 to
avoid sc_prohibit_magic_number_exit failure.
(verify_signal_is_fatal): Likewise.
(verify_signal_is_nonfatal_with_p): Likewise.
* tests/.gitignore (/xargs/test-sigusr): While at it, add an entry
for the built test program here.
The following syntax-check rule fails:
$ make syntax-check
...
maint.mk: Use #include <hdr.h>, not #include "hdr.h" for the above
make: *** [maint.mk:619: sc_prefer_angle_bracket_headers] Error 1
The rule suggests using '#include <header.h>' instead of
'#include "header.h"' for headers that override system headers.
See gnulib documentation, section "Style of #include statements".
* find/parser.c (#include "fnmatch.h": Change from "..." to <...> style.
* find/pred.c (#include "fnmatch.h"): Likewise.
* find/tree.c (#include "fnmatch.h"): Likewise.
* lib/system.h (#include "error.h"): Likewise.
* locate/locate.c (#include "fnmatch.h"): Likewise.
* tests/xargs/test-sigusr.c (#include "error.h"): Likewise.
While we do use the gnulib safe_read function, we read input from
stdin using stdio, not direct Unix syscalls, so safe_read is not
involved.
* xargs/xargs.c: If a stdin read fails with EINTR, do it again. Use
SA_RESTART when setting up signal handlers. This fixes Savannah
bug #64442.
If the user uses -P we're not using only POSIX options, so in that
case it is OK to handle SIGUSR1/2. Otherwise (without -P) don't
handle these signals, meaning that they could cause xargs to
terminate.
* xargs/xargs.c: set signal handlers for SIGUSR1 and SIGUSR2 only if
the -P option was used. Warn if SIGUSR1 or SIGUSR2 is not defined.
* tests/xargs/test-sigusr: a new test for this.
* tests/local.mk: build and run the new test.
* NEWS: mention these changes.
* xargs/xargs.c: fix Savannah bug #64451 (xargs -P exits before all
children have exited if one exits with status 255).
* xargs/xargs.1 (BUGS): mention this bug and the corrected behaviour.
* doc/find.texi: Likewise.
* NEWS: mention this bugfix.
The @var{name} renders as NAME in Info, to this inconsistency is hard
to spot there. The inconsistency is easier to spot in the typeset
output (e.g. PDF, Postscript).
Our solution is to use @var{name} even inside @samp, since that
works (and is intended to, according to the documentation).
This fixes Savannah bug #65305.
Run 'make update-gnulib-to-latest'; there have been 518 commits on gnulib
since the last update, including the update of the copyright year numbers.
* gnulib: Update to latest.
* bootstrap: Likewise.
* bootstrap-funclib.sh: Likewise.
* tests/init.sh: Likewise.
* doc/Makefile.am (AM_MAKEINFOFLAGS): Add configuration variable
CHECK_NORMAL_MENU_STRUCTURE=1 to warn about inconsistent menu structure
again: makeinfo >=6.8 would not do this anymore.
* doc/find.texi (deffn Test -newerXY reference): Change lower-case
'b' to upper-case 'B' as only the latter is recognized in the code.
* NEWS (Documentation Changes): Document the fix.
Documentation bug introduced with commit f361af57cdb3 in 2007.
Fixes https://savannah.gnu.org/bugs/?65378
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.
* doc/find.texi (@node O_NOFOLLOW): Add a grep filter to 'find --version'
to only get the wanted "Features" line, thus avoiding to have a regular
Copyright line in the texi file. Previously, that place always had to
be reverted after 'make update-copyright'.
Run 'make update-gnulib-to-latest'; there have been 219 commits on gnulib
since the last update, including the update of the copyright year numbers.
* gnulib: Update to latest.
* autogen.sh: Auto-update.
* autopull.sh: Likewise.
* bootstrap: Likewise.
* bootstrap-funclib.sh: Likewise.
* tests/init.sh: Likewise.
Since gnulib update in findutils commit f293f5da80f9, there are more
files the make target 'gnulib-sync' alias 'update-gnulib-to-latest'
needs to copy.
* Makefile.am (gnulib-sync): Use 'fdl.texi' from gnulib now as it is
identical to 'fdl-1.3.texi'.
Copy autogen.sh, autopull.sh, bootstrap-funclib.sh and bootstrap from
the 'gnulib/top' directory.
The number parsing of integer arguments of the -user and -group option
was limited to INT_MAX, although the data types uid_t and gid_t are
larger on many systems, including x86_64 GNU/Linux.
* find/parser.c (UID_T_MAX, GID_T_MAX): Define.
(parse_group): Use xstrtoumax directly instead of safe_atoi, and check
the returned number vs. GID_T_MAX. Simplify error handling.
While at it, fix the est_success_rate guessing.
(parse_user): Use xstrtoumax directly instead of safe_atoi, and check
the returned number vs. UID_T_MAX.
* find/getlimits.c: Add helper utility to determine platform-local
limits for uid_t and gid_t, based on 'getlimits' of GNU coreutils,
written by Padraig Brady.
* find/Makefile.am (noinst_PROGRAMS): Make 'getlimits' as such.
* cfg.mk (exclude_file_name_regexp--sc_bindtextdomain): Add getlimits.c.
* find/.gitignore (/getlimits): Add entry.
* tests/find/user-group-max.sh: Add test.
* tests/local.mk (all_tests): Reference it.
* NEWS (Bug Fixes): Mention the fix.
Reported by Jocelyn Le Sage in
https://savannah.gnu.org/bugs/?64900
The long option --replace it not deprecated, only the short form.
* xargs/xargs.1: Clarify the above better by explicitly mentioning
the short -i form.
The description of the --replace/-i options of xargs in the Reference
chapter said that the replace-str would only be allowed to be omitted
for -i while this holds also true for the long option --replace.
A similar description of the same options in Interspersing File Names
was missing the '[]' to mark the REPLACE-STR as optional for -i.
* doc/find.texi (xargs options): Document that omitting the REPLACE-STR
is allowed for --replace, too. Further align the description with
that in ...
(Interspersing File Names): ... here. Mark the replace-str as optional
for -i by surrounding with '[]'.
* doc/find.texi: Change the deprecated -l option to -L 1 in various
xargs(1) examples.
* NEWS (Documentation Changes): Document the change.
Reported by Sebastian Carlos in
Fixes https://savannah.gnu.org/bugs/?64480
Now that Gnulib's 'error' module does proper static checking
for not returning, we need no longer use the 'die' macro.
This makes code easier to read for people that are used to 'error'.
* cfg.mk (sc_die_EXIT_FAILURE): Remove.
* src/die.h: Remove. All includes removed. All calls to 'die'
changed back to calls to 'error'.
* lib/Makefile.am (libfind_a_SOURCES): Remove 'die.h'.
* src/system.h: Include error.h. Stop including error.h elsewhere.
* find/ftsfind.c (process_all_startpoints): Avoid extra '\n' in error
diagnostics wrt/ -files0-from. Also avoid redundant "%s" formats.
* find/parser.c (parse_perm, parse_regex):
* lib/buildcmd.c (bc_push_arg):
Wrap calls to 'error' in block when under an if-condition and either
the if-condition or the 'error' invocation is spanning over more
than one line.
* find/tree.c (get_pred_cost): Make error message translatable - found
by sc_unmarked_diagnostics.
The predicates -used, -amin, -cmin, -mmin, -atime, -ctime, and -mtime
dumped core via an assertion when passing a not-a-number argument.
* find/parser.c (isnan): Add define.
(get_relative_timestamp): Diagnose when the return value of xstrtod
is not-a-number. Mention the missing parsers in the description of
the function.
* tests/find/arg-nan.sh: Add test.
* tests/local.mk (all_tests): Reference it.
* NEWS (Improvements): Mention the improvement.
Reported by Jaehan Yoon in
https://savannah.gnu.org/bugs/?64717
Newer troff(1) complains about the TE macro:
find/find.1:908: warning: tbl preprocessor failed, or it or soelim \
was not run; table(s) likely not rendered (TE macro called with \
TW register undefined)
* build-aux/man-lint.sh: Change from troff(1) to groff(1).
Not in the patch.
Output from "mandoc -T lint xargs.1":
mandoc: xargs.1:1:2: WARNING: missing date, using "": TH
#######
Change '-' (\-) to '\(en' (en-dash) for a numeric range.
GNU gnulib has recently (2023-06-18) updated its
"build_aux/update-copyright" to recognize "\(en" in man pages.
xargs.1:393:if any invocation of the command exited with status 1-125
xargs.1:518:Copyright \(co 1990-2023 Free Software Foundation, Inc.
#####
Change (or include a "FIXME" paragraph about) misused SI (metric)
numeric prefixes (or names) to the binary ones, like Ki (kibi), Mi
(mebi), Gi (gibi), or Ti (tebi), if indicated.
If the metric prefixes are correct, add the definitions or an
explanation to avoid misunderstanding.
254:more than 128KiB, 128Kib is used as the default value; otherwise, the
255:default value is the maximum. 1KiB is 1024 bytes.
#####
Reduce space between words.
51:prevents such problems. When using this option you will need to
94:command. Multibyte characters are not supported.
466:internally. This means that there is an upper limit on the length
492:a line which is longer than it can handle. This is not an ideal
#####
Change -- in x--y to \(em (em-dash), or, if an
option, to \-\-
268:.BR --no-run-if-empty )
#####
Change - to \- if it shall be printed as a minus sign.
xargs.1:393:if any invocation of the command exited with status 1-125
xargs.1:518:Copyright \(co 1990-2023 Free Software Foundation, Inc.
#####
Change a HYPHEN-MINUS (code 0x55, 2D) to a minus (\-), if in front of a
name for an option.
234:.BR -t .
248:.BI -s " max-chars\fR, \fI" \-\-max\-chars "=\fImax-chars\fR"
#####
Wrong distance between sentences.
Separate the sentences and subordinate clauses; each begins on a new
line. See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").
The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.
Remember coding: Only one command ("sentence") on each (logical) line.
E-mail: Easier to quote exactly the relevant lines.
Generally: Easier to edit the sentence.
Patches: Less unaffected text.
The amount of space between sentences in the output can then be
controlled with the ".ss" request.
51:prevents such problems. When using this option you will need to
94:command. Multibyte characters are not supported.
316:are mutually exclusive. If some of them are specified at the same
466:internally. This means that there is an upper limit on the length
492:a line which is longer than it can handle. This is not an ideal
#####
Do not use more than two space characters between sentences or (better)
only a new line character.
51:prevents such problems. When using this option you will need to
94:command. Multibyte characters are not supported.
466:internally. This means that there is an upper limit on the length
492:a line which is longer than it can handle. This is not an ideal
#####
Not in the patch.
Output from "test-nroff -man -b -ww -z":
[ "test-groff" is a developmental version of "groff" ]
Input file is ./xargs.1
Output from test-groff -b -mandoc -dAD=l -rF0 -rHY=0 -t -w w -z :
an.tmac:/tmp/chk_manuals.temp.ZC2PK6:1: style: .TH missing third argument;\
suggest document modification date in ISO 8601 format (YYYY-MM-DD)
an.tmac:/tmp/chk_manuals.temp.ZC2PK6:1: style: .TH missing fourth argument;\
suggest package/project name and version (e.g., "groff 1.23.0")
####
* xargs/xargs.1: Change as described above.
* xargs/xargs.1 (--show-limits): Remove redundant backslash character,
introduced when adding the description of that option in commit
956992ff71b3 in 2005.
* 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
* doc/find.texi (subsection Full Name Patterns): Change 2nd '-wholename'
to '-iwholename' to complete the enumeration of related options.
Fixes https://savannah.gnu.org/bugs/?61303
Copyright-paperwork-exempt: Yes
The FTS-based find is the default for a long time; oldfind has not been
installed since 4.5.18 (2015), and was only just used in tests.
* NEWS: Document the change.
* doc/find-maint.texi (Factor Out Repeated Code): Remove mentioning of
oldfind.
* find/.gitignore (/oldfind): Remove entry.
* find/Makefile.am (check_PROGRAMS): Remove.
(oldfind_SOURCES): Remove.
* find/defs.h (struct dir_id): Remove, it was only used in oldfind.c.
(symlink_handling): Likewise.
Adjust comments wrt oldfind otherwise.
* find/oldfind.c: Remove.
* find/testsuite/config/unix.exp: Remove the code to search for and
to run tests with oldfind.
* find/testsuite/find.posix/dotdotfiles.exp: Adjust comment.
* po/POTFILES.in (find/oldfind.c): Remove entry.
* tests/find/debug-missing-arg.sh: Remove run with oldfind.
* 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/local.mk (built_programs): Remove oldfind from list.
* find/util.c (usage): Start sentences with upper case.
Add extra newlines to put each section (operators, options, tests, and
actions) on its own line.
Move the typical generic options --help and --version to the end.
* NEWS (Documentation Changes): Mention the change.
* build-aux/gen-changelog.sh: Call gitlog-to-changelog with the
--no-cluster option. The resulting ChangeLog reads better, because
each commit get its own date/author line.
The struct state field exit_status is only set to 0 (EXIT_SUCCESS) or
to 1 (EXIT_FAILURE) throughout the code.
Therefore, remove the more complicated wrapper function error_severity
which was only used in very few cases anyway.
While at it, replace the above magic numbers by EXIT_OKAY/EXIT_SUCCESS.
* find/defs.h (error_severity): Remove.
* find/util.c (error_severity): Remove, and update all callers by replacing
it by the direct assignment to state.exit_status.
(get_statinfo): Use the above better names.
(report_file_err): Likewise.
* find/exec.c (launch): Likewise.
* find/ftsfind.c (consider_visiting): Likewise.
(find): Likewise.
(process_all_startpoints): Likewise.
(main): Likewise.
* find/pred.c (pred_delete): Likewise.
(pred_empty): Likewise.
(match_lname): Likewise.
(pred_xtype): Likewise.
* find/print.c (do_fprintf): Likewise.
Prompted by the following warning of GCC-11.1.1:
tree.c: In function 'get_expr':
tree.c:140:31: warning: dereference of NULL 'prev_pred' [CWE-476] \
[-Wanalyzer-null-dereference]
140 | if ((UNI_OP == prev_pred->p_type
| ~~~~~~~~~^~~~~~~~
Former versions of find are not vulnerable to this, because a closing
parenthesis ')' without anything before was treated as a pathname
rather than an option.
But this is possible now with the recent introduction of the -files0-from
option (see commit 11576f4e6a) - yet still an invalid invocation.
Reproducer for a crash:
$ find -files0-from FILE ')' -print
Segmentation fault (core dumped)
In the similar case when the user didn't specify any action, and find(1)
adds the default action via '( user-expr ) -print', the error diagnostic
was very confusing, too:
$ find -files0-from FILE ')'
find: invalid expression; empty parentheses are not allowed.
* find/tree.c (get_expr): Handle the cases when there's no predicate
before CLOSE_PAREN, and output a useful error diagnostic.
* tests/find/files0-from.sh: Add a test case for it.
* 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.
* 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.
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
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/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
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.
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.
* 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.
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/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
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.
'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.
"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.
* 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
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.
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.
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'.
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.
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.
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
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
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.
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.
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.
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.
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
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.
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.
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/find.texi (Comparing Timestamps): Clarify that the above options
are equivalent to the options -neweram, -newercm and -newermm.
Suggested by Reuben Thomas.
* 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
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.
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/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
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
* find/find.1 (EXAMPLES): Use (aq...(aq consistently around the -exec
arguments containing the placeholder '{}/...'.
Suggested in https://sv.gnu.org/bugs/?59012
* 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 .
* 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
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.
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".
* 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
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.
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.
* 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 a4718831e17.
* 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>
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>
'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.
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.
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.
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.
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
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
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>
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'.
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.
* 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.
* 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.
'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
* 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
* 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'.
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.
* 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.
* 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.
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.
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.
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
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.
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.
This avoids this bootstrap warning:
Notice from module gettext:
This module is obsolete. Use the module 'gettext-h' instead to make
your program capable of internationalization, when GNU gettext is also
used.
* bootstrap.conf (gnulib_modules): s/gettext/&-h/
The -prune action always returns true, also if -depth is in effect.
* find/find.1 (-prune): Remove the wrong statement that -prune would
return false when -depth is given. Furthermore, move the example down
from -path.
Reported by Cristian Zoicas in
https://lists.gnu.org/r/bug-findutils/2019-04/msg00024.html
Utilize GNU_FINDUTILS_FD_LEAK_CHECK environment variable
to enable/disable fd leak check for xargs the same way as
for find.
* find/defs.h: Remove prototype for fd_leak_check_is_enabled().
* find/util.c: Remove implementation of fd_leak_check_is_enabled().
* lib/fdleak.c: Add implementation of fd_leak_check_is_enabled().
* lib/fdleak.h: Add prototype for fd_leak_check_is_enabled().
* xargs/testsuite/config/unix.exp: Enable GNU_FINDUTILS_FD_LEAK_CHECK
for all tests.
* xargs/xargs.c: Execute complain_about_leaky_fds when
fd_leak_check_is_enabled returns true.
* NEWS (Improvements): Document support of GNU_FINDUTILS_FD_LEAK_CHECK
by xargs.
Copyright-paperwork-exempt: Yes
* build-aux/update-online-manual.sh: add a script (originally
written in 2005 but not previously included in the source
distribution) which automates the updating of the online manual.
* doc/Makefile.am: Add some targets useful for update-online-manual.sh.
* doc/find-maint.texi (Documentation): Explain how to check out
the web pages and how to update the findutils documentation there.
The previous description "File was modified more recently than file."
was hard to understand without markup, e.g. over the phone.
Furthermore, the description for symbolic links as reference file was
wrong in the man page for the -anewer and -cnewer options: in fact,
find(1) always uses the mtime of the reference file.
* doc/find.texi (Comparing Timestamps): Improve the wording for the
-anewer/-cnewer/-newer options. Use 'reference' as the argument name.
Add the note from find.1 that the -H/-L options make find(1) use
the data modification time of the file being referenced.
* find/find.1 (-anewer,-cnewer,-newer): Improve the wording, and use
'reference' as argument name.
Fix the description for -anewer/-cnewer: when -H/-L is used with a
symbolic link as reference, then find always uses the mtime of that,
not atime or ctime.
Reported by Dan Jacobson <jidanni@jidanni.org> in
https://lists.gnu.org/r/bug-findutils/2019-04/msg00002.html
There is a small race condition between the previous stat call
and openat/fdopendir (which cannot be avoided): if the directory
got replaced by another file type, then openat would succeed but the
subsequent fdopendir would fail with ENOTDIR. Detect this earlier
by passing the O_DIRECTORY flag.
Furthermore, the opened file descriptor was leaked in that case
(bug introduced in FINDUTILS_4_3_2-1-80-gb46b0d89 in 2007).
Later on, after a readdir error, also the directory stream was leaked
(bug introduced by myself in commit 7a6e548690b1).
* find/pred.c (pred_empty): Add more flags to the openat call,
especially O_DIRECTORY; inspired by gnulib's opendirat module.
Close the file descriptor when fdopendir failed.
Close the directory stream when readdir failed.
Cause developer builds to fail for any use of a VLA.
VLAs (variable length arrays) limit portability.
* configure.ac (findutils_gnulib_noise_warnings): Remove as the only
suppressed warning for gnulib was -Wvla, thus enabling the warning
when configured with --enable-compiler-warnings.
(compiler-warnings-are-errors): Likewise.
(GNULIB_NO_VLA) Define, disabling use of VLAs in gnulib. This commit
is functionally equivalent to coreutils' v8.30-44-gd26dece5d
Discussed for other GNU packages in:
https://lists.gnu.org/r/coreutils/2019-01/msg00058.html
Make this test a "check-root" test to increase test coverage.
This test runs for non-privileged users as well, but skips the tests
for block and character devices as mknod(1) will fail with EPERM.
* find/testsuite/test_type-list.sh: Move to ...
* tests/find/type_list.sh: ... this, and apply the above.
Simplify, and make more robust.
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_root_tests): ... and add it here.
* find/testsuite/sv-52220.sh: Move to ...
* tests/find/debug-missing-arg.sh: ... this, and apply the above.
Simplify, and make more robust.
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_tests): .. and add it here.
* find/testsuite/sv-48180-refuse-noop.sh: Move to ...
* tests/find/refuse-noop.sh: ... this, and apply the above.
Simplify, and make more robust.
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_tests): .. and add it here.
* find/testsuite/sv-48030-exec-plus-bug.sh: Move to ...
* tests/find/exec-plus-last-file.sh: ... this, and apply the above.
Simplify, and make more robust.
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_tests): .. and add it here.
* find/testsuite/sv-34976-execdir-fd-leak.sh: Move to ...
* tests/find/execdir-fd-leak.sh: ... this, and apply the above.
Simplify, and make more robust.
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_tests): .. and add it here.
* find/testsuite/test_inode.sh: Move to ...
* tests/find/printf_inode.sh: ... this, and apply the above. Simplify.
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_tests): .. and add it here.
* find/testsuite/test_escape_c.sh: Move to ...
* tests/find/printf_escape_c.sh: ... this, and apply the above. Simplify.
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_tests): .. and add it here.
For migrating, merge with the basic structure from 'tests/sample-test',
i.e., source in 'tests/init.sh', call 'print_ver_', "Exit $fail", etc.
Also remove now-common functions like die() and framework_failure_().
* find/testsuite/test_escapechars.golden: Remove, as the axpected output
is created on the fly by the new test.
* find/testsuite/test_escapechars.sh: Move to ...
* tests/find/printf_escapechars.sh: ... this, and apply the above.
Create the expected output on the fly, and also check for the expected
error diagnostic on stderr.
* find/testsuite/Makefile.am (EXTRA_DIST_GOLDEN): Remove.
(EXTRA_DIST): Remove $(EXTRA_DIST_GOLDEN).
(tests_shell_progs): Remove the reference to this test ...
* tests/local.mk (all_tests): .. and add it here.
For migrating, merge with the basic structure from 'tests/sample-test',
i.e., source in 'tests/init.sh', call 'print_ver_', "Exit $fail", etc.
Also remove now-common functions like die() and framework_failure_().
* find/testsuite/sv-bug-32043.sh: Move to ...
* tests/find/name-lbracket-literal.sh: ... this, and apply the above.
Simplify.
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_tests): .. and add it here.
For migrating, merge with the basic structure from 'tests/sample-test',
i.e., source in 'tests/init.sh', call 'print_ver_', "Exit $fail", etc.
Also remove now-common functions like die() and framework_failure_().
* find/testsuite/sv-34079.sh: Move to ...
* tests/find/many-dir-entries-vs-OOM.sh: ... this, and apply the above.
While at it, loosely pull in changes from the related test in the
GNU coreutils [1]:
Create only 200,000 files, rather than 4 million. The latter was overkill,
and was too likely to fail due to inode exhaustion. Now that this test
doesn't take so long, label it as merely "expensive", rather than
"very expensive".
Furthermore, simplify the test data creation, and use the ulimit specifically
for each program under test (find, oldfind).
* find/testsuite/Makefile.am (tests_shell_progs): Remove the reference
to this test ...
* tests/local.mk (all_tests): .. and add it here.
[1]
https://git.sv.gnu.org/cgit/coreutils.git/tree/tests/rm/many-dir-entries-vs-OOM.sh?id=4711c49312d5
Borrow the 'tests' framework from GNU coreutils. This allows better
shell-style tests with more control over stdin, stdout, stderr, signals,
preparatory steps, cleanup, return code verification, root-only tests,
etc.
* .gitignore: Add entries for per-test *.log and *.trs files, and the
'test-suite.log'.
* .x-update-copyright: Exempt 'tests/init.sh' as this comes from gnulib.
* Makefile.am: Include 'tests/local.mk'.
(EXTRA_DIST): Add 'tests/GNUmakefile'.
(SUBDIRS): Move 'gnulib-tests' to the end, i.e., run our own tests first.
(ALL_RECURSIVE_TARGETS): Initialize.
(update-gnulib-to-latest): Copy 'tests/init.sh' from gnulib.
* cfg.mk: Add some syntax-check rules.
* init.cfg: Add file.
* tests/GNUmakefile: Likewise.
* tests/envvar-check: Likewise.
* tests/init.sh: Likewise.
* tests/lang-default: Likewise.
* tests/local.mk: Likewise.
* tests/misc/help-version.sh: Likewise.
* tests/other-fs-tmpdir: Likewise.
* tests/sample-test: Likewise.
* tests/.gitignore: Likewise.
* NEWS (Changes to the build process): Mention the new test framework.
'make' on all of FreeBSD, NetBSD and OpenBSD fails to understand that
'./libfindtools.a' and 'libfindtools.a' are the same, and - unless one
builds that target manually - fails with:
make[3]: don't know how to make ./libfindtools.a. Stop
* find/Makefile.am (LDADD): Change './libfindtools.a' to 'libfindtools.a'.
* find/parser.c (check_name_arg): Add parameter ALT for the alternative
option to suggest. Avoid confusing quoting in the warning by making
the message more terse.
(parse_iname): Pass "-iwholename" as alternative parameter.
(parse_name): Pass "-wholename" as alternative parameter.
Reported by Andreas Metzler in
https://sv.gnu.org/bugs/?55272
Run 'make update-copyright'.
* lib/regexprops.c (copying): Update the year number manually.
* 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.
* lib/bugreports.c (explain_how_to_report_bugs): Avoid continued strings
by using multi-part strings, one per line.
* cfg.mk (sc_prohibit_continued_string_alpha_in_column_1): Add SC rule.
Run 'make update-gnulib-to-latest'.
* bootstrap: Sync from gnulib/build-aux/bootstrap.
* gnulib: Update to latest.
* configure.ac (AC_PREREQ): Change from very old 2.59 to current 2.69
to avoid gnulib-tool complaining about "minimum supported autoconf
version is 2.63".
* Makefile.am (gnulib-sync, update-gnulib-to-latest): Add targets to
pull the latest commit of the gnulib submodule, and also to copy over
the files we keep in sync.
* doc/find-maint.texi (How to update Gnulib to latest): Add section.
* find/defs.h (DebugOption): Add DebugAll, which includes all other
debug options but DebugHelp.
* find/util.c (debugassoc): Add an entry for DebugAll, and move DebugHelp
to the end.
* doc/find.texi (node Debug Options): Document the new option.
* find/find.1: Likewise.
* NEWS (Improvements): Likewise.
* doc/find.texi (node Controlling Parallelism): Change from 'xargs -1'
(minus one) to 'xargs -l' (minus El) in three places.
Reported by Ahmad ElKomey in
https://sv.gnu.org/bugs/index.php?54859
* doc/find.texi (Mode Bits): Move the misplaced '-perm -g+w,o+w' example
up to the '-perm -022' example to where it belongs. The former got
accidentally separated from the latter in commit 7ade936bc2c4: the patch
proposed in https://sv.gnu.org/bugs/?14619 was applied in the wrong place.
* NEWS (Bug fixes): Mention the fix.
Reported by Ahmad ElKomey in https://sv.gnu.org/bugs/?54838
A non-zero exit status of a command launched via the -exec predicate
family only leads to a non-zero exit status of 'find' itself when
the '+' form of the punctuation for the command is used. This is
also what POSIX requires [1].
To put it the other way round: when the ';' form is used, the exit
status of 'find' is not affected.
[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html
* find/find.1 (-exec ... +): Explicitly mention that the exit status of
the launched command affects find's exit status when the '+' form is used.
To allow a future change, deliberately leave the behavior for failing
commands with the ';' form undocumented.
(-execdir): Likewise.
Previously, in the form committed with v4.6.0-63-gae424b95, that sentence
did not explicitly limit the behavior to the '+' form, and therefore
might have confused the user.
Fixes https://sv.gnu.org/bugs/?54509
* lib/fdleak.c (get_max_fd): Move definition of the fd_limit variable
into the HAVE_GETRLIMIT block giving it a better scope: platforms
lacking getrlimit probably also lack struct rlimit, too.
Copyright-paperwork-exempt: Yes
* COPYING: Merge fom gnulib/doc/COPYINGv3.
* bootstrap: Merge from gnulib/build-aux/bootstrap.
* gnulib: Update, mainly to avoid the following warnings from GCC-8.1.1:
cc1: warning: -Wabi won't warn about anything [-Wabi]
cc1: note: -Wabi warns about differences from the most up-to-date ABI,\
which is also used by default
cc1: note: use e.g. -Wabi=11 to warn about changes from GCC 7
The above command should output 'N' (for broken symlinks) not only in
the ENOENT case, but also when an intermediate part of the symlink target
file name is a file (ENOTDIR):
$ touch file
$ ln -s file/ENOTDIR link
$ find link -printf '%Y %p\n'
N link
Previously, find output 'l' as for a resolvable symlink.
* find/print.c (do_fprintf): Treat ENOTDIR the same as ENOENT to detect
broken symlinks.
* find/testsuite/find.gnu/printf-symlink.exp: Extend the test, and ...
* find/testsuite/find.gnu/printf-symlink.xo: ... the expected output.
* NEWS (Bug fixes, #54262): Explicitly mention that both ENOENT and ENOTDIR
are used to detect broken symlinks.
Suggested by Tavian Barnes.
* find/print.c (do_fprintf): Move the 'else' statment into the #ifdef'ed
block to avoid compilation failure on systems without S_ISLNK (although
it seems nobody tried to build on such a platform since 2005).
Bug introduced in commit 'FINDUTILS_4_2_23-1-63-g238d9547'.
The format %Y shall output 'N' for broken links (ENOENT), 'L' for ELOOP,
and '?' for any other error when stat()ing the symlink target.
The %Y implementation implicitly fell back to lstat(); therefore it
output 'l' for dangling symlinks.
$ ln -s ENOENT DANGLE
$ find -D stat DANGLE -printf '%y %Y %p\n'
fallback_stat(): stat(DANGLE) failed; falling back on lstat()
l l DANGLE
* find/print.c (do_fprintf): For %Y, always follow links to determine
the type of the symlink target.
* find/testsuite/find.gnu/printf-symlink.exp: Add a test case for broken
links and the ELOOP case ...
* find/testsuite/find.gnu/printf-symlink.xo: ... with the expected output.
* NEWS (Bug fixes): Mention the fix.
Bug introduced in version v4.5.8 with commit '25e7c5fbf9'.
Reported by GCC 8.1.1:
ftsfind.c: In function ‘get_fts_info_name’:
ftsfind.c:164:23: warning: ‘%d’ directive writing between 1 and 11 bytes into a region of size 9 [-Wformat-overflow=]
sprintf (buf, "[%d]", info);
^~
ftsfind.c:164:7: note: ‘sprintf’ output between 4 and 14 bytes into a destination of size 10
sprintf (buf, "[%d]", info);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
* find/ftsfind.c (get_fts_info_name): Increase buffer from 10 to 14
to be able to hold the 11-char string representation of the %d format,
the surrounding '[' and ']', plus the terminating NULL character.
* find/ftsfind.c (consider_visiting): Split the FTS_ERR and FTS_DNR
cases to be able to continue processing that entry in the latter case
(unreadable directory) when the -depth option is given.
* NEWS (Bug Fixes): Mention the fix.
Reported by Tavian Barnes in https://savannah.gnu.org/bugs/?54171.
When qmark_chars() replaces a multibyte character with a single
character, this reduces the length of the string. When this happens,
terminate the now-shorter string at the new length.
This is simple workaround for bug http://savannah.gnu.org/bugs/?54236.
oldfind.c:277:1: error: function might be candidate for attribute 'malloc' if it is known to return normally [-Werror=suggest-attribute=malloc]
specific_dirname (const char *dir)
^~~~~~~~~~~~~~~~
* find/oldfind.c (specific_dirname): Mark with _GL_ATTRIBUTE_MALLOC.
GCC 8 issues the following warning diagnostic:
xargs.c:1134:29: warning: '%u' directive output may be truncated writing \
between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=]
static const char *fmt = "%u";
^~
xargs.c:1161:7: note: 'snprintf' output between 2 and 11 bytes into a \
destination of size 2
snprintf (buf, size+1, fmt, n);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* xargs/xargs.c (set_slot_var): Simplify BUF handling to pacify GCC 8
about safe use of snprintf wrt truncated writing.
On Alpine Linux v3.6, the test failed because the created 'tstcmd'
script lacks a shebang - see shortened log:
+ echo printf "%s\n" "$@"
+ chmod +x bin/tstcmd
+ PATH=/tmp/tmp.10fq3tSrnx/bin:...
+ .../find/find bin -maxdepth 0 -exec tstcmd {} +
find: ‘tstcmd’: Exec format error
+ [ = bin ]
sh: bin: unknown operand
+ return 1
* find/testsuite/sv-48030-exec-plus-bug.sh: Add a shebang to the
generated 'tstcmd' script, and add quotes around the find call to
avoid the "unknown operand" error.
The test exited as a test failure (exit 1) also when set-up failed,
e.g. when running the test with TMPDIR on a file system with too
few free inodes. Instead, the test should exit with 77 to skip the
test. In other cases, exit properly with 99 to signal a test
framework failure.
* find/testsuite/sv-34079.sh (very_expensive_): Move the check for
RUN_VERY_EXPENSIVE_TESTS to the beginning, thus decreasing the
indentation level of the test code. This is also a preparation
step for moving this check to a central place.
(skip_,framework_failure_): Define utility functions to skip the test
or terminate it as a test framework failure.
(get_ifree_): Define function to determine the number of free inodes.
(make_test_data): Use it, and skip early if we know that there are too
few free inodes on the current file system.
Use "seq -f" to build the file names, and directly feed them via xargs
to touch. This avoids slower shell code.
Skip the test if touch fails; previously, the test exited as FAIL.
Move the creation of test files up, i.e., outside the if-condition,
and use trap to remove the temporary directory at exit.
seq(1) is not required by POSIX and also not available on some
systems, e.g. the *BSDs. Skip tests requiring it.
* find/testsuite/sv-34079.sh: Add a check whether seq(1) is available,
and exit 77 (SKIP) otherwise.
* find/testsuite/sv-48030-exec-plus-bug.sh: Likewise.
The list of languages is in po/LINGUAS since gettext-0.11.
Removing ALL_LINGUAS avoids the following warning:
config.status: setting ALL_LINGUAS in configure.in is obsolete
* configure.ac (ALL_LINGUAS): Remove.
* Makefile.am (findutils-check-pofiles): Remove check.
(dist-hook): Remove dependency to findutils-check-pofiles.
Let bootstrap auto-update the PO files from "translationproject.org".
* bootstrap.conf (SKIP_PO): Remove, thus letting bootstrap download
the PO files now.
* po/.gitignore: Add entries now created during the build.
* doc/find-maint.texi (Internationalisation): Mention the change.
* NEWS (Changes to the build process): Likewise.
(Translations): Remove section.
sed(1) on FreeBSD-11.1 and OpenBSD 6.2 requires the last command inside
'{...}' groups to be terminated with a semicolon, otherwise it fails with:
sed: 1: "/^# Copyright /{s/^..// ...: extra characters at the end \
of q command
* locate/Makefile.am (updatedb): Add a ';' after the last command in the
'{...}' group - introduced in commit v4.6.0-133-g6d186665.
'va_start' must have a corresponding 'va_end'. Depending on the
implementation, the consequence of a missing 'va_end' may be a
corrupted stack.
* find/print.c (checked_fprintf): Add va_end.
Spotted by coverity analysis.
parser.c: In function 'collect_arg_stat_info':
parser.c:755:1: warning: control reaches end of non-void function [-Wreturn-type]
* find/parser.c (collect_arg_stat_info): Invert condition to work
around the above warning for compilers failing to detect that
fatal_target_file_error does never return.
Some make implementations, e.g. on NetBSD 7.1, lack it; therefore
avoid it in order to prevent error messages during 'make clean'.
* Makefile.am (coverage-clean): Replace $(RM) by 'rm -f'.
* find/Makefile.am: Likewise.
* lib/Makefile.am: Likewise.
* locate/Makefile.am: Likewise.
* xargs/Makefile.am: Likewise.
* find/pred.c (pred_delete): Return true when the -ignore_readdir_race
option is active and unlinkat() came back with ENOENT.
* doc/find.texi (Option -ignore_readdir_race): Document the change.
(Action -delete): Likewise.
* find/find.1: Likewise.
* NEWS (Bug Fixes): Mention the fix.
For now, it seems a bit hard to add a proper test for this,
so the following shell snippet demonstrates the race:
$ seq 10 | xargs touch
$ env time -f 'find exit status: %x\nfind time: %e' \
find -ignore_readdir_race -type f \
-delete \
-exec sh -c 'sleep $(basename {})' \; \
-printf 'find deleted: %p\n' \
& \
sleep 20; \
seq 10 | xargs rm -fv; \
wait $!
Reported by Alexander Golubev in
https://savannah.gnu.org/bugs/?52981
This may be used by 'make emit_upload_commands' and 'make stable' /
'make alpha' later on.
* bootstrap.conf (gnulib_modules): Add entry for 'gnupload'.
* build-aux/.gitignore (/gnupload): Add entry.
Rename from 'tests' to 'gnulib-tests' to make clearer that these
are the tests of gnulib, and not those of findutils.
* .gitignore (tests): Remove.
(/gnulib-tests/): Add entry.
* Makefile.am (SUBDIRS): s/tests/gnulib-tests/
(findutils-check-smells): Likewise.
(coverage-clean): Likewise.
* bootstrap.conf (gnulib_tool_option_extras): Add option
"--tests-base=gnulib-tests".
* configure.ac (AC_CONFIG_FILES): s/tests/gnulib-tests/ here, too.
Now, each snapshot has a version "number" like 4.6-131-219-gda920ee,
which indicates that it is built using the 131st change set
(in _some_ repository) following the "v4.6" tag, and that da920ee
is a prefix of the commit SHA1.
* bootstrap.conf (gnulib_modules): Add git-version-gen.
* build-aux/.gitigore (/git-version-gen): Add entry.
* configure.ac: Run it to set the version from .tarball-version.
* Makefile.am (EXTRA_DIST): Add git-version-gen.
(dist-hook): Create .tarball-version in distribution tarballs,
never in a checked-out repository.
(AUTOMAKE_OPTIONS): Change from 'gnits' to 'gnu std-options readme-alpha'.
* .gitignore (.tarball-version): Add entry.
* doc/find-maint.texi (Making Releases): Adjust: tag before the build,
changed handling in NEWS, etc.
* NEWS (Changes to the build process): Document the change.
* configure.ac (AM_SILENT_RULES): Use this, with it's undocumented
[yes] argument. Those who want verbose build output may configure
with --disable-silent-rules or use "make V=1".
Changes:
- Avoid warning "(macro BR): only 1 argument, but more are expected".
- Change misused SI (metric) numeric prefixes to the binary ones, like
a bare "1K blocks" to "1 KB blocks".
- Protect a full stop (.) with "\&", if it has a blank (white-space)
in front of or (ignoring transparent characters to the full stop) after
it, and it does not mean an end of a sentence.
- Change the name of a macro for two fonts (e.g., BR and IR) to one
letter, if there is only one argument.
- Use a macro to change to the italic font, instead of \fI [1], if
possible.
- Remove space in the first column, if not intented.
- Move a full stop (period) and a comma outside of a quoted text, if
it is at the end of the quote and does not end a quoted sentence.
- Change a HYPHEN-MINUS (code 0x55, 2D) to a minus (\-), if in front
of a name for an option.
- Split lines longer than 80 characters into two or more lines.
- Separate the sentences and subordinate clauses; each begins on a new
line. Or: Adjust space between sentences (two spaces).
- Fix the spelling of "kibi", "mebi", and "gibi".
* find/find.1: Do the above.
Patch contributed via https://sv.gnu.org/patch/?9585
Copyright-paperwork-exempt: Yes
Run 'make update-copyright'.
* lib/regexprops.c (copying): Update the year number manually.
* All other files: Update copyright years via the above make run.
The following new warning sneaked in with the gnulib update in the
previous commit:
In file included from parser.c:49:0:
../gl/lib/stat-time.h: In function 'stat_time_normalize':
../gl/lib/stat-time.h:215:47: error: unused parameter 'st' \
[-Werror=unused-parameter]
stat_time_normalize (int result, struct stat *st)
^~
* configure.ac: Add the -Wno-unused-parameter option explicitly as it
is implied - and thus overridden - by the more general -Wunused option.
* find/find.1 (-executable): Mention to whom the matching files are
accessible: to the current user.
(-readable): Likewise.
(-writable): Likewise.
Reported by 積丹尼 Dan Jacobson <jidanni@jidanni.org> in
https://lists.gnu.org/r/bug-findutils/2017-12/msg00017.html
* lib/regextype.c (get_regex_type_synonym): don't return regex
dialect Y as a synonym of dialect X, if we're not in fact going to
include X. Accept a CONTEXT parameter in order to identify this
situation. This ensures that the bug fixed in commit
e2c673cbcdc325a3a2e9dd02169bb4a42c61bc48 stays fixed for any
permutation of regex_map.
* lib/regextype.h: update prototype of get_regex_type_synonym.
* lib/regexprops.c (describe_all): Pass the new context parameter.
* doc/regexprops.texi: regenerate this file.
* lib/regextype.c (regex_map): Permute the entries to list POSIX
dialects before other ones, so that we don't end up with a
dangling reference to `ed' regular expressions when
context=findutils. Remove trailing white space from the output.
* doc/regexprops.texi: Regenerate this file, so that we no longer
have a dangling reference to the `ed' dialect.
* doc/find.texi (Regular Expressions): Point out the difference
between Emacs regular expressions and findutils regular
expressions: in findutils "." will match newline.
* find/find.1: Likewise.
* locate/locate.1: Likewise. Also document the --regextype option.
Each /archive/html/ part can be replace with /r/.
Run this to induce the change:
git grep -l archive/html|xargs perl -pi -e 's,/archive/html/,/r/,g'
* README: Perform that substitution.
* find/testsuite/find.posix/depth1.exp: Likewise.
* gnulib-local/lib/gcc-function-attributes.h
die() has the advantage of being apparent to the compiler
that it doesn't return, which will avoid warnings in some cases,
and possibly generate better code.
While at it, wrap some of the overly long error messages into a new line.
* cfg.mk (sc_die_EXIT_FAILURE): A new syntax check rule to
catch any new uses of error (CONSTANT, ...);
* find/exec.c: Include "die.h" and use die rather than exit (EXIT_FAILURE).
* find/fstype.c: Likewise.
* find/ftsfind.c: Likewise.
* find/oldfind.c: Likewise.
* find/parser.c: Likewise.
* find/pred.c: Likewise.
* find/print.c: Likewise.
* find/tree.c: Likewise.
* find/util.c: Likewise.
* lib/buildcmd.c: Likewise.
* lib/listfile.c: Likewise.
* lib/regextype.c: Likewise.
* lib/safe-atoi.c: Likewise.
* locate/frcode.c: Likewise.
* locate/locate.c: Likewise.
* locate/word_io.c: Likewise.
* xargs/xargs.c: Likewise.
GCC-7.2.1 complained about this occur during 'make check'.
* lib/regexprops.c (menu): Remove set-but-unused-variable 'options'.
* lib/test_splitstring.c (main): Avoid unused-parameter warnings
for 'argc' and 'argv'.
* lib/die.h (die): New file/function from grep/coreutils.
Note: this file will probably be migrated to gnulib.
* lib/Makefile.am (libfind_a_SOURCES): Reference it.
* xargs/xargs.c: Include die.h.
(xargs_do_exec): Use die in place of error-nonzero, thus allowing
the compiler to know that we do not fall through into the 0 (child)
case.
Avoid the new warnings GCC 7 gives with the
"-Werror=implicit-fallthrough=" compiler option.
Since version 7, GCC requires fallthrough switch/cases to be
marked by the appropriate attribute.
* lib/system.h: Add new header file defining the FALLTHROUGH macro.
* lib/Makefile.am (libfind_a_SOURCES): Reference it.
* find/print.c (do_fprintf): Use the new macro.
* xargs/xargs.c (read_line): Likewise.
(xargs_do_exec): For error(3), GCC 7 doesn't know that the function
does not return, and would complain about falling through into the
following case. Temporarily add an abort call - this will be fixed
with another commit.
Avoid the new warnings GCC 7 gives with the
"-Werror=implicit-fallthrough=" compiler option.
Since version 7, GCC requires fallthrough switch/cases to be
marked by the appropriate attribute.
* lib/system.h: Add new header file defining the FALLTHROUGH macro.
* lib/Makefile.am (libfind_a_SOURCES): Reference it.
* find/print.c (do_fprintf): Use the new macro.
* xargs/xargs.c (read_line): Likewise.
(xargs_do_exec): For error(3), GCC 7 doesn't know that the function
does not return, and would complain about falling through into the
following case. Temporarily add an abort call - this will be fixed
with another commit.
GCC-7.2.1 on openSUSE-Tumbleweed complains:
listfile.c:56:0: error: macro "HAVE_MAJOR" is not used \
[-Werror=unused-macros]
#define HAVE_MAJOR
* listfile.c (major,minor): Avoid the temporary #define HAVE_MAJOR
by using #else's.
Previously, the Copyright header output by 'updatedb --version' was
not updated by 'make update-copyright', so it still showed 2010 as
the Copyright year.
* locate/updatedb.sh (version): Replace the Copyright header by
the placeholder "@COPYRIGHT@" ...
* locate/Makefile.am (updatedb): ... set here from the Copyright line
extracted from 'updatedb.sh'.
'make distcheck' failed with:
...
ERROR: files left in build directory after distclean:
./find/testsuite/find.err
./find/testsuite/oldfind.err
Makefile:2064: recipe for target 'distcleancheck' failed
* find/testsuite/sv-52220.sh: Add command to remove the temporary
files used for stderr output.
Bug introduced in commit v4.6.0-123-gef1581e.
* cfg.mk: Set XZ_OPT = -7e (determined empirically).
The compressed tarball size is identical to the default settings (-9e),
but using -9e would force every decompression process to use 48 MiB
more memory.
On some platforms, 'find -D' without any further argument crashed.
* find/util.c (process_leading_options): Output an error diagnostic
when the -D option is the last argument. Previously, 'find -D'
without any further arguments crashed on some platforms where the
following strtok_r does not expect a NULL pointer argument in the
first call.
* NEWS (Bug Fixes): Mention the fix.
* find/testsuite/sv-52220.sh: Add a test.
* find/testsuite/Makefile.am (test_shell_progs): Reference the test.
Fixes https://savannah.gnu.org/bugs/?52220
* find/find.1 (NON-BUGS): Update the sample error diagnostic to match
the latest code of the unquoted pattern example for the -name predicate.
Also improve the explanation about what is happening in that case.
* find/testsuite/find.gnu/printf.exp: Add coverage for %T* (limited to
strftime sequences mandated by POSIX), %M, %t, %y, and %Y. Run this test
with TZ=UTC. (Latter fix by Bernhard Voelker.)
* find/testsuite/find.gnu/printf.xo: Likewise.
* find/print.c (format_date): Increase size of local variable
FMT to match the longest possible content.
Fixes https://bugs.debian.org/873032 reported upstream by
Andreas Metzler in https://savannah.gnu.org/bugs/?51841;
fix proposed by Kamil Dudka.
Bug introduced in commit v4.6.0-111-g95816b2, so no released version
ever saw this; therefore not adding a NEWS entry.
When the user passes a bad command line, then find(1) outputs the
error message followed by a short usage() text, e.g. (wrapped):
$ find . -name a* b*
find: paths must precede expression: bfile
Usage: find [-H] [-L] [-P] [-Olevel] \
[-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
Omit the usage() text in more cases like this in order to make the
error diagnostic more eye-catching.
* find/tree.c (build_expression_tree): Exit with EXIT_FAILURE
immediately in more cases, i.e., without outputting also a short
usage() text. While at it, add quotes around the offending argument
in one another place.
* NEWS (Improvements): Mention the fix.
Reported in https://savannah.gnu.org/bugs/?51711
* find/print.c (format_date): Avoid passing %F to strftime since
some implementation lack it. Pass the synonymous %Y-%m-%d
instead. This fixes a bug manifesting on HP Tru64 UNIX V5.1B.
Reported by Steven M. Schweda <sms@antinode.info>.
* build-aux/git-log-fix: Ignore a recent incorrectly-formatted
change-log message (5e56fe96bc5cf5c0b616dc0251dddebb7e480074)
which is replaced by another
(f146a243400c211a19c9b76e5f598b6d7c57b1b0). Also don't copy the
resulting merge commit message into the ChangeLog.
* find/find.1 (STANDARDS CONFORMANCE): Change the reference to the
POSIX standard from the 2003 Edition to the 2016 Edition.
In the list of supported primaries, add the missing ones:
-exec, -ok and -path. Remove the stray duplicates from the list.
* doc/find.texi (node Size): Add a sentence to make even clearer that
values prefixed with '+' or '-' do not find files with an exact match
of N in file size.
* find/find.1 (-size): Likewise.
find(1) uses binary-based units for the suffixes 'k', 'M', and 'G' of
the argument of the '-size' option: 1024, 1024*1024 and 1024^3.
Therefore, the documentation should use the correct IEC prefixes
kibibyte, mebibyte and gibibyte respectively (or their abbreviations
'KiB', 'MiB' and 'GiB').
* doc/find.texi (node Overview): Change 'Kilobytes' to the shorter
but correct 'KiB'.
(node Size): Use the above mentioned, correct IEC prefixes.
While at it, move the 'w' suffix up to match the man page.
* find/find.1 (-size): Likewise.
* find/parser.c (parse_size): Also change to IEX prefixes in some
comments for consistency.
* NEWS (Bug fixes): Mention the fix.
See also:
https://en.wikipedia.org/wiki/Binary_prefix
Reported by Andreas Metzler in
https://savannah.gnu.org/bugs/?51304
* doc/find.texi (Multiple Files): Mention the new --open-tty option
to be used as an alternative.
(Safe File Name Handling): Likewise.
* xargs/xargs.1 (EXAMPLES): Remove the tty redirection example.
This option is available in the xargs implementation of FreeBSD, NetBSD,
OpenBSD and in the Apple variant. Add it for compatibility.
* xargs/xargs.c (open_tty): Add static flag for the new option.
(longopts): Add member.
(main): Handle the 'o' case in the getopt_long() loop.
(prep_child_for_exec): Redirect stdin of the child to /dev/tty when
the -o option is given. Furthermore, move the just-opened file
descriptor to STDIN_FILENO.
(usage): Document the new option.
* bootstrap.conf (gnulib_modules): Add dup2.
* xargs/xargs.1 (SYNOPSIS): Replace the too-long list of options by
"[options]" - they are listed later anyway.
(OPTIONS): Document the new option.
(STANDARDS CONFORMANCE): Mention that the -o option is an extension.
* doc/find.texi (xargs options): Document the new option.
(Invoking the shell from xargs): Amend the explanation of the
redirection example with a note about the -o option.
(Viewing And Editing): Likewise.
(Error Messages From xargs): Add the message when dup2() fails.
(NEWS): Mention the new option.
Fixes http://savannah.gnu.org/bugs/?51151
* doc/find.texi (Mode Bits): Fix the description of the -perm examples
which search for the "022" mode bits: the match is for the file's group
and 'other' mode bits instead of for user and group.
While at it, remove a superfluous ';' in the adjacent example.
Bug introduced when adding the -perm examples in FINDUTILS-4.2.11.
* NEWS: Mention the fix.
Reported by Jacob Nevins <0jacobnk.gnu@chiark.greenend.org.uk> in
http://savannah.gnu.org/bugs/?50758
Previously, find would output the pathname name for the '%h' format
when that was passed with a trailing slash:
$ mkdir foo
$ find foo/ -printf '%h/%f\n'
foo/foo/
* find/print.c (do_fprintf -> 'h'): Strip trailing slashes, i.e. any
number of directory separators, unless this is the root "/" directory.
* find/testsuite/find.gnu/printf-h.exp: Enhance test with various
combinations of "/", "./", "foo/", "./foo", "./foolink/", etc.
* find/testsuite/find.gnu/printf-h.xo: Add the expected output for the
above new test cases.
* NEWS: Mention the fix.
Bug introduced in commit FINDUTILS_4_2_18-1-6-g0fd15a4.
Reported by Tavian Barnes <tavianator@gmail.com> in
https://savannah.gnu.org/bugs/?50259
* find/fstype.c (fstype_known): Move variable from global context ...
(filesystem_type): ... here, and pass it on explicitly by reference
to file_system_type_uncached().
(file_system_type_uncached): Add fstype_known as parameter.
Add a static cache for mount list to fstype.c.
* find/fstype.c (get_file_system_list): Add wrapper around GNULIB's
read_file_system_list function with a static cache to avoid multiple
invocations of that GNULIB function. Still re-read the list if the
first invocation didn't include the ME_TYPE members.
(is_used_fs_type): Use the above new wrapper.
(file_system_type_uncached): Likewise, and do not free the list here
anymore because this is now done in get_file_system_list() as needed.
* find/fstype.c (must_read_fs_list): Remove function and inline body ...
(file_system_type_uncached): ... here where its last use was.
(get_mounted_devices): Remove it from a comment.
oldfind.c: At top level:
oldfind.c:88:0: error: macro "N_" is not used [-Werror=unused-macros]
# define N_(String) gettext_noop (String)
cc1: all warnings being treated as errors
* find/oldfind.c (N_): Remove unused macro.
oldfind.c: In function ‘process_path’:
oldfind.c:1445:14: error: cannot optimize loop, the loop counter may overflow [-Werror=unsafe-loop-optimizations]
while (cur_path_size < file_len)
^
cc1: all warnings being treated as errors
* find/oldfind.c (process_path): Replace loop by calculation, avoiding
the offending loop at all.
buildcmd.c: In function 'bc_push_arg':
buildcmd.c:362:11: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
if (ctl->replace_pat
^~
buildcmd.c:366:13: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
bc_do_exec (ctl, state);
^~~~~~~~~~
pred.c: In function 'print_optlist':
pred.c:1328:46: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'long unsigned int' [-Werror=format=]
fprintf (fp, "[real success rate %ld/%ld", p->perf.successes, p->perf.visits);
^
pred.c:1328:50: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'long unsigned int' [-Werror=format=]
fprintf (fp, "[real success rate %ld/%ld", p->perf.successes, p->perf.visits);
^
print.c: In function 'scan_for_digit_differences':
print.c:449:46: error: logical 'or' of equal expressions [-Werror=logical-op]
if (!isdigit ((unsigned char)q[i]) || !isdigit ((unsigned char)q[i]))
^~
In file included from ../gl/lib/gettext.h:25:0,
from locate.c:86:
locate.c: In function 'dolocate':
locate.c:1873:28: error: format '%d' expects argument of type 'int', but argument 5 has type 'unsigned int' [-Werror=format=]
_("warning: database %s is more than %d %s old (actual age is %.1f %s)"),
^
locate.c:1873:26: note: in expansion of macro '_'
_("warning: database %s is more than %d %s old (actual age is %.1f %s)"),
^
locate.c:1927:18: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'long unsigned int' [-Werror=format=]
printf ("%ld\n", found);
^
cc1: all warnings being treated as errors
* find/pred.c (print_optlist): Use %lu for unsigned long int.
* find/print.c (scan_for_digit_differences): Check p[i] too rather than
q[i] two times.
* lib/buildcmd.c (bc_push_arg): Fix indentation.
* locate/locate.c (dolocate): Use %u format for unsigned int.
Use %lu format for unsigned long int.
Similar to the FTS readdir fix in v4.6.0-72-g155c9d1, handle the last
two unhandled readdir(3) errors.
* find/pred.c (pred_empty): Do the above.
* lib/fdleak.c (get_proc_max_fd): Likewise. While at it, fix the
condition to only skip "." and ".."; previously, also other files
beginning with ".." would have been skipped - that was theoretically,
as we only expect the FD files in "/proc/self/fd".
Avoid the following 2 warnings:
oldfind.c: In function ‘main’:
oldfind.c:228:5: warning: passing argument 1 of ‘ctime’ from incompatible pointer type [enabled by default]
fprintf (stderr, "cur_day_start = %s", ctime (&options.cur_day_start/*.tv_sec*/));
^
In file included from ../gl/lib/time.h:41:0,
from ../gl/lib/sys/stat.h:44,
from oldfind.c:35:
/usr/include/time.h:264:14: note: expected ‘const time_t *’ but argument is of type ‘struct timespec *’
oldfind.c: In function ‘at_top’:
oldfind.c:1003:12: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
base = pathname;
^
* find/oldfind.c (main): Correct the call to ctime; it takes time_t*,
so don't pass struct timeval*; instead, pass the address of the tv_sec
member.
(at_top): Declare base as const char*.
As of findutils-4.6, this package is stable.
* README-alpha: Remove file, moving the useful content of it to ...
* README: ... here.
* doc/find-maint.texi: Remove README-alpha here, too.
Reported by Steve in
http://lists.gnu.org/archive/html/bug-findutils/2016-10/msg00000.html
* README-hacking: "./configure", not "configure". Also fix a
grammatical error (missing "to") and point out that the "trivial
change" criterion is cumulative.
* find/find.1: quoting fixes; be consistent about quoting "!"
(it's likely not necessary in most places, but the previous
inconsistent approach was no more correct). Use \(dq instead of
just ", where we specifically need a double quote. This fixes a
quoting bug in which troff rendered "*~" as *~, presumably because
the "" was being eaten by macro argument processing. We use \(aq
to ensure that quotes qre rendered correctly where double quotes
is needed, and `these quotes' where they are not.
Fixes an FTS bug ignoring readdir() errors which also affected find(1).
See http://git.sv.gnu.org/cgit/gnulib.git/commit/?id=6835fc458f
* gnulib: Update to latest.
* bootstrap: Likewise.
* NEWS: Specifically mention the fts readdir() fix.
* find/testsuite/test_type-list.sh: Run "${ftsfind}" (i.e. newly built
executable) instead of find (version installed on build-system). The
latter may have prevented some tests to run.
Bug introduced in commit v4.6.0-61-g6c37ce4.
The regression (bug #48314) fixed in the previous commit was not
detected by the existing tests.
* find/testsuite/test_type-list.sh: Add checks for "-type f" and "-type l".
Since commit v4.6.0-61-g6c37ce4, the option -type and -ltype is broken
on armel, armhf and mipsel at least. The reason is that the union member
args of the struct predicate was not completely initialized as its new
bool types[] member may be implemented larger than the union member
initialized: str.
* find/tree.c (set_new_parent): Replace xmalloc() by xzalloc() to
initialize the complete new predicate structure. Therefore, remove all
individual NULL and false initializations.
(get_new_pred): Likewise, plus move the xzmalloc() invocations before
the if-condition to have only one place left for the allocation, thus
improving readability.
Reported by Andreas Metzler <ametzler@bebt.de> in
https://savannah.gnu.org/bugs/?48314
Co-authored-by: Bernhard Voelker <mail@bernhard-voelker.de>
Copyright-paperwork-exempt: Yes
Since commit v4.6.0-67-g595060f, 'make distcheck' failed:
ERROR: files left in build directory after distclean:
./find/oldfindnoop.out
./find/findnoop.out
./find/find--noop.err
./find/oldfind--noop.out
./find/find--noop.out
./find/oldfind--noop.err
./find/findnoop.err
./find/oldfindnoop.err
Makefile:1985: recipe for target 'distcleancheck' failed
* find/testsuite/sv-48180-refuse-noop.sh: Change the names of the *out
and *err files to be located in the temporary directory.
The pseudo-option '-noop' was never meant to be exposed to the user
interface. If specified by the user, find(1) segfaulted.
Bug introduced in commit FINDUTILS_4_3_0-1-12-g6b8a4db.
* find/parser.c (struct parser_table): Rename the parser_name element of
the ARG_NOOP entry from 'noop' to '--noop', thus indicating its pure
internal character.
(found_parser): Return NULL when the user has passed the '---noop' option;
the caller does the error handling.
* find/testsuite/sv-48180-refuse-noop.sh: Add test.
* find/testsuite/Makefile.am (test_shell_progs): Reference the test.
* NEWS (Bug fixes): Document the fix.
Reported by Tavian Barnes <tavianator@tavianator.com> in
https://savannah.gnu.org/bugs/?48180
When the -exec arguments buffer (usually 128k) is full and the given
command has been executed with all that arguments, find(1) missed to
execute the command yet another time if only 1 another file would have
to be processed.
Both find(1), i.e., nowadays FTS-version, and oldfind are affected.
This bug was present since the implementation of '-exec +' in 2005,
see commit FINDUTILS_4_2_11-1-25-gf0a6ac6.
* lib/buildcmd.c (bc_push_arg): Move the assignment to set 'state->todo'
to 1 down after the immediate execution which resets that flag.
* find/testsuite/sv-48030-exec-plus-bug.sh: Add a test.
* find/testsuite/Makefile.am (test_shell_progs): Reference the test.
* NEWS (Bug Fixes): Mention the fix.
Reported by Joe Philip Ninan <indiajoe@gmail.com> in
https://savannah.gnu.org/bugs/?48030
* doc/find.texi (node Controlling Parallelism): s/ouptut/output/
* xargs/xargs.1: Likewise.
* find/util.c (cleanup): While at it, fix the same typo here
in a comment, too.
Copyright-paperwork-exempt: Yes
* find/find.1 (-exec): Explain how exit status is propagated if the
-exec command {} + syntax is used.
(-execdir): Likewise.
Reported at https://bugzilla.redhat.com/1325049
* find/defs.h (enum file_type): Add enumeration for all (supported)
file types.
(struct predicate): Replace 'type' by 'types' as an array of bool
for the above enum file_type.
* find/parser.c (insert_type): Treat the argument to -type and -xtype
as a comma-separated list of type letters: instead of storing the
single type of the predicate, save the searched type letters in the
above 'types' array.
* find/pred.c (pred_type): Change the comparison against the saved file
type predicate: now check if the type of the actual file is in the array
of searched 'types'.
* find/testsuite/test_type-list.sh: Add test.
* find/testsuite/Makefile.am: Reference the test.
* find/find.1: Document the new feature.
* doc/find.texi: Likewise.
* NEWS: Likewise.
RFE originally initiated by Young Mo Kang in
http://lists.gnu.org/archive/html/bug-findutils/2016-02/msg00025.html
* locate/testsuite/config/unix.exp (locate_textonly): Don't append
a newline to the input file. Instead use exactly the data
specified by the caller. This means that in some cases the input
now lacks a final newline. Ignore any warning message produced by
frcode.
* locate/frcode.c (main): If the final character of the line
returned by getdelim is not the delimiter, don't overwrite it with
a NUL character. Instead, issue a warning message.
* NEWS: Mention this bugfix.
* doc/.gitignore: Ignore gendocs_template and gendocs_template_min,
since these are copied from gnulib/doc/.
* cfg.mk (manual_title): Set $manual_title, since this is needed
for maint.mk's nvocation of gendocs.sh. Also set
$gendocs_options_ so that the Texinfo tools can find
dblocation.texi.
* build-aux/.gitignore: Ignore gendocs.sh since it is copied into
this directory by gnulib-tool (the file is part of the gendocs
module).
* bootstrap.conf (maintainer_modules): Add gendocs, so that we can
automate the generation of HTML and other documentation for
http://www.gnu.org/software/findutils.
* find/find.1 (EXAMPLES): In the example to skip SCM administrative
directories, parenthesize "\( ... \)" the ORed tests. Otherwise, only
the SCM roots matching the last test, "CVS", are printed.
Reported in http://savannah.gnu.org/bugs/?47482
* find/find.1 (-D): Change argument name from "debugoptions" to
"debugopts" to match the synopsis, thus making searching in the man
page easier. While at it, sort possible arguments alphabetically.
When there are invalid options or arguments, all utilities printed the
full usage in addition to the original error diagnostic. The quite
large text distracted the user's attention from the error message.
* find/defs.h (usage): Mark as _GL_ATTRIBUTE_NORETURN, and remove the
arguments FP and MSG.
* find/parser.c (parse_help): Factor out the usage text from here ...
* find/util.c (usage): ... to here. Unless called with EXIT_SUCCESS,
just emit a short hint to try again with the --help option rather than
emitting the full usage. Afterward, exit the program with the given
status.
(debugassoc): Sort array, as it is used in that order when outputting
the usage text.
(process_debug_options): Also output an error diagnostic when no
argument to -D is passed.
(show_valid_options): Always output to stdout, always output the header
line. Update all callers.
* find/tree.c (build_expression): Update invocation of usage().
Also call it for syntax errors like unknown or invalid predicates
or invalid or missing arguments.
* locate/frcode.c (usage): Similar to the change in util.c (usage).
(main): Update invocation of usage(). Also output an error diagnostic
when an unexpected argument is passed.
* locate/locate.c (usage): Similar to the change in util.c (usage).
(dolocate): Update invocation of usage(). Also output an error
diagnostic when an unexpected argument is passed.
* locate/updatedb.sh: Output "Try ... --help ..." when an invalid option
is passed.
* xargs/xargs.c (usage): Similar to the change in util.c (usage).
(parse_num, main): Update all callers, removing the now-obsolete
return or exit().
* NEWS (Improvements): Mention the change.
* lib/.gitignore: Use pattern for prominent suffixes like *.o, *.log
and *.a; an entry for the new intermediate file bugreports.o was missing
here. Sort file.
* locate/.gitignore (bigram,code,bigram.o,code.o): Remove, as these
programs have been removed with commit v4.6.0-44-g89ec021.
* find/.gitignore: Use pattern for *.o, and sort the file.
* xargs/.gitignore: Likewise.
'make syntax-check' failed with:
locate/word_io.h:
maint.mk: the above files include assert.h but don't use it
maint.mk:479: recipe for target 'sc_prohibit_assert_without_use' failed
...
lib/bugreports.h:
maint.mk: empty line(s) or no newline at EOF
maint.mk:929: recipe for target 'sc_prohibit_empty_lines_at_EOF' failed
* locate/word_io.h (#include <assert.h>): Remove superfluous inclusion
of <assert.h>.
* lib/bugreports.h: Remove stray empty line at EOF.
* locate/Makefile.am (updatedb): Substitute PACKAGE_BUGREPORT,
PACKAGE_BUGREPORT_URL and PACKAGE_URL. We do this in the Makefile
directly since updatedb.sh is not an output file generated
directly by configure (instead, it's generated by the Makefile
itself).
* configure.ac (PACKAGE_BUGREPORT_URL): AC_DEFINE defines only a
preprocessor macro. In order to get a similar effect for
substituted output files, we need to use AC_SUBST. Hence
introduce a shell variable $bugreport_url which we pass to both
AC_SUBST and AC_DEFINE_UNQUOTED (replacing the previous call to
AC_DEFINE).
* locate/updatedb.sh (usage): Use PACKAGE_URL and PACKAGE_BUGREPORT_URL.
* configure.ac (PACKAGE_BUGREPORT_URL): Define this macro to point
to the findutils bug-reporting web page.
* lib/bugreports.c: New file, defining the function
explain_how_to_report_bugs which explains how to report bugs. Use
the new PACKAGE_BUGREPORT_URL macro.
* lib/bugreports.h: New file, providing a declaration of
explain_how_to_report_bugs.
* lib/Makefile.am (libfind_a_SOURCES): Add bugreports.c and
bugreports.h.
* find/parser.c (parse_help): Call explain_how_to_report_bugs
instead of printing an explanation here.
* xargs/xargs.c (usage): Likewise.
* locate/locate.c (usage): Likewise.
* locate/code.c (usage): Likewise.
* locate/frcode.c (usage): Likewise.
* locate/updatedb.sh (usage): Produce a similar message
by including it in the usage text itself.
* xargs/xargs.c (parse_num): Specify the value passed for the
invalid argument to make it easier to debug things when bug
reports don't specify the actual command line.
* locate/testsuite/Makefile.am (EXTRA_DIST_EXP): Remove
locate.gnu/old_prefix.exp and locate.gnu/oldformat.exp.
(EXTRA_DIST_XO): Remove locate.gnu/old_prefix.xo and
locate.gnu/oldformat.xo.
* doc/find.texi (Database Formats): Remove the warning about old
versions of locate failing to read the LOCATE02 database format.
Mention that the slocate database format is also supported.
(Old Database Format): Point out that updatedb will no longer
produce the old format.
(Invoking updatedb): Remove mention of the --old-format option.
Remove mention of --dbformat=old.
(Long File Name Bugs with Old-Format Databases): Remove this
section.
* locate/updatedb.sh: remove support for --dbformat=old and
--old-format.
(checkbinary): Don't look for the bigram and code binaries.
* locate/updatedb.1: Explain that support for the old database
format has been removed from updatedb and will shortly be removed
from locate also. Remove the documentation for the removed
option --old-format and mention of --dbformat-old.
* locate/code.c: remove since this program was only used to
generate old-format databases.
* locate/bigram.c: remove since this program was only used to
generate old-format databases.
* po/POTFILES.in: Remove bigram.c and code.c.
* locate/word_io.c (putword): Remove this function, since it was
only needed for making old-format databases.
* find/find.1 (NON-BUGS): Don't mention bigram.c and code.c in the
example.
* locate/locatedb.h: Remove declaration of putword, which has been
deleted.
* locate/Makefile.am (libexec_PROGRAMS): Remove bigram and code
(since they were only used to generate old-format databases).
(updatedb): Don't substitute @bigram@ and @code@.
(code_SOURCES): Delete.
* locate/testsuite/locate.gnu/old_prefix.exp: delete test case for
the old database format.
* locate/testsuite/locate.gnu/old_prefix.xo: Likewise.
* locate/testsuite/locate.gnu/oldformat.exp: Likewise.
* locate/testsuite/locate.gnu/oldformat.xo: Likewise.
* TODO: manpages for bigram and code are no longer needed.
* NEWS: Mention these changes.
* locate/updatedb.sh: fix typo in comment pointed out by Bernhard
Voelker.
* NEWS: point out that the order of file names in the locate
database is now different, but still unspecified.
* locate/updatedb.sh: Set LC_ALL to C to avoid unexpected character
encodings in path names causing sort to fail (idea from Clarence
Risher). Don't do case-folding, since the character set in now C,
which is likely inconsistent with the user's expectations anyway.
Honour $TMPDIR. Correct the error message you get if you specify
both --old-format and --dbformat.
* NEWS: Explain these changes.
Avoid growing lists of copyright year numbers by collapsing consecutive
years like "1996, 1997-2015, 2016" into a single range like "1996-2016".
This change may take effect the next time 'make update-copyright' is run.
* cfg.mk (update-copyright-env): Add with UPDATE_COPYRIGHT_USE_INTERVALS=1
as described above. Also add UPDATE_COPYRIGHT_FORCE=1 to rejoin some
split lines if necessary.
The entries in the exemption list are processed by
"grep -vEf ./.x-update-copyright" and therefore evaluated as an
extended regular expression (ERE). Thus, e,g, a "bootstrap" entry
would also match for "bootstrap.conf" which we may want to be updated.
The current entries are unambiguous so far, but to avoid confusion when
adding further entries in the future, turn them into proper EREs.
* .x-update-copyright: Change all entries to EREs, i.e. including
the caret ^ and dollar sign $ meta-characters matching the beginning
and the end of a line.
Avoid bootstrap warnings:
Notice from module malloc:
This module is deprecated. Use the module 'malloc-gnu' instead.
Notice from module realloc:
This module is deprecated. Use the module 'realloc-gnu' instead.
* bootstrap.conf (gnulib_modules): Use malloc-gnu and realloc-gnu
modules, rather than malloc and realloc. The shorter-named modules
are deprecated.
* Makefile.am (findutils-check-pofiles): s/configure\.in/configure.ac/,
as that file has been renamed long ago (FINDUTILS_4_3_8-1-50-gc4ef190).
While at it, re-indent the lines to shorten the lines for readability.
(coverage-clean): Re-indent likewise.
(gen-ChangeLog): While at it, replace leading blanks by a tab here for
a proper make syntax; introduced in previous commit (v4.6.0-17-g48bf0d0).
Avoid the following error when running ./bootstrap on a clean tree:
autoreconf: running: aclocal -I gl/m4 --force -I gl/m4 -I m4
configure.ac:129: error: AC_PROG_CC cannot be called after AM_PROG_CC_C_O
../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
../../lib/autoconf/general.m4:1462: AC_ARG_ENABLE is expanded from...
configure.ac:129: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1
autoreconf: aclocal failed with exit status: 1
./bootstrap: autoreconf failed
* configure.ac (compiler-warnings-are-errors): Remove AC_PROG_CC, as this
has already run before and is not allowed at this point anyway.
* lib/regexprops.c (copying): Update the text so that the
copyright years (and the line breaks) match the
result of "make update-copyright".
* doc/regexprops.texi: Tweak copyright years to match the
result of "make update-copyright".
* All other files: update copyright years if the file has
a copyright statement.
* .x-update-copyright: new file, a list of files to exclude
from automated copyright updates.
* lib/regexprops.c (newpara): Function parameter list should be
declared as void in the function definition, instead of leaving it
blank (C++ style). This fixes a GCC warning controlled by
-Wstrict-prototypes.
(beginenum): Likewise.
(endenum): Likewise.
(endtable): Likewise.
(copying): Update copyright years.
* doc/regexprops.texi: Update copyright years to match the output
of regexprops.c.
* configure.ac: For --enable-compiler-warnings, don't enable
warnings that flag usage common in gnulib (such as variable-length
arrays) or which provide no value (such as switch statements
lacking a default case that would never be used). Also don't
enable some useful warnings (such as missed opportunitied to mark
a function as pure) which we don't yet have a portable way of
avoiding.
Also add a new option --enable-compiler-warnings-are-errors,
turning GCC compiler warnings into errors. This is off by
default.
* find/print.c (do_fprintf): Don't use a dynamic format string,
even when we know it contains no formatting directives, because
this confuses whatever produces the GCC warning
-Wformat-security.
* find/util.c (check_nofollow): Avoid compiler warnings about
comparison between the float variable release and some double
constants by changing the constants to be floats, too.
* find/parser.c (estimate_file_age_success_rate): Avoid warnings
of comparison of float against other types by consistently using
float constants.
(insert_type): move the definition of type_cell and set it in the
switch cases handling S_IFLINK and other types of file which may
not be defined on the platform we're building for. We do this in
order to silence a compiler warning about use of an uninitialised
value. It's not really used uninitialised, it's just that the
compiler doesn't know that the way we're calling error() will
cause that function not to return.
(parse_time): Avoid a compiler warning about signed/unsigned
comparison by using a cast.
* find/ftsfind.c: Don't #define USE_SAFE_CHDIR, it's unused.
Likewise STRINGIFY.
(show_outstanding_execdirs): Avoid overflowing int variable seen
by making a bool and setting it to true, instead of incrementing
it.
(main): Correct the call to ctime; it takes time_t*, so don't pass
struct timeval* (instead, pass the address of the tv_sec member).
* find/exec.c (launch): Avoid warnign of unused parameter ctl. We
really don't use it, but this function takes the parameter as
it's a callback.
* find/pred.c (struct pred_assoc): make the pred_name member const.
* find/defs.h: Declare pred_quit as _GL_ATTRIBUTE_NORETURN.
* locate/word_io.c (decode_value): Fix typo in comment.
(getword): Remove unused parameter minvalue.
* locate/locatedb.h: Adjust declaration of decode_value to remove
minvalue parameter.
* locate/locate.c: Declare dolocate(). Make that function static.
(visit_old_format): Don't pass a minvalue parameter to getword()
since it no longer wants it.
* lib/listfile.h (list_file): Make the relname parameter const.
* lib/listfile.c (list_file): Make the relname parameter const.
Remove the unused local variable inode_field_width. Update
nlink_width with the greatest width of the st_nlink field, and
print the field using the maximum width (as we do for other
fields).
* find/find.c (get_current_dirfd): remove unused function.
(process_dir): make parameters const: parent, pathname, name.
(process_path): make parameters const: parent, pathname, name.
(at_top): Modify the function pointer parameter accordingly.
* find/ftsfind.c (get_fts_info_name): Now returns const char*, not
char*.
(show_outstanding_execdirs): Fix type of loop variable to avoid
possible overflow.
(process_all_startpoints): Avoid compiler warning about overflow
of int loop variable.
* find/defs.h (struct predicate): Make p_name const.
(struct state): make rel_pathname const.
* find/exec.c (impl_pred_exec): Make prefix const.
(launch): Silence compiler warning about unused parameter argc.
* find/pred.c (blank_rtrim): Make str parameter const, since we do
not modify it.
* find/util.c (debug_option_assoc): name and docstring are now
const qualified.
(show_valid_debug_options): Avoid signed/unsigned comparison by
using a size_t array index.
(set_stat_placeholders): Avoid a compiler warning on systems
lacking birth time fields (and on which this function therefore
does nothing).
* find/Makefile.am (AM_CPPFLAGS): Remove -I../intl, since that
directory does not exist; it was removed in 2006 by Paul Eggert
(commit 9499a434f9da547373fa9d236cb397717ebb0c50).
* locate/Makefile.am (AM_CPPFLAGS): Likewise.
* xargs/Makefile.am (AM_CPPFLAGS): Likewise.
* gnulib-local/lib/gcc-function-attributes.h: New header file,
providing macros to allow portable use of GCC function attributes.
* gnulib-local/modules/gcc-attributes: New (local) module.
* bootstrap.conf (local_gl_dir): Set local_gl_dir so that we can
use our new module. Use the gcc-attributes module.
* find/defs.h:
Include gcc-function-attributes.h. Delete our local macro
ATTRIBUTE_NORETURN and use the one from the header file.
* find/parser.c: Include gcc-function-attributes.h. Add
_GL_ATTRIBUTE_NORETURN to parse_help, parse_version and
pred_quit.
* find/print.c (checked_fprintf): add attribute
_GL_ATTRIBUTE_FORMAT_PRINTF to the function declaration.
* configure.ac: gnulib supplies waitpid and C89 supplies strspn.
Hence there is no need for any call to FINDLIB_REPLACE_FUNCS.
That being the case we don't need to test it with forcefindlib.
* m4/findlib.m4: remove since FINDLIB_REPLACE_FUNCS is unused.
* m4/Makefile.am (EXTRA_DIST): findlib.m4 has been deleted, so
don't distribute it.
* lib/waitpid.c: remove, since gnulib provides this.
* lib/forcefindlib.c: remove, since there is no longer any need to
test FINDLIB_REPLACE_FUNCS.
* lib/Makefile.am (libfind_a_SOURCES): Specify this variable all
in one go, instead of in several parts. Move some header files
into here instead of just having them in EXTRA_DIST. Because
FINDLIBOBJS is empty now, there is no need to copy that to
libfind_a_LIBADD.
* build-aux/gen-changelog.sh: Shell script for generating the
ChangeLog. The effect is much the same as the previous version of
the gen-ChangeLog rule, but it is easier to run this script to
discover what the ChangeLog resulting from a recent commit is.
The only change is that we now also use --strip-cherry-pick.
* build-aux/Makefile.am (EXTRA_DIST): Distribute gen-changelog.sh.
* Makefile.am (gen-ChangeLog): Simplify the gen-ChangeLog rule by
calling gen-changelog.sh.
* find/pred.c (print_optlist): output now distinguishes more
clearly between estimated and actual success rates.
* find/parser.c (insert_type): Use estimated success rates
computed by surveying a real file system. Use 4 digits of
precision for est_success_rate.
* find/tree.c (print_tree): Consistently use 4 digits of precision
for est_success_rate.
Problem report from Ludovic Courtès (though this fix is unlike the one he
suggested).
* find/testsuite/sv-34976-execdir-fd-leak.sh (make_test_data):
Don't assume that there is an xargs binary already on the path.
* find/defs.h (enum DebugOption): add DebugTime.
* find/util.c (debugassoc): -D time sets the DebugTime debug flag.
* find/oldfind.c (main): print the value of options.cur_day_start
when "-D time" is in effect (instead of when DEBUG is #defined).
* find/ftsfind.c (main): Likewise.
* find/pred.c (pred_table): Instantiate pred_table even if DEBUG
is not #defined.
* find/parser.c (parse_version): DEBUG is no longer a (distinct)
feature.
* configure.ac: Remove the --enable-debug option (all debugging is
now controlled via find's -D option). Don't #define the
preprocessor macro DEBUG.
* NEWS: Mention this change.
* configure.ac: We no longer need to #define DEBUG_STAT with
--enable-debug, since the relevant debug messages are controlled
instead with find's command-line option -D stat.
* find/defs.h (enum DebugOption): bitmask values are now expressed
as 1 << N instead of decimal values, simply to make it clearer
when we need to start worrying about which integer type is used to
hold the bitmask.
* find/parser.c (fallback_getfilecon): Print a debug message when
the -D stat option is in effect, whether or not find was
configured with --enable-debug.
(parse_version): DEBUG_STAT is no longer a (distinct) feature.
* configure.ac: Remove the --enable-id-cache option. This option
became a no-op in findutils-4.5.15. Before that it did something
but the code was buggy. See https://savannah.gnu.org/bugs/?45062
for details.
* NEWS: State that this configure option is removed.
For some time now, this translation has had 0 out of the possible 283
messages actually translated, so the po file has no current value. If
any findutils are once again translated this translation can be
reinstated.
* configure.ac: Remove rw from ALL_LINGUAS.
* po/rw.po: Delete.
* configure.ac: Update version number to indicate that the Git
repository has moved on from 4.6.0 (the trunk will be 4.7.x release
series).
* NEWS: Likewise.
* README-hacking (Required format for check-in messages): Add a paragraph
aiming at maintainers to check that the author of the commit has proper
copyright assignment in place, or otherwise how to document that this
is not needed.
* configure.ac: Update the version number to 4.6.0.
* NEWS: Update the version number to 4.6.0. Add a release date.
Summarize the changes since the previous stable release. Explain
that all bugs fixed in 4.4.x are also fixed in this release.
xargs.c: In function 'fopen_cloexec_for_read_only':
xargs.c:387:1: warning: control reaches end of non-void function [-Wreturn-type]
* xargs/xargs.c (fopen_cloexec_for_read_only): Return result.
* configure.ac: Advance the version to 4.5.20-git, signifying that
the code in the repository is no longer identical to that of the
4.5.19 release.
* NEWS: Likewise.
Patch contributed via http://bugs.debian.org/726870
* find/find.1: A full stop (.) that starts or ends a string and is a
part of it, is now protected with \& and the space between some
sentences has been reduced or increased.
Copyright-paperwork-exempt: Yes
Issue and patch via http://bugs.debian.org/726870
Copyright-paperwork-exempt: Yes
* find/find.1: correct typos: filsystem, signifiy, immeidately
* find/find.1: correct grammar: which would -> which you would
These improvements were suggested at https://savannah.gnu.org/bugs/?46714.
* find/Makefile.am (check_PROGRAMS): Put oldfind in check_PROGRAMS
instead of noinst_PROGRAMS, so that we don't build it when it is
not needed.
* m4/withfts.m4 (FIND_WITH_FTS): Fix whitespace alignment.
(FIND_WITH_FTS): The WITH_FTS C preprocessor macro and the
accompanying Automake conditional are no longer needed.
* THANKS: Add Mike Frysinger.
* configure.ac: Check for getrlimit function directly rather than the
"sys/resource.h" header file.
* lib/fdleak.c: Include "sys/resource.h" when HAVE_GETRLIMIT is set.
(get_max_fd): s/HAVE_GETRUSAGE/HAVE_GETRLIMIT/.
* Makefile.am (gen-ChangeLog): Replace 8 spaces by a tab to avoid
sc_makefile_TAB_only_indentation failure.
* po/POTFILES.in: Remove some entries to let sc_po_check pass.
While at it, sort the entries.
* find/print.c (do_fprintf): Remove stray semicolon to let
sc_prohibit_double_semicolon pass.
* find/util.c (digest_mode): Likewise.
* bootstrap.conf: Change comment to let sc_prohibit_doubled_word pass.
* build-aux/git-log-fix: Remove empty lines at EOF to let
sc_prohibit_empty_lines_at_EOF pass.
* find/testsuite/Makefile.am: Likewise.
* find/testsuite/sv-34079.sh: Likewise.
* find/testsuite/test_inode.sh: Likewise.
* locate/testsuite/locate.gnu/slocate.exp: Likewise.
* lib/buildcmd.c: Remove unused include of openat header to let
sc_prohibit_openat_without_use pass.
* lib/listfile.c: Likewise.
* find/util.c: Remove unused include of 'verify.h' to let
sc_prohibit_verify_without_use pass.
* xargs/xargs.c: Likewise.
* find/parser.c (insert_regex): Mark error diagnostic for translation;
found by 'make sc_unmarked_diagnostics'.
* cfg.mk (exclude_file_name_regexp--sc_prohibit_strncpy): Exempt the
2 remaining sources using the possibly dangerous strncpy function
from the syntax-check.
* find/Makefile.am (oldfind_SOURCES): rename find.c to oldfind.c.
* find/.gitignore: Likewise.
* po/POTFILES.in: rename find/find.c to find/oldfind.c
* find/defs.h: Change references to find.c to oldfind.c.
* doc/find-maint.texi (Factor Out Repeated Code): Likewise.
* find/ftsfind.c: Point out that this file is derived from
oldfind.c (instead of leaving a reference to the old name of the
renamed file).
* find/testsuite/config/unix.exp: Look for ftsfind.o instead of find.o
when checking that we're really looking at the build directory.
This fulfills a reqeust made as Savannah bug #46714.
* NEWS: Mention this change.
* m4/withfts.m4 (FIND_WITH_FTS): --with-fts is the only supported
choice. The configure script now fails if run using --without-fts
or --with-fts=no.
* find/Makefile.am (noinst_PROGRAMS): Never install oldfind.
Delete the oldfind.1 and ftsfind.1 manpages, leaving only find.1.
Fix a typo and remove some commented-out lines.
* find/find.c (main): add a comment pointing out that this is not
the main() function of th binary that actually gets installed.
* find/ftsfind.1: delete.
* find/oldfind.1: delete.
* find/find.1: Remove the section "BINARIES" since there are no
longer two binaries.
* find/testsuite/config/unix.exp: Assume --with-fts; hence the binaries
are always called oldfind and find (and there is no ftsfind binary).
* README-hacking (footer): use the official FDL license wording as
listed in FDL's "ADDENDUM: How to use this License for your
documents". Update copyright year.
* NEWS (footer): Likewise.
* doc/find-maint.texi: Likewise.
* doc/find.texi: Likewise.
* doc/regexprops.texi: Likewise.
* lib/regexprops.c (copying): Amend the code to emit the updated
wording. Update the copyright year.
* find/parser.c (parse_table): -warn is now parsed as a positional
option instead of a global one. This does not affect the effect of
-warn. (found_parser): Warnings are no longer issued for global
options specified in confusing positions when the POSIXLY_CORRECT
environment variable is set. POSIXLY_CORRECT also suppresses warnings
about -d and the use of '/' in the argument to -name. * find/find.1:
Eliminate the duplicate section name OPTIONS, using the OPTIONS
section just for -L, -P and so on. Other options are now documented
in the subsection POSITIONAL OPTIONS (if they take effect only on
items on the command line which appear later) or GLOBAL OPTIONS (if
they take effect even on tests/actions appearing before them). The
-regextype option in particular is now correctly documented as being
positional. We rename the EXPRESSIONS section to EXPRESSION in order
to match the usage summary. The OPERATORS heading is demoted to a
subheading so that it fits within EXPRESSION. (POSITIONAL OPTIONS):
be more explicit about how warnings are controlled by -warn, -nowarn
and POSIXLY_CORRECT. * NEWS: Describe the changes to the find manual
page and warnings.
* xargs/xargs.c (fopen_cloexec_for_read_only): when fdopen fails,
close the file descriptor instead of leaking it. Also, use GNU-style
brace positioning. Both problems were noticed by Paul Eggert.
This fixes a bug reported by Kyle Sallee (by email, so there is no
Savannah bug number for it).
* xargs/xargs.c (fopen_cloexec_for_read_only): New function; like
fopen (..., "r") but sets the resulting file to be closed on exec.
(main): Remember any non-O_CLOEXEC file desciptors that were open
on startup so that we don't get false positives later.
(prep_child_for_exec): Call complain_about_leaky_fds.
(main): Any file opened to support the -a option is marked
close-on-exec. If we open /dev/tty to support the -p option, mark
that file close-on-exec, too.
* NEWS: mention this bugfix.
Before this change, a pointer to struct saved_cwd was used in place
of char*, leading to incorrect error diagnostics, e.g.:
$ chmod a-x . && find / -maxdepth 0 -exec true \;
find: Failed to change directory: ÿÿÿÿ: Permission denied
find: failed to restore initial working directory: ÿÿÿÿ: Permission denied
* find/exec.c (prep_child_for_exec): Fix error diagnostics.
* find/util.c (record_initial_cwd, cleanup_initial_cwd): Likewise.
echo"$(top_srcdir) has no .git subdirectory" >&2;\
fi
## Check that we actually shipped all the .po files. If this rule fails,
## check ALL_LINGUAS in configure.in against the po files in the source
## directory (their names, not their contents)
findutils-check-pofiles:
@echo ;echo Checking to see if we distributed the full set of .po files
distcount=`ls $(distdir)/po/*.po | wc -l`;srccount=`ls $(srcdir)/po/*.po | wc -l`;test$$distcount -eq $$srccount ||(echo FAILED: Please check the value of ALL_LINGUAS in configure.in against the actual set of ".po" files >&2;false)
@echo All .po files distributed OK.
## Check that we actually shipped all the test files that exist in the source.
## runtest will run all the .exp files it finds, and so if we don't ship all
## of them, there will be some tests which people using the CVS code will be
AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
AC_CONFIG_SRCDIR([find/pred.c])
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_HOST
AC_CONFIG_MACRO_DIR(gl/m4)
dnl Set of available languages.
ALL_LINGUAS="be bg cs ca da de el eo es et fi fr ga gl hr hu id it ja ko lg lt ms nb nl pl pt pt_BR ro ru rw sk sl sr sv tr uk vi zh_CN zh_TW"
AC_SUBST(AUXDIR,$ac_aux_dir)
dnl check for --with-fts
FIND_WITH_FTS
AC_ARG_ENABLE(id-cache,
[ --enable-id-cache This currently has no effect.],)
AC_ARG_ENABLE(debug,
AS_HELP_STRING(--enable-debug,Enable debugging output which is likely to be interesting to people debugging findutils),
[ac_cv_debug=$enableval],[ac_cv_debug=no])
AC_ARG_ENABLE(leaf-optimisation,
AS_HELP_STRING(--enable-leaf-optimisation,Enable an optimisation which saves lstat calls to identify subdirectories on filesystems having traditional Unix semantics),
@c 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
@c Copyright (C) 1994--2026 Free Software Foundation, Inc.
@c
@c Permission is granted to copy, distribute and/or modify this document
@c under the terms of the GNU Free Documentation License, Version 1.3 or
@c any later version published by the Free Software Foundation; with no
@c Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
@c Texts. A copy of the license is included in the ``GNU Free
@c Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
@c A copy of the license is included in the ``GNU Free
@c Documentation License'' file as part of this distribution.
@c this regular expression description is for: findutils
@ -43,7 +42,8 @@ matches a @samp{?}.
@end table
Bracket expressions are used to match ranges of characters. Bracket expressions where the range is backward, for example @samp{[z-a]}, are ignored. Within square brackets, @samp{\} is taken literally. Character classes are not supported, so for example you would need to use @samp{[0-9]} instead of @samp{[[:digit:]]}.
Bracket expressions are used to match ranges of characters. Bracket expressions where the range is backward, for example @samp{[z-a]}, are ignored. Within square brackets, @samp{\} is taken literally. Character classes are supported; for example @samp{[[:digit:]]} will match a single decimal digit.
GNU extensions are supported:
@enumerate
@ -74,11 +74,10 @@ The alternation operator is @samp{\|}.
The character @samp{^} only represents the beginning of a string when it appears:
@enumerate
@item
At the beginning of a regular expression
@item At the beginning of a regular expression
@item After an open-group, signified by @samp{\(}
@item After an open-group, signified by
@samp{\(}
@item After the alternation operator @samp{\|}
@ -90,8 +89,8 @@ The character @samp{$} only represents the end of a string when it appears:
@item At the end of a regular expression
@item Before a close-group, signified by
@samp{\)}
@item Before a close-group, signified by @samp{\)}
@item Before the alternation operator @samp{\|}
@end enumerate
@ -102,13 +101,15 @@ The character @samp{$} only represents the end of a string when it appears:
@item At the beginning of a regular expression
@item After an open-group, signified by
@samp{\(}
@item After an open-group, signified by @samp{\(}
@item After the alternation operator @samp{\|}
@end enumerate
Intervals are specified by @samp{\@{} and @samp{\@}}.
Invalid intervals such as @samp{a\@{1z} are not accepted.
The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.
@ -136,21 +137,24 @@ matches a @samp{?}.
Bracket expressions are used to match ranges of characters. Bracket expressions where the range is backward, for example @samp{[z-a]}, are invalid. Within square brackets, @samp{\} can be used to quote the following character. Character classes are supported; for example @samp{[[:digit:]]} will match a single decimal digit.
GNU extensions are not supported and so @samp{\w}, @samp{\W}, @samp{\<}, @samp{\>}, @samp{\b}, @samp{\B}, @samp{\`}, and @samp{\'} match @samp{w}, @samp{W}, @samp{<}, @samp{>}, @samp{b}, @samp{B}, @samp{`}, and @samp{'} respectively.
Grouping is performed with parentheses @samp{()}. An unmatched @samp{)} matches just itself. A backslash followed by a digit matches that digit.
The alternation operator is @samp{|}.
The characters @samp{^} and @samp{$} always represent the beginning and end of a string respectively, except within square brackets. Within brackets, @samp{^} can be used to invert the membership of the character class being specified.
@samp{*}, @samp{+} and @samp{?} are special at any point in a regular expression except:
@enumerate
@item At the beginning of a regular expression
@item After an open-group, signified by
@samp{(}
@item After an open-group, signified by @samp{(}
@item After the alternation operator @samp{|}
@end enumerate
@ -183,6 +187,7 @@ matches a @samp{?}.
Bracket expressions are used to match ranges of characters. Bracket expressions where the range is backward, for example @samp{[z-a]}, are invalid. Within square brackets, @samp{\} is taken literally. Character classes are supported; for example @samp{[[:digit:]]} will match a single decimal digit.
GNU extensions are supported:
@enumerate
@ -211,9 +216,12 @@ The alternation operator is @samp{|}.
The characters @samp{^} and @samp{$} always represent the beginning and end of a string respectively, except within square brackets. Within brackets, @samp{^} can be used to invert the membership of the character class being specified.
The characters @samp{*}, @samp{+} and @samp{?} are special anywhere in a regular expression.
Intervals are specified by @samp{@{} and @samp{@}}. Invalid intervals are treated as literals, for example @samp{a@{1} is treated as @samp{a\@{1}
Intervals are specified by @samp{@{} and @samp{@}}.
Invalid intervals are treated as literals, for example @samp{a@{1} is treated as @samp{a\@{1}
The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.
@ -238,7 +246,8 @@ matches a @samp{?}.
@end table
Bracket expressions are used to match ranges of characters. Bracket expressions where the range is backward, for example @samp{[z-a]}, are ignored. Within square brackets, @samp{\} is taken literally. Character classes are not supported, so for example you would need to use @samp{[0-9]} instead of @samp{[[:digit:]]}.
Bracket expressions are used to match ranges of characters. Bracket expressions where the range is backward, for example @samp{[z-a]}, are ignored. Within square brackets, @samp{\} is taken literally. Character classes are supported; for example @samp{[[:digit:]]} will match a single decimal digit.
GNU extensions are supported:
@enumerate
@ -269,11 +278,10 @@ The alternation operator is @samp{\|}.
The character @samp{^} only represents the beginning of a string when it appears:
@enumerate
@item
At the beginning of a regular expression
@item At the beginning of a regular expression
@item After an open-group, signified by @samp{\(}
@item After an open-group, signified by
@samp{\(}
@item After the alternation operator @samp{\|}
@ -285,8 +293,8 @@ The character @samp{$} only represents the end of a string when it appears:
@item At the end of a regular expression
@item Before a close-group, signified by
@samp{\)}
@item Before a close-group, signified by @samp{\)}
@item Before the alternation operator @samp{\|}
@end enumerate
@ -297,13 +305,15 @@ The character @samp{$} only represents the end of a string when it appears:
@item At the beginning of a regular expression
@item After an open-group, signified by
@samp{\(}
@item After an open-group, signified by @samp{\(}
@item After the alternation operator @samp{\|}
@end enumerate
Intervals are specified by @samp{\@{} and @samp{\@}}.
Invalid intervals such as @samp{a\@{1z} are not accepted.
The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.
@ -331,6 +341,7 @@ matches a @samp{?}.
Bracket expressions are used to match ranges of characters. Bracket expressions where the range is backward, for example @samp{[z-a]}, are invalid. Within square brackets, @samp{\} can be used to quote the following character. Character classes are supported; for example @samp{[[:digit:]]} will match a single decimal digit.
GNU extensions are supported:
@enumerate
@ -359,19 +370,21 @@ The alternation operator is @samp{|}.
The characters @samp{^} and @samp{$} always represent the beginning and end of a string respectively, except within square brackets. Within brackets, @samp{^} can be used to invert the membership of the character class being specified.
@samp{*}, @samp{+} and @samp{?} are special at any point in a regular expression except:
@enumerate
@item At the beginning of a regular expression
@item After an open-group, signified by
@samp{(}
@item After an open-group, signified by @samp{(}
@item After the alternation operator @samp{|}
@end enumerate
Intervals are specified by @samp{@{} and @samp{@}}. Invalid intervals are treated as literals, for example @samp{a@{1} is treated as @samp{a\@{1}
Intervals are specified by @samp{@{} and @samp{@}}.
Invalid intervals are treated as literals, for example @samp{a@{1} is treated as @samp{a\@{1}
The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.
@ -391,11 +404,13 @@ indicates that the regular expression should match one or more occurrences of th
indicates that the regular expression should match zero or one occurrence of the previous atom or regexp.
@item + and ?
match themselves.
@end table
Bracket expressions are used to match ranges of characters. Bracket expressions where the range is backward, for example @samp{[z-a]}, are invalid. Within square brackets, @samp{\} is taken literally. Character classes are supported; for example @samp{[[:digit:]]} will match a single decimal digit.
GNU extensions are supported:
@enumerate
@ -425,11 +440,10 @@ The alternation operator is @samp{\|}.
The character @samp{^} only represents the beginning of a string when it appears:
@enumerate
@item
At the beginning of a regular expression
@item At the beginning of a regular expression
@item After an open-group, signified by @samp{\(}
@item After an open-group, signified by
@samp{\(}
@item After a newline
@ -443,8 +457,8 @@ The character @samp{$} only represents the end of a string when it appears:
@item At the end of a regular expression
@item Before a close-group, signified by
@samp{\)}
@item Before a close-group, signified by @samp{\)}
@item Before a newline
@item Before the alternation operator @samp{\|}
@ -457,8 +471,8 @@ The character @samp{$} only represents the end of a string when it appears:
@item At the beginning of a regular expression
@item After an open-group, signified by
@samp{\(}
@item After an open-group, signified by @samp{\(}
@item After a newline
@item After the alternation operator @samp{\|}
@ -466,7 +480,9 @@ The character @samp{$} only represents the end of a string when it appears:
@end enumerate
Intervals are specified by @samp{\@{} and @samp{\@}}. Invalid intervals such as @samp{a\@{1z} are not accepted.
Intervals are specified by @samp{\@{} and @samp{\@}}.
Invalid intervals such as @samp{a\@{1z} are not accepted.
The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.
@ -493,34 +509,127 @@ matches a @samp{?}.
Bracket expressions are used to match ranges of characters. Bracket expressions where the range is backward, for example @samp{[z-a]}, are invalid. Within square brackets, @samp{\} can be used to quote the following character. Character classes are supported; for example @samp{[[:digit:]]} will match a single decimal digit.
GNU extensions are not supported and so @samp{\w}, @samp{\W}, @samp{\<}, @samp{\>}, @samp{\b}, @samp{\B}, @samp{\`}, and @samp{\'} match @samp{w}, @samp{W}, @samp{<}, @samp{>}, @samp{b}, @samp{B}, @samp{`}, and @samp{'} respectively.
Grouping is performed with parentheses @samp{()}. An unmatched @samp{)} matches just itself. A backslash followed by a digit acts as a back-reference and matches the same thing as the previous grouped expression indicated by that number. For example @samp{\2} matches the second group expression. The order of group expressions is determined by the position of their opening parenthesis @samp{(}.
The alternation operator is @samp{|}.
The characters @samp{^} and @samp{$} always represent the beginning and end of a string respectively, except within square brackets. Within brackets, @samp{^} can be used to invert the membership of the character class being specified.
@samp{*}, @samp{+} and @samp{?} are special at any point in a regular expression except the following places, where they are not allowed:
@enumerate
@item At the beginning of a regular expression
@item After an open-group, signified by
@samp{(}
@item After an open-group, signified by @samp{(}
@item After the alternation operator @samp{|}
@end enumerate
Intervals are specified by @samp{@{} and @samp{@}}. Invalid intervals are treated as literals, for example @samp{a@{1} is treated as @samp{a\@{1}
Intervals are specified by @samp{@{} and @samp{@}}.
Invalid intervals are treated as literals, for example @samp{a@{1} is treated as @samp{a\@{1}
The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.
The character @samp{.} matches any single character except the null character.
@table @samp
@item \+
indicates that the regular expression should match one or more occurrences of the previous atom or regexp.
@item \?
indicates that the regular expression should match zero or one occurrence of the previous atom or regexp.
@item + and ?
match themselves.
@end table
Bracket expressions are used to match ranges of characters. Bracket expressions where the range is backward, for example @samp{[z-a]}, are invalid. Within square brackets, @samp{\} is taken literally. Character classes are supported; for example @samp{[[:digit:]]} will match a single decimal digit.
GNU extensions are supported:
@enumerate
@item @samp{\w} matches a character within a word
@item @samp{\W} matches a character which is not within a word
@item @samp{\<} matches the beginning of a word
@item @samp{\>} matches the end of a word
@item @samp{\b} matches a word boundary
@item @samp{\B} matches characters which are not a word boundary
@item @samp{\`} matches the beginning of the whole input
@item @samp{\'} matches the end of the whole input
@end enumerate
Grouping is performed with backslashes followed by parentheses @samp{\(}, @samp{\)}. A backslash followed by a digit acts as a back-reference and matches the same thing as the previous grouped expression indicated by that number. For example @samp{\2} matches the second group expression. The order of group expressions is determined by the position of their opening parenthesis @samp{\(}.
The alternation operator is @samp{\|}.
The character @samp{^} only represents the beginning of a string when it appears:
@enumerate
@item At the beginning of a regular expression
@item After an open-group, signified by @samp{\(}
@item After the alternation operator @samp{\|}
@end enumerate
The character @samp{$} only represents the end of a string when it appears:
@enumerate
@item At the end of a regular expression
@item Before a close-group, signified by @samp{\)}
@item Before the alternation operator @samp{\|}
@end enumerate
@samp{\*}, @samp{\+} and @samp{\?} are special at any point in a regular expression except:
@enumerate
@item At the beginning of a regular expression
@item After an open-group, signified by @samp{\(}
@item After the alternation operator @samp{\|}
@end enumerate
Intervals are specified by @samp{\@{} and @samp{\@}}.
Invalid intervals such as @samp{a\@{1z} are not accepted.
The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.
Bracket expressions are used to match ranges of characters. Bracket expressions where the range is backward, for example @samp{[z-a]}, are invalid. Within square brackets, @samp{\} is taken literally. Character classes are supported; for example @samp{[[:digit:]]} will match a single decimal digit.
GNU extensions are supported:
@enumerate
@ -574,19 +684,22 @@ The alternation operator is @samp{|}.
The characters @samp{^} and @samp{$} always represent the beginning and end of a string respectively, except within square brackets. Within brackets, @samp{^} can be used to invert the membership of the character class being specified.
@samp{*}, @samp{+} and @samp{?} are special at any point in a regular expression except the following places, where they are not allowed:
@enumerate
@item At the beginning of a regular expression
@item After an open-group, signified by
@samp{(}
@item After an open-group, signified by @samp{(}
@item After the alternation operator @samp{|}
@end enumerate
Intervals are specified by @samp{@{} and @samp{@}}. Invalid intervals such as @samp{a@{1z} are not accepted.
Intervals are specified by @samp{@{} and @samp{@}}.
Invalid intervals such as @samp{a@{1z} are not accepted.
The longest possible match is returned; this applies to the regular expression as a whole and (subject to this constraint) to subexpressions within groups.
warning { Cannot perform test as your $PATH environment variable includes a reference to the current directory or a directory name which is not absolute }
untested { skipping this test because your $PATH variable is wrongly set }
warning { Cannot perform test as your PATH environment variable includes a reference to the current directory or a directory name which is not absolute }
untested { skipping this test because your PATH variable is wrongly set }
/* We include sys/param.h in order to detect this case. */
#error "You have an unusual system. Once you remove this error message from buildcmd.c, it should work, but please make sure that DejaGnu is installed on your system and that 'make check' passes before using the findutils programs. Please mail bug-findutils@gnu.org to tell us about your system."
#define ARG_MAX NCARGS
# error "You have an unusual system. Once you remove this error message from buildcmd.c, it should work, but please make sure that DejaGnu is installed on your system and that 'make check' passes before using the findutils programs. Please mail bug-findutils@gnu.org to tell us about your system."
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.