]> Savannah Git Hosting - gnulib.git/log
gnulib.git
12 months agoexp2l: Work around a NetBSD 10.0/i386 bug.
Bruno Haible [Fri, 5 Apr 2024 14:45:25 +0000 (16:45 +0200)]
exp2l: Work around a NetBSD 10.0/i386 bug.

* m4/exp2l.m4 (gl_FUNC_EXP2L): Test the value of exp2l(LDBL_MAX_EXP-1).
* doc/posix-functions/exp2l.texi: Mention the NetBSD 10.0/i386 bug.

12 months agoroundl: Fix a link error on Linux/powerpc64le.
Bruno Haible [Fri, 5 Apr 2024 14:04:59 +0000 (16:04 +0200)]
roundl: Fix a link error on Linux/powerpc64le.

* m4/check-math-lib.m4 (gl_CHECK_MATH_LIB): Accept an additional TYPE
argument.
* m4/isfinite.m4 (gl_ISFINITE): Use the type 'double'.
* m4/isinf.m4 (gl_ISINF): Likewise.
* m4/round.m4 (gl_FUNC_ROUND): Likewise.
* m4/roundf.m4 (gl_FUNC_ROUNDF): Use the type 'float'.
* m4/roundl.m4 (gl_FUNC_ROUNDL): Use the type 'long double'.

12 months agoexp2l tests: Enable a test for glibc versions >= 2.16.
Bruno Haible [Fri, 5 Apr 2024 13:30:28 +0000 (15:30 +0200)]
exp2l tests: Enable a test for glibc versions >= 2.16.

* tests/test-exp2.h (test_function): Disable a glibc bug workaround for
glibc versions >= 2.16.

12 months agoexpl tests: Avoid test failure on NetBSD 10.0/i386.
Bruno Haible [Fri, 5 Apr 2024 13:16:27 +0000 (15:16 +0200)]
expl tests: Avoid test failure on NetBSD 10.0/i386.

* tests/test-exp.h (test_function): Allow more deviation on NetBSD/i386.

12 months agognulib-tool.py: Use 'Any' instead of type unions in GLConfig.
Collin Funk [Fri, 5 Apr 2024 04:41:08 +0000 (21:41 -0700)]
gnulib-tool.py: Use 'Any' instead of type unions in GLConfig.

* pygnulib/GLConfig.py (GLConfig.__getitem__, GLConfig.dictionary)
(GLConfig.default, GLConfig.isdefault, GLConfig.values): Use 'Any' from
the typing module instead of large type unions. This silences unhelpful
warnings from type checkers.

12 months agognulib-tool.py: Fix 'consider-using-set-comprehension' warnings.
Collin Funk [Fri, 5 Apr 2024 03:42:09 +0000 (20:42 -0700)]
gnulib-tool.py: Fix 'consider-using-set-comprehension' warnings.

* pygnulib/GLImport.py (GLImport.prepare): Create a set directly instead
of creating a list and passing it to a call of set().
(GLImport.__init__): Likewise. Use max() instead of getting the last
element of a sorted list.

12 months agognulib-tool.py: Fix 'consider-using-with' pylint warnings.
Collin Funk [Fri, 5 Apr 2024 03:32:55 +0000 (20:32 -0700)]
gnulib-tool.py: Fix 'consider-using-with' pylint warnings.

* pygnulib/GLModuleSystem.py (GLModuleSystem.list): Use run() instead of
Popen() from the subprocess module. This function handles cleanup
internally instead of as a context manager via the 'with' statement.

12 months agoUpdate for NetBSD 9.3 and 10.0.
Bruno Haible [Fri, 5 Apr 2024 10:04:59 +0000 (12:04 +0200)]
Update for NetBSD 9.3 and 10.0.

