pygnulib

Branch


Log

Author Commit Date CI Message
Bruno Haible b1fcec6d 2025-09-10T23:22:53 Remove support for IRIX. * all-modules: Update comments. * build-aux/install-reloc: Likewise. * build-aux/reloc-ldflags: Likewise. * gnulib-tool: Likewise. * gnulib-tool.py: Likewise. * gnulib-tool.sh: Likewise. * lib/aligned-malloc.h: Likewise. * lib/boot-time.c: Likewise. * lib/c32is-impl.h: Likewise. * lib/c32srtombs-state.c: Likewise. * lib/c32to-impl.h: Likewise. * lib/c32width.c: Likewise. * lib/errno.in.h: Likewise. * lib/euidaccess.c: Likewise. * lib/fbufmode.c: Likewise. * lib/fenv-except-state-get.c: Likewise. * lib/fenv-except-state-set.c: Likewise. * lib/fenv-except-tracking-clear.c: Likewise. * lib/fenv-except-tracking-set.c: Likewise. * lib/fenv-except-tracking-test.c: Likewise. * lib/fenv-except-trapping.c: Likewise. * lib/fenv-round.c: Likewise. * lib/fflush.c: Likewise. * lib/fileblocks.c: Likewise. * lib/forkpty.c: Likewise. * lib/fpending.c: Likewise. * lib/fpurge.c: Likewise. * lib/freadable.c: Likewise. * lib/freadahead.c: Likewise. * lib/freading.c: Likewise. * lib/freadptr.c: Likewise. * lib/freadseek.c: Likewise. * lib/fseeko.c: Likewise. * lib/fseterr.c: Likewise. * lib/fsusage.c: Likewise. * lib/fwritable.c: Likewise. * lib/fwriting.c: Likewise. * lib/getdomainname.c: Likewise. * lib/idpriv-drop.c: Likewise. * lib/idpriv-droptemp.c: Likewise. * lib/limits.in.h: Likewise. * lib/mbrtoc16.c: Likewise. * lib/mbrtoc32.c: Likewise. * lib/mbsrtoc32s-state.c: Likewise. * lib/mbsrtowcs-state.c: Likewise. * lib/mbtowc-lock.h: Likewise. * lib/minmax.h: Likewise. * lib/netdb.in.h: Likewise. * lib/pipe-filter-ii.c: Likewise. * lib/posix_openpt.c: Likewise. * lib/ptsname_r.c: Likewise. * lib/readutmp.c: Likewise. * lib/readutmp.h: Likewise. * lib/resource-ext.h: Likewise. * lib/safe-read.h: Likewise. * lib/safe-write.h: Likewise. * lib/save-cwd.c: Likewise. * lib/stdbool.in.h: Likewise. * lib/striconv.c: Likewise. * lib/striconveh.c: Likewise. * lib/termcap.h: Likewise. * lib/terminfo.h: Likewise. * lib/unistd.in.h: Likewise. * lib/vasnprintf.c: Likewise. * lib/wcrtomb.c: Likewise. * lib/wcsrtombs-state.c: Likewise. * m4/fenv-environment.m4: Likewise. * m4/fenv-exceptions-state.m4: Likewise. * m4/fenv-exceptions-tracking.m4: Likewise. * m4/fenv-rounding.m4: Likewise. * m4/fmod.m4: Likewise. * m4/getdomainname.m4: Likewise. * m4/getloadavg.m4: Likewise. * m4/getopt.m4: Likewise. * m4/hypot.m4: Likewise. * m4/hypotf.m4: Likewise. * m4/hypotl.m4: Likewise. * m4/iconv.m4: Likewise. * m4/intl-thread-locale.m4: Likewise. * m4/largefile.m4: Likewise. * m4/libdl.m4: Likewise. * m4/locale-ja.m4: Likewise. * m4/locale_h.m4: Likewise. * m4/log.m4: Likewise. * m4/log10.m4: Likewise. * m4/log10f.m4: Likewise. * m4/logf.m4: Likewise. * m4/modf.m4: Likewise. * m4/modff.m4: Likewise. * m4/modfl.m4: Likewise. * m4/pthread-rwlock.m4: Likewise. * m4/semaphore.m4: Likewise. * m4/socklen.m4: Likewise. * m4/stdint.m4: Likewise. * m4/strtod.m4: Likewise. * m4/strtof.m4: Likewise. * m4/strtold.m4: Likewise. * modules/sigsegv: Likewise. * posix-modules: Likewise. * pygnulib/GLImport.py: Likewise. * tests/init.sh: Likewise. * tests/test-echo.sh: Likewise. * tests/test-isatty.c: Likewise. * tests/test-math-h.c: Likewise. * tests/test-nonblocking-pipe.h: Likewise. * tests/test-nonblocking-socket.h: Likewise. * tests/test-strtod.h: Likewise. * tests/test-strtof.h: Likewise. * tests/test-strtold.h: Likewise. * tests/test-vasnprintf.c: Likewise. * tests/test-vasnwprintf.c: Likewise.
Bruno Haible 4ef864ec 2025-09-04T22:52:44 gnulib-tool: Improve changes from yesterday and today. * gnulib-tool.sh (func_emit_tests_Makefile_am): Consider also the case that --with-tests is specified and --makefile-name / --tests-makefile-name are not specified. Simplify an initialization and augmentation to an initialization. * pygnulib/GLEmiter.py (GLEmiter.tests_Makefile_am): Likewise.
Collin Funk 7e676bba 2025-09-03T20:18:04 gnulib-tool: Avoid Automake error when using --create-testdir (regr. today). * gnulib-tool.sh (func_emit_tests_Makefile_am): Initialize AM_CFLAGS and AM_CXXFLAGS when creating a test directory. * pygnulib/GLEmiter.py (GLEmiter.tests_Makefile_am): Likewise.
Bruno Haible 6fd6098f 2025-09-04T00:15:19 gnulib-tool: In tests directories, augment AM_CFLAGS and AM_CXXFLAGS. Reported by Pádraig Brady in <https://lists.gnu.org/archive/html/bug-gnulib/2025-09/>. * gnulib-tool.sh (func_emit_tests_Makefile_am): Append the warning-protection options to AM_CFLAGS and AM_CXXFLAGS, in addition to initializing CFLAGS and CXXFLAGS. * pygnulib/GLEmiter.py (GLEmiter.tests_Makefile_am): Likewise. * doc/gnulib-tool.texi (Modified build rules): Document the need to initialize AM_CFLAGS and AM_CXXFLAGS in tests directories. * NEWS: Mention the new requirement.
Bruno Haible 813f4991 2025-09-03T23:43:45 gnulib-tool: Improve C++ awareness of 2021-06-10 / 2024-03-06 commit. * gnulib-tool.sh (func_emit_lib_Makefile_am): If the file list contains some C++ files, emit also an initialization for ${libname}_${libext}_CXXFLAGS. (func_emit_tests_Makefile_am): If the file list contains no C++ files, don't emit an initialization for CXXFLAGS. * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): If the file list contains some C++ files, emit also an initialization for ${libname}_${libext}_CXXFLAGS. (GLEmiter.tests_Makefile_am): If the file list contains no C++ files, don't emit an initialization for CXXFLAGS.
Bruno Haible 352844c6 2025-08-09T08:17:09 gnulib-tool: Fix invalid generated Makefile.am (regression 2025-08-04). * gnulib-tool.sh (func_emit_lib_Makefile_am): Emit line that initializes TESTS_ENVIRONMENT. * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Likewise.
Bruno Haible de208bd2 2025-06-16T11:15:01 gnulib-tool: Default to --single-configure. New option --two-configures. * gnulib-tool.sh: single_configure now defaults to false. New option --two-configures. Stop documenting option --single-configure. * pygnulib/GLInfo.py (GLInfo.usage): Document option --two-configures. Stop documenting option --single-configure. * pygnulib/GLTestDir.py (GLTestDir.execute): Update comment. * pygnulib/main.py (main): single_configure now defaults to false. New option --two-configures. * doc/transversal.texi: Update. * HACKING: Update.
Bruno Haible 6f629af8 2025-05-26T10:25:10 gnulib-tool: Remove build-aux/test-driver.orig from testdirs. * gnulib-tool.sh (func_create_testdir): Remove file build-aux/test-driver.orig at the end. * pygnulib/GLTestDir.py (_patch_test_driver): Likewise.
Bruno Haible 618538b8 2025-04-15T22:21:04 gnulib-tool.py: Fix exception during --update with changed macro-prefix. * pygnulib/GLImport.py (GLImport.__init__): Support the case that the expected ${macro_prefix}_FILE_LIST definition was not found.
Eric Blake 44cec52a 2025-04-05T15:21:13 gnulib-tool.py: Fix missing space. * pygnulib/main.py (main_with_exception_handling): Typo fix.
Bruno Haible a77e2c44 2025-02-04T12:00:50 gnulib-tool: Fix the result of --create-testdir (regression yesterday). * gnulib-tool.sh (func_emit_lib_Makefile_am): If $for_test, revert to the previous code. * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): If for_test, revert to the previous code.
Bruno Haible f4ba7b1b 2025-02-03T22:28:51 gnulib-tool: Allow compiler warnings in Gnulib code. * gnulib-tool.sh (func_emit_lib_Makefile_am): Append $(GL_CFLAG_ALLOW_WARNINGS) to the ${libname}_${libext}_CFLAGS variable. * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Likewise.
Bruno Haible dbbfee44 2025-02-03T23:55:39 gnulib-tool: Apply libgnu.{,l}a specific CFLAGS to all its object files. * gnulib-tool.sh (func_emit_initmacro_end): Define ${macro_prefix}_${libname}_{LIBOBJS,LTLIBOBJS,LIBOBJDEPS} macros, that include libname in the base name of the object files. (func_emit_lib_Makefile_am): Use ${macro_prefix}_${libname}_*LIBOBJS values instead of ${macro_prefix}_*LIBOBJS values. * pygnulib/GLEmiter.py (GLEmiter.initmacro_end): Define {macro_prefix_arg}_{libname}_{LIBOBJS,LTLIBOBJS,LIBOBJDEPS} macros, that include libname in the base name of the object files. (GLEmiter.lib_Makefile_am):Use {macro_prefix}_{libname}_*LIBOBJS values instead of {macro_prefix}_*LIBOBJS values.
Paul Eggert 2c13f11a 2025-01-01T11:31:58 maint: update copyrights by hand This fixes some copyright dates that were not updated correctly by "make update-copyright".
Pádraig Brady 7b089321 2025-01-01T09:24:36 maint: run 'make update-copyright'
Bruno Haible ed7f79d4 2024-12-21T22:56:46 gnulib-tool: Recognize @LT@, @la@, @lo@ tokens in module descriptions. * gnulib-tool.sh (func_emit_lib_Makefile_am): Replace @LT@, @la@, @lo@ tokens. (func_emit_tests_Makefile_am): Likewise. * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Likewise. (GLEmiter.tests_Makefile_am): Likewise.
Bruno Haible f554058c 2024-12-09T12:30:23 gnulib-tool: Fix test failures (regression 2024-12-06). * gnulib-tool.sh (func_import): Try both remove-potcdate.sin and remove-potcdate.sed, whichever exists. * pygnulib/GLImport.py (GLImport.execute): Likewise.
Bruno Haible 7c908caf 2024-12-08T18:15:49 Document the new approach for gnulib localization. * doc/gnulib-tool.texi (Localization): Recommend to use the gnulib-l10n package. Deprecate the two previous approaches. * gnulib-tool.sh (func_usage): Deprecate the --po-base and --po-domain options. * pygnulib/GLInfo.py (GLInfo.usage): Likewise.
Bruno Haible b64ee46c 2024-12-06T09:16:37 Update build-aux/po/Makefile.in.in. Reported by Assaf Gordon in <https://lists.gnu.org/archive/html/bug-gnulib/2019-08/msg00045.html> and by Reuben Thomas <rrt@sc3d.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00020.html>. * build-aux/po/Makefile.in.in: Sync from GNU gettext 0.23. Fixes: - Don't fail when 'make' is used with option -j. - Pass the option --quiet to 'msgmerge'. - Simplify by assuming that 'sed' groks comments. * build-aux/po/remove-potcdate.sed: Renamed from build-aux/po/remove-potcdate.sin. * doc/gnulib.texi (Developer tools): Update file list. * gnulib-tool.sh (func_import): Copy remove-potcdate.sed instead of remove-potcdate.sin. * pygnulib/GLImport.py (GLImport.execute): Likewise.
Bruno Haible ab4cc5f2 2024-12-05T09:43:14 gnulib-tool.py: Fix invalid use of cache. * pygnulib/GLModuleSystem.py (GLModule._getDependents): Make the modules argument mandatory. Don't store the result in self.cache.
Bruno Haible 5efa7c42 2024-12-05T09:28:13 gnulib-tool.py: Refactor. * pygnulib/GLModuleSystem.py (GLModuleSystem.getAllModules): Moved here from GLModule._getAllModules. No need to eliminate empty module names. (GLModule._getDependents, GLModule.getDependentsRecursively): Update.
Bruno Haible d72b2930 2024-12-05T09:14:49 gnulib-tool.py: Remove dead code. * pygnulib/GLModuleSystem.py (GLModule.getDependents): Remove top_level parameter. Use the cached value if present. * pygnulib/main.py: Update accordingly.
Collin Funk ac562bbf 2024-12-04T18:49:45 gnulib-tool.py: Make --extract-dependents quick again. Suggested by Bruno Haible in: <https://lists.gnu.org/archive/html/bug-gnulib/2024-12/msg00012.html>. * pygnulib/GLModuleSystem.py (GLModule.getDependents): Add an optional argument to use the implementation before yesterdays change. * pygnulib/main.py (mode == 'extract-dependents'): Add the optional argument to call of GLModule.getDependents.
Collin Funk 1e0fff5e 2024-12-03T19:17:52 gnulib-tool.py: Optimize --extract-recursive-dependencies. * pygnulib/GLModuleSystem.py (GLModuleSystem.list): Add optional argument to include test modules. (GLModule._getDependents) New function. (GLModule.getDependents): Use it. (GLModule.getDependentsRecursively): Likewise. (GLModule._getAllModules): New function.
Bruno Haible e5f02da1 2024-11-13T02:36:11 gnulib-tool.py: Fix logic of --remove-import option. Reported by Gavin Smith <gavinsmith0123@gmail.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2024-11/msg00101.html>. * pygnulib/GLImport.py (GLImport.__init__): Compute the modules to keep correctly.
Bruno Haible 7b6f844b 2024-08-29T18:32:35 gnulib-tool.py: Allow verifying license compatibility with GPLv2+. * pygnulib/GLInfo.py (GLInfo.usage): Document the --gpl option. * pygnulib/main.py (main): Accept a --gpl option. Pass it to the GLConfig. * pygnulib/GLConfig.py (GLConfig): Add 'gpl' field and constructor argument. Add getGPL, setGPL, resetGPL methods. * m4/gnulib-tool.m4 (gl_GPL): New macro. * doc/gnulib-tool.texi (Modified imports): Document the gl_GPL macro. * pygnulib/GLImport.py (GLImport.__init__): Look for gl_GPL invocations in gnulib-cache.m4. (GLImport.actioncmd): Output --gpl option when option --gpl was given. (GLImport.gnulib_cache): Emit a gl_GPL invocation when option --gpl was given. (GLImport.prepare): Do license compatibility checking when option --gpl was given. * pygnulib/GLModuleSystem.py: Update a comment.
Bruno Haible dbb15bde 2024-08-29T17:49:33 gnulib-tool: Fix description of --lgpl option (missed on 2021-06-04). * gnulib-tool.sh (func_usage): Remove "Also modify license template" sentence. * pygnulib/GLInfo.py (GLInfo.usage): Likewise.
Bruno Haible 5c735437 2024-08-16T18:24:54 gnulib-tool.py: Correct the result of --extract-dependents. * pygnulib/GLModuleSystem.py (GLModule.getDependents): Add the current module's test module, if that exists.
Bruno Haible b254680d 2024-08-16T17:57:02 gnulib-tool.py: Don't treat 'valgrind-tests' as a tests module. Reported by Marc Nieper-Wißkirchen <marc.nieper+gnu@gmail.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00093.html>. * pygnulib/GLModuleSystem.py (_isTestsModuleName): New function. (GLModuleSystem.list, GLModule.isNonTests, GLModule.getApplicability, GLModule.getDependencies, GLModule.getAutomakeSnippet_Unconditional, GLModule.getLicense): Use it.
Bruno Haible 26aab01a 2024-08-05T20:24:44 gnulib-tool.py: Fix testdirs created with --without-tests. * pygnulib/GLTestDir.py (GLTestDir.execute): Don't assume that 'gltests' is the last subdirectory with a configure.ac.
Bruno Haible da8e6e13 2024-08-03T17:04:55 gnulib-tool.py: Small refactoring. Suggested by Collin Funk. * pygnulib/GLModuleSystem.py (GLModule.getDependenciesRecursively): Return a set of GLModule. * pygnulib/main.py (main): Convert the result to a string here.
Collin Funk 2f400ffc 2024-08-02T20:52:28 gnulib-tool.py: Correct type hint and doc string. * pygnulib/GLModuleSystem.py (GLModule.getDependentsRecursively): Adjust type hint and doc string to correctly state a set of GLModule's is returned.
Bruno Haible e0de8e47 2024-07-29T01:26:51 gnulib-tool.py: New options --extract-[recursive-]dependents. * pygnulib/GLInfo.py (GLInfo.usage): Document --extract-dependents and --extract-recursive-dependents options. * pygnulib/GLModuleSystem.py (GLModule.getDependenciesRecursively): Move method. (getDependents, getDependentsRecursively): New methods. * pygnulib/main.py (main): Add support for --extract-dependents and --extract-recursive-dependents.
Bruno Haible 8f2cda7d 2024-07-28T23:52:04 gnulib-tool.py: Avoid adding specific modules to a testdir. Reported by Paul Eggert in <https://lists.gnu.org/archive/html/bug-gnulib/2024-07/msg00292.html>. * pygnulib/GLInfo.py (GLInfo.usage): Document --extract-usability-in-testdir option. * pygnulib/GLModuleSystem.py (GLModule.section_label_pattern): Recognize Usable-in-testdir section. (GLModule.getUsabilityInTestdir): New function. * pygnulib/GLTestDir.py (GLTestDir.execute): Invoke it to filter out modules to avoid. Warn if such a module was specified. * pygnulib/main.py (main): Add support for --extract-usability-in-testdir. Provide an error message for error 24. * pygnulib/GLError.py: Likewise. * modules/config-h (Usable-in-testdir): New section. * modules/lib-ignore (Usable-in-testdir): New section. * modules/mountlist (Usable-in-testdir): New section. * modules/non-recursive-gnulib-prefix-hack (Usable-in-testdir): New section. * modules/timevar (Usable-in-testdir): New section. (Files): Remove lib/timevar.def.
Bruno Haible 94046e1c 2024-07-28T23:38:45 gnulib-tool.py: Fix an exception message. * pygnulib/GLModuleSystem.py (GLModuleSystem.find): Raise error 23, not 3. * pygnulib/GLError.py: Provide an error message for error 23. * pygnulib/main.py: Likewise.
Bruno Haible beb4e550 2024-07-22T15:05:30 gnulib-tool: Omit the logs of skipped tests from test-suite.log. * gnulib-tool.sh (func_emit_tests_Makefile_am): Emit an assignment to IGNORE_SKIPPED_LOGS. * pygnulib/GLEmiter.py (GLEmiter.tests_Makefile_am): Likewise.
Collin Funk 7a99ec18 2024-06-15T05:42:18 gnulib-tool.py: Revert previous change. * pygnulib/constants.py (joinpath): Restore function and remove unused local variable. (relativize, symlink_relative, as_link_value_at_dest, hardlink): Use it. * pygnulib/GLConfig.py (resetAutoconfFile): Likewise. * pygnulib/GLEmiter.py (lib_Makefile_am, tests_Makefile_am): Likewise. * pygnulib/GLFileSystem.py (lookup, shouldLink, tmpfilename, add) (update, add_or_update, super_update): Likewise. * pygnulib/GLImport.py (__init__, relative_to_currdir) (_done_dir_, _update_ignorelist_, prepare, execute): Likewise. * pygnulib/GLInfo.py (version): Likewise. * pygnulib/GLMakefileTable.py (parent): Likewise. * pygnulib/GLModuleSystem.py (exists, find, getFiles) (getAutomakeSnippet_Unconditional): Likewise. * pygnulib/GLTestDir.py (_patch_test_driver, execute): Likewise. * pygnulib/main.py (main): Likewise.
Collin Funk 790206bf 2024-06-14T21:55:48 gnulib-tool.py: Simplify joining paths. * pygnulib/constants.py (joinpath): Remove function. It is equivalent to os.path.normpath(os.path.join(...)) where the os.path.normpath is typically not needed. (relativize, symlink_relative, as_link_value_at_dest, hardlink): Use os.path.join instead of joinpath. * pygnulib/GLConfig.py (resetAutoconfFile): Likewise. * pygnulib/GLEmiter.py (lib_Makefile_am, tests_Makefile_am): Likewise. * pygnulib/GLFileSystem.py (lookup, shouldLink, tmpfilename, add) (update, add_or_update, super_update): Likewise. * pygnulib/GLInfo.py (version): Likewise. * pygnulib/GLMakefileTable.py (parent): Likewise. * pygnulib/GLTestDir.py (_patch_test_driver, execute): Likewise. * pygnulib/main.py (main): Likewise. * pygnulib/GLModuleSystem.py (exists, find, getFiles): Likewise. * pygnulib/GLImport.py (__init__, relative_to_currdir) (_done_dir_, _update_ignorelist_, prepare, execute): Likewise. (getAutomakeSnippet_Unconditional): Likewise. Add a comment about not using os.path.normpath() to protect a Make variable.
Collin Funk 86bedefc 2024-06-09T18:08:00 gnulib-tool.py: Handle absolute path checks consistently. * pygnulib/GLImport.py (GLImport.relative_to_destdir) (GLImport.relative_to_currdir): Use os.path.isabs() instead of checking for a slash. * pygnulib/constants.py (symlink_relative, as_link_value_at_dest) (hardlink): Use os.path.isabs() instead of checking for a slash or drive prefix.
Collin Funk 80949983 2024-06-05T20:21:51 gnulib-tool.py: Don't perform unnecessary configure.ac scanning. * pygnulib/GLImport.py (GLImport.execute): Use re.search() instead of re.findall() since we only care about finding one match. Remove unnecessary bool() calls.
Collin Funk c1cdc5ef 2024-06-03T04:57:14 gnulib-tool.py: Use a set to optimize. * pygnulib/GLModuleSystem.py (GLModule.getAutomakeSnippet_Unconditional): Call set() on the result of _extract_lib_SOURCES() to ensure computing the difference between another set is O(n).
Collin Funk 26d76031 2024-06-02T22:32:39 gnulib-tool.py: Refactor duplicated regular expressions. * pygnulib/GLModuleSystem.py (_LIB_SOURCES_PATTERN): New variable. (_extract_lib_SOURCES): New function. (GLModule.getAutomakeSnippet_Unconditional): Use the new function. (GLModuleTable.add_dummy): Likewise. Add a second break statement to stop unnecessary looping.
Collin Funk 1372dc16 2024-06-02T05:29:33 gnulib-tool.py: Fix regular expression (regr. today). * pygnulib/main.py (main) [import]: Match all characters until '#' or end of line, whichever comes first.
Collin Funk 80ed61e8 2024-06-02T01:06:32 gnulib-tool.py: Fix crash when no ACLOCAL_AMFLAGS is found. * pygnulib/main.py (main) [import]: Use a regular expression to match the ACLOCAL_AMFLAGS Makefile.am variable. Properly handle the case where none is found.
Collin Funk 1b74469a 2024-05-29T02:35:02 gnulib-tool.py: Don't emit non-ASCII shell output. Reported by Bruno Haible in <https://lists.gnu.org/archive/html/bug-gnulib/2024-05/msg00441.html>. * pygnulib/GLModuleSystem.py (GLModule.shell_id_chars): Use the re.ASCII flag for the regular expression.
Collin Funk 001302d0 2024-05-28T23:26:19 gnulib-tool.py: Add missing docstring. * pygnulib/GLModuleSystem.py (GLModule.getShellId): Add docstring forgotten in the previous commit.
Collin Funk eacd6153 2024-05-28T21:55:12 gnulib-tool.py: Simplify creation of module shell ids. * pygnulib/GLModuleSystem.py (GLModule.shell_id_chars): Remove class variable. (GLModule.shell_id_pattern): New class variable. (GLModule.getShellId): New function. (GLModule.getShellFunc, GLModule.getShellVar) (GLModule.getConditionalName): Use it.
Collin Funk 46be8fb6 2024-05-16T18:26:50 gnulib-tool.py: Fix return value when exiting with Ctrl-C. * pygnulib/main.py (main_with_exception_handling): Catch KeyboardInterrupts and exit with a return code of 1.
Collin Funk 43ca9607 2024-05-15T20:25:38 gnulib-tool.py: Don't print tracebacks when Ctrl-C is pressed. Suggested by Pádraig Brady in <https://lists.gnu.org/archive/html/bug-gnulib/2024-05/msg00200.html>. * pygnulib/main.py (cli_exception): New function. (main_with_exception_handling): Use it.
Bruno Haible 3f2814ea 2024-05-14T11:20:15 gnulib-tool.py: Fix formatting of error message in last commit. * pygnulib/main.py (main_with_exception_handling): Use the usual formatting of error messages.
Collin Funk 719ce7d3 2024-05-13T21:36:25 gnulib-tool.py: Don't continue creating testdirs when destdir exists. * pygnulib/GLError.py (GLError.__init__, GLError.__repr__): Add a new error number for destination directories that already exist. * pygnulib/main.py (main_with_exception_handling): Print the message. * pygnulib/GLTestDir.py (GLTestDir.__init__, GLMegaTestdir.__init__): Fail if the destination directory exists instead of creating files and failing to patch test driver.
Collin Funk 6c3614c1 2024-05-11T21:45:12 gnulib-tool.py: Filter out dependencies that cannot be found. Reported by Paul Eggert in <https://lists.gnu.org/archive/html/bug-gnulib/2024-05/msg00136.html>. * pygnulib/GLModuleSystem.py (GLModule.getDependenciesWithConditions): Reorder conditionals to avoid duplicate checks. Filter out None from the gathered dependencies when gathering module dependencies. Let GLModuleSystem.find() warn instead of crashing.
Bruno Haible 07e4eeaf 2024-05-08T11:11:12 gnulib-tool.py: Make --megatest behaviour more similar to shell impl. * pygnulib/main.py (main) [megatest]: Remove space from the testdir name.
Bruno Haible 06287e49 2024-05-08T10:55:43 gnulib-tool: In --megatestdir mode, stop when there is an error. * gnulib-tool.sh (megatest): Fail when one of the 'configure' or 'make' steps fails. * pygnulib/main.py (main): Likewise.
Collin Funk 17b859fb 2024-05-08T01:24:09 gnulib-tool.py: Fix behavior of --test when a subprocess fails. Reported by Bruno Haible in <https://lists.gnu.org/archive/html/bug-gnulib/2024-05/msg00101.html>. * pygnulib/main.py (main): Use sp.run with check=True so that an exception is thrown when a process fails. Simply exit if an exception occurs.
Collin Funk e91650b1 2024-05-07T17:10:23 gnulib-tool.py: Handle module dependencies that cannot be found. * pygnulib/GLModuleSystem.py (GLModule.getDependenciesWithoutConditions): Filter out None from the module dependencies. An appropriate warning will already be printed by GLModuleSystem.find().
Bruno Haible 655328ba 2024-05-05T16:30:10 gnulib-tool.py: Regenerate aclocal.m4 before using 'autoconf -t ...'. Reported by Paul Eggert in <https://lists.gnu.org/archive/html/bug-gnulib/2024-05/msg00065.html>. * pygnulib/GLImport.py (GLImport): New field m4dirs. (GLImport.__init__): Accept an additional m4dirs argument. (GLImport.execute): Regenerate aclocal.m4 before creating the library Makefile. * pygnulib/main.py (main): Pass the guessed_m4dirs to GLImport.
Collin Funk b86d31ad 2024-05-03T17:26:18 gnulib-tool.py: Fix an undefined function name. * pygnulib/main.py (main_with_exception_handling): Use the tempfile module prefix when calling mkdtemp(). Use the 'glpy' prefix for the temporary directory that exists for the entirety of the program.
Collin Funk 3169fd03 2024-05-02T00:49:58 gnulib-tool.py: Don't leave temporary directories on exit. * pygnulib/main.py (main_with_exception_handling): Use tempfile.TemporaryDirectory as a context manager so it is removed before the program exits. (main): Expect a temporary directory to be passed as an argument. * pygnulib/GLConfig.py (GLConfig.__init__): Accept an optional temporary directory parameter instead of creating one. * pygnulib/GLImport.py (GLImport.__init__): Don't remove the cache's temporary directory since it doesn't create one anymore. (GLImport.execute): Don't remove the temporary directory explicitly. It is handled by the usage of a context manager. * pygnulib/GLTestDir.py (GLTestDir.execute, GLMegaTestDir.execute): Likewise.
Collin Funk adc6d632 2024-05-01T21:26:34 gnulib-tool.py: Quote file names passed to 'patch'. * pygnulib/GLTestDir.py (_patch_test_driver): Import shlex and cleanup unused imports. Use shlex.quote() on the file names passed to 'patch'. * pygnulib/GLFileSystem.py (GLFileSystem.lookup): Likewise. Perform redirection using sp.call() arguments instead of using the shell.
Collin Funk ecdab13f 2024-05-01T02:21:43 gnulib-tool.py: Fix mistake in previous commit. * pygnulib/GLModuleSystem.py (GLModuleSystem.exists) (GLModuleSystem.find): Rename 'module' argument to 'module_name' so it is clear they are not a GLModule object. Treat them as such.
Collin Funk ffde9905 2024-05-01T01:12:18 gnulib-tool.py: Use the GLModule's name variable directly. * pygnulib/GLModuleSystem.py (GLModule.getName): Remove function. (GLModule.__str__, GLModule.__repr__, GLModule.isNonTests) (GLModule.repeatModuleInTests, GLModule.getDependenciesRecursively) (GLModule.getShellFunc, GLModule.getShellVar) (GLModule.getConditionalName, GLModule.getApplicability) (GLModule.getDependencies, GLModule.getAutomakeSnippet_Unconditional) (GLModule.getLicense, GLModuleSystem.find) (GLModuleTable.transitive_closure): Use the GLModule's name instance variable instead of using str() or removed getName() function. * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippet) (GLEmiter.preEarlyMacros, GLEmiter.lib_Makefile_am) (GLEmiter.tests_Makefile_am): Likewise. * pygnulib/GLImport.py (GLImport.gnulib_comp, GLImport.prepare): Likewise. * pygnulib/GLTestDir.py (GLTestDir.execute, GLMegaTestDir.execute): Likewise.
Collin Funk 134f6b8a 2024-04-30T01:09:55 gnulib-tool.py: Remove remaining unused instance variables. * pygnulib/GLModuleSystem.py (GLModule.__init__) (GLModuleTable.__init__): Remove the unused GLFileSystem variable. These classes perform lookups with a GLModuleSystem. * pygnulib/GLTestDir.py (GLTestDir.__init__): Remove the unused GLFileAssistant variable. The transformations it performs are not needed in testdirs.
Collin Funk 20061b49 2024-04-29T22:20:31 gnulib-tool.py: Add type hints to classes. * pygnulib/*.py: Add type hints for all instance and class variables. * pygnulib/GLMakefileTable.py (GLMakefileTable.__getitem__): Fix return type hint since the dictionary has str values.
Collin Funk afca3c77 2024-04-29T22:15:56 gnulib-tool.py: Emit libtests in testdirs generated Makefile.am. Reported by Bruno Haible in <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00463.html>. * pygnulib/GLTestDir.py (GLTestDir.execute): Modify the GLEmiter's config variable instead of the GLTestDir's so that it can be accessed when emitting the Makefile.am.
Collin Funk dba810f6 2024-04-27T15:01:24 gnulib-tool.py: Preserve module ordering in --create-megatestdir. * pygnulib/GLTestDir.py (GLMegaTestDir.execute): Use a separate set to remove duplicates from the original list without sorting.
Collin Funk f306be62 2024-04-26T01:58:09 gnulib-tool.py: Remove some unused instance variables. * pygnulib/GLTestDir.py (GLMegaTestDir.__init__): Don't define instance variables that are never used.
Collin Funk 9af79f66 2024-04-25T15:30:29 gnulib-tool.py: Reduce code duplication in file name transformations. * pygnulib/functions.py: New file for shared functions between modules. Add a function based on functions removed from GLImport and GLTestDir. Accepts a single file name instead of a list. * pygnulib/GLImport.py (GLImport.prepare): Use the new function. (GLImport.rewrite_new_files, GLImport.rewrite_old_files): Remove functions. * pygnulib/GLTestDir.py (GLTestDir.execute): Use the new function. (GLTestDir.rewrite_files): Remove functions. * pygnulib/main.py (main): Remove unused function import. Use the new function.
Collin Funk 962397de 2024-04-24T16:04:25 gnulib-tool.py: Add a new GLFileTable class. * pygnulib/GLFileTable.py: New file. Define the GLFileTable class with five attributes which can be individually typed. * pygnulib/GLTestDir.py (GLTestDir.execute): Use the GLFileTable class. * pygnulib/GLImport.py (GLImport.gnulib_comp, GLImport.prepare) (GLImport.execute): Likewise. Update type hints and doc strings.
Collin Funk 379b3a02 2024-04-23T11:28:19 gnulib-tool.py: Make better use of imports. * pygnulib/*.py: Import functions from constants.py directly instead of assigning them to module-specific variable. Keep the module prefix for standard library functions.
Collin Funk 5b6e410e 2024-04-21T00:29:50 gnulib-tool.py: Make temporary directories recognizable. * pygnulib/GLConfig.py (GLConfig.__init__): Pass the 'glpy' prefix to mkdtemp.
Collin Funk 5b1dcad0 2024-04-20T20:29:44 gnulib-tool.py: Don't fail when given a bad module name. * pygnulib/GLTestDir.py (GLTestDir.execute): Don't include None in the list of GLModule objects. * pygnulib/GLModuleSystem.py (GLModuleSystem.find): Document the meaning of the None return.
Collin Funk 83ce09b8 2024-04-20T19:47:28 gnulib-tool.py: Update type hints and docstring. * pygnulib/GLImport.py (GLImport.execute): Update transformer type hint to reflect change from sed expressions to re.sub() arguments. (GLImport.prepare): Likewise. Don't reference sed or license replacements in docstring.
Collin Funk 544b6f6e 2024-04-19T23:42:24 gnulib-tool.py: Remove duplicate per-module definitions. * pygnulib/constants.py: Remove duplicate __authors__, __license__, and __copyright__ definitions. * pygnulib/GLInfo.py: Use the value of __authors__ and __copyright__ from __init__.py for output. * pygnulib/*.py: Remove unused references to the constant.py definitions.
Bruno Haible 464e9ed3 2024-04-20T23:45:59 gnulib-tool.py: Fix a bug in removed / added files handling. * pygnulib/GLImport.py (GLImport.execute): When looking for files that are in both filetable['old'] and filetable['new'], consider only the first element of each tuple, not the entire tuple.
Bruno Haible e0c69b7c 2024-04-20T23:03:18 gnulib-tool.py: Sort file lists case-sensitively. * pygnulib/GLImport.py (GLImport.prepare, GLImport.execute): Omit .lower() call in sort key computation.
Bruno Haible a114a97b 2024-04-20T21:55:45 gnulib-tool.py: Fix output of --create-megatestdir. * pygnulib/GLTestDir.py (GLMegaTestDir.execute): Remove stray backslash from output.
Collin Funk b9fa78e2 2024-04-19T12:00:33 gnulib-tool.py: Make use of GLModule's __hash__ method. * pygnulib/GLModuleSystem.py (GLModuleTable.addUnconditional) (GLModuleTable.isConditional): Use the GLModule object instead of the module name directly. (GLModuleTable.addConditional, GLModuleTable.getCondition): Likewise. Use a tuple of two GLModule objects as a key for the conditionals dictionary.
Collin Funk efc1cb63 2024-04-19T11:32:44 gnulib-tool.py: Simplify data structures for dependencies. * pygnulib/GLModuleSystem.py (GLModuleTable.__init__): Use a defaultdict for dependers to remove the base initialization case. (GLModuleTable.addConditional): Use a set to disallow duplicates instead of performing list lookups.
Bruno Haible 344f8683 2024-04-19T18:21:26 gnulib-tool.py: Simplify running some commands in a given directory. * pygnulib/GLImport.py (GLImport.execute): Use sp.call with a cwd argument, instead of calling chdir twice. * pygnulib/GLModuleSystem.py (GLModuleSystem.list): Likewise. * pygnulib/main.py (mode=='find'): Likewise.
Bruno Haible 6adcc628 2024-04-19T17:41:54 gnulib-tool.py: Update authors list. * pygnulib/constants.py (__author__): Add Collin Funk. * pygnulib/__init__.py (__copyright__, __author__): Include years and authors of the gnulib-tool shell script.
Collin Funk 229e2648 2024-04-18T11:03:00 gnulib-tool.py: Add a comment about coding style. * pygnulib/main.py: Add a note about the common convention of using an underscore prefix to mark a function/variable as private.
Collin Funk 33530824 2024-04-18T10:46:33 gnulib-tool.py: Remove some unused instance variables. * pygnulib/GLModuleSystem.py (GLModuleSystem.__init__) (GLModule.__init__): Remove unused 'args' instance variable.
Collin Funk f9fdc52f 2024-04-17T16:20:32 gnulib-tool.py: Ignore 'attribute-defined-outside-init' warnings. * pygnulib/.pylintrc: Add W0201 to the disabled warnings. See discussion here: <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00275.html>
Bruno Haible 3cdd0b36 2024-04-18T00:44:19 gnulib-tool.py: Use same warning style as gnulib-tool.sh. * pygnulib/GLTestDir.py (GLTestDir.execute): Prefix the "incompatible license" message with "gnulib-tool: warning: ".
Collin Funk cdfb7dad 2024-04-17T11:47:16 gnulib-tool.py: Make an instance variable local to a function. * pygnulib/GLImport.py (GLImport.execute): Define the GLFileAssistant as local to this function because it is unused elsewhere.
Collin Funk 4daa5ced 2024-04-17T11:34:07 gnulib-tool.py: Remove an unused instance attribute. * pygnulib/GLImport.py (GLImport.__init__): Remove the unused GLFileSystem object.
Collin Funk 5ee99431 2024-04-16T20:21:04 gnulib-tool.py: Fix a pylint 'attribute-defined-outside-init' warning. * pygnulib/GLModuleSystem.py (GLModuleTable.transitive_closure): Don't define a 'modules' attribute since it is never used.
Collin Funk daa21fd2 2024-04-16T12:13:08 gnulib-tool.py: Make GLModule's __eq__ and __hash__ method agree. * pygnulib/GLModuleSystem.py (GLModuleTable.__hash__): Only use the module name in hash computations.
Collin Funk 886f8476 2024-04-16T08:36:55 gnulib-tool.py: Prefer 'not in' over 'not ... in'. * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippet): Change conditional. * pygnulib/GLModuleSystem.py (GLModuleTable.addConditional): Likewise.
Collin Funk 5097cf4b 2024-04-16T08:21:27 gnulib-tool.py: Make data structures more clear. * pygnulib/GLModuleSystem.py (GLModuleTable.__init__): Use a set to represent the unconditional modules instead of a dictionary. Remove redundant comments. (GLModuleTable.addUnconditional): Add the module to a set instead of using it as a key to the dictionary.
Collin Funk 3e5ac2fc 2024-04-15T09:16:25 gnulib-tool.py: Optimize directory creation. * pygnulib/GLTestDir.py (GLTestDir.execute): Use a list of possible subdirectories and create them upfront instead of checking every file.
Collin Funk cb7ab9c7 2024-04-14T13:41:17 gnulib-tool.py: Fix incorrect type hint. * pygnulib/constants.py (filter_filelist): Correct the type hint on the 'filelist' argument. It is a list of strings, not a string.
Collin Funk cb7e1bb2 2024-04-14T10:31:34 gnulib-tool.py: Write newlines consistently. * pygnulib/constants.py (NL): Remove variable. * pygnulib/GLImport.py (GLImport.gnulib_comp): Use '\n' instead of constants.NL. * pygnulib/GLModuleSystem.py (GLModule.getAutomakeSnippet_Unconditional): Likewise. * pygnulib/main.py (main_with_exception_handling): Likewise.
Collin Funk aaabd2eb 2024-04-14T10:18:03 gnulib-tool.py: Don't perform newline conversions. * pygnulib/constants.py (nlconvert): Remove function. Remove unused platform import. * pygnulib/GLImport.py (GLImport.gnulib_cache): Remove calls to nlconvert(). * pygnulib/GLModuleSystem.py (GLModule.getAutomakeSnippet_Unconditional): Likewise. * pygnulib/GLTestDir.py (GLTestDir.execute, GLMegaTestDir.execute): Likewise.
Collin Funk 3897b2b1 2024-04-14T09:37:17 gnulib-tool.py: Remove some unused variable assignments. * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Remove unused variable. * pygnulib/GLInfo.py (GLInfo.date, GLInfo.version): Remove assignments to variables unconditionally set in try, except blocks. * pygnulib/GLModuleSystem.py (GLModule.getConditionalName) (GLModule.getShellFunc, GLModule.getShellVar): Likewise.
Collin Funk f67b0b14 2024-04-13T18:51:06 gnulib-tool.py: Don't use mutable default arguments. * pygnulib/GLFileSystem.py (GLFileAssistant.__init__): Set the default argument for 'transformers' to None. If it is None then set it to an empty dictionary in the body.
Collin Funk b4e435f6 2024-04-13T10:09:17 gnulib-tool.py: Fix extra arguments to function call. * pygnulib/GLImport.py (GLImport.execute): Add the missing joinpath call on two file name components before calling isfile().
Bruno Haible 172b9afb 2024-04-13T13:30:44 gnulib-tool.py: Code tweak. * pygnulib/main.py (main): Move file contents analysis out of a 'with' statement.
Bruno Haible 3258dcae 2024-04-13T12:55:44 gnulib-tool.py: Stop using codecs.open. * pygnulib/*.py: To open a file, consistently use open(..., mode='[rwa]', newline='\n', encoding='utf-8').