Bruno Haible [Wed, 3 Aug 2022 20:29:52 +0000 (22:29 +0200)]
gnulib-tool.py: Implement options --without-c++-tests etc.
* gnulib-tool.py (main): Accept options --without-c++-tests,
--without-longrunning-tests, --without-privileged-tests,
--without-unportable-tests.
Improve error message for --copy-file with invalid number of arguments.
Check for invalid options given in --import, --add-import,
--remove-import, --update modes.
Pass both sets of test categories to the GLConfig constructor.
* pygnulib/GLConfig.py (GLConfig.__init__): Accept incl_test_categories
and excl_test_categories instead of testflags.
(checkInclTestCategory): Renamed from checkTestFlag.
(enableInclTestCategory): Renamed from enableTestFlag.
(disableInclTestCategory): Renamed from disableTestFlag.
(getInclTestCategories): Renamed from getTestFlags.
(setInclTestCategories): Renamed from setTestFlags.
(resetInclTestCategories): Renamed from resetTestFlags.
(setInclTestCategory, checkExclTestCategory, enableExclTestCategory,
disableExclTestCategory, getExclTestCategories, setExclTestCategories,
resetExclTestCategories): New methods.
* pygnulib/GLModuleSystem.py (GLModuleTable.__init__): Accept two
booleans as second and third constructor arguments.
(transitive_closure): Correct the determination of whether to include
each module, depending on the with-* and without-* options.
(transitive_closure_separately): Update.
* pygnulib/GLMakefileTable.py: Update.
* pygnulib/GLImport.py (__init__, actioncmd, gnulib_cache, execute):
Update.
* pygnulib/GLTestDir.py (GLTestDir.__init__, GLTestDir.execute,
GLMegaTestDir.__init__): Update.
Bruno Haible [Wed, 3 Aug 2022 14:49:15 +0000 (16:49 +0200)]
gnulib-tool.py: Follow gnulib-tool changes, part 23.
Follow gnulib-tool changes
2016-11-11 Bruno Haible <bruno@clisp.org>
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
2016-12-02 Nikos Mavrogiannopoulos <nmav@gnutls.org>
gnulib-tool (func_import): Adhere to the license guideline ...
2016-12-02 Daiki Ueno <ueno@gnu.org>
gnulib-tool (func_import): Relax the regex ...
* gnulib-tool.py: For --lgpl, accept value 3orGPLv2.
* pygnulib/GLInfo.py (GLInfo.usage): Update.
* pygnulib/GLConfig.py (GLConfig.setLGPL): Update argument check.
* pygnulib/GLImport.py (GLImport.__init__, GLImport.gnulib_cache):
Update gl_LGPL handling.
(GLImport.prepare): Update license compatibility checks and license
header rewriting.
* pygnulib/GLTestDir.py (GLTestDir.execute): Update license
compatibility checks. Handle also the licenses GPLv3+, GPL, LGPLv3+.
Bruno Haible [Wed, 3 Aug 2022 12:37:12 +0000 (14:37 +0200)]
gnulib-tool.py: Follow gnulib-tool changes, part 20.
Follow gnulib-tool changes
2016-01-15 Paul Eggert <eggert@cs.ucla.edu>
gnulib-tool: don't assume ln -s works
2016-01-24 Paul Eggert <eggert@cs.ucla.edu>
gnulib-tool: don't give up on ln -s so easily
2017-06-08 Bruno Haible <bruno@clisp.org>
gnulib-tool: Fix bug in func_ln_s, from 2016-01-15.
* pygnulib/constants.py (symlink_relative): New function.
(link_relative): Use it instead of os.symlink.
Bruno Haible [Sun, 31 Jul 2022 18:02:40 +0000 (20:02 +0200)]
gnulib-tool.py: Make --copy-file work.
* gnulib-tool.py (main) [copy-file]: Fix reference to uninitialized
variable. Fix error handling of os.makedirs. Pass the destdir to the
GLFileAssistant.
Bruno Haible [Sun, 31 Jul 2022 16:56:05 +0000 (18:56 +0200)]
gnulib-tool.py: Allow module arguments to occur at any position.
* gnulib-tool.py (main): Collect the non-option arguments in a single
list, regardless of their position. Use parse_known_args instead of
parse_args, and give an error message about unknown options ourselves.
* gnulib-tool: Fix typo in error message.
Bruno Haible [Sun, 31 Jul 2022 16:39:19 +0000 (18:39 +0200)]
gnulib-tool.py: Follow gnulib-tool changes, part 19.
Follow gnulib-tool changes
2015-12-09 Pavel Raiskup <praiskup@redhat.com>
gnulib-tool: allow multiple --local-dir usage
2019-02-14 Bruno Haible <bruno@clisp.org>
gnulib-tool: Improve handling of multiple --local-dir options.
* gnulib-tool (func_reconstruct_cached_dir): When the argument is
absolute, return it unmodified.
(func_compute_relative_local_gnulib_path): Renamed from
func_count_relative_local_gnulib_path. Add comment.
* gnulib-tool.py: Accept multiple --local-dir options and collect the
values into localpath.
* pygnulib/GLConfig.py: Take a localpath argument instead of a localdir
argument.
(getLocalDir, setLocalDir, resetLocalDir): Remove methods.
(getLocalPath, setLocalPath, resetLocalPath): New methods.
* pygnulib/GLFileSystem.py (CopyAction): New class.
(GLFileSystem.lookup): Consider all dirs in localpath.
(GLFileSystem.shouldLink): New method.
(GLFileAssistant): Use shouldLink.
* pygnulib/GLModuleSystem.py (GLModuleSystem.exists): Iterate over all
dirs in localpath.
(GLModuleSystem.list): Likewise.
* pygnulib/GLEmiter.py: Update.
* pygnulib/GLImport.py (GLImport.__init__): Put the argument of
gl_LOCAL_DIR into localpath, not localdir.
(GLImport.actioncmd): Consider all dirs in localpath.
(GLImport.relative_to_destdir, GLImport.relative_to_currdir): New
methods.
(GLImport.gnulib_cache): Combine all dirs in localpath. Use
self.relative_to_destdir.
* pygnulib/GLTestDir.py (GLTestDir.execute): Use shouldLink.
* gnulib-tool (main): Handle --automake-subdir-tests.
(func_emit_shellvars_init, func_emit_lib_Makefile_am): Use
$sourcebase when handling tests and --automake-subdir-tests is
given.
(func_append_actionarg): Support --automake-subdir-tests.
(func_create_testdir): Add missing argument for func_emit_initmacro_end.
* pygnulib/GLImport.py (GLImport.gnulib_comp): Put the
gl_USE_SYSTEM_EXTENSIONS right before gl_PROG_AR_RANLIB into
gnulib-comp.m4 (if the 'extensions' module is used).
Bruno Haible [Mon, 25 Jul 2022 08:21:42 +0000 (10:21 +0200)]
bootstrap: Make the automatic sync more resilient.
Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-07/msg00060.html>.
* top/bootstrap (bootstrap_sync): Set to true when bootstrap-funclib.sh
is not present.
* top/gen-bootstrap.sed: Insert a couple of comment lines.
* build-aux/bootstrap: Regenerated using "make build-aux/bootstrap".
Bruno Haible [Sun, 24 Jul 2022 14:24:37 +0000 (16:24 +0200)]
Split bootstrap into autopull.sh and autogen.sh.
* top/bootstrap-funclib.sh: New file, based on build-aux/bootstrap.
* top/autopull.sh: New file, based on build-aux/bootstrap.
* top/autogen.sh: New file, based on build-aux/bootstrap.
* top/bootstrap: New file, based on build-aux/bootstrap.
* top/gen-bootstrap.sed: New file.
* Makefile (build-aux/bootstrap): New rule.
(regen): Depend on it.
* build-aux/bootstrap: Regenerated using "make build-aux/bootstrap".
Bruno Haible [Sun, 24 Jul 2022 10:58:44 +0000 (12:58 +0200)]
bootstrap: Obey another environment variable GNULIB_REFDIR.
* build-aux/bootstrap (usage): Document option --gnulib-refdir and
environment variable GNULIB_REFDIR.
Accept option --gnulib-refdir.
When GNULIB_SRCDIR is specified, verify that it denotes a directory.
Use $GNULIB_REFDIR, not $GNULIB_SRCDIR, as argument to git's --reference
option.
Improve an error message.
* NEWS: Mention the change.
Bruno Haible [Sun, 10 Jul 2022 19:52:11 +0000 (21:52 +0200)]
vma-iter: Add support for AIX 7.
* lib/vma-iter.h (VMA_ITERATE_SUPPORTED): Define also on AIX.
* lib/vma-iter.c (vma_iterate): Add code for AIX, known to work on
AIX 7.
* lib/get-rusage-as.c: Update comments.
* lib/get-rusage-data.c: Likewise.
* tests/test-get-rusage-as.c (main): Take into account the special
address space organization on AIX in 32-bit mode.
Jim Meyering [Sun, 10 Jul 2022 01:42:29 +0000 (18:42 -0700)]
announce-gen: better diagnose some usage errors
* build-aux/announce-gen (main): Erroneous usage would elicit a
misleading diagnostic. When --gnulib-version=V was specified:
- without --bootstrap-tools=..., or
- with --bootstrap-tools=..., but without "gnulib" in that list
we would give an inappropriate diagnostic. Now, each diagnostic
is tailored to the precise erroneous condition.
Reported by Bruno Haible in
https://lists.gnu.org/r/bug-gnulib/2022-01/msg00025.html
Jim Meyering [Thu, 23 Jun 2022 15:12:44 +0000 (08:12 -0700)]
maint.mk: fix syntax-check for unnecessary hash.h header use
* top/maint.mk (_hash_re): Correct the regexp. It had two problems:
- lacked the "hash_" prefix, so would match non-uses
- failed to detect uses of the hash_x?initialize functions
The former led to an excess/unneeded use of hash.h in coreutils' cut.c.
The latter would have led to a FP "not needed" report for copy.c.
Bruno Haible [Tue, 21 Jun 2022 23:43:52 +0000 (01:43 +0200)]
chmod: New module.
* lib/sys_stat.in.h (chmod): Declare when GNULIB_CHMOD is 1.
* lib/chmod.c: New file, based on lib/lchmod.c.
* m4/chmod.m4: New file, based on m4/fchmodat.m4.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H): Test whether chmod is declared.
(gl_SYS_STAT_H_REQUIRE_DEFAULTS): Initialize GNULIB_CHMOD.
(gl_SYS_STAT_H_DEFAULTS): Initialize REPLACE_CHMOD.
* modules/sys_stat (Makefile.am): Substitute GNULIB_CHMOD,
REPLACE_CHMOD.
* modules/chmod: New file, based on modules/lchmod.
* doc/posix-functions/chmod.texi: Mention the new module and the
problems on IRIX and Windows.
Paul Eggert [Mon, 20 Jun 2022 04:30:01 +0000 (23:30 -0500)]
lchmod: port back to AIX 7.2
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2022-06/msg00075.html
* lib/lchmod.c: Include string.h, for strlen.
(lchmod): Do not depend on HAVE_READLINK since we now depend on
the readlink module. Check for AIX 7.2 bug.
* m4/lchmod.m4 (gl_PREREQ_LCHMOD): Do not check for readlink
since we now depend on the readlink module.
* modules/lchmod (Depends-on): Depend on readlink.
Paul Eggert [Sun, 12 Jun 2022 20:46:52 +0000 (13:46 -0700)]
fchmodat: port better to MS-Windows etc.
MS-Windows problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2022-06/msg00041.html
Although I don’t use MS-Windows I see some related fstatat etc.
problems and am trying to fix them with this further patch.
* lib/fchmodat.c (fchmodat):
* lib/lchmod.c (lchmod):
* lib/lchown.c (lchown)
[!HAVE_LCHOWN && HAVE_CHOWN && !CHOWN_MODIFIES_SYMLINK]:
* lib/renameatu.c (renameatu)
[HAVE_RENAME && RENAME_TRAILING_SLASH_SOURCE_BUG]:
Use readlinkat/readlink instead of fstatat/lstat to test merely
whether a string names a symlink, as this avoids problems
with EOVERFLOW. Also, I hope it works around the MS-Windows
issues that Bruno noted.
* m4/fchmodat.m4 (gl_PREREQ_FCHMODAT):
Check for readlinkat, not lchmod.
* m4/lchmod.m4 (gl_FUNC_LCHMOD): Do not require AC_CANONICAL_HOST
or check for lstat.
(gl_PREREQ_LCHMOD): Check for readlink.
* modules/lchown (Depends-on): Add readlink. Do not depend on
lstat merely because !HAVE_LCHOWN.
* modules/renameatu (Depends-on): Add fstatat, readlinkat.
Paul Eggert [Sat, 11 Jun 2022 23:58:25 +0000 (16:58 -0700)]
fchmodat: port to old Linux kernel + newer headers
Problem reported by Lance Fredrickson in:
https://lists.gnu.org/r/bug-gnulib/2022-06/msg00038.html
* lib/fchmodat.c (fchmodat):
* lib/lchmod.c (lchmod): Do not rely on AT_EMPTY_PATH as to
whether syscalls work on ""; instead, if a call fails with
ENOENT assume that those syscalls do not work.
Do not use fstatat to determine whether a file is a symlink,
as this has problems with EOVERFLOW. Use readlinkat instead,
and if it fails with EINVAL then the file is not a symlink.
Remove #if tests on __linux__ || __ANDROID__ || __CYGWIN__
as this has been a maintenance hassle and it’s unlikely
these days that a new platform would #define O_PATH without also
either supporting /proc or keeping it absent.
* modules/fchmodat (Depends-on): Remove fstatat.
There should be no need for either fchmodat or lchmod to depend on
readlinkat, since they use readlinkat only in contexts where it
should work without Gnulib intervention.
Bruno Haible [Mon, 6 Jun 2022 09:55:04 +0000 (11:55 +0200)]
getlogin, getlogin_r tests: Avoid test failure in specific environments.
Reported by Letu Ren <fantasquex@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-06/msg00001.html>.
* modules/getlogin-tests (Depends-on): Add stdbool.
* modules/getlogin_r-tests (Depends-on): Likewise.
* tests/test-getlogin.h: Include stdbool.h.
(test_getlogin_result): On Linux, skip the test if /proc/self/loginuid
contains "-1".
Paul Eggert [Sat, 4 Jun 2022 16:55:28 +0000 (09:55 -0700)]
regex-quote: \} -> } in EREs
* lib/regex-quote.c (ere_special): Don’t use \} in EREs,
as POSIX says the interpretation is undefined.
* tests/test-regex-quote.c (test_bre, test_ere):
Add tests for }.
Paul Eggert [Sat, 4 Jun 2022 00:27:44 +0000 (17:27 -0700)]
filevercmp: don’t treat entire filename as suffix
Problem reported by Artém S. Tashkinóv in:
https://lists.gnu.org/r/bug-gnulib/2022-06/msg00012.html
* lib/filevercmp.c (file_prefixlen): When stripping
(\.[A-Za-z~][A-Za-z0-9~]*)*$ suffixes, do not strip
the entire file name.
* tests/test-filevercmp.c (examples): Adjust to match new behavior.