49 Commits

Author SHA1 Message Date
Bernhard Voelker
c56b96a54f maint: prefer NULL to nullptr
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.
2026-01-20 23:03:54 +01:00
Bernhard Voelker
733bb9a054 maint: update copyright year number ranges
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.
2026-01-02 11:46:15 +01:00
Bernhard Voelker
7156420fab maint: switch from gnulib ctype to ctype-h module
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
2025-11-15 19:44:18 +01:00
Bernhard Voelker
93ce19f0d5 maint: prefer C23-style nullptr
* 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.
2025-11-15 19:39:43 +01:00
Collin Funk
c18bba5c59 maint: ensure that new "make syntax-check"-run sc_codespell passes
* cfg.mk (codespell_ignore_words_list): Ignore false-positives.
(exclude_file_name_regexp--sc_codespell): Skip some file names.
* NEWS: Fix typos.
* README-hacking: Likewise.
* doc/find-maint.texi: Likewise.
* doc/find.texi: Likewise.
* bootstrap.conf: Fix typos in comments.
* find/ftsfind.c: Likewise.
* find/parser.c: Likewise.
* find/print.c: Likewise.
* find/testsuite/find.gnu/exec-one-rtn-fail.exp: Likewise.
* find/testsuite/find.posix/bracket-depth.exp: Likewise.
* find/testsuite/find.posix/exec-nogaps.exp: Likewise.
* find/testsuite/find.posix/files-not-expressions1.exp: Likewise.
* find/testsuite/find.posix/files-not-expressions2.exp: Likewise.
* find/testsuite/find.posix/files-not-expressions3.exp: Likewise.
* find/util.c: Likewise.
* init.cfg: Likewise.
* lib/regextype.h: Likewise.
* lib/splitstring.h: Likewise.
* locate/locate.c: Likewise.
* locate/updatedb.sh: Likewise.
* tests/find/exec-plus-last-file.sh: Likewise.
* tests/find/files0-from.sh: Likewise.
* tests/xargs/test-sigusr.c: Likewise.
* tests/xargs/verbose-quote.sh: Likewise.
* xargs/xargs.c: Likewise.
2025-11-15 19:39:02 +01:00
Bernhard Voelker
b52c6688ff maint: adjust to gnulib module renaming
Since previous gnulib update, './bootstrap' shows deprecation warnings
like the following for several modules:
  Notice from module errno:
    This module is deprecated. Use the module 'errno-h' instead.
Use the newer names instead:
- errno -> errno-h
- inttypes -> inttypes-h
- locale -> locale-h
- math -> math-h
- realloc-gnu -> realloc-posix
- stdarg -> stdarg-h
- stdbool -> bool
- stddef -> stddef-h
- stdint -> stdint-h
- stdio -> stdio-h
- stdlib -> stdlib-h
- string -> string-h
- sys_stat -> sys_stat-h
- sys_time -> sys_time-h
- sys_types -> sys_types-h
- sys_wait -> sys_wait-h
- wchar -> wchar-h

* bootstrap.conf (gnulib_modules): Do the above replacements.
2025-01-05 00:58:10 +01:00
Bernhard Voelker
f1f6471ae8 maint: update copyright year number ranges
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.
2025-01-04 11:43:53 +01:00
Bernhard Voelker
324b5dddc2 maint: pull in gnulib module basename-lgpl
* bootstrap.conf (gnulib_modules): Add 'basename-lgpl', because we're
using the gnulib 'base_name' function.
2024-12-23 21:00:51 +01:00
Collin Funk
5db475b306 maint: don't use gettimeofday
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.
2024-12-02 19:54:19 +01:00
Bernhard Voelker
744da6ddcc maint: prefer endian.h for byte order conversions
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.
2024-11-03 21:32:30 +01:00
Bernhard Voelker
f4ec39eee0 maint: import tests/init.sh from Gnulib during bootstrap
* bootstrap.conf (bootstrap_post_import_hook): Use gnulib-tool
--copy-file to import tests/init.sh.
* tests/init.sh: Remove file.
* tests/.gitignore (/init.sh): Add entry.
* Makefile.am (update-gnulib-to-latest): Remove handling tests/init.sh.
2024-11-03 21:32:17 +01:00
Bernhard Voelker
d0187016e1 maint: list Gnulib sys_types directly
* bootstrap.conf (gnulib_modules): Add sys_types.
Although it’s already brought in indirectly, findutils code
includes <sys/types.h> directly.
2024-11-03 21:32:08 +01:00
Dave
07bd7fa675 build: add bison as requirement
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
2024-09-17 21:44:33 +02:00
Bernhard Voelker
ea1abfa968 maint: update copyright year number ranges
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.
2024-01-02 09:13:29 +01:00
Bernhard Voelker
0bc43b0b40 maint: require support for post-2038 timestamps
* bootstrap.conf (gnulib_modules): Replace year2038 with
year2038-recommended.
* NEWS (Changes to the build process): Mention the change.
2023-05-23 00:13:10 +02:00
Bernhard Voelker
251158b59e build: update gnulib prerequisite tools
* bootstrap.conf (buildreq): Add autopoint, m4, makeinfo, texi2pdf,
wget and xz.
2023-05-22 23:15:27 +02:00
Bernhard Voelker
73d020f472 maint: update copyright year number ranges
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.
2023-01-01 23:51:15 +01:00
Bernhard Voelker
17e3183c1a maint: fix GPLv3 texts to use a comma instead of semicolon
See: https://www.gnu.org/licenses/gpl-3.0.html#howto
Run:
  $ git grep -l 'Foundation; either version 3' \
      | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/'

