]> Savannah Git Hosting - gnulib.git/log
gnulib.git
2 years agotempname: generate better names for MinGW Emacs
Paul Eggert [Tue, 16 Aug 2022 19:06:48 +0000 (12:06 -0700)]
tempname: generate better names for MinGW Emacs

On MinGW, GNU Emacs disables clock_gettime, which reliably breaks
some of gen_tempname’s optimistic callers.  Work around the
problem by making the generated names less predictable.  We don’t
need cryptographic randomness here, just enough unpredictability
to keep Emacs happy most of the time.
* lib/tempname.c (HAS_CLOCK_ENTROPY): New macro.
(random_bits): Use it.
(try_tempname_len): On systems lacking clock entropy, maintain
state so that gen_filename generates less-predictable names on
successive successful calls.

2 years agomaintainer-makefile: Check for incorrect DISTCHECK_CONFIGURE_FLAGS usage.
Simon Josefsson [Tue, 16 Aug 2022 15:26:56 +0000 (17:26 +0200)]
maintainer-makefile: Check for incorrect DISTCHECK_CONFIGURE_FLAGS usage.

* top/maint.mk (sc_makefile_DISTCHECK_CONFIGURE_FLAGS): Add.

2 years agotempname: Add tests.
Bruno Haible [Tue, 16 Aug 2022 13:27:50 +0000 (15:27 +0200)]
tempname: Add tests.

* tests/test-tempname.c: New file.
* modules/tempname-tests: New file.

2 years agopmccabe2html: Doc fix.
Simon Josefsson [Mon, 15 Aug 2022 22:28:22 +0000 (00:28 +0200)]
pmccabe2html: Doc fix.

* build-aux/pmccabe2html: Don't use reserved _SOURCES namespace.
Use AM_V_GEN.  Use LC_ALL=C.

2 years agostdbool: Drop old BeOS support that gets in the way of ISO C 23 support.
Bruno Haible [Mon, 15 Aug 2022 21:38:12 +0000 (23:38 +0200)]
stdbool: Drop old BeOS support that gets in the way of ISO C 23 support.

* lib/stdbool.in.h: Don't include <OS.h>.

2 years agotempname: Fix a comment.
Bruno Haible [Mon, 15 Aug 2022 21:21:05 +0000 (23:21 +0200)]
tempname: Fix a comment.

* lib/tempname.c (try_tempname_len): Use of entropy makes the function
more, not less, secure.

2 years agotempname: remove incorrect comment
Paul Eggert [Mon, 15 Aug 2022 20:04:08 +0000 (13:04 -0700)]
tempname: remove incorrect comment

