Also, do not reject -perm /MODE merely because of POSIXLY_CORRECT.
Problem reported in <https://savannah.gnu.org/bugs/?38474>.
* NEWS:
* doc/find.texi (Mode Bits): Document this.
(Environment Variables): POSIXLY_CORRECT does not affect -perm.
* find/parser.c (parse_help): Mention /MODE, not +MODE.
(non_posix_mode): Remove.
(parse_perm): Remove support for -perm +MODE.
Do not reject -perm /MODE merely because POSIXLY_CORRECT is set;
POSIXLY_CORRECT is not supposed to be for pedantic checking.
* doc/find.texi (xargs options): Explain that the logical end of
file marker string set with -E is not special if -d or -0 was
specified.
* xargs/xargs.c (usage): Mention this in the --help output.
(read_string): Correct the function header comment to point out
that there is no logical end-of-file processing for this case.
Also point out that the delimiter may not always be NUL.
This documentation update fixes Savannah bug #36652.
(main): Emit a warning message if -0/-d is specified and -E was
also used.
* xargs/testsuite/xargs.gnu/E_-0.exp: Don't compare stderr output,
since for this case xargs now emits a warning message.
* NEWS: Mention this change.
* xargs/xargs.1: Expand on the warning about sharing stdout for
"xargs -P".
* doc/find.texi (Controlling Parallelism): Add a suitable warning
about sharing resources here, too.
* NEWS: Mention that all relevant documentation was updated with
this warning.
* doc/find.texi (Top): Re-order menu items to be consistent with
ordering of sections ('Reference' is moved).
(Print File Information): Add missing menu item 'Formatting Flags'
and remove that menu item from inside 'Format Directives'.
(Formatting Flags): Hence this is a subsection, not a
subsubsection.
The recent change v0.0-7611-g3a9002d in gnulib that made fts_open strip
trailing slashes from input path names had a negative impact on
findutils that relies on the old fts_open behavior to implement POSIX
requirement that each path operand of the find utility shall be
evaluated unaltered as it was provided, including all trailing slash
characters.
A new bit flag FTS_VERBATIM was added later as the option to disable
that stripping when it is not desirable.
* gnulib: update to latest, to get FTS_VERBATIM support.
* find/ftsfind.c (ftsoptions): Set the FTS_VERBATIM bit.
As a result of the gnulib update, re-generate doc/regexprops.texi.
* doc/regexprops.texi: re-generate to describe the changes to
gnulib for the regular expression types "awk" (to add character
class support), "gnu-awk" (to add range support) and "posix-awk"
(also to add range suport).
* NEWS: Describe this change.
First, change "cant" to "can't" manually in m4/nullsort.m4,
since "cant" had 3 replacement options. Then remove "dum"
from the LocalWords lists in doc/*.texi. It was not used.
Finally, perform the remaining changes mechanically using
http://github.com/lyda/misspell-check and
some perl to massage its diagnostics into sed -i commands:
git ls-files|grep -v '\.po$'|misspellings -f -|perl -nl \
-e '/^(.*?)\[(\d+)\]: (\w+) -> "(.*?)"$/ or next;' \
-e '($file,$n,$l,$r)=($1,$2,$3,$4); $q="'\''"; $r=~s/$q/$q\\$q$q/g;'\
-e 'print "sed -i $q${n}s!$l!$r!$q $file"'|bash
* find/print.c (insert_fprintf): Reject %(, %{ and %[.
(make_segment): Remove code which previously supposedly rejected
these format specifiers, but in fact did nothing. Replace with
an assertion to document the fact that we do not expect to see
these format characters in make_segment.
* find/testsuite/find.gnu/printf-reserved.exp: New test case, for
%(, %{ and %[, which are all rejected.
* find/testsuite/Makefile.am (EXTRA_DIST_EXP): Add
find.gnu/printf-reserved.exp.
* doc/find.texi (Reserved and Unkown Directives): Document this.
* find/find.1: Document this.
* NEWS: Mention this change.
* cfg.mk: Enable the sc_texinfo_acronym check. Exempt
doc/perm.text, which isn't ours anyway.
* doc/find.texi (Deleting Files): Say just POSIX rather than
@acronym{POSIX}, simply because this is the convention in GNU
documentation. The motivation is that it's hard to do so
consistently (because, for example, you can't use @acronym in a
node name).
* .x-sc_prohibit_doubled_word: don't perform this check on
xargs/testsuite/xargs.sysv/iquotes.xo or ChangeLog.
Don't check .po files for doubled English words (because they're
not in English).
* find/tree.c: Modify some text to avoid saying "AND and",
which one of the syntax checks doesn't like.
(opt_expr): Likewise.
(consider_arm_swap): Likewise.
* README: Likewise.
* doc/find.texi (Error Messages From xargs): the message "can not
fit single argument within argument list size limit" is now
"argument list too long".
* xargs/xargs.c (main): Change default_cmd from "/bin/echo" (which
may not be present on some POSIX systems) to "echo" (which must
exist somewhere on $PATH on any POSIX system).
* doc/find.texi (Multiple Files): document this.
* NEWS: Describe this change.
* xargs/testsuite/xargs.sysv/empty_def-t.xe: Change /bin/echo to
echo.
* xargs/testsuite/xargs.gnu/n2-s26-x-0.exp: Change -s26 to -s21 to
keep the expected test result the same. Rename the test to
reflect the updated arguments.
* xargs/testsuite/xargs.gnu/n2-s26-x-0.xo: Rename to
n2-s21-x-0.xo.
* xargs/testsuite/xargs.gnu/n2-s26-0.exp: Rename to n2-s21-0.exp,
update -s argument.
* xargs/testsuite/xargs.posix/s30.exp: Rename to s25.exp, update -s.
* xargs/testsuite/xargs.posix/s30.xo: Rename to s25.xo.
* xargs/testsuite/xargs.gnu/s30-0.exp: Rename to s25-0.exp, update
-s argument.
* xargs/testsuite/xargs.gnu/s30-0.xo: Rename to s25-0.xo.
* xargs/testsuite/xargs.sysv/s30-t.exp: Rename to s25-t.exp,
update -s.
* xargs/testsuite/xargs.sysv/s30-t.xo: Rename to s25-t.xo.
* xargs/testsuite/xargs.sysv/s30-t.xe: Rename to s25-t.xe, change
/bin/echo to just echo.
* xargs/testsuite/xargs.posix/s47.exp: Rename to s42.exp, update -s.
* xargs/testsuite/xargs.posix/s47.xo: Rename to s42.xo.
* xargs/testsuite/xargs.gnu/n3-s36-0.exp: Rename to n3-s31-0.exp,
update -s.
* xargs/testsuite/xargs.gnu/n3-s36-0.xo: Rename to n3-s31-0.xo.
* xargs/testsuite/xargs.gnu/s20-0.exp: Rename to s15-0.exp, update
-s.
* xargs/testsuite/xargs.gnu/s20-0.xo: Rename to s15-0.xo.
* xargs/testsuite/xargs.posix/n2-s26.exp: Rename to n2-s21.exp,
update -s.
* xargs/testsuite/xargs.posix/n2-s26.xo: Rename to n2-s21.xo.
* xargs/testsuite/xargs.gnu/s19-0.exp: Rename to s14-0.exp, update
-s.
* xargs/testsuite/xargs.gnu/s19-0.xo: Rename to s14-0.xo.
* xargs/testsuite/xargs.gnu/s19_2-0.exp: Rename to s14_2-0.exp,
update -s.
* xargs/testsuite/xargs.gnu/s19_2-0.xo: Rename to s14_2-0.xo.
* xargs/testsuite/xargs.posix/n3-s36.exp: Rename to n3-s31.exp,
update -s.
* xargs/testsuite/xargs.posix/n3-s36.xo: Rename to n3-s31.xo.
* xargs/testsuite/xargs.posix/s19.exp: Rename to s14.exp, update
-s.
* xargs/testsuite/xargs.posix/s19.xo: Rename to s14.xo.
* xargs/testsuite/xargs.posix/s19_2.exp: Rename to s14_2.exp,
update -s.
* xargs/testsuite/xargs.posix/s19_2.xo: Rename to s14_2.xo.
* xargs/testsuite/xargs.posix/s20.exp: Rename to s15.exp,
update -s.
* xargs/testsuite/xargs.posix/s20.xo: Rename to s15.xo.
* xargs/testsuite/Makefile.am (EXTRA_DIST_XO): Update names.
(EXTRA_DIST_EXP): Likewise.
* doc/find.texi (Configuration): New section documenting the
important configuration options that can be passed to configure,
including --without-fts.
* find/find.1 (BINARIES): New section explaining why two binaries
are installed.
* find/oldfind.1: New manual page explaining how 'oldfind' is
different to 'find'.
* find/ftsfind.1: New manual page explaining how 'ftsfind' is
different to 'find'.
* find/Makefile.am (man_MANS): As well as find.1, install one of
ftsfind.1 or oldfind.1, depending on whether --without-fts was
specified to configure.
* NEWS: Mention this change.
* xargs/xargs.c (set_slot_var): New function; sets an environment
variable to the index of the entry in pids[] that represents the
relevant child process. This can be used in rudimentary load
distribution systems.
(slot_var_name): the name of the variable to use (selected by
--process-slot-var).
(enum LongOptionIdentifier): Unique identifiers for long options
with no short option equivalent (--process-slot-var is the first).
(longopts): Add --process-slot-var.
(add_proc): return the index within pids[] that we selected.
(main): Pass &option_index to getopt_long (option_index is a new
variable) in order to identify which long option was passed.
Handle --process-slot-var.
(prep_child_for_exec): Call set_slot_var.
(usage): Mention --process-slot-var.
* doc/find.texi (xargs options): Document --process-slot-var.
* xargs/xargs.1: Likewise.
* NEWS: Mention this change.
Signed-off-by: James Youngman <jay@gnu.org>
* import-gnulib.config (modules): Import the gnulib module
parse-datetime instead of the obsolete module getdate.
(gnulib_version): Update to the current version of gnulib.
* find/parser.c: Include parse-datetime.h instead of getdate.h.
* doc/find.texi: Include parse-datetime.texi instead of
getdate.texi.
* doc/Makefile.am (find_TEXINFOS): Use parse-datetime.texi instead
of getdate.texi.
* configure.ac: Update to gettext 0.18.1.
* po/Rules-quot: Update this file from gettext.
* doc/find-maint.texi: Update the maintenance manual to take into
account the fact that we uniformly use git rather than CVS. Point
out the new version tag format. Mention "make coverage".
README-CVS is now called README-hacking. Update the URL for the
Translation Project.
Signed-off-by: James Youngman <jay@gnu.org>
Avoid using magic numbers as exit statuses.
* cfg.mk (skip_defer): Enable sc_prohibit_magic_number_exit.
* doc/find-maint.texi (Security): Avoid error (1, ...) in the
example patch.
* find/find.c (main): Use exit status EXIT_FAILURE instead of 1.
(wd_sanity_check): Likewise.
(safely_chdir_lstat): Likewise.
(process_dir): Likewise.
* find/fstype.c (must_read_fs_list): Likewise.
* find/ftsfind.c (main): Likewise.
(main): Likewise.
* find/parser.c (check_option_combinations): Use exit status
EXIT_FAILURE instead of 1.
(parse_group): Likewise.
(parse_help): Use exit status EXIT_SUCCESS instead of 0.
(parse_version): Likewise.
(fnmatch_sanitycheck): Use exit status EXIT_FAILURE instead of 1.
(insert_depthspec): Likewise.
(parse_newerXY): Likewise.
(non_posix_mode): Likewise.
(parse_perm): Likewise.
(insert_regex): Likewise.
(parse_size): Likewise.
(parse_show_control_chars): Likewise.
(parse_used): Likewise.
(parse_user): Likewise.
(parse_context): Likewise.
(insert_type): Likewise.
(insert_fprintf): Likewise.
(make_segment): Likewise.
(check_path_safety): Likewise.
(new_insert_exec_ok): Likewise.
(get_relative_timestamp): Likewise.
(parse_time): Likewise.
* find/tree.c (get_expr): Use exit status EXIT_FAILURE instead of 1.
(scan_rest): Likewise.
(get_pred_cost): Likewise.
(get_pred_cost): Likewise.
(build_expression_tree): Likewise.
(get_new_pred_chk_op): Likewise.
* find/pred.c (launch): Use exit status EXIT_FAILURE instead of 1.
* find/util.c (process_debug_options): Use exit status
EXIT_SUCCESS instead of 0.
(process_optimisation_option): Use exit status EXIT_FAILURE
instead of 1.
(set_option_defaults): Likewise.
* lib/buildcmd.c (exceeds): Likewise.
(bc_do_exec): Likewise.
(bc_push_arg): Likewise.
* lib/nextelem.c: Remove test code.
* lib/safe-atoi.c (safe_atoi): Use exit status EXIT_FAILURE
instead of 1.
* lib/regextype.c (get_regex_type): Use exit status EXIT_FAILURE
instead of 1. Include <stdlib.h>, for EXIT_FAILURE.
* locate/locate.c (set_max_db_age): Use exit status EXIT_FAILURE
instead of 1.
(set_max_db_age): Likewise.
(toolong): Likewise.
(visit_locate02_format): Likewise.
(search_one_database): Likewise.
(drop_privs): Likewise.
* locate/frcode.c (get_seclevel): Use exit status EXIT_FAILURE
instead of 1.
(outerr): Likewise.
(main): Likewise.
* locate/code.c (inerr): Use exit status EXIT_FAILURE instead of
1.
(outerr): Likewise.
* locate/word_io.c (getword): Use exit status EXIT_FAILURE instead of 1.
Use named constants for xargs exit codes.
* xargs/xargs.c (child_error): Use EXIT_SUCCESS instead of 0.
(enum XargsStatusValues): introduce named constants for the
various things that cause speicific exit codes.
(enum ClientStatusValues): Also introduce named constants for the
child's exit status.
(get_char_oct_or_hex_escape): Use EXIT_FAILURE instead of 1.
(get_input_delimiter): Likewise.
(main): Likewise.
(read_line): Likewise.
(read_string): Likewise.
(print_args): Likewise.
(xargs_do_exec): Likewise.
(wait_for_proc): Likewise.
(wait_for_proc): Use enum XargsStatusValues for exit codes.
(parse_num): Use EXIT_FAILURE instead of 1.
Signed-off-by: James Youngman <jay@gnu.org>
* doc/find.texi (Updating A Timestamp File): Work around a syntax
check designed to prevent the use of "test X -a Y".
* find/find.1: Likewise.
Signed-off-by: James Youngman <jay@gnu.org>
* lib/regextype.c: Don't use HAVE_CONFIG_H.
* doc/find-maint.texi: Remove RCS keywords (they were in an
example security vulnerability announcement).
Signed-off-by: James Youngman <jay@gnu.org>
* NEWS: Update GFDL version.
* README-hacking: Likewise.
* doc/find-maint.texi: Likewise.
* lib/regexprops.c: Likewise (though the license being changed is the
license for the output).
Signed-off-by: James Youngman <jay@gnu.org>
Optimise -fstype NOTUSED to -false at -O2.
* find/parser.c: Include mountlist.h.
(insert_false): New function, inserts a -false predicate.
(parse_false): Use insert_false.
(is_used_fs_type): New function, determines if any mounted
filesystem is of the named type.
(parse_fstype): At optimisation level 2 and above, -fstpe FOO
is converted to -false if no mounted filesytem is of type FOO.
* find/find.1: Document this optimisation.
* doc/find.texi (Optimisation Options): Likewise.
* NEWS: Mention this change.
* find/find.1 (-iname): We already refer to -name, so duplicate
less text.
(-name): Explain that -name a/b will never match anything.
* doc/find.texi (Base Name Patterns): Explain that -name a/b will
never match anything.
(Full Name Patterns): Fix typo.
Signed-off-by: James Youngman <jay@gnu.org>
* doc/find.texi (Problems with -exec and filenames): Add missing
$0 argument in example for sh -c 'something "$@" sh ...
* NEWS: Mention this change.
Signed-off-by: James Youngman <jay@gnu.org>
Savannah bug #23920: warn about -path arguments ending in /.
* find/parser.c (insert_path_check): new function; abstracts the
common functionality of parse_path, parse_ipath, parse_wholename,
parse_iwholename. Also check for a trailing slash and warn about
it (unless $POSIXLY_CORRECT is set). Don't warn if the pattern
also happens to be a start_point, because those could be matched.
(parse_path, parse_ipath, parse_wholename, parse_iwholename): Use
insert_path_check.
* find/tree.c (is_start_point): new function; returns true if the
indidated string matches a start point.
(num_start_points, start_points): new variables, storing the
starting points listed on the command line.
(build_expression_tree): Set num_start_points and start_points.
* find/defs.h: Declare is_start_point.
* doc/find.texi (Full Name Patterns): Explain that candidate names
for -path, -regex etc. will never end in a slash, so "-path /tmp/"
will never match anything.
* find/find.1: Likewise.
* lib/check-regexprops.sh: New test. Run regexprops as a check,
and compare its output against the contents of doc/regexprops.texi.
If there is a mismatch for regexprops.texi, save the correct version.
* lib/Makefile.am: Run check-regexprops.sh for 'make check'.
* doc/Makefile.am: don't clean regexprops.texi, and don't generate
it automatically.
* doc/regexprops.texi: add into source control.
it automatically.
* doc/.gitignore: don't ignore regexprops.texi