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