* lib/tempname.c, lib/tempname.h: Remove incorrect comment,
as the names are not necessarily hard to predict (Bug#57129).

2 years agobootstrap.conf: Use proper shell marker for Emacs.
Simon Josefsson [Sun, 14 Aug 2022 20:38:01 +0000 (22:38 +0200)]
bootstrap.conf: Use proper shell marker for Emacs.

* build-aux/bootstrap.conf: Add it.

2 years agostdbool: port to C23
Paul Eggert [Sun, 14 Aug 2022 03:00:02 +0000 (20:00 -0700)]
stdbool: port to C23

* m4/stdbool.m4 (AC_CHECK_HEADER_STDBOOL): Copy from bleeding-edge
Autoconf.  Don’t define if Autoconf 2.72 or later.
* tests/test-stdbool.c (bool, false, true)
(__bool_true_false_are_defined): Do not require these to be
defined.  C23 still requires __bool_true_false_are_defined but
marks it as obsolescent, and it’s no longer worth testing.
(WORKING_BOOL): New macro, which also tests __STDC_VERSION__.
Use it in tests for working bool.
Test for bool instead of for _Bool, which C23 says is obsolescent.

2 years agognulib-tool.py: Fix some code generation details.
Bruno Haible [Sat, 13 Aug 2022 13:02:55 +0000 (15:02 +0200)]
gnulib-tool.py: Fix some code generation details.

* pygnulib/GLEmiter.py: Don't produce Windows CR-LFs on Windows.
(GLEmiter.po_Makevars): Emit a definition of top_builddir, not
top_subdir.
(GLEmiter.po_POTFILES_in): Fix result when sourcebase is 'tests' or
something like that.
(GLEmiter.initmacro_start): Add two more newlines (mistake from
2021-04-11).

2 years agognulib-tool.py: Reduce code duplication.
Bruno Haible [Sat, 13 Aug 2022 11:18:06 +0000 (13:18 +0200)]
gnulib-tool.py: Reduce code duplication.

* pygnulib/constants.py (relinverse): New function.
* pygnulib/GLEmiter.py (GLEmiter.po_Makevars,
GLEmiter.tests_Makefile_am): Use it.
* pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.

2 years agohamt: fix technically undefined behavior
Marc Nieper-Wißkirchen [Fri, 12 Aug 2022 14:00:23 +0000 (16:00 +0200)]
hamt: fix technically undefined behavior

Bug reported by Bruno Haible in
<https://lists.gnu.org/r/bug-gnulib/2022-04/msg00023.html>.
* lib/hamt.c (entry_insert): Remove technically undefined
behavior when shifting an integer of N bits by N or more bits.

2 years agostdckdint: fix dependency
Paul Eggert [Wed, 10 Aug 2022 14:58:18 +0000 (07:58 -0700)]
stdckdint: fix dependency

* modules/stdckdint (Depends-on): Add stdbool.
Reported by Bruno Haible.

2 years agomaint: parenthesize macro definiens
Paul Eggert [Wed, 10 Aug 2022 07:17:58 +0000 (00:17 -0700)]
maint: parenthesize macro definiens

* lib/intprops.h (INT_ADD_OK, INT_SUBTRACT_OK, INT_MULTIPLY_OK):
* lib/pipe-filter-ii.c (GetLastError):
* lib/thread-optim.h (gl_multithreaded): Parenthesize
function-like macro definiens beginning with a unary operator;
needed for weird invocations like ‘m (...)[p]’.

2 years agostdckdint: prefer to intprops when easy
Paul Eggert [Wed, 10 Aug 2022 06:20:49 +0000 (23:20 -0700)]
stdckdint: prefer to intprops when easy

stdckdint.h is part of draft C23 and therefore is more likely
to be familiar to programmers in the future, so prefer it to
intprops.h in files that don’t need non-_WRAPV intprops.h macros.
* lib/alignalloc.c, lib/backupfile.c, lib/fnmatch.c, lib/fnmatch_loop.c:
* lib/group-member.c, lib/malloca.c, lib/posixtm.c, lib/reallocarray.c:
* lib/xmalloc.c:
For files that can use stdckdint.h just as easily as intprops.h,
include the former instead of the latter, and use the former’s
ckd_* macros instead of the latter’s *_WRAPV macros.
* modules/alignalloc, modules/backup-rename, modules/backupfile:
* modules/fnmatch, modules/group-member, modules/malloca:
* modules/posixtm, modules/reallocarray:
* modules/relocatable-prog-wrapper, modules/xalloc:
Depend on stdckdint instead of intprops.

2 years agostdckdint-h: new module
Paul Eggert [Wed, 10 Aug 2022 06:20:49 +0000 (23:20 -0700)]
stdckdint-h: new module

This supports draft C23 <stdckdint.h>.
* doc/posix-headers/stdckdint.texi:
* lib/stdckdint.in.h, modules/stdckdint:
* modules/stdckdint-tests, tests/test-stdckdint.c:
New files.
* MODULES.html.sh, doc/gnulib.texi: Update for new module.
* lib/intprops-internal.h: Include <stdckdint.h> if C23 and
its macros would help and our substitute has not already
started to be included.
(_GL_INT_ADD_WRAPV, _GL_INT_SUBTRACT_WRAPV)
(_GL_INT_MULTIPLY_WRAPV): Use ckd_add, ckd_sub, ckd_mul
if they are defined and would help.
* lib/intprops-internal.h, lib/intprops.h: Improve comments.
The C23 restrictions on stdckdint macros already mostly applied to
intprops.h, so these are clarifications, not further restrictions.
* tests/test-intprops.c: If TEST_STDCKDINT is defined,
include <stdckdint.h> instead of "intprops.h", and test
it instead.
(VERIFY) [TEST_STDCKDINT]: Ignore the arg in this case.
(main) [TEST_STDCKDINT]: Skip tests irrelevant to stdckdint.h.

2 years agointprops: refactor intprops.h into two
Paul Eggert [Wed, 10 Aug 2022 06:20:49 +0000 (23:20 -0700)]
intprops: refactor intprops.h into two

* lib/intprops.h: Include new file intprops-internal.h.
(_GL_INT_CONVERT, _GL_INT_NEGATE_CONVERT, _GL_INT_MINIMUM)
(_GL_INT_MAXIMUM, _GL_SIGNED_INT_MAXIMUM, LLONG_MAX, LLONG_MIN)
(_GL_HAVE___TYPEOF__, _GL_SIGNED_TYPE_OR_EXPR)
(_GL_HAS_BUILTIN_ADD_OVERFLOW, _GL_HAS_BUILTIN_MUL_OVERFLOW)
(_GL_HAS_BUILTIN_OVERFLOW_P, _GL__GENERIC_BOGUS)
(_GL_INT_OP_WRAPV, _GL_INT_OP_WRAPV_LONGISH, _GL_INT_OP_CALC)
(_GL_INT_OP_WRAPV_VIA_UNSIGNED, _GL_INT_ADD_RANGE_OVERFLOW)
(_GL_INT_SUBTRACT_RANGE_OVERFLOW)
(_GL_INT_MULTIPLY_RANGE_OVERFLOW):
Move to intprops-internal.h.
(TYPE_SIGNED, EXPR_SIGNED, TYPE_WIDTH, INT_NEGATE_RANGE_OVERFLOW)
(INT_NEGATE_OVERFLOW, INT_ADD_WRAPV, INT_SUBTRACT_WRAPV)
(INT_MULTIPLY_WRAPV): Rename to _GL_ prefix, move to
intprops-internal.h, and define here in terms of the _GL_ name.
* lib/intprops-internal.h: New file, containing the above.
* modules/intprops (Files): Add lib/intprops-internal.h.

2 years agointprops: refactor _GL_HAS_BUILTIN_OVERFLOW_P
Paul Eggert [Wed, 10 Aug 2022 06:20:49 +0000 (23:20 -0700)]
intprops: refactor _GL_HAS_BUILTIN_OVERFLOW_P

* lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW_P)
[_GL_HAS_BUILTIN_OVERFLOW_P]: Use __builtin_sub_overflow_p
directly rather than indirectly via INT_SUBTRACT_OVERFLOW.
This simplifies future changes, and doesn’t change the generated code.

2 years agoverify: port ‘assume’ to C23 non-GCC
Paul Eggert [Wed, 10 Aug 2022 06:20:48 +0000 (23:20 -0700)]
verify: port ‘assume’ to C23 non-GCC

* lib/verify.h (assume): Use C23's unreachable if available
and if GCC and/or MSC primitives are not available.

2 years agognulib-tool.py: Finish implementing option --conditional-dependencies.
Bruno Haible [Tue, 9 Aug 2022 22:51:59 +0000 (00:51 +0200)]
gnulib-tool.py: Finish implementing option --conditional-dependencies.

