pygnulib/GLModuleSystem.py


Log

Author Commit Date CI Message
Simon Josefsson 32a72f45 2023-01-01T01:14:21 maint: run 'make update-copyright'
Bruno Haible 62fa8fc7 2022-08-10T00:51:59 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.
Bruno Haible 501feeb5 2022-08-08T21:22:15 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.
Bruno Haible d0e09431 2022-08-08T18:42:45 gnulib-tool.py: Refactor. * pygnulib/GLModuleSystem.py (GLModule.getLicense): Separate the warning logic from the result logic.
Bruno Haible 276c20ee 2022-08-08T00:02:59 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.
Bruno Haible d528738a 2022-08-07T22:59:08 gnulib-tool.py: Rename a method. * pygnulib/GLModuleSystem.py (GLModule.getAutoconfEarlySnippet): Renamed from GLModule.getAutoconfSnippet_Early. * pygnulib/GLImport.py: Update. * pygnulib/GLTestDir.py: Likewise.
Bruno Haible 81b8c4d5 2022-08-07T22:53:32 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.
Bruno Haible 586000e5 2022-08-07T20:04:56 gnulib-tool.py: Improve field naming. * pygnulib/GLModuleSystem.py (GLModule): Rename field 'module' to 'path'. Fix a typo in a TypeError message.
Bruno Haible 9b2a7c80 2022-08-07T19:26:51 gnulib-tool.py: Simplify. * pygnulib/GLModuleSystem.py (GLModule): Convert Windows newlines right after reading the module description, not in every accessor.
Bruno Haible 8341b4a2 2022-08-07T17:29:16 gnulib-tool.py: Reduce code duplication. * pygnulib/GLModuleSystem.py (GLModule): Declare two regexes are class variables.
Bruno Haible 72ac0235 2022-08-07T17:02:21 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'.
Bruno Haible 5c087011 2022-08-07T13:46:15 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.
Bruno Haible 9d722ddc 2022-08-07T13:40:07 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.
Bruno Haible 54bf87fe 2022-08-07T13:29:59 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.
Bruno Haible 276725c4 2022-08-05T04:05:04 gnulib-tool.py: Simplify. * pygnulib/constants.py (compiler): Remove function. * gnulib-tool.py: Use re.compile directly instead. * pygnulib/*.py: Likewise.
Bruno Haible 362f779b 2022-08-04T21:53:51 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 2a33db96 2022-08-04T18:26:08 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 353460b9 2022-08-04T12:40:04 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 de028fc3 2022-08-03T22:29:52 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 65349591 2022-08-03T14:51:20 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.
Bruno Haible 6b79ce37 2022-07-31T23:02:58 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.
Bruno Haible 6bdf668e 2022-07-31T18:39:19 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.
Bruno Haible dd7b332f 2022-07-30T13:51:36 gnulib-tool.py: Clean up imports. * gnulib-tool.py: Remove unused constants. * pygnulib/*.py: Likewise.
Bruno Haible 0a624ee7 2022-07-30T13:29:26 gnulib-tool.py: Assume Python 3. * gnulib-tool.py: Don't allow 'bytes' as an alternative to 'str'. * pygnulib/*.py: Likewise.
Bruno Haible d2abfb90 2022-07-30T11:45:36 gnulib-tool.py: Assume Python 3. * gnulib-tool.py: Don't set PYTHON3, string. Use str instead of string. * pygnulib/*.py: Likewise.
Bruno Haible 5d39cdb4 2022-07-30T10:44:02 gnulib-tool.py: Modernize coding style. * pygnulib/*.py: Remove parentheses around raise value expressions.
Bruno Haible 0bc144f9 2022-07-29T18:45:33 gnulib-tool.py: Modernize coding style. * pygnulib/*.py: Remove parentheses around return value expressions.
Bruno Haible 3e44e3bb 2022-07-29T16:41:28 gnulib-tool.py: Modernize the file headers. * pygnulib/*.py: Remove '#!/usr/bin/python' (not needed) and 'encoding: UTF-8' lines (default in Python 3). Add copyright notice.
Bruno Haible 67e61c85 2022-07-29T11:14:27 gnulib-tool.py: Fix warning from Python 3.10.4. * pygnulib/GLModuleSystem.py (getConditionalName): Fix a string substitution expression.
Bruno Haible 38b9f060 2020-01-18T23:05:36 Rename ~~gnulib.m4 to zzgnulib.m4. Suggested by Paul Eggert. * m4/zzgnulib.m4: Renamed from m4/~~gnulib.m4. * gnulib-tool (func_get_filelist): Update. * pygnulib/GLModuleSystem.py (getFiles): Likewise.
Bruno Haible 378a9634 2020-01-18T14:03:36 Fix major regression from 2020-01-10. Reported by Paul Eggert in <https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00079.html>. * m4/00gnulib.m4 (gl_COMPILER_CLANG, gl_COMPILER_PREPARE_CHECK_DECL): Don't AC_REQUIRE anything. (gl_COMPILER_PREPARE_CHECK_DECL): Define through AC_DEFUN, not AC_DEFUN_ONCE. Use _AC_COMPILE_IFELSE, not AC_COMPILE_IFELSE. (_AC_CHECK_DECL_BODY): If ac_compile_for_check_decl has not been set, use ac_compile instead. (AC_CHECK_DECL): Remove override. * m4/~~gnulib.m4: New file. * gnulib-tool (func_get_filelist): Add also ~~gnulib.m4. * pygnulib/GLModuleSystem.py (getFiles): Likewise.
Tim Rühsen c2dbe353 2019-11-30T13:04:28 gnulib-tool.py: Fix libgnu_la_LDFLAGS section in generated Makefile.am. Reported by Dagobert Michelsen <dam@opencsw.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2019-11/msg00086.html>. * pygnulib/GLModuleSystem.py (getLink): Don't join the parts. Return a list of strings instead of one string. * pygnulib/GLEmiter.py (lib_Makefile_am): Adapt accordingly. * pygnulib/GLImport.py (execute): Likewise.
Bruno Haible 844f63f9 2018-10-23T00:06:52 Assume Autoconf >= 2.63. * DEPENDENCIES: Mention the requirement. * gnulib-tool (DEFAULT_AUTOCONF_MINVERSION): Bump to 2.63. (func_get_filelist): Don't list m4/onceonly.m4 any more. * pygnulib/GLModuleSystem.py (getFiles): Likewise. * m4/onceonly.m4: Remove file. * m4/openmp.m4: Remove file. * modules/openmp (Files): Remove m4/openmp.m4. * m4/configmake.m4 (gl_CONFIGMAKE_PREP): Don't set datarootdir, docdir, htmldir, dvidir, pdfdir, psdir, localedir. * m4/po.m4 (AM_PO_SUBDIRS): Don't set localedir. * m4/gnulib-common.m4 (m4_foreach_w): Remove fallback for Autoconf < 2.60. (AC_PROG_MKDIR_P): Remove definition for Autoconf < 2.62. (AC_PROG_SED): Remove fallback for Autoconf < 2.60. * m4/errno_h.m4 (AC_COMPUTE_INT): Remove fallback for Autoconf < 2.61. * m4/size_max.m4 (AC_COMPUTE_INT): Likewise. * m4/stdint.m4 (AC_COMPUTE_INT): Likewise. * m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): Assume AC_USE_SYSTEM_EXTENSIONS exists. * m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Likewise, * m4/lib-link.m4 (AC_LIB_LINKFLAGS_BODY): Remove workaround for Autoconf < 2.61. * m4/lib-prefix.m4 (AC_LIB_ARG_WITH): Remove macro. (AC_LIB_PREFIX): Use AC_ARG_WITH, assuming semantics of Autoconf >= 2.52. * m4/longlong.m4: Require Autoconf >= 2.62. Update comments. * m4/ls-mntd-fs.m4: Require Autoconf >= 2.60. Update comments. * m4/gettext.m4 (AM_GNU_GETTEXT): Update comment.
Bruno Haible 0f23f389 2017-09-09T12:48:58 gnulib-tool.py: Define and use two new global functions. * pygnulib/constants.py (remove_backslash_newline, combine_lines): New functions.
Bruno Haible 6c81a581 2017-09-09T01:04:08 gnulib-tool.py: follow gnulib-tool changes, part 5 Follow gnulib-tool change 2013-05-04 Stefano Lattarini <stefano.lattarini@gmail.com> Assume gnulib is checked out from Git, not CVS
Bruno Haible f0e4c4b6 2017-09-09T00:32:50 gnulib-tool.py: follow gnulib-tool changes, part 3 Follow gnulib-tool change 2012-08-26 Bruno Haible <bruno@clisp.org> gnulib-tool: Remove no-op option --no-changelog. * pygnulib/constants.py: Remove FILES dictionary. * pygnulib/*: Update.
Dmitry Selyutin 21c52a82 2017-09-08T18:34:58 [pygnulib] autopep8 (fixing indentation, style, etc.)
Dmitry Selyutin 3df66605 2017-09-05T10:04:18 gnulib-tool.py: fix errors on building wget2; use UTF-8 in subprocess
Dmitry Selyutin 02a1f93e 2017-08-20T11:17:58 [pygnulib] initial merge (including some small bug fixes)