* bootstrap.conf: Adjust GPLv3 header via the above command.
* build-aux/gen-changelog.sh: Likewise.
* lib/die.h: Likewise.
2022-01-05 21:54:16 +01:00
Bernhard Voelker
db5ec614a7 maint: update copyright year number ranges
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.
2022-01-02 18:42:35 +01:00
Bernhard Voelker
11576f4e6a find: add -files0-from option
* 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.
2021-05-08 14:13:36 +02:00
Bernhard Voelker
c5da48bcff maint: update copyright year number ranges
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.
2021-01-02 01:46:51 +01:00
Bernhard Voelker
160e2f8258 maint: use more *-safer gnulib modules
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().
2020-12-02 01:12:16 +01:00
Bernhard Voelker
f066937370 maint: copy FDL from gnulib instead of using it as module
Since the previous gnulib update, bootstrap outputs this warning:

  Notice from module fdl:
    Don't use this module! Instead, copy the referenced license file \
    into your version control repository.

See gnulib commit:
  https://git.sv.gnu.org/cgit/gnulib.git/commit/?id=88fc5afbccc9

* bootstrap.conf (gnulib_modules): Remove 'fdl'.
* doc/fdl.texi: Add file as a copy of 'gnulib/doc/fdl.texi'.
* doc/.gitignore (/fdl.texi): Remove to no longer ignore that file.
* Makefile.am (update-gnulib-to-latest): Add command to sync the file.
While at it, add the command to show the git status for
'tests/init.sh' as well.
2020-05-25 18:05:55 +02:00
Bernhard Voelker
c1dd7c8a94 maint: bootstrap gnulib with --symlink
* bootstrap.conf (gnulib_tool_option_extras): Add --symlink option.
2020-04-22 19:38:19 +02:00
Bernhard Voelker
9820a15a43 maint: adjust to split out xstrtol-error gnulib module
* bootstrap.conf (gnulib_modules): Add the new module split from xstrtol.
* locate/locate.c: Include "xstrtol-error.h" for xstrtol_fatal.
2020-01-01 17:44:30 +01:00
Bernhard Voelker
f7ea96d2b8 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Likewise, here to avoid starting a year number range.
* All other files: Update copyright years via the above make run.
2020-01-01 16:22:52 +01:00
James Youngman
416113ee3f gnulib: use nstrftime module instead of strftime.
These modules are actually synonymous, it's just that the module name
strftime is deprecated in favour of nstrftime.
2019-08-30 19:57:51 +01:00
Bernhard Voelker
c07f6924c8 maint: change from gettext to gettext-h gnulib module
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/
2019-05-11 21:34:26 +02:00
Bernhard Voelker
54b543a8ff maint: bump build prerequisite versions
* bootstrap.conf (buildreq): Require at least autoconf-2.59,
automake-1.11.2, and gettext-0.19.2.
2019-05-11 21:34:21 +02:00
Bernhard Voelker
487d0701c5 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* All other files: Update copyright years via the above make run.
2019-01-04 23:47:26 +01:00
Jim Meyering
e3b9af8ab2 maint: use gnulib's intprops module to avoid magic numbers
* bootstrap.conf (gnulib_modules): Add intprops.
* find/ftsfind.c (get_fts_info_name): Use the INT_BUFSIZE_BOUND macro
to calculate the size of BUF.
2018-07-11 17:58:13 +02:00
Bernhard Voelker
0f3822c284 build: remove PO files from version control
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.
2018-03-14 20:44:14 +01:00
Bernhard Voelker
2d6ce760f1 build: add gnupload
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.
2018-03-14 20:44:14 +01:00
Bernhard Voelker
b028f53140 maint: give gnulib's test directory a better name
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.
2018-03-14 20:44:14 +01:00
Bernhard Voelker
1cc207f6eb maint: make inter-release --version output more useful
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.
2018-03-14 20:44:14 +01:00
Bernhard Voelker
8705455ce0 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* All other files: Update copyright years via the above make run.
2018-01-01 19:27:15 +01:00
Bernhard Voelker
d43734ced4 maint: include the module year2038 from gnulib
* bootstrap.conf (gnulib_modules): Add 'year2038' to ensure that time_t
is 64-bit (and thus works after 2038).