* gnulib-tool.py (main) Accept options --conditional-dependencies,
--no-conditional-dependencies.
* pygnulib/GLModuleSystem.py (GLModuleTable.addConditional): Use
str(module), not module, as key. Fix logic bug.
(GLModuleTable.getCondition): Simplify.
(GLModuleTable.transitive_closure): Show a warning when there are
duplicate dependencies. Fix logic bug.
(GLModuleTable.transitive_closure_separately): Simplify.
(GLModuleTable.add_dummy): Ignore tests modules. Cope with multiple
lib_SOURCES augmentation lines. Cope with comments at the end of a
lib_SOURCES augmentation line. Add the dummy module at the end of the
modules list.
* pygnulib/GLTestDir.py (GLTestDir.execute): Remove the code that forces
the dummy module to the end of the list.
* pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Add code to
terminate the shell functions. Add code for the dependencies from the
unconditional to the conditional modules. Don't emit AM_CONDITIONAL for
unconditional modules.

2 years agognulib-tool.py: Don't do license replacements in the autoconf snippets.
Bruno Haible [Tue, 9 Aug 2022 21:59:40 +0000 (23:59 +0200)]
gnulib-tool.py: Don't do license replacements in the autoconf snippets.

* pygnulib/GLEmiter.py (GLEmiter.autoconfSnippet): Remove fileassistant
argument. Don't invoke the 'aux' transformer here. Don't produce Windows
CR-LFs on Windows.
(GLEmiter.autoconfSnippets): Remove fileassistant argument.
* pygnulib/GLImport.py (GLImport.gnulib_comp): Update all callers.
* pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.

2 years agognulib-tool.py: Fix some code generation details.
Bruno Haible [Tue, 9 Aug 2022 14:11:09 +0000 (16:11 +0200)]
gnulib-tool.py: Fix some code generation details.

* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): When removing a
lib_LDFLAGS line, remove also the newline. Fix regex that matches
lib_SOMETHING. Add a newline after each '## begin gnulib module' line.
Don't emit 'endif' lines without corresponding 'if'. When emitting a
'+=' augmentation, make sure it does not get emitted a second time.
Don't emit a blank line when there is no AM_CPPFLAGS augmentation.
Update after getLink() changed. In the value of DEFAULT_TEXT_DOMAIN,
backslash-escape the double-quotes. Don't produce Windows CR-LFs on
Windows. Simplify.
(GLEmiter.tests_Makefile_am): When removing a lib_LDFLAGS line, remove
also the newline. Fix regex that matches lib_SOMETHING. Don't remove a
blank line before EXTRA_DIST. Add a newline after each
'## begin gnulib module' line. Set uses_subdirs also when there is a .c
file in a subdir of tests/. When emitting a '+=' augmentation, make sure
it does not get emitted a second time. Don't produce Windows CR-LFs on
Windows. Simplify.
* pygnulib/GLImport.py (GLImport.execute): Update after getLink()
changed.

2 years agognulib-tool.py: Fixes for conditional dependencies.
Bruno Haible [Mon, 8 Aug 2022 19:22:15 +0000 (21:22 +0200)]
gnulib-tool.py: Fixes for conditional dependencies.

* pygnulib/GLModuleSystem.py (GLModule.shell_id_chars): New constant.
(GLModule.getShellFunc): Don't use md5 just because of an '_' character.
(GLModule.getShellVar): Likewise.
(GLModule.getConditionalName): Include a newline in the md5 input.
* pygnulib/constants.py (ALPHANUMERIC): Remove constant.

2 years agognulib-tool.py: Refactor.
Bruno Haible [Mon, 8 Aug 2022 16:42:45 +0000 (18:42 +0200)]
gnulib-tool.py: Refactor.

* pygnulib/GLModuleSystem.py (GLModule.getLicense): Separate the warning
logic from the result logic.

2 years agolargefile, year2038: simplify if Autoconf 2.72
Paul Eggert [Tue, 9 Aug 2022 18:12:05 +0000 (11:12 -0700)]
largefile, year2038: simplify if Autoconf 2.72

* m4/largefile.m4 (gl_SET_LARGEFILE_SOURCE)
(_AC_SYS_LARGEFILE_MACRO_VALUE):
* m4/year2038.m4 (gl_YEAR2038_EARLY, gl_YEAR2038, gl_YEAR2038_BODY):
Adjust to Autoconf 2.72, which should contain the Gnulib
patches in this area and so should not need to be overridden.

2 years agognulib-tool.py: Finish implementing option --extract-test-module.
Bruno Haible [Sun, 7 Aug 2022 22:46:13 +0000 (00:46 +0200)]
gnulib-tool.py: Finish implementing option --extract-test-module.

* gnulib-tool.py (main): Accept option --extract-tests-module.

2 years agognulib-tool.py: Fix handling of nonexistent module names in --extract-*.
Bruno Haible [Sun, 7 Aug 2022 22:43:25 +0000 (00:43 +0200)]
gnulib-tool.py: Fix handling of nonexistent module names in --extract-*.

* gnulib-tool.py (main): To test whether a module exists, just call
GLModuleSystem.find and test its return value.

2 years agognulib-tool.py: Fix --extract-dependencies result.
Bruno Haible [Sun, 7 Aug 2022 22:02:59 +0000 (00:02 +0200)]
gnulib-tool.py: Fix --extract-dependencies result.

* pygnulib/GLModuleSystem.py (GLModule.getDependencies): Return a
snippet, not a list. Implement dependency of ${module}-tests on
${module}.
(GLModule.getDependenciesWithoutConditions,
GLModule.getDependenciesWithConditions): New methods.
(GLModuleTable.transitive_closure): Call getDependenciesWithConditions.
* pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Call
getDependenciesWithoutConditions.
* gnulib-tool.py (main) [--extract-dependencies]: Update.

2 years agognulib-tool.py: Rename a method.
Bruno Haible [Sun, 7 Aug 2022 20:59:08 +0000 (22:59 +0200)]
gnulib-tool.py: Rename a method.

* pygnulib/GLModuleSystem.py (GLModule.getAutoconfEarlySnippet): Renamed
from GLModule.getAutoconfSnippet_Early.
* pygnulib/GLImport.py: Update.
* pygnulib/GLTestDir.py: Likewise.