* doc/*/*.texi: Update for NetBSD 9.3 and 10.0.
* m4/expm1l.m4 (gl_FUNC_EXPM1L): Update comments and cross-compilation
guess.
* m4/log1pl.m4 (gl_FUNC_LOG1PL_WORKS): Likewise.
* m4/log2l.m4 (gl_FUNC_LOG2L_WORKS): Likewise.
* m4/printf.m4 (gl_SWPRINTF_DIRECTIVE_LA): Likewise.
* m4/remainderl.m4 (gl_FUNC_REMAINDERL_WORKS): Likewise.
* m4/fcntl.m4: Update comments.
* m4/fenv-environment.m4: Likewise.
* m4/fenv-exceptions-trapping.m4: Likewise.
* m4/fnmatch.m4: Likewise.
* m4/getcwd-abort-bug.m4: Likewise.
* m4/iswdigit.m4: Likewise.
* m4/iswxdigit.m4: Likewise.
* m4/modfl.m4: Likewise.
* m4/wcscmp.m4: Likewise.
* m4/wcsncmp.m4: Likewise.
* m4/wctrans.m4: Likewise.
* m4/wcwidth.m4: Likewise.

13 months agoposix-modules, all-modules: Fix --version output using git options.
Collin Funk [Thu, 4 Apr 2024 00:48:56 +0000 (17:48 -0700)]
posix-modules, all-modules: Fix --version output using git options.

* all-modules (func_version): Pass --format and --date options to git
so the output does not depend on the user's configuration. Pass
'-n 1' to speed up the operation, since we only need the first entry.
* posix-modules (func_version): Likewise.

13 months agoall-modules: Fix errors during './all-modules --version' execution.
Bruno Haible [Fri, 5 Apr 2024 02:17:56 +0000 (04:17 +0200)]
all-modules: Fix errors during './all-modules --version' execution.

Reported by Collin Funk in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00050.html>.

* all-modules (func_exit, func_fatal_error, func_readlink,
func_gnulib_dir): Include auxiliary functions from gnulib-tool.sh.

13 months agoposix-modules: Sync auxiliary functions from gnulib-tool.sh.
Bruno Haible [Fri, 5 Apr 2024 02:11:22 +0000 (04:11 +0200)]
posix-modules: Sync auxiliary functions from gnulib-tool.sh.

* posix-modules (func_exit, func_fatal_error, func_readlink,
func_gnulib_dir): Move before func_usage and func_version. Incorporate
improvements from gnulib-tool.sh.

13 months agognulib-tool.py: Ignore 'use-dict-literal' warnings.
Collin Funk [Thu, 4 Apr 2024 22:29:50 +0000 (15:29 -0700)]
gnulib-tool.py: Ignore 'use-dict-literal' warnings.

* pygnulib/.pylintrc: Don't emit warning messages suggesting that
'dict()' be converted to '{}'. This literal can be mistaken for sets,
see discussion here:
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00054.html>
* pygnulib/main.py: Document this convention in coding style section.
* pygnulib/GLFileSystem.py (GLFileAssistant.__init__): Convert an
occurrence of '{}' to 'dict()'.

13 months agognulib-tool.py: Fix pylint 'raise-missing-from' warnings.
Collin Funk [Thu, 4 Apr 2024 21:56:12 +0000 (14:56 -0700)]
gnulib-tool.py: Fix pylint 'raise-missing-from' warnings.

* pygnulib/*.py: Use explicit exception chaining so that stack trace
messages do not seem like bugs. See examples in:
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00056.html>

13 months agoAdd serial numbers to *.m4 files that did not have them.
Bruno Haible [Thu, 4 Apr 2024 10:22:38 +0000 (12:22 +0200)]
Add serial numbers to *.m4 files that did not have them.

* m4/*.m4: Ensure the usual file header with file name and serial
number.

13 months agoMake the file header of *.m4 files consistent:
Bruno Haible [Thu, 4 Apr 2024 09:56:10 +0000 (11:56 +0200)]
Make the file header of *.m4 files consistent:

1. The file name.
2. The serial number.
3. The copyright and license header.

* m4/*.m4: Adjust file headers.

13 months agoMake the serial numbers in *.m4 files effective.
Bruno Haible [Thu, 4 Apr 2024 09:16:15 +0000 (11:16 +0200)]
Make the serial numbers in *.m4 files effective.

Reported by Sam James in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00051.html>.

* m4/*.m4: Apply sed -e '1s|^# \(.*[.]m4\) serial |# \1\n# serial |'.

13 months agognulib-tool.sh: Reduce code duplication in last commit.
Bruno Haible [Wed, 3 Apr 2024 23:26:48 +0000 (01:26 +0200)]
gnulib-tool.sh: Reduce code duplication in last commit.

* gnulib-tool.sh (func_get_automake_snippet_unconditional): Refactor
computation of sed_prepend_auxdir.

13 months agognulib-tool.sh: Don't emit an unnecessary './' path component.
Collin Funk [Wed, 3 Apr 2024 12:11:33 +0000 (05:11 -0700)]
gnulib-tool.sh: Don't emit an unnecessary './' path component.

* gnulib-tool.sh (func_get_automake_snippet_unconditional): Only prefix
build-aux files with '$(top_srcdir)/' when $auxdir is the top level
directory.

13 months agognulib-tool.py: Modernize class declarations to Python 3.
Collin Funk [Wed, 3 Apr 2024 09:56:42 +0000 (02:56 -0700)]
gnulib-tool.py: Modernize class declarations to Python 3.

* pygnulib/GLConfig.py: Remove the explicit object inheritance from
class declarations. This is previously required in Python 2.
* pygnulib/GLEmiter.py: Likewise.
* pygnulib/GLFileSystem.py: Likewise.
* pygnulib/GLImport.py: Likewise.
* pygnulib/GLInfo.py: Likewise.
* pygnulib/GLMakefileTable.py: Likewise.
* pygnulib/GLModuleSystem.py: Likewise.
* pygnulib/GLTestDir.py: Likewise.

13 months agognulib-tool.py: Ignore pylint 'unidiomatic-typecheck' warnings.
Collin Funk [Wed, 3 Apr 2024 09:25:53 +0000 (02:25 -0700)]
gnulib-tool.py: Ignore pylint 'unidiomatic-typecheck' warnings.

* pygnulib/.pylintrc: Disable warning C0123 since we don't mind using
'type() is' instead of 'isinstance'.

13 months agognulib-tool.py: Don't ignore the argument to --doc-base.
Collin Funk [Wed, 3 Apr 2024 01:04:09 +0000 (18:04 -0700)]
gnulib-tool.py: Don't ignore the argument to --doc-base.

* pygnulib/main.py (main): Check for the argument to --doc-base before
creating the GLConfig object.

13 months agoquotearg: fix shell-escape quoting with single quotes
Pádraig Brady [Wed, 3 Apr 2024 14:46:47 +0000 (15:46 +0100)]
quotearg: fix shell-escape quoting with single quotes

With shell-escape quoting, we misquoted strings
where the first and last characters required escaping,
while the string also contained single quotes.

* lib/quotearg.c (quotearg_buffer_restyled): Ensure that
pending_shell_escape_end is reset to the initial state
when reprocessing input due to single quotes.
* tests/test-quotearg-simple.c: Add a minimal test case.
* tests/test-quotearg.c: Likewise.
* tests/test-quotearg.h: Likewise.
Reported by Grisha Levit

13 months agognulib-tool.py: Use [] instead of list() to initialize empty lists.
Collin Funk [Tue, 2 Apr 2024 18:35:51 +0000 (11:35 -0700)]
gnulib-tool.py: Use [] instead of list() to initialize empty lists.

* pygnulib/*.py: Change occurrences of list() to [].

13 months agognulib-tool.py: Fix determination whether to add the dummy module.
Collin Funk [Tue, 2 Apr 2024 11:41:22 +0000 (04:41 -0700)]
gnulib-tool.py: Fix determination whether to add the dummy module.

* pygnulib/GLModuleSystem.py (GLModuleSystem.add_dummy): Only match the
'lib_SOURCES' variable; stop at end-of-line.

13 months agorenameatu: handle ENOSYS from renameatx_np
Pádraig Brady [Tue, 2 Apr 2024 12:21:41 +0000 (13:21 +0100)]
renameatu: handle ENOSYS from renameatx_np

* lib/renameatu.c(): Fall back to renameat() when
renameatx_np(RENAME_EXCL) returns "Function not implemented".
This issue was seen with macFUSE.
Reported at https://github.com/coreutils/coreutils/issues/79

13 months agognulib-tool.py: Accept valid make syntax for escaped newlines.
Collin Funk [Tue, 2 Apr 2024 10:58:37 +0000 (03:58 -0700)]
gnulib-tool.py: Accept valid make syntax for escaped newlines.

* pygnulib/GLModuleSystem.py (GLModuleTable.add_dummy): Use
combine_lines instead of remove remove_backslash_newline so spaces are
added between each combined line.
* pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.
* pygnulib/constants.py (remove_backslash_newline): Remove unused
function.

13 months agognulib-tool.py: Don't default to 'build-aux' for --auxdir.
Collin Funk [Tue, 2 Apr 2024 02:13:16 +0000 (19:13 -0700)]
gnulib-tool.py: Don't default to 'build-aux' for --auxdir.

* pygnulib/GLConfig.py (GLConfig.__getitem__): Don't map '' to
'build-aux' for the 'auxdir' key.
* pygnulib/GLImport.py (GLImport.__init__): Change conditional to use an
empty string instead of None since this is returned when --auxdir is not
used.

13 months agognulib-tool: Remove unused variables.
Bruno Haible [Tue, 2 Apr 2024 11:42:53 +0000 (13:42 +0200)]
gnulib-tool: Remove unused variables.

* pygnulib/GLConfig.py: Remove unused variables.
* pygnulib/GLEmiter.py: Likewise.
* pygnulib/GLFileSystem.py: Likewise.
* pygnulib/GLImport.py: Likewise.
* pygnulib/GLInfo.py: Likewise.
* pygnulib/GLModuleSystem.py: Likewise.
* pygnulib/GLTestDir.py: Likewise.
* pygnulib/main.py: Likewise.
* gnulib-tool.sh (func_emit_tests_Makefile_am): Remove unused variable
perhapsLT.

13 months agognulib-tool.py: Remove no-op statements.
Bruno Haible [Mon, 1 Apr 2024 23:29:24 +0000 (01:29 +0200)]
gnulib-tool.py: Remove no-op statements.

* pygnulib/GLConfig.py (GLConfig.update): Remove no-op statement.

13 months agognulib-tool.py: Remove unused imports.
Bruno Haible [Mon, 1 Apr 2024 23:18:59 +0000 (01:18 +0200)]
gnulib-tool.py: Remove unused imports.

* pygnulib/GLFileSystem.py: Remove unused imports.
* pygnulib/GLEmiter.py: Likewise.
(GLEmiter.autoconfSnippets): Fix type assertion message.

13 months agognulib-tool.py: Fix some IDE warnings.
Bruno Haible [Tue, 2 Apr 2024 11:38:32 +0000 (13:38 +0200)]
gnulib-tool.py: Fix some IDE warnings.

* HACKING: Update configuration of warnings.

13 months agognulib-tool.py: Add developer documentation.
Bruno Haible [Mon, 1 Apr 2024 22:21:54 +0000 (00:21 +0200)]
gnulib-tool.py: Add developer documentation.

* HACKING: New section "Debugging the Python implementation of
gnulib-tool".

13 months agognulib-tool.py: Use a standard Python program directory structure.
Bruno Haible [Mon, 1 Apr 2024 19:50:51 +0000 (21:50 +0200)]
gnulib-tool.py: Use a standard Python program directory structure.

* pygnulib/main.py (main_with_exception_handling): New function for
existing code.
* .gnulib-tool.py: New file.
* pygnulib/constants.py: Update the computation of APP['root'].
* gnulib-tool.py: Don't set PYTHONPATH.

13 months agognulib-tool.py: Simplify imports.
Bruno Haible [Mon, 1 Apr 2024 19:28:23 +0000 (21:28 +0200)]
gnulib-tool.py: Simplify imports.

* pygnulib/enums.py: New file, extracted from pygnulib/GLFileSystem.py.
* pygnulib/classes.py: Remove file.
* pygnulib/GLFileSystem.py: Remove class CopyAction. Update imports.
* pygnulib/GLTestDir.py: Update imports.
* pygnulib/GLConfig.py: Update imports and remove 'classes.' prefix.
* pygnulib/main.py: Likewise.

13 months agognulib-tool.py: Only check existence for --extract-tests-module.
Collin Funk [Mon, 1 Apr 2024 08:40:01 +0000 (01:40 -0700)]
gnulib-tool.py: Only check existence for --extract-tests-module.

* pygnulib/main.py (main): Check that the test module exists instead of
looking it up and patching it if diff's are found.

13 months agognulib-tool.py: Fix --extract-tests-module with a test module.
Collin Funk [Mon, 1 Apr 2024 08:18:17 +0000 (01:18 -0700)]
gnulib-tool.py: Fix --extract-tests-module with a test module.

* pygnulib/GLModuleSystem.py (GLModule.getTestsName): Return the module
name with '-tests' appended to it unconditionally.

13 months agognulib-tool.py: Use case-sensitive sorting for file names.
Collin Funk [Mon, 1 Apr 2024 01:00:16 +0000 (18:00 -0700)]
gnulib-tool.py: Use case-sensitive sorting for file names.

* pygnulib/GLImport.py (GLImport.prepare): Remove the str.lower key from
the call to sorted().

13 months agogetcwd: port better to buggy file systems
Paul Eggert [Mon, 1 Apr 2024 04:12:38 +0000 (22:12 -0600)]
getcwd: port better to buggy file systems

* m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX):
Time out after 5 seconds.

13 months agognulib-tool.py: Add missing quotation mark to reminder.
Collin Funk [Mon, 1 Apr 2024 00:41:03 +0000 (17:41 -0700)]
gnulib-tool.py: Add missing quotation mark to reminder.

* pygnulib/GLImport.py (GLImport.execute): Add missing end quote around
file name in AC_CONFIG_FILES reminder.

13 months agoquotearg: Improve documentation.
Bruno Haible [Sun, 31 Mar 2024 20:56:14 +0000 (22:56 +0200)]
quotearg: Improve documentation.

* lib/quotearg.h: Refer to specification of $'...' syntax. Document a
limitation of QA_ELIDE_OUTER_QUOTES.

13 months agocanonicalize[-lgpl] tests: Fix test failure on musl libc.
Bruno Haible [Sun, 31 Mar 2024 19:31:34 +0000 (21:31 +0200)]
canonicalize[-lgpl] tests: Fix test failure on musl libc.

Reported by Adept's Lab <adeptslab@gmail.com> via Pádraig Brady at
<https://lists.gnu.org/archive/html/bug-coreutils/2024-03/msg00086.html>.

* tests/test-canonicalize-lgpl.c (main): Don't special-case "//"
handling for musl libc.
* tests/test-canonicalize.c (main): Likewise.
* modules/canonicalize-lgpl-tests (Files): Remove m4/musl.m4.
(configure.ac): Don't invoke gl_MUSL_LIBC.

13 months agognulib-tool.py: Fix output of 'po/LINGUAS'.
Collin Funk [Sun, 31 Mar 2024 05:38:48 +0000 (22:38 -0700)]
gnulib-tool.py: Fix output of 'po/LINGUAS'.

* pygnulib/GLImport.py (GLImport.execute): Only use PO files when
determining the output for po/LINGUAS.

13 months agognulib-tool.py: Fix sorting of modules when --local-dir is used.
Collin Funk [Sun, 31 Mar 2024 03:51:22 +0000 (20:51 -0700)]
gnulib-tool.py: Fix sorting of modules when --local-dir is used.

* pygnulib/GLModuleSystem.py (GLModule.__eq__, GLModule.__ne__)
(GLModule.__ge__, GLModule.__gt__, GLModule.__hash__, GLModule.__le__)
(GLModule.__lt__): Use module names as identifiers instead of paths.

13 months agognulib-tool.py: Make a module's name immediately accessible.
Bruno Haible [Sun, 31 Mar 2024 12:00:48 +0000 (14:00 +0200)]
gnulib-tool.py: Make a module's name immediately accessible.

* pygnulib/GLModuleSystem.py (GLModuleSystem.find): Pass the module name
to the GLModule constructor.
(GLModule.__init__): Accept the module's name as argument and store it.
(GLModule.getName): Simplify.

13 months agognulib-tool.py: Don't discard the 'dummy' module.
Collin Funk [Sat, 30 Mar 2024 10:23:46 +0000 (03:23 -0700)]
gnulib-tool.py: Don't discard the 'dummy' module.

* pygnulib/GLImport.py (GLImport.prepare): Don't set modules stored in
the GLModuleTable until after the 'dummy' module is added.
* pygnulib/GLModuleSystem.py (GLImport.setBaseModules)
(GLImport.setFinalModules, GLImport.setMainModules)
(GLImport.setTestsModules): Don't sort modules since the 'dummy' module
should be placed last in the Makefiles.

13 months agognulib-tool.py: Fix reading of 'gl_VC_FILES' in gnulib-cache.m4.
Collin Funk [Sat, 30 Mar 2024 03:15:24 +0000 (20:15 -0700)]
gnulib-tool.py: Fix reading of 'gl_VC_FILES' in gnulib-cache.m4.

* pygnulib/GLImport.py (GLImport.__init__): Check for an empty string
explicitly in conditional so False is not ignored.

13 months agotime_r tests: Avoid misleading skip message on native Windows.
Bruno Haible [Sat, 30 Mar 2024 21:50:39 +0000 (22:50 +0100)]
time_r tests: Avoid misleading skip message on native Windows.

* tests/test-localtime_r.c (main): Use the macro FRENCH_TZ.
* tests/test-localtime_r-mt.c (main): Likewise.

13 months agotime_r-tests: skip French tests if no Europe/Paris
Paul Eggert [Sat, 30 Mar 2024 19:28:01 +0000 (13:28 -0600)]
time_r-tests: skip French tests if no Europe/Paris

* tests/test-localtime_r.c (main):
* tests/test-localtime_r-mt.c (main):
If TZ='Europe/Paris' does not work, skip these tests.

13 months agointprops: pacify GCC < 10 -Wsign-compare
Paul Eggert [Fri, 29 Mar 2024 22:56:45 +0000 (15:56 -0700)]
intprops: pacify GCC < 10 -Wsign-compare

Problem reported by Martin Dorey in:
https://savannah.gnu.org/bugs/index.php?65537
* lib/intprops-internal.h (_GL_INT_MULTIPLY_WRAPV):
When working around GCC bug 91450, pacify -Wsign-compare by
casting 0 to the result type.

13 months agognulib-tool: Use bold output on Linux, NetBSD, OpenBSD, OmniOS consoles.
Bruno Haible [Fri, 29 Mar 2024 21:48:37 +0000 (22:48 +0100)]
gnulib-tool: Use bold output on Linux, NetBSD, OpenBSD, OmniOS consoles.

Reported by Pádraig Brady in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-03/msg00399.html>.

* gnulib-tool.sh (func_show_module_list): Use 'tput' to determine the
"bold" capability of terminal types other than xterm*.
* pygnulib/constants.py (get_terminfo_string, bold_escapes): New
functions.
* pygnulib/GLTestDir.py (GLTestDir.execute): Invoke
constants.bold_escapes.
* pygnulib/GLImport.py (GLImport.prepare): Likewise.

13 months agognulib-tool.py: Display specified modules in bold.
Collin Funk [Fri, 29 Mar 2024 13:09:20 +0000 (06:09 -0700)]
gnulib-tool.py: Display specified modules in bold.

* pygnulib/GLImport.py (GLImport.prepare): Detect terminals starting
with 'xterm'. Change hexadecimal numbers to octal, matching
gnulib-tool.sh.
* pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.

13 months agoattribute: Work around compiler bug of Oracle cc 12.6.
Bruno Haible [Fri, 29 Mar 2024 13:35:01 +0000 (14:35 +0100)]
attribute: Work around compiler bug of Oracle cc 12.6.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Expand _GL_ATTRIBUTE_PACKED to
empty on SunPRO C.

13 months agognulib-tool.py: Don't print Makefile.am edits that are already done.
Bruno Haible [Fri, 29 Mar 2024 11:14:21 +0000 (12:14 +0100)]
gnulib-tool.py: Don't print Makefile.am edits that are already done.

* pygnulib/GLMakefileTable.py (GLMakefileTable): Improve comments.
(GLMakefileTable.__getitem__): Do not clone the result.
* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am, tests_Makefile_am):
Avoid a KeyError when testing for 'var'.
Use 'del' to remove a dictionary entry.
* pygnulib/GLImport.py (GLImport.execute): Avoid a KeyError when
testing for 'var'. Simplify loop over makefiletable.

13 months agofenv-exceptions-state-c99: Fix test failures with Oracle cc 12.6.
Bruno Haible [Fri, 29 Mar 2024 02:50:44 +0000 (03:50 +0100)]
fenv-exceptions-state-c99: Fix test failures with Oracle cc 12.6.

* lib/fenv-except-state-set.c (mask387cw): New function.
(fesetexceptflag): Use it on glibc.

13 months agomcel tests: Fix test failure with Oracle cc 12.6.
Bruno Haible [Fri, 29 Mar 2024 01:14:21 +0000 (02:14 +0100)]
mcel tests: Fix test failure with Oracle cc 12.6.

* tests/test-mcel.c (main): Explicitly return 0 at the end.

13 months agognulib-tool: Drop workarounds for Automake < 1.14.
Bruno Haible [Thu, 28 Mar 2024 22:33:56 +0000 (23:33 +0100)]
gnulib-tool: Drop workarounds for Automake < 1.14.

Reported by Collin Funk in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-03/msg00384.html>.

* gnulib-tool.sh (func_emit_lib_Makefile_am): Emit pkgdata_DATA
initialization always.
(func_emit_tests_Makefile_am): Likewise.
(func_import): Don't emit 'AC_REQUIRE([AM_PROG_CC_C_O])' into
gnulib-comp.m4.
(func_create_testdir): Don't emit AM_PROG_CC_C_O into configure.ac.
Bump required Automake version to 1.14.
(func_create_megatestdir): Bump required Automake version to 1.14.
* pygnulib/constants.py: Update comments.
* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Emit pkgdata_DATA
initialization always. Don't return uses_subdirs.
(GLEmiter.tests_Makefile_am): Likewise.
* pygnulib/GLImport.py (GLImport.gnulib_comp): Don't emit
'AC_REQUIRE([AM_PROG_CC_C_O])'.
(GLImport.execute): Update.
* pygnulib/GLTestDir.py (GLTestDir.execute): Don't emit AM_PROG_CC_C_O
into configure.ac. Bump required Automake version to 1.14.
(GLMegaTestDir.execute): Bump required Automake version to 1.14.

13 months agopthread-h: Fix override of pthread_spinlock_t with non-GNU compilers.
Bruno Haible [Thu, 28 Mar 2024 21:05:39 +0000 (22:05 +0100)]
pthread-h: Fix override of pthread_spinlock_t with non-GNU compilers.

* m4/pthread-spin.m4 (gl_PTHREAD_SPIN): Define through AC_DEFUN_ONCE.
Require gl_PTHREAD_H_DEFAULTS, not gl_PTHREAD_H.
* m4/pthread_h.m4 (gl_PTHREAD_H): Invoke gl_PTHREAD_SPIN.
* lib/pthread.in.h (pthread_spinlock_t,
GNULIB_defined_pthread_spin_types): Don't define if
HAVE_PTHREAD_SPIN_INIT && !REPLACE_PTHREAD_SPIN_INIT.
* modules/pthread-h (Files): Add m4/pthread-spin.m4.

13 months agohavelib: Recognize ELF platform despite SunPRO C on Linux.
Bruno Haible [Thu, 28 Mar 2024 16:50:55 +0000 (17:50 +0100)]
havelib: Recognize ELF platform despite SunPRO C on Linux.

* m4/lib-prefix.m4 (AC_LIB_PREPARE_MULTILIB): Recognize Linux as an ELF
platform, even with the SunPRO C compiler that does not define __ELF__.

13 months agognulib-tool.py: Fix missing 'gnulib-cache.m4' in EXTRA_DIST.
Collin Funk [Thu, 28 Mar 2024 09:40:46 +0000 (02:40 -0700)]
gnulib-tool.py: Fix missing 'gnulib-cache.m4' in EXTRA_DIST.

* pygnulib/GLMakefileTable.py (GLMakefileTable.parent): Fix the loop
condition so that it matches gnulib-tool.sh.

13 months agognulib-tool.py: Fix whitespace in gnulib-comp.m4.
Collin Funk [Thu, 28 Mar 2024 04:08:36 +0000 (21:08 -0700)]
gnulib-tool.py: Fix whitespace in gnulib-comp.m4.

* pygnulib/GLEmiter.py (GLEmiter.autoconfSnippet): Prefix each line with
the indentation string instead of using regular expressions.

13 months agognulib-tool.py: Update the gnulib-tool.py.TODO file.
Bruno Haible [Thu, 28 Mar 2024 03:41:21 +0000 (04:41 +0100)]
gnulib-tool.py: Update the gnulib-tool.py.TODO file.

* gnulib-tool.py.TODO: Add a suggestion by Collin Funk.

13 months agognulib-tool.py: Fix breakage that I introduced with Collin's last patch.
Bruno Haible [Thu, 28 Mar 2024 02:21:52 +0000 (03:21 +0100)]
gnulib-tool.py: Fix breakage that I introduced with Collin's last patch.

* pygnulib/GLFileSystem.py (GLFileAssistant.add_or_update): Correct the
open calls.

13 months agognulib-tool.py: Update the gnulib-tool.py.TODO file.
Bruno Haible [Thu, 28 Mar 2024 01:37:39 +0000 (02:37 +0100)]
gnulib-tool.py: Update the gnulib-tool.py.TODO file.

13 months agognulib-tool.py: Inline 'sed' invocations used on library files.
Collin Funk [Thu, 28 Mar 2024 00:39:58 +0000 (17:39 -0700)]
gnulib-tool.py: Inline 'sed' invocations used on library files.

* pygnulib/GLFileSystem.py (GLFileAssistant.__init__): Update type hints
and docstrings to reflect changes necessary for using re.sub() instead
of 'sed'.
(GLFileAssistant.add_or_update): Use re.sub() instead of invoking 'sed'.
* pygnulib/GLImport.py (GLImport.prepare): Update transformation
variables to reflect changes to GLFileAssistant.

13 months agoobstack: Work around ICE with Oracle cc 12.6 (regr. 2023-12-01).
Bruno Haible [Wed, 27 Mar 2024 20:34:40 +0000 (21:34 +0100)]
obstack: Work around ICE with Oracle cc 12.6 (regr. 2023-12-01).

* lib/obstack.in.h (__PTR_ALIGN): Use SMALL_PTRDIFF_T, instead of
testing sizeof (ptrdiff_t) < sizeof (void *) at compile time.
* m4/obstack.m4 (gl_FUNC_OBSTACK): Set SMALL_PTRDIFF_T.
* modules/obstack (Makefile.am): Substitute SMALL_PTRDIFF_T.

13 months agognulib-tool.py: Add type hints to all functions.
Collin Funk [Wed, 27 Mar 2024 07:56:29 +0000 (00:56 -0700)]
gnulib-tool.py: Add type hints to all functions.

* pygnulib/*.py: Add type hints and remove duplicate function signatures
from docstrings.

13 months agognulib-tool.py: Allow the use of both configure.ac and configure.in.
Collin Funk [Tue, 26 Mar 2024 22:43:21 +0000 (15:43 -0700)]
gnulib-tool.py: Allow the use of both configure.ac and configure.in.

* pygnulib/GLImport.py (GLImport.__init__): Remove redundant checks for
configure.ac and configure.in.
* pygnulib/main.py (main): Check for configure.ac and configure.in
before reading it. Pass it to GLImport using the GLConfig object.

13 months agogettime-res: Fix test failure on Solaris 11.4/SPARC.
Bruno Haible [Tue, 26 Mar 2024 11:12:23 +0000 (12:12 +0100)]
gettime-res: Fix test failure on Solaris 11.4/SPARC.

* lib/gettime-res.c (gettime_res): On Solaris/SPARC, just return 1 ns.

13 months agojit/cache: Fix a compilation error on Solaris 11.4/SPARC.
Bruno Haible [Tue, 26 Mar 2024 00:56:46 +0000 (01:56 +0100)]
jit/cache: Fix a compilation error on Solaris 11.4/SPARC.

* lib/jit/cache.h: On Solaris, include <stddef.h>.

13 months agognulib-tool.py: Print "executing mkdir ..." messages.
Bruno Haible [Mon, 25 Mar 2024 14:48:19 +0000 (15:48 +0100)]
gnulib-tool.py: Print "executing mkdir ..." messages.

* pygnulib/GLTestDir.py (GLTestDir.execute, GLMegaTestDir.execute):
Print a message before creating a 'build-aux' directory.

13 months agognulib-tool.py: Tweak last change.
Bruno Haible [Mon, 25 Mar 2024 12:44:24 +0000 (13:44 +0100)]
gnulib-tool.py: Tweak last change.

* pygnulib/GLImport.py (GLImport.execute): Recognize #if also at the
beginning of an Include snippet.

13 months agognulib-tool.py: Fix output of #include directive advice.
Collin Funk [Mon, 25 Mar 2024 08:56:24 +0000 (01:56 -0700)]
gnulib-tool.py: Fix output of #include directive advice.

* pygnulib/GLImport.py (GLImport.execute): Copy comment from
gnulib-tool.sh with modified variable names. Search the 'Include:' as a
whole instead of each individual line.

13 months agognulib-tool.py: Simplify last change.
Bruno Haible [Mon, 25 Mar 2024 12:19:53 +0000 (13:19 +0100)]
gnulib-tool.py: Simplify last change.

* pygnulib/GLImport.py (GLImport.execute): Remove unnecessary list to
set and set to list conversion.

13 months agognulib-tool.py: Fix "Creating directory" output.
Collin Funk [Mon, 25 Mar 2024 01:51:29 +0000 (18:51 -0700)]
gnulib-tool.py: Fix "Creating directory" output.

* pygnulib/GLImport.py (GLImport.execute): Reorder directories. Use
os.path.join instead of joinpath to avoid path normalization.

13 months agognulib-tool.py: Tweak last change.
Bruno Haible [Mon, 25 Mar 2024 11:53:34 +0000 (12:53 +0100)]
gnulib-tool.py: Tweak last change.

* pygnulib/GLImport.py (GLImport._update_ignorelist_): Rename some local
variables. Use rstrip built-in function.

13 months agognulib-tool.py: Handle removed files in the vc ignore files.
Collin Funk [Mon, 25 Mar 2024 05:20:15 +0000 (22:20 -0700)]
gnulib-tool.py: Handle removed files in the vc ignore files.

* pygnulib/GLImport.py (GLImport._update_ignorelist_): Handle removed
files. Check whether the original lines should be removed too.

13 months agognulib-tool.py: Fix filetable construction for ignorelist.
Collin Funk [Sun, 24 Mar 2024 23:09:34 +0000 (16:09 -0700)]
gnulib-tool.py: Fix filetable construction for ignorelist.

* pygnulib/GLImport.py (GLImport.execute): Fix typo in dictionary key
that overwrites removed files. Sort ignorelist by directory.

13 months agognulib-tool.py: Use Python raw strings for regular expressions.
Bruno Haible [Sun, 24 Mar 2024 23:07:49 +0000 (00:07 +0100)]
gnulib-tool.py: Use Python raw strings for regular expressions.

* pygnulib/*.py: Use raw string syntax for regular expression pattern
strings and repl strings.

13 months agognulib-tool.py: Bring the output into the right order.
Bruno Haible [Sun, 24 Mar 2024 21:46:44 +0000 (22:46 +0100)]
gnulib-tool.py: Bring the output into the right order.

* pygnulib/constants.py (force_output): New function.
(execute): Flush stdout after printing the "executing ..." line.
* pygnulib/GLTestDir.py (GLTestDir.execute, GLMegaTestDir.execute):
Invoke force_output.
* pygnulib/main.py (test, megatest): Likewise.

13 months agonstrtime, c-nstrftime: Fix %c directive's result on glibc ≤ 2.30.
Bruno Haible [Sun, 24 Mar 2024 18:23:47 +0000 (19:23 +0100)]
nstrtime, c-nstrftime: Fix %c directive's result on glibc ≤ 2.30.

* lib/strftime.c (__strftime_internal): On glibc ≤ 2.30, like on NetBSD
and Solaris, remove the last word of the %c directive's result if it
looks like a time zone.
* doc/posix-functions/strftime.texi: Update platforms list.

13 months agognulib-tool.py: Fix output of notices.
Bruno Haible [Sun, 24 Mar 2024 11:06:50 +0000 (12:06 +0100)]
gnulib-tool.py: Fix output of notices.

* pygnulib/GLTestDir.py (GLTestDir.execute): Don't print notices if the
verbosity is < -1. Strip newlines from each notice.
* pygnulib/GLImport.py (GLImport.prepare): Don't print notices if the
verbosity is < -1. Strip only newlines, not spaces.

13 months agognulib-tool.py: Fix the modules indentation in --create-testdir' output.
Bruno Haible [Sun, 24 Mar 2024 02:18:24 +0000 (03:18 +0100)]
gnulib-tool.py: Fix the modules indentation in --create-testdir' output.

* pygnulib/GLTestDir.py (GLTestDir.execute): Use specified_modules
instead of self.config.getModules(), since the latter may be empty.

13 months agognulib-tool.sh: Use a default auxdir in --extract-automake-snippet.
Bruno Haible [Sun, 24 Mar 2024 00:37:30 +0000 (01:37 +0100)]
gnulib-tool.sh: Use a default auxdir in --extract-automake-snippet.

* gnulib-tool.sh (extract-automake-snippet): Set auxdir to 'build-aux'
if it is not set.

13 months agognulib-tool.py: Don't unnecessarily sort an EXTRA_DIST augmentation.
Bruno Haible [Sun, 24 Mar 2024 00:28:49 +0000 (01:28 +0100)]
gnulib-tool.py: Don't unnecessarily sort an EXTRA_DIST augmentation.

* pygnulib/GLModuleSystem.py
(GLModule.getAutomakeSnippet_Unconditional): Don't remove duplicates or
sort the filenames in the EXTRA_lib_SOURCES augmentation or the
EXTRA_DIST augmentation for build-aux.

13 months agognulib-tool.py: Don't print Python bools in gnulib-cache.m4.
Collin Funk [Sat, 23 Mar 2024 19:55:58 +0000 (12:55 -0700)]
gnulib-tool.py: Don't print Python bools in gnulib-cache.m4.

* pygnulib/GLImport.py (GLImport.gnulib_cache): Convert Python bools to
lowercase before printing.

13 months agognulib-tool.py: Don't unnecessarily run configure && make in testdirs.
Bruno Haible [Sat, 23 Mar 2024 18:17:59 +0000 (19:17 +0100)]
gnulib-tool.py: Don't unnecessarily run configure && make in testdirs.

* pygnulib/GLTestDir.py (GLTestDir.execute): Correct the value of
tests_distributed_built_sources.

13 months agognulib-tool.py: Fix autoconf snippets inclusion if --single-configure.
Bruno Haible [Sat, 23 Mar 2024 17:54:19 +0000 (18:54 +0100)]
gnulib-tool.py: Fix autoconf snippets inclusion if --single-configure.

* pygnulib/GLTestDir.py (GLTestDir.execute): Correct the arguments
passed to autoconfSnippets.

13 months agognulib-tool.py: Produce same diagnostics regardless of Automake version.
Bruno Haible [Sat, 23 Mar 2024 17:10:13 +0000 (18:10 +0100)]
gnulib-tool.py: Produce same diagnostics regardless of Automake version.

* pygnulib/GLTestDir.py (_patch_test_driver): Suppress the diagnostics
from 'patch', and instead provide our own diagnostics.

13 months agognulib-tool.py: Print "executing touch config.h.in".
Bruno Haible [Sat, 23 Mar 2024 16:53:36 +0000 (17:53 +0100)]
gnulib-tool.py: Print "executing touch config.h.in".

* pygnulib/GLTestDir.py (GLTestDir.execute): Print
"executing touch config.h.in", like gnulib-tool.sh does.

13 months agognulib-tool.py: Update the gnulib-tool.py.TODO file.
Bruno Haible [Sat, 23 Mar 2024 15:29:17 +0000 (16:29 +0100)]
gnulib-tool.py: Update the gnulib-tool.py.TODO file.

13 months agognulib-tool.py: Refactor.
Bruno Haible [Sat, 23 Mar 2024 10:20:29 +0000 (11:20 +0100)]
gnulib-tool.py: Refactor.

* pygnulib/GLImport.py (GLImport._done_dir_,
GLImport._update_ignorelist_, GLImport.execute): Rename some variables.
(GLImport._update_ignorelist_): Use constants.substart.

13 months agognulib-tool.py: Follow gnulib-tool changes, part 69.
Collin Funk [Sat, 23 Mar 2024 02:43:41 +0000 (19:43 -0700)]
gnulib-tool.py: Follow gnulib-tool changes, part 69.

Follow gnulib-tool change
2012-08-19  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Remove old file names from .cvsignore, .gitignore.

* pygnulib/GLImport.py (GLImport._update_ignorelist_): Add
gnulib-comp.m4 to the added file list.
(GLImport.execute): Remove unused variables. Use sets to match the
'join' invocations in gnulib-tool.sh.

13 months agognulib-tool.py: Don't remove newlines in testdir's Automake snippets.
Collin Funk [Fri, 22 Mar 2024 19:57:01 +0000 (12:57 -0700)]
gnulib-tool.py: Don't remove newlines in testdir's Automake snippets.

* pygnulib/GLTestDir.py (GLTestDir.execute): Don't strip newlines from
Automake snippets.

13 months agognulib-tool.py: Fix empty newline output in test directories.
Collin Funk [Fri, 22 Mar 2024 19:19:28 +0000 (12:19 -0700)]
gnulib-tool.py: Fix empty newline output in test directories.

* pygnulib/GLTestDir.py (GLTestDir.execute, GLMegaTestDir.execute):
Match newlines printed by gnulib-tool.sh.

13 months agognulib-tool.py: Fix unconditional Automake snippets for non-tests.
Collin Funk [Fri, 22 Mar 2024 09:15:24 +0000 (02:15 -0700)]
gnulib-tool.py: Fix unconditional Automake snippets for non-tests.

* pygnulib/GLModuleSystem.py
(GLModule.getAutomakeSnippet_Unconditional): Fix the file lookups used
to determine the EXTRA_DIST and EXTRA_lib_SOURCES Automake variables.
Update comment to match gnulib-tool.sh.
* pygnulib/constants.py (filter_filelist): Fix misleading return type in
docstring. Return an empty string if no files were found.

13 months agognulib-tool.sh: Produce same diagnostics regardless of Automake version.
Bruno Haible [Fri, 22 Mar 2024 15:27:15 +0000 (16:27 +0100)]
gnulib-tool.sh: Produce same diagnostics regardless of Automake version.

* gnulib-tool.sh (func_create_testdir, func_create_megatestdir):
Suppress the diagnostics from 'patch', and instead provide our own
diagnostics.

13 months agognulib-tool: Remove test-driver.{orig,rej} if patching succeeded.
Bruno Haible [Fri, 22 Mar 2024 15:10:29 +0000 (16:10 +0100)]
gnulib-tool: Remove test-driver.{orig,rej} if patching succeeded.

* gnulib-tool.sh (func_create_testdir, func_create_megatestdir): After
a 'patch' command failed, remove the leftover files test-driver.orig and
test-driver.rej.
* pygnulib/GLTestDir.py (_patch_test_driver): Likewise.

13 months agognulib-tool.py: Fix an error in --create-testdir.
Bruno Haible [Fri, 22 Mar 2024 15:01:39 +0000 (16:01 +0100)]
gnulib-tool.py: Fix an error in --create-testdir.

* pygnulib/GLTestDir.py (GLTestDir.execute): Fix chdir calls at the end.

13 months agognulib-tool.sh: Avoid a redundant space in gl_AVOID in gnulib-cache.m4.
Collin Funk [Fri, 22 Mar 2024 01:55:21 +0000 (02:55 +0100)]
gnulib-tool.sh: Avoid a redundant space in gl_AVOID in gnulib-cache.m4.

* gnulib-tool.sh (avoidlist): Don't add a space before the first module
name.

13 months agognulib-tool.py: Fix --extract-recursive-link-directive.
Collin Funk [Thu, 21 Mar 2024 02:07:50 +0000 (19:07 -0700)]
gnulib-tool.py: Fix --extract-recursive-link-directive.

* pygnulib/GLModuleSystem.py (GLModule.getLinkDirectiveRecursively):
Check the 'Link:' section of each individual module. Use sets instead of
lists to remove duplicates.