[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Findutils-patches] [PATCH] Update gnulib; update documentation of effec
From: |
James Youngman |
Subject: |
[Findutils-patches] [PATCH] Update gnulib; update documentation of effect of environment variables. |
Date: |
Sat, 17 May 2008 12:16:21 +0100 |
2008-05-17 James Youngman <address@hidden>
Update gnulib.
* import-gnulib.config (gnulib_version): Update to current head
version of gnulib.
Document effect of gnulib update, mainly on yesno().
* doc/find.texi (Unusual Characters in File Names): Explain that
the LC_CTYPE variable affects which characters are considered to
be printable by -printf %p, -print and -fprint.
(Querying): Explain in more detail how environment variables
affect the interpretation of the response to -ok and -okdir.
(Regular Expressions): Indicate that the locale configuration
affects the interpretation of regular expressions.
(Environment Variables): Describe how LC_COLLATE and LC_CTYPE
affect the interpretation of regular expressions. Indicate that
LC_MESSAGES affects the interpretation of the response to -ok.
* find/find.1 (-ok): Describe the effect of POSIXLY_CORRECT,
LC_CTYPE and LC_COLLATE.
(-okdir): Likewise.
(UNUSUAL FILENAMES): Describe how LC_CTYPE affects -printf %p,
-print, -fprint.
(STANDARDS CONFORMANCE): -ok and -okdir now obey the system's
defintion of yes/no if POSIXLY_CORRECT is set. In any case,
LC_CTYPE and LC_COLLATE may have some effect. Point out that
the setting of LC_MESSAGES deternmines what pattern is used to
interpret the user's response to -ok/-okdir.
* find/parser.c: Remove definition of ISUPPER, which we no longer
need.
* NEWS: mention these changes.
Signed-off-by: James Youngman <address@hidden>
---
NEWS | 24 +++++++++++++
doc/find.texi | 67 ++++++++++++++++++++++++++++---------
find/find.1 | 89 ++++++++++++++++++++++++++++++++++++-------------
find/parser.c | 1 -
import-gnulib.config | 2 +-
5 files changed, 141 insertions(+), 42 deletions(-)
diff --git a/NEWS b/NEWS
index b4b8fdc..49582ac 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,29 @@
GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
+* Major changes in release 4.4.1, YYYY-MM-DD
+
+** Bug Fixes
+
+On some systems without support for a boolean type (for example some
+versions of the AIX C compiler), find's regular expression
+implementation fails to support case-insensitive regular expression
+matching, causing -iregex to behave like -regex. This is now fixed.
+
+** Functional Enhancements to find
+
+If the POSIXLY_CORRECT environment variable is set, the system's
+definition of "yes" and "no" responses are used to interpret the
+response to questions from -ok and -okdir. The default is still to
+use information from the findutils message translations.
+
+** Documentation Enhancements
+
+Both the Texinfo manual and the find manual page now include a more
+precise description of how youtr locale configuration affects the
+interpretation of regular expressions and how your response to prompts
+from the -ok action are interpreted.
+
+
* Major changes in release 4.4.0, 2008-03-15
The 4.4.0 release of findutils is a stable release, succeeding the
diff --git a/doc/find.texi b/doc/find.texi
index aa95456..b74ca5b 100644
--- a/doc/find.texi
+++ b/doc/find.texi
@@ -2362,14 +2362,15 @@ which cannot be used to send arbitrary data to the
terminal, and so
these are printed as-is.
@item %f, %h, %l, %p, %P
The output of these directives is quoted if the output is going to a
-terminal.
+terminal. The setting of the `LC_CTYPE' environment
+variable is used to determine which characters need to be quoted.
This quoting is performed in the same way as for GNU @code{ls}. This
is not the same quoting mechanism as the one used for @samp{-ls} and
@samp{fls}. If you are able to decide what format to use for the
output of @code{find} then it is normally better to use @samp{\0} as a
terminator than to use newline, as file names can contain white space
-and newline characters.
+and newline characters.
@end table
@item -print
@itemx -fprint
@@ -2520,10 +2521,20 @@ use the @code{find} primary @samp{-okdir} instead of
@samp{-execdir},
and the @code{find} primary @samp{-ok} instead of @samp{-exec}:
@deffn Action -okdir command ;
-Like @samp{-execdir} (@pxref{Single File}), but ask the user first (on
-the standard input); if the response does not start with @samp{y} or
address@hidden, do not run the command, and return false. If the command is
-run, its standard input is redirected from @file{/dev/null}.
+Like @samp{-execdir} (@pxref{Single File}), but ask the user first.
+If the user does not agree to run the command, just return false.
+Otherwise, run it, with standard input redirected from
address@hidden/dev/null}.
+
+The response to the prompt is matched against a pair of regular
+expressions to determine if it is a yes or no response.
+This regular expression is obtained from the system if the
+POSIXLY_CORRECT environment variable is set, or otherwise from
address@hidden's message translations. If the system has no suitable
definition,
address@hidden's own definition will be used. In either case, the
+interpretation of the regular expression itself will be affected by
+the environment variables LC_CTYPE (character classes) and LC_COLLATE
+(character ranges and equivalence classes).
@end deffn
@deffn Action -ok command ;
@@ -3633,8 +3644,15 @@ This causes @code{xargs} to stop immediately.
The @samp{-regex} and @samp{-iregex} tests of @code{find} allow
matching by regular expression, as does the @samp{--regex} option of
address@hidden There are many different types of Regular Expression,
-but the type used by @code{find} and @code{locate} is the same as is
address@hidden
+
+Your locale configuration affects how regular expressions are
+interpreted. @xref{Environment Variables}, for a description of how
+your locale setup affects the interpretation of regular expressions.
+
+There are also several different types of regular expression, and
+these are interpreted differently. Normally, the type of regular
+expression used by @code{find} and @code{locate} is the same as is
used in GNU Emacs. Both programs provide an option which allows you
to select an alternative regular expression syntax; for @code{find}
this is the @samp{-regextype} option, and for @code{locate} this is
@@ -3660,16 +3678,28 @@ The POSIX standard specifies that this variable affects
the pattern
matching to be used for the `\-name' option. GNU find uses the
GNU version of the @code{fnmatch} library function.
-POSIX also specifies that the `LC_COLLATE' environment
-variable affects the interpretation of the user's response to the
-query issued by `\-ok', but this is not the case for GNU find.
+This variable also affects the interpretation of
+the response to @code{-ok}; while the LC_MESSAGES variable selects the
+actual pattern used to interpret the response to @code{-ok},
+the interpretation of any bracket expressions in the pattern will be
+affected by the LC_COLLATE variable.
+
@item LC_CTYPE
-This variable affects the treatment of character classes used with
-the @samp{-name} test, if the system's
address@hidden library function supports this. It has no effect on the
behaviour
-of the @samp{-ok} expression.
+This variable affects the treatment of character classes used in
+regular expression and with
+the @samp{-name} test, if the @code{fnmatch} function supports this.
+
+This variable also affects the interpretation of any character classes
+in the regular expressions used to interpret the response to the
+prompt issued by @code{-ok}. The LC_CTYPE environment variable will
+also affect which characters are considered to be unprintable when
+filenames are printed (@pxref{Unusual Characters in File Names}).
+
@item LC_MESSAGES
-Determines the locale to be used for internationalised messages.
+Determines the locale to be used for internationalised messages,
+including the interpretation of the response to the prompt made by the
address@hidden action.
+
@item NLSPATH
Determines the location of the internationalisation message catalogues.
@item PATH
@@ -3695,6 +3725,11 @@ Arguments to @samp{-perm} beginning with @samp{+} are
treated
differently when POSIXLY_CORRECT is set. See
@ref{Mode Bits,-perm,File Mode Bits}.
+When POSIXLY_CORRECT is set, the response to the prompt made by the
address@hidden action is interpreted according to the system's message
+catalogue, as opposed to according to @code{find}'s own message
+translations.
+
@item TZ
Affects the time zone used for some of the time-related format
directives of @samp{-printf} and @samp{-fprintf}.
diff --git a/find/find.1 b/find/find.1
index d7f40cf..4f3d5ad 100644
--- a/find/find.1
+++ b/find/find.1
@@ -1095,19 +1095,34 @@ section for information about how unusual characters in
filenames are handled.
.IP "\-ok \fIcommand\fR ;"
Like
.B \-exec
-but ask the user first (on the standard input); if the
-response does not start with `y' or `Y', do not run the command, and
-return false. If the command is run, its standard input is redirected
+but ask the user first. If the user agrees, run the command. Otherwise
+just return false. If the command is run, its standard input is redirected
from
.BR /dev/null .
+.IP
+The response to the prompt is matched against a pair of regular
+expressions to determine if it is an affirmative or negative
+response. This regular expression is obtained from the system if the
+`POSIXLY_CORRECT' environment variable is set, or otherwise from
+.BR find 's
+message translations. If the system has no suitable
+definition,
+.BR find 's
+own definition will be used. In either case, the interpretation of
+the regular expression itself will be affected by the environment
+variables 'LC_CTYPE' (character classes) and 'LC_COLLATE' (character
+ranges and equivalence classes).
+
+
+
.IP "\-okdir \fIcommand\fR ;"
Like
.B \-execdir
-but ask the user first (on the standard input); if the
-response does not start with `y' or `Y', do not run the command, and
-return false. If the command is run, its standard input is redirected
-from
+but ask the user first in the same way as for
+.BR \-ok .
+If the user does not agree, just return false.
+If the command is run, its standard input is redirected from
.BR /dev/null .
.IP \-print
@@ -1443,7 +1458,8 @@ If you are able to decide what format to use for the
output of
.B find
then it is normally better to use `\e0' as a terminator
than to use newline, as file names can contain white space and newline
-characters.
+characters. The setting of the `LC_CTYPE' environment
+variable is used to determine which characters need to be quoted.
.IP "\-print, \-fprint"
Quoting is handled in the same way as for
@@ -1463,6 +1479,7 @@ The
and
.B \-okdir
actions print the current filename as-is. This may change in a future release.
+
.SS OPERATORS
.P
Listed in order of decreasing precedence:
@@ -1533,8 +1550,17 @@ Supported. POSIX specifies `b', `c', `d', `l', `p',
`f' and `s'.
GNU find also supports `D', representing a Door, where the OS provides these.
.IP \fB\-ok\fR
-Supported. Interpretation of the response is not locale-dependent
-(see ENVIRONMENT VARIABLES).
+Supported.
+Interpretation of the response is according to the "yes" and "no"
+patterns selected by setting the `LC_MESSAGES' environment variable.
+When the `POSIXLY_CORRECT' environment variable is set, these patterns
+are taken system's definition of a positive (yes) or negative (no)
+response. See the system's
+documentation for \fBnl_langinfo\fP(3), in particular YESEXPR and
+NOEXPR. When `POSIXLY_CORRECT' is not set, the patterns are instead
+taken from
+.BR find 's
+own message catalogue.
.IP \fB\-newer\fR
Supported. If the file specified is a symbolic link, it is always
@@ -1647,28 +1673,36 @@ matching to be used for the
option. GNU find uses the
.BR fnmatch (3)
library function, and so support for `LC_COLLATE' depends on the
-system library.
-
-.IP
-POSIX also specifies that the `LC_COLLATE' environment
-variable affects the interpretation of the user's response to the
-query issued by
-.BR \-ok' ,
-but this is not the case for GNU find.
+system library. This variable also affects the interpretation of
+the response to
+.BR \-ok;
+while the `LC_MESSAGES' variable selects the actual pattern used to
+interpret the response to
+.BR \-ok ,
+the interpretation of any bracket expressions in the pattern will be
+affected by `LC_COLLATE'.
.IP LC_CTYPE
-This variable affects the treatment of character classes used with
+This variable affects the treatment of character classes used in
+regular expressions and also with
the
.B \-name
test, if the system's
.BR fnmatch (3)
-library function supports this. It has no effect on the behaviour
-of the
-.B \-ok
-expression.
+library function supports this. This variable also affects the
+interpretation of any character classes in the regular expressions
+used to interpret the response to the prompt issued by
+.BR \-ok .
+The `LC_CTYPE' environment variable will
+also affect which characters are considered to be unprintable when
+filenames are printed; see the section UNUSUAL FILENAMES.
.IP LC_MESSAGES
-Determines the locale to be used for internationalised messages.
+Determines the locale to be used for internationalised messages. If
+the `POSIXLY_CORRECT' environment variable is set, this also
+determines the interpretation of the response to the prompt made by the
+.BR \-ok
+action.
.IP NLSPATH
Determines the location of the internationalisation message catalogues.
@@ -1710,6 +1744,13 @@ is treated just like
if
+zzz is not a valid symbolic mode. When POSIXLY_CORRECT is set, such
constructs are treated as an error.
+.IP
+When POSIXLY_CORRECT is set, the response to the prompt made by the
+.B \-ok
+action is interpreted according to the system's message catalogue, as
+opposed to according to
+.BR find 's
+own message translations.
.IP TZ
Affects the time zone used for some of the time-related format
diff --git a/find/parser.c b/find/parser.c
index 246c4ce..623b741 100644
--- a/find/parser.c
+++ b/find/parser.c
@@ -74,7 +74,6 @@
#endif
#define ISDIGIT(c) (isascii ((unsigned char)c) && isdigit ((unsigned char)c))
-#define ISUPPER(c) (isascii ((unsigned char)c) && isupper ((unsigned char)c))
#ifndef HAVE_ENDGRENT
#define endgrent()
diff --git a/import-gnulib.config b/import-gnulib.config
index f2e8998..2d7f34e 100644
--- a/import-gnulib.config
+++ b/import-gnulib.config
@@ -1,7 +1,7 @@
# findutils gnulib.config -*- sh -*-
# What version of gnulib to use?
-gnulib_version="e5573b1bad88bfabcda181b9e0125fb0c52b7d3b"
+gnulib_version="1f8fbdc736500bb3f7278838adf552916954b536"
destdir="gnulib"
# Random extra gnulib files needed for findutils.
--
1.5.5.1
- [Findutils-patches] [PATCH] Update gnulib; update documentation of effect of environment variables.,
James Youngman <=