2 years agognulib-tool.py: Fix section extraction from module descriptions.
Bruno Haible [Sun, 7 Aug 2022 20:53:32 +0000 (22:53 +0200)]
gnulib-tool.py: Fix section extraction from module descriptions.

The code with   self.content.split(section)[-1]
was broken because it recognizes an indented section label.
Similar code with   ('\n' + self.content).split('\n' + section)[-1]
would still be broken because it recognizes an indented section label
in the first line of the file.
The code with   section_label_regex
was broken because sometimes it returns the second-to-last section with
the given label, not the last one.
Also, whitespace after the colon was not ignored.

* pygnulib/GLModuleSystem.py (GLModule.__init__): Dissect the module
description's contents immediately, once only, in a reliable way.
(GLModule.getDescription, GLModule.getComment): Simplify.
(GLModule.getStatus): Simplify. Return a string.
(GLModule.getStatuses): New function. Return a list.
(GLModule.getNotice, GLModule.getApplicability, GLModule.getFiles,
GLModule.getDependencies, GLModules.getAutoconfSnippet_Early,
GLModules.getAutoconfSnippet, GLModule.getAutomakeSnippet_Conditional,
GLModule.getInclude, GLModule.getLink, GLModule.getLicense_Raw):
Simplify.
(GLModule.getLicense): Remove whitespace after calling getLicense_Raw.
(GLModule.getMaintainer): Simplify.
(GLModuleTable.transitive_closure): Call getStatuses() instead of
getStatus().
* pygnulib/GLEmiter.py: Likewise.
* gnulib-tool.py (main): For --extract-description, --extract-comment,
--extract-status, --extract-notice, --extract-autoconf-snippet,
--extract-automake-snippet, --extract-include-directive,
--extract-link-directive, --extract-maintainer, don't add an extra
newline after the snippet.

2 years agognulib-tool.py: Improve field naming.
Bruno Haible [Sun, 7 Aug 2022 18:04:56 +0000 (20:04 +0200)]
gnulib-tool.py: Improve field naming.

* pygnulib/GLModuleSystem.py (GLModule): Rename field 'module' to
'path'. Fix a typo in a TypeError message.

2 years agognulib-tool.py: Simplify.
Bruno Haible [Sun, 7 Aug 2022 17:26:51 +0000 (19:26 +0200)]
gnulib-tool.py: Simplify.

* pygnulib/GLModuleSystem.py (GLModule): Convert Windows newlines right
after reading the module description, not in every accessor.

2 years agognulib-tool.py: Reduce code duplication.
Bruno Haible [Sun, 7 Aug 2022 15:29:16 +0000 (17:29 +0200)]
gnulib-tool.py: Reduce code duplication.

* pygnulib/GLModuleSystem.py (GLModule): Declare two regexes are class
variables.

2 years agognulib-tool.py: Implement option --find.
Bruno Haible [Sun, 7 Aug 2022 15:02:21 +0000 (17:02 +0200)]
gnulib-tool.py: Implement option --find.

* pygnulib/GLModuleSystem.py (GLModuleSystem.file_is_module): New
method.
(GLModuleSystem.list): Filter the listing in memory; don't use a 'sed'
subprocess.
* gnulib-tool.py (main): Handle mode 'find'.

2 years agognulib-tool: Fix option --find in combination with option --local-dir.
Bruno Haible [Sun, 7 Aug 2022 12:09:03 +0000 (14:09 +0200)]
gnulib-tool: Fix option --find in combination with option --local-dir.

* gnulib-tool (func_prefixed_modules_in_dir): New function.
(find): Use it, and filter the directory names away after the 'grep'
pass.

2 years agognulib-tool.py: Fix some regexes.
Bruno Haible [Sun, 7 Aug 2022 11:49:49 +0000 (13:49 +0200)]
gnulib-tool.py: Fix some regexes.

* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Use an equivalent
regex as gnulib-tool.
* pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.

2 years agognulib-tool.py: Fix some regex uses.
Bruno Haible [Sun, 7 Aug 2022 11:46:15 +0000 (13:46 +0200)]
gnulib-tool.py: Fix some regex uses.

* pygnulib/GLModuleSystem.py (GLModuleTable.transitive_closure): Match
the regex against all lines of the snippet, not only the first line.
* pygnulib/GLEmiter.py (GLEmiter.autoconfSnippet): Likewise.

2 years agognulib-tool.py: Make regex uses more straightforward.
Bruno Haible [Sun, 7 Aug 2022 11:40:07 +0000 (13:40 +0200)]
gnulib-tool.py: Make regex uses more straightforward.

* pygnulib/constants.py: Don't use the "minimal matching" *? construct
when it makes no difference (because we're matching a single line only
and flag re.M is not specified).
* pygnulib/GLModuleSystem.py: Likewise.

2 years agognulib-tool.py: Make regex uses more straightforward.
Bruno Haible [Sun, 7 Aug 2022 11:29:59 +0000 (13:29 +0200)]
gnulib-tool.py: Make regex uses more straightforward.

* pygnulib/GLModuleSystem.py: Don't use flag re.S on regular expressions
that are meant to match a single line only, and remove the use of the
"minimal matching" *? construct whose only purpose was to neutralize the
re.S flag.
* pygnulib/GLEmiter.py: Likewise.
* pygnulib/GLImport.py: Likewise.
* pygnulib/GLTestDir.py: Likewise.

2 years agognulib-tool.py: Make regex uses more straightforward.
Bruno Haible [Sun, 7 Aug 2022 11:11:07 +0000 (13:11 +0200)]
gnulib-tool.py: Make regex uses more straightforward.

* pygnulib/GLEmiter.py: Don't use flag re.S on regular expressions on
regular expressions with no '.'.
* pygnulib/GLImport.py: Likewise.

2 years agognulib-tool: In the VC files messages, omit the destination directory.
Bruno Haible [Sat, 6 Aug 2022 21:22:26 +0000 (23:22 +0200)]
gnulib-tool: In the VC files messages, omit the destination directory.