Suggested by Bruno Haible in
https://lists.gnu.org/r/bug-gnulib/2017-11/msg00022.html
2017-11-13 18:40:29 +01:00
Bernhard Voelker
77651af6a8 maint: update copyright year number ranges
Better late than never: run 'make update-copyright'.

* cfg.mk (update-copyright-env): Change UPDATE_COPYRIGHT_USE_INTERVALS
from 1 to 2 to get a minimal containing range of years; also set
UPDATE_COPYRIGHT_MAX_LINE_LENGTH to 79 characters.
* .x-update-copyright: Add an entry for bootstrap which comes from
gnulib.
* lib/qmark.c: While at it, fix a typo: s/courutils/coreutils/.
* lib/regexprops.c (copying): Update the text so that the
copyright years match the result of "make update-copyright".
* po/fi.po: Change copyright header so that "make update-copyright"
can pick it up: s/©/(C)/
* po/it.po: Likewise.
* po/vi.po: Likewise.
* All other files: Update copyright years via the above make run.
2017-10-23 00:45:18 +02:00
Bernhard Voelker
64f5f93900 gnulib: update to latest
* bootstrap: Merge from gnulib/build-aux/.
* bootstrap.conf: Likewise.
2017-10-22 20:56:44 +02:00
Bernhard Voelker
40cd25147b xargs: add -o, --open-tty option
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
2017-06-09 00:44:42 +02:00
James Youngman
c97c9c4f17 Adopt the use of the gnulib module "gendocs".
* 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.
2016-03-24 06:56:15 +00:00
Bernhard Voelker
be4566f079 maint: don't use obsolete gnulib modules
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.
2016-01-04 08:34:50 +01:00
James Youngman
265753b4af maint: update copyright years.
* 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.
2016-01-03 23:27:34 +00:00
James Youngman
34c53b7637 Make use of suggested GCC function attributes.
* 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.
2016-01-03 17:13:10 +00:00
James Youngman
248be69b6b Fix a typo in bootstrap.conf.
* bootstrap.conf (maintainer_modules): Fix typo 'consder'.
2015-12-28 18:25:14 +00:00
Ville Skyttä
dd7c9c6ee7 Spelling fixes (fixing Savannah bug #8688).
* locate/locate.c: typo fix: whcih
* doc/find.texi: typo fix: futher
* bootstrap.conf: spelling fix: consistant
* NEWS: Mention this change.
Copyright-paperwork-exempt: Yes
2015-12-28 12:59:44 +00:00
Bernhard Voelker
852e4225af maint: avoid syntax-check failures
* 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.
2015-12-28 10:15:31 +00:00
James Youngman
731826cc8d find: adaptive column alignment (resolves Savannah bug #45780)
* lib/listfile.c (list_file): For aligned fields, use the number
of characters output to deduce whether our current idea of the
maximum width of each field is too small.  When this happens,
increase the field width.  Keep track of the field width in a
static variable for each field.  Do this for the inode number,
number of blocks, owner, group, major and minor device numbers,
and the file size.  Use mbswidth in some places to count
characters.
* find/print.c (do_fprintf): Mention the potential portability
problems in casting ino_t to uintmax_t.
* bootstrap.conf (gnulib_modules): Add mbswidth.
* po/Makevars (XGETTEXT_OPTIONS): updated by running bootstrap.
*NEWS: Mention this bugfix.
2015-10-31 23:26:31 +00:00
Assaf Gordon
3752a0a46e build: use gnulib's 'bootstrap' script
* bootstrap: import gnulib's bootstrap script as-is
* bootstrap.conf: mimick as close as possible the settings from
'import-gnulib.{sh,config}'
2015-05-10 16:34:28 +01:00