summaryrefslogtreecommitdiff
path: root/pygnulib/GLModuleSystem.py
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* gnulib-tool.py: Finish implementing option --conditional-dependencies.Bruno Haible2022-08-101-26/+74
| | | | | | | | | | | | | | | | | | | | | * 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.
* gnulib-tool.py: Fixes for conditional dependencies.Bruno Haible2022-08-091-33/+37
| | | | | | | | * 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.
* gnulib-tool.py: Refactor.Bruno Haible2022-08-091-10/+11
| | | | | * pygnulib/GLModuleSystem.py (GLModule.getLicense): Separate the warning logic from the result logic.
* gnulib-tool.py: Fix --extract-dependencies result.Bruno Haible2022-08-081-21/+62
| | | | | | | | | | | | * 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.
* gnulib-tool.py: Rename a method.Bruno Haible2022-08-071-2/+2
| | | | | | | * pygnulib/GLModuleSystem.py (GLModule.getAutoconfEarlySnippet): Renamed from GLModule.getAutoconfSnippet_Early. * pygnulib/GLImport.py: Update. * pygnulib/GLTestDir.py: Likewise.
* gnulib-tool.py: Fix section extraction from module descriptions.Bruno Haible2022-08-071-289/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* gnulib-tool.py: Improve field naming.Bruno Haible2022-08-071-20/+18
| | | | | * pygnulib/GLModuleSystem.py (GLModule): Rename field 'module' to 'path'. Fix a typo in a TypeError message.
* gnulib-tool.py: Simplify.Bruno Haible2022-08-071-12/+1
| | | | | * pygnulib/GLModuleSystem.py (GLModule): Convert Windows newlines right after reading the module description, not in every accessor.
* gnulib-tool.py: Reduce code duplication.Bruno Haible2022-08-071-61/+23
| | | | | * pygnulib/GLModuleSystem.py (GLModule): Declare two regexes are class variables.
* gnulib-tool.py: Implement option --find.Bruno Haible2022-08-071-32/+27
| | | | | | | | * 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'.
* gnulib-tool.py: Fix some regex uses.Bruno Haible2022-08-071-1/+1
| | | | | | * 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.
* gnulib-tool.py: Make regex uses more straightforward.Bruno Haible2022-08-071-1/+1
| | | | | | | * 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.
* gnulib-tool.py: Make regex uses more straightforward.Bruno Haible2022-08-071-3/+3
| | | | | | | | | | * 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.
* gnulib-tool.py: Simplify.Bruno Haible2022-08-051-20/+19
| | | | | | * pygnulib/constants.py (compiler): Remove function. * gnulib-tool.py: Use re.compile directly instead. * pygnulib/*.py: Likewise.
* gnulib-tool.py: Coding style: Revisit line breaks.Bruno Haible2022-08-041-57/+81
| | | | | | * gnulib-tool.py: Avoid line breaks at arbitrary points inside expressions. Use line breaks to clarify [... for ...] iterations. * pygnulib/*.py: Likewise.
* gnulib-tool.py: Use mainstream/GNU coding style.Bruno Haible2022-08-041-30/+29
| | | | | | * gnulib-tool.py: Break lines before the % operator, not after. * pygnulib/*.py: Likewise. Avoid line breaks when the resulting lines are not too long.
* gnulib-tool.py: Implement option --avoid.Bruno Haible2022-08-041-67/+71
| | | | | | | | | | | * 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.
* gnulib-tool.py: Implement options --without-c++-tests etc.Bruno Haible2022-08-041-50/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* gnulib-tool.py: Follow gnulib-tool changes, part 22.Bruno Haible2022-08-031-9/+15
| | | | | | | | | 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.
* gnulib-tool.py: Improve some error messages.Bruno Haible2022-07-311-2/+1
| | | | | | | * 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.
* gnulib-tool.py: Follow gnulib-tool changes, part 19.Bruno Haible2022-07-311-22/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.py: Clean up imports.Bruno Haible2022-07-311-8/+0
| | | | | * gnulib-tool.py: Remove unused constants. * pygnulib/*.py: Likewise.
* gnulib-tool.py: Assume Python 3.Bruno Haible2022-07-311-27/+4
| | | | | * gnulib-tool.py: Don't allow 'bytes' as an alternative to 'str'. * pygnulib/*.py: Likewise.
* gnulib-tool.py: Assume Python 3.Bruno Haible2022-07-311-59/+54
| | | | | * gnulib-tool.py: Don't set PYTHON3, string. Use str instead of string. * pygnulib/*.py: Likewise.
* gnulib-tool.py: Modernize coding style.Bruno Haible2022-07-311-42/+42
| | | | * pygnulib/*.py: Remove parentheses around raise value expressions.
* gnulib-tool.py: Modernize coding style.Bruno Haible2022-07-291-57/+57
| | | | * pygnulib/*.py: Remove parentheses around return value expressions.
* gnulib-tool.py: Modernize the file headers.Bruno Haible2022-07-291-2/+14
| | | | | * pygnulib/*.py: Remove '#!/usr/bin/python' (not needed) and 'encoding: UTF-8' lines (default in Python 3). Add copyright notice.
* gnulib-tool.py: Fix warning from Python 3.10.4.Bruno Haible2022-07-291-1/+1
| | | | | * pygnulib/GLModuleSystem.py (getConditionalName): Fix a string substitution expression.
* Rename ~~gnulib.m4 to zzgnulib.m4.Bruno Haible2020-01-181-1/+1
| | | | | | | | Suggested by Paul Eggert. * m4/zzgnulib.m4: Renamed from m4/~~gnulib.m4. * gnulib-tool (func_get_filelist): Update. * pygnulib/GLModuleSystem.py (getFiles): Likewise.
* Fix major regression from 2020-01-10.Bruno Haible2020-01-181-0/+1
| | | | | | | | | | | | | | | | 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.
* gnulib-tool.py: Fix libgnu_la_LDFLAGS section in generated Makefile.am.Tim Rühsen2019-11-301-6/+4
| | | | | | | | | | 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.
* Assume Autoconf >= 2.63.Bruno Haible2018-10-231-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* gnulib-tool.py: Define and use two new global functions.Bruno Haible2017-09-091-2/+2
| | | | | * pygnulib/constants.py (remove_backslash_newline, combine_lines): New functions.
* gnulib-tool.py: follow gnulib-tool changes, part 5Bruno Haible2017-09-091-3/+1
| | | | | | Follow gnulib-tool change 2013-05-04 Stefano Lattarini <stefano.lattarini@gmail.com> Assume gnulib is checked out from Git, not CVS
* gnulib-tool.py: follow gnulib-tool changes, part 3Bruno Haible2017-09-091-1/+0
| | | | | | | | | 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.
* [pygnulib] autopep8 (fixing indentation, style, etc.)Dmitry Selyutin2017-09-081-1194/+1207
|
* gnulib-tool.py: fix errors on building wget2; use UTF-8 in subprocessDmitry Selyutin2017-09-081-3/+3
|
* [pygnulib] initial merge (including some small bug fixes)Dmitry Selyutin2017-09-081-0/+1267