This makes these messages consistent with the other "Copying ..." and
"Creating ..." messages.

* gnulib-tool (func_import): Omit $destdir/ from the "Updating"/
"Creating" messages regarding .gitignore files.
* pygnulib/GLImport.py (GLImport._update_ignorelist_): Likewise.

2 years agognulib-tool.py: Fix output in --dry-run mode.
Bruno Haible [Sat, 6 Aug 2022 21:10:14 +0000 (23:10 +0200)]
gnulib-tool.py: Fix output in --dry-run mode.

* pygnulib/GLImport.py (GLImport._update_ignorelist_): In dry-run mode,
say "Update", not "Updating".

2 years agognulib-tool.py: Finish implementing options --vc-files, --no-vc-files.
Bruno Haible [Sat, 6 Aug 2022 21:01:36 +0000 (23:01 +0200)]
gnulib-tool.py: Finish implementing options --vc-files, --no-vc-files.

* gnulib-tool.py (main): Accept options --vc-files, --no-vc-files.
* pygnulib/GLImport.py (GLImport.__init__): Correct parsing of
gl_VC_FILES directive.
(GLImport.gnulib_cache): Don't treat the value False like None.
(GLImport.execute): Skip the .gitignore file manipulations if vc_files
is False.

2 years agognulib-tool.py: Finish implementing option --witness-c-macro.
Bruno Haible [Sat, 6 Aug 2022 19:54:04 +0000 (21:54 +0200)]
gnulib-tool.py: Finish implementing option --witness-c-macro.

* gnulib-tool.py (main): Accept option --witness-c-macro.
* pygnulib/GLConfig.py (GLConfig.__init__): Remove wrong type check of
witness_c_macro argument.

2 years agognulib-tool.py: Don't initialize local variables too early.
Bruno Haible [Sat, 6 Aug 2022 01:18:32 +0000 (03:18 +0200)]
gnulib-tool.py: Don't initialize local variables too early.

* gnulib-tool.py (main): Initialize each local variable in one place.
I prefer to have pylint tell me about uninitialized variables than to
get the value None at runtime.

2 years agognulib-tool.py: Finish implementing option --po-domain.
Bruno Haible [Sat, 6 Aug 2022 01:06:51 +0000 (03:06 +0200)]
gnulib-tool.py: Finish implementing option --po-domain.

* gnulib-tool.py (main): Accept option --po-domain.
* pygnulib/GLEmiter.py (GLEmiter.po_POTFILES_in): Fix variable
reference.
* pygnulib/GLImport.py (GLImport.execute): Don't delete Makefile.in.in
from the gnulib directory. Don't require a shell when invoking wget.
After invoking wget, restore the current directory.

2 years agognulib-tool.py: Finish implementing option --macro-prefix.
Bruno Haible [Sat, 6 Aug 2022 00:10:32 +0000 (02:10 +0200)]
gnulib-tool.py: Finish implementing option --macro-prefix.

* gnulib-tool.py (main): Accept option --macro-prefix.

2 years agognulib-tool.py: Refactor --makefile-name option.
Bruno Haible [Fri, 5 Aug 2022 23:47:34 +0000 (01:47 +0200)]
gnulib-tool.py: Refactor --makefile-name option.

* gnulib-tool.py (main): Handle option --makefile-name like all other
string-valued options.

2 years agognulib-tool.py: Implement option --no-libtool.
Bruno Haible [Fri, 5 Aug 2022 22:14:02 +0000 (00:14 +0200)]
gnulib-tool.py: Implement option --no-libtool.

* gnulib-tool.py (main): Accept option --no-libtool.

2 years agognulib-tool.py: Remove redundant type checks.
Bruno Haible [Fri, 5 Aug 2022 21:34:20 +0000 (23:34 +0200)]
gnulib-tool.py: Remove redundant type checks.

* pygnulib/GLConfig.py (GLConfig.__init__): Remove redundant type
checks, left over from 2022-08-04.
(GLConfig.getIncludeGuardPrefix): Improve comment.
(GLConfig.resetMacroPrefix): Optimize.

2 years agognulib-tool.py: Refactor --makefile-name option.
Bruno Haible [Fri, 5 Aug 2022 21:15:39 +0000 (23:15 +0200)]
gnulib-tool.py: Refactor --makefile-name option.

* gnulib-tool.py (main): Rename variable 'makefile' to 'makefile_name'.
* pygnulib/GLConfig.py: Rename attribute 'makefile' to 'makefile_name'.
* pygnulib/GLMakefileTable.py: Update.
* pygnulib/GLEmiter.py: Likewise.
* pygnulib/GLImport.py: Likewise.
* pygnulib/GLFileSystem.py (GLFileAssistant): Remove unused assignment.

2 years agognulib-tool.py: Fix link_if_changed function.
Bruno Haible [Fri, 5 Aug 2022 17:24:14 +0000 (19:24 +0200)]
gnulib-tool.py: Fix link_if_changed function.

* pygnulib/constants.py (joinpath): Fix comment.
(as_link_value_at_dest): New function, extracted from link_relative.
(link_relative): Use it.
(link_if_changed): Really don't replace the symbolic link if it does not
need to change.

2 years agognulib-tool.py: Fix 'Unused import' warnings.
Bruno Haible [Fri, 5 Aug 2022 15:13:20 +0000 (17:13 +0200)]
gnulib-tool.py: Fix 'Unused import' warnings.

* gnulib-tool.py: Remove unused imports.
* pygnulib/*.py: Likewise.

2 years agognulib-tool.py: Fix 'Undefined variable' errors.
Bruno Haible [Fri, 5 Aug 2022 13:15:16 +0000 (15:15 +0200)]
gnulib-tool.py: Fix 'Undefined variable' errors.

* pygnulib/constants.py: Import codecs.
* pygnulib/GLConfig.py (GLConfig.setLibName): Fix local variable
reference.
* pygnulib/GLFileSystem.py (GLFileSystem.lookup,
GLFileAssistant.update): Fix local variable references.
* pygnulib/GLEmiter.py (GLEmiter.po_POTFILES_in): Fix reference.
* pygnulib/GLTestDir.py (GLMegaTestDir.execute): Define missing local
variables.

2 years agognulib-tool.py: Make option --version work.
Bruno Haible [Fri, 5 Aug 2022 12:17:35 +0000 (14:17 +0200)]
gnulib-tool.py: Make option --version work.

* pygnulib/constants.py (__copyright__): Bump copyright year.
* pygnulib/GLInfo.py (GLInfo.authors): Add a comma after the
second-to-last author.
(GLInfo.copyright): Show only the last modification year.
(GLInfo.date): Check whether git and GNU date are available. Use
'git log ChangeLog', not 'git log'. Run 'git log' in the gnulib
directory, not in the current directory. Search for 'Date:' only at the
beginning of a line. As a fallback, look at the first ChangeLog entry.
(GLInfo.version): Check whether git is available. Run git-version-gen in
the gnulib directory, not in the current directory. Replace '-dirty'
with '-modified'. As a fallback, return the empty string.
* gnulib-tool.py (main) [--version]: Add a space before the version.

2 years agognulib-tool.py: Simplify.
Bruno Haible [Fri, 5 Aug 2022 02:05:04 +0000 (04:05 +0200)]
gnulib-tool.py: Simplify.

* pygnulib/constants.py (compiler): Remove function.
* gnulib-tool.py: Use re.compile directly instead.
* pygnulib/*.py: Likewise.

2 years agognulib-tool.py: Fix typo.
Bruno Haible [Thu, 4 Aug 2022 20:24:20 +0000 (22:24 +0200)]
gnulib-tool.py: Fix typo.

* pygnulib/GLImport.py (GLImport.execute): Actually handle file
removals.

2 years agognulib-tool.py: Coding style: Revisit line breaks.
Bruno Haible [Thu, 4 Aug 2022 19:53:51 +0000 (21:53 +0200)]
gnulib-tool.py: Coding style: Revisit line breaks.

* gnulib-tool.py: Avoid line breaks at arbitrary points inside
expressions. Use line breaks to clarify [... for ...] iterations.
* pygnulib/*.py: Likewise.

2 years agognulib-tool.py: Simplify boolean setters.
Bruno Haible [Thu, 4 Aug 2022 17:10:27 +0000 (19:10 +0200)]
gnulib-tool.py: Simplify boolean setters.

* pygnulib/GLConfig.py (setLibtool): New method, replaces enableLibtool
and disableLibtool.
(setCondDeps): New method, replaces enableCondDeps and disableCondDeps.
(setVCFiles): New method, replaces enableVCFiles and disableVCFiles.
(setSymbolic): New method, replaces enableSymbolic and disableSymbolic.
(setLSymbolic): New method, replaces enableLSymbolic and
disableLSymbolic.
(setLibtests): New method, replaces enableLibtests and disableLibtests.
(setSingleConfigure): New method, replaces enableSingleConfigure and
disableSingleConfigure.
(setDryRun): New method, replaces enableDryRun and disableDryRun.
(setErrors): New method, replaces enableErrors and disableErrors.
(__init__): Update.
* pygnulib/GLImport.py: Likewise.
* pygnulib/GLTestDir.py: Likewise.

2 years agognulib-tool.py: Implement options --cache-modules, --no-cache-modules.
Bruno Haible [Thu, 4 Aug 2022 16:35:49 +0000 (18:35 +0200)]
gnulib-tool.py: Implement options --cache-modules, --no-cache-modules.

* gnulib-tool.py (main): Accept options --cache-modules,
--no-cache-modules.
* pygnulib/GLConfig.py: Remove modcache property and constructor
argument.
* pygnulib/GLInfo.py (GLInfo.usage): Don't document these no-op options.

2 years agognulib-tool.py: Use mainstream/GNU coding style.
Bruno Haible [Thu, 4 Aug 2022 16:26:08 +0000 (18:26 +0200)]
gnulib-tool.py: Use mainstream/GNU coding style.

* gnulib-tool.py: Break lines before the % operator, not after.
* pygnulib/*.py: Likewise. Avoid line breaks when the resulting lines
are not too long.

2 years agognulib-tool.py: Follow gnulib-tool changes, part 24.
Bruno Haible [Thu, 4 Aug 2022 11:02:13 +0000 (13:02 +0200)]
gnulib-tool.py: Follow gnulib-tool changes, part 24.

Follow gnulib-tool change
2017-02-19  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Avoid conflict of havelib-tests with --single-configure.

* pygnulib/GLTestDir.py (GLTestDir.__init__): Don't allocate the
GLModuleTable here.
(GLTestDir.execute): Do it here. Avoid havelib-tests when
--with-tests --single-configure is specified.

2 years agognulib-tool.py: Respect the specified module list.
Bruno Haible [Thu, 4 Aug 2022 10:48:56 +0000 (12:48 +0200)]
gnulib-tool.py: Respect the specified module list.

* pygnulib/GLTestDir.py (GLTestDir.execute): Don't remove specific
modules (ftruncate, mountlist, etc.) from the specified module list.

2 years agognulib-tool.py: Implement option --avoid.
Bruno Haible [Thu, 4 Aug 2022 10:40:04 +0000 (12:40 +0200)]
gnulib-tool.py: Implement option --avoid.

* pygnulib/GLModuleSystem.py (GLModuleTable.__init__): Compute the
effective avoids list here.
(GLModuleTable.transitive_closure, GLModuleTable.add_dummy): Consider
the avoids list.
* pygnulib/GLImport.py (GLImport.gnulib_cache): Use the avoids list from
GLConfig directly.
(GLImport.prepare): No need any more to set the avoids list in the
GLModuleTable.

2 years agognulib-tool.py: Make --with/--without-*-tests handling a little safer.
Bruno Haible [Thu, 4 Aug 2022 09:53:37 +0000 (11:53 +0200)]
gnulib-tool.py: Make --with/--without-*-tests handling a little safer.

* pygnulib/GLConfig.py (__init__): Fix reset* invocations.
setInclTestCategories, setExclTestCategories): Revert to old value if
the new value is invalid.

2 years agognulib-tool.py: Implement option --single-configure.
Bruno Haible [Wed, 3 Aug 2022 20:42:25 +0000 (22:42 +0200)]
gnulib-tool.py: Implement option --single-configure.

* gnulib-tool.py (main): Accept option --single-configure. Pass its
value to the GLConfig constructor.
* pygnulib/GLTestDir.py (GLTestDir.execute): Remove debugging output.

2 years agognulib-tool.py: Implement options --without-c++-tests etc.
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.

2 years agognulib-tool.py: Implement option --without-tests.
Bruno Haible [Wed, 3 Aug 2022 16:00:13 +0000 (18:00 +0200)]
gnulib-tool.py: Implement option --without-tests.

* gnulib-tool.py (main): Accept option --without-tests.

2 years agognulib-tool.py: Fix broken 'for' loop.
Bruno Haible [Wed, 3 Aug 2022 15:55:24 +0000 (17:55 +0200)]
gnulib-tool.py: Fix broken 'for' loop.

* gnulib-tool.py (main): Canonicalize inctests before creating the
GLConfig. Rewrite a broken 'for' loop.
* pygnulib/GLConfig.py (GLConfig.setTestFlags): Remove unused statement.

2 years agognulib-tool.py: Follow gnulib-tool changes, part 23.
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+.

2 years agognulib-tool.py: Fix unjustified "incompatible license" warnings.
Bruno Haible [Wed, 3 Aug 2022 13:51:35 +0000 (15:51 +0200)]
gnulib-tool.py: Fix unjustified "incompatible license" warnings.

* pygnulib/GLTestDir.py (GLTestDir.execute): Don't emit a warning when
the dependency module has a license such as "public domain" or
"unlimited".

2 years agognulib-tool.py: Follow gnulib-tool changes, part 22.
Bruno Haible [Wed, 3 Aug 2022 12:51:20 +0000 (14:51 +0200)]
gnulib-tool.py: Follow gnulib-tool changes, part 22.

Follow gnulib-tool change
2016-10-15  Bruno Haible  <bruno@clisp.org>
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.

* pygnulib/GLModuleSystem.py (GLModule.getLicense): Special-case the
'parse-datetime' module.

2 years agognulib-tool.py: Follow gnulib-tool changes, part 21.
Bruno Haible [Wed, 3 Aug 2022 12:43:40 +0000 (14:43 +0200)]
gnulib-tool.py: Follow gnulib-tool changes, part 21.

Follow gnulib-tool change
2016-10-16  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Make --create-testdir on all modules work again.

* pygnulib/GLTestDir.py (GLTestDir.execute): Don't include the
non-recursive-gnulib-prefix-hack module.

2 years agognulib-tool.py: Follow gnulib-tool changes, part 20.
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.

2 years agognulib-tool.py: Avoid errors when writing to a VFAT file system, part 2.
Bruno Haible [Wed, 3 Aug 2022 12:27:51 +0000 (14:27 +0200)]
gnulib-tool.py: Avoid errors when writing to a VFAT file system, part 2.

* pygnulib/constants.py (movefile): New function.
* pygnulib/*.py: Use it instead of shutil.

2 years agognulib-tool.py: Avoid errors when writing to a VFAT file system.
Bruno Haible [Wed, 3 Aug 2022 09:27:21 +0000 (11:27 +0200)]
gnulib-tool.py: Avoid errors when writing to a VFAT file system.

* pygnulib/constants.py (copyfile, copyfile2): New functions.
* gnulib-tool.py: Use them instead of shutil.
* pygnulib/*.py: Likewise.

2 years agognulib-tool.py: Fix typo.
Bruno Haible [Tue, 2 Aug 2022 22:24:29 +0000 (00:24 +0200)]
gnulib-tool.py: Fix typo.

* pygnulib/GLImport.py (GLImport.__init__): Use the relative auxdir as
second, not as first argument of joinpath.

2 years agognulib-tool.py: Fix typo.
Bruno Haible [Sun, 31 Jul 2022 21:28:18 +0000 (23:28 +0200)]
gnulib-tool.py: Fix typo.

* pygnulib/GLTestDir.py (GLMegaTestDir.execute): Invoke os.mkdir as
intended.

2 years agognulib-tool.py: Improve some error messages.
Bruno Haible [Sun, 31 Jul 2022 21:02:58 +0000 (23:02 +0200)]
gnulib-tool.py: Improve some error messages.

* gnulib-tool.py (main): Write "*** Stop." instead of "*** Exit.".
(__main__): Print an error message for GLError 5, 13, 14, 15, 16, 17, 18.
* pygnulib/GLError.py (GLError.__repr__): Compute one error message,
not 19.

2 years agognulib-tool.py: Write errors to stderr, not stdout.
Bruno Haible [Sun, 31 Jul 2022 20:35:30 +0000 (22:35 +0200)]
gnulib-tool.py: Write errors to stderr, not stdout.

* pygnulib/constants.py: Write error messages to stderr, not stdout.

2 years agognulib-tool.py: Use mainstream coding style.
Bruno Haible [Sun, 31 Jul 2022 20:29:15 +0000 (22:29 +0200)]
gnulib-tool.py: Use mainstream coding style.

* pygnulib/GLConfig.py: Use 'raise' to re-throw an exception.

2 years agognulib-tool.py: Implement options --symlink and --local-symlink.
Bruno Haible [Sun, 31 Jul 2022 19:08:55 +0000 (21:08 +0200)]
gnulib-tool.py: Implement options --symlink and --local-symlink.

* gnulib-tool.py (main): Handle options --symlink and --local-symlink.
* pygnulib/constants.py (link_if_changed): Ignore FileNotFoundError from
os.remove call.

2 years agognulib-tool.py: Make --copy-file work.
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.

2 years agognulib-tool.py: Allow module arguments to occur at any position.
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.

2 years agognulib-tool.py: Make --test behaviour more similar to gnulib-tool.
Bruno Haible [Sun, 31 Jul 2022 16:54:22 +0000 (18:54 +0200)]
gnulib-tool.py: Make --test behaviour more similar to gnulib-tool.

* gnulib-tool.py (main) [test]: Remove space from the testdir name.

2 years agognulib-tool: Clarify that --test allows zero module arguments.
Bruno Haible [Sun, 31 Jul 2022 16:53:24 +0000 (18:53 +0200)]
gnulib-tool: Clarify that --test allows zero module arguments.

* gnulib-tool (func_usage): Mark the modules for --test as optional.
* pygnulib/GLInfo.py (GLInfo.usage): Likewise.

2 years agognulib-tool.py: Make option processing more similar to gnulib-tool.
Bruno Haible [Sun, 31 Jul 2022 16:51:17 +0000 (18:51 +0200)]
gnulib-tool.py: Make option processing more similar to gnulib-tool.

* gnulib-tool.py (main): Allow --add-import and --remove-import with 0
modules.

2 years agognulib-tool.py: Improve compliance with GNU standards.
Bruno Haible [Sun, 31 Jul 2022 16:48:25 +0000 (18:48 +0200)]
gnulib-tool.py: Improve compliance with GNU standards.

* gnulib-tool.py (main): Handle --help and --version before testing for
conflicting modes.

2 years agognulib-tool.py: Emit error message when conflicting modes are specified.
Bruno Haible [Sun, 31 Jul 2022 16:44:56 +0000 (18:44 +0200)]
gnulib-tool.py: Emit error message when conflicting modes are specified.

* gnulib-tool.py (main): Fix test of conflicting modes. (Some options
produce a value of [], and as a condition, [] evaluates to False.)

2 years agognulib-tool.py: Remove most short options.
Bruno Haible [Sun, 31 Jul 2022 16:42:31 +0000 (18:42 +0200)]
gnulib-tool.py: Remove most short options.

* gnulib-tool.py (main): Reorder the list of options. Remove most short
options, for consistency with gnulib-tool.

2 years agognulib-tool.py: Follow gnulib-tool changes, part 19.
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.

2 years agognulib-tool.py: Improve the primitives for relative file names.
Bruno Haible [Sun, 31 Jul 2022 16:35:58 +0000 (18:35 +0200)]
gnulib-tool.py: Improve the primitives for relative file names.

* pygnulib/constants.py (relativize): Don't attempt to handle absolute
file names. Fix bug with relativize('../foo/bar', '../foo/bla/zut').
(relconcat): New function.

2 years agognulib-tool.py: Follow gnulib-tool changes, part 18.
Bruno Haible [Sun, 31 Jul 2022 16:30:50 +0000 (18:30 +0200)]
gnulib-tool.py: Follow gnulib-tool changes, part 18.

Follow gnulib-tool change
2005-09-20  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Remove trailing slashes

* pygnulib/constants.py (remove_trailing_slashes): New function.
* pygnulib/GLConfig.py (GLConfig): Use it in the setters.

2 years agoavltree-omap, avltree-oset, avltreehash-list, rbtree-omap: Pacify GCC.
Bruno Haible [Sun, 31 Jul 2022 21:48:14 +0000 (23:48 +0200)]
avltree-omap, avltree-oset, avltreehash-list, rbtree-omap: Pacify GCC.

* lib/gl_avltree_omap.c (gl_avltree_omap_check_invariants): Add extern
decl.
* lib/gl_avltree_oset.c (gl_avltree_oset_check_invariants): Likewise.
* lib/gl_avltreehash_list.c (gl_avltreehash_list_check_invariants):
Likewise.
* lib/gl_rbtree_omap.c (gl_rbtree_omap_check_invariants): Likewise.

2 years agorbtree-oset: Pacify GCC
Paul Eggert [Sun, 31 Jul 2022 17:17:35 +0000 (10:17 -0700)]
rbtree-oset: Pacify GCC

* lib/gl_rbtree_oset.c (gl_rbtree_oset_check_invariants):
* lib/gl_rbtreehash_list.c (gl_rbtreehash_list_check_invariants):
Add extern decls, to pacify --enable-gcc-warnings with Bison.

2 years agoUpdate gnulib-tool.py.TODO.
Bruno Haible [Sun, 31 Jul 2022 16:28:32 +0000 (18:28 +0200)]
Update gnulib-tool.py.TODO.

2 years agognulib-tool: add support for --automake-subdir-tests
Akim Demaille [Mon, 4 Jul 2022 05:18:07 +0000 (07:18 +0200)]
gnulib-tool: add support for --automake-subdir-tests

<https://lists.gnu.org/r/bug-gnulib/2022-01/msg00111.html>

* 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.

2 years agogendocs.sh: Fix error when invoking 'perl' (regression 2022-07-23).
Bruno Haible [Sun, 31 Jul 2022 05:16:34 +0000 (07:16 +0200)]
gendocs.sh: Fix error when invoking 'perl' (regression 2022-07-23).

* build-aux/gendocs.sh (PERL): Use double-quotes, not single-quotes.

2 years agognulib-tool.py: Clean up imports.
Bruno Haible [Sat, 30 Jul 2022 11:51:36 +0000 (13:51 +0200)]
gnulib-tool.py: Clean up imports.

* gnulib-tool.py: Remove unused constants.
* pygnulib/*.py: Likewise.

2 years agognulib-tool.py: Assume Python 3.
Bruno Haible [Sat, 30 Jul 2022 11:29:26 +0000 (13:29 +0200)]
gnulib-tool.py: Assume Python 3.

* gnulib-tool.py: Don't allow 'bytes' as an alternative to 'str'.
* pygnulib/*.py: Likewise.