pygnulib/GLImport.py


Log

Author Commit Date CI Message
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 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.
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 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 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').
Bruno Haible d018f537 2024-04-13T12:06:34 gnulib-tool.py: Refactor directory tree removals. * pygnulib/constants.py (rmtree): New function. * pygnulib/GLImport.py (GLImport.execute): Use it instead of calling 'rm -rf' directly or shutil.rmtree. * pygnulib/GLTestDir.py (GLTestDir.execute, GLMegaTestDir.execute): Likewise. * pygnulib/main.py (main): Likewise.
Bruno Haible 0227d548 2024-04-13T01:23:11 gnulib-tool.py: Implement --add-import --with-*-tests correctly. * pygnulib/GLConfig.py (GLConfig.update): Use list-merging for the test categories. * pygnulib/GLImport.py (GLImport.__init__): Don't merge back those values which were already considered by taking the union.
Bruno Haible 01b07158 2024-04-13T00:49:50 gnulib-tool.py: Implement --add-import --avoid correctly. * pygnulib/GLConfig.py (GLConfig.update): Don't test for the unused key 'tests'. * pygnulib/GLImport.py (GLImport.__init__): Don't merge back those values which were already considered by taking the union.
Bruno Haible 48f615b7 2024-04-13T00:24:52 gnulib-tool.py: Refactor. * pygnulib/GLConfig.py (GLConfig.update, GLConfig.update_key): Improve variable names and comments. * pygnulib/GLImport.py (GLImport.__init__): Improve comments.
Bruno Haible 2fee5e30 2024-04-12T22:21:57 gnulib-tool.py: Implement --no-conditional-dependencies correctly. * pygnulib/GLConfig.py (GLConfig.default): For 'conddeps', return None, not False. (GLConfig.checkCondDeps): Update result type. (resetCondDeps): Reset to return None, not False. * pygnulib/GLImport.py (GLImport.actioncmd): Update.
Bruno Haible 50a6834e 2024-04-12T22:10:54 gnulib-tool.py: Implement --no-libtool option correctly. * pygnulib/GLConfig.py (GLConfig.default): For 'libtool', return None, not False. (GLConfig.checkLibtool): Update result type. (resetLibtool): Reset to return None, not False. * pygnulib/GLImport.py (GLImport.actioncmd): Update.
Bruno Haible b3373a01 2024-04-12T19:10:33 gnulib-tool.py: Accept conditional dependencies with tests. * pygnulib/GLImport.py (GLImport.__init__): Don't reject the combination of gl_CONDITIONAL_DEPENDENCIES and gl_WITH_TESTS. * pygnulib/GLError.py (GLError.__repr__): Remove error 10. * pygnulib/main.py (main_with_exception_handling): Likewise.
Bruno Haible 40970e22 2024-04-12T18:11:46 gnulib-tool.py: Fix handling of --with-obsolete. * pygnulib/constants.py (TESTS): Remove 'obsolete' category. * pygnulib/GLConfig.py (GLConfig.__init__): Add optional incobsolete parameter. (GLConfig.default): Handle 'incobsolete'. (GLConfig.checkIncObsolete, GLConfig.setIncObsolete, GLConfig.resetIncObsolete): New methods. * pygnulib/GLModuleSystem.py (GLModuleSystem.transitive_closure): For incobsolete, use new GLConfig methods. * pygnulib/GLImport.py (GLImport.__init__, GLImport.actioncmd, GLImport.gnulib_cache): Likewise. * pygnulib/main.py (main): Pass the incobsolete value to the GLConfig constructor.
Bruno Haible 104328f6 2024-04-12T17:17:12 gnulib-tool.py: Fix parsing of gl_LGPL in gnulib-cache.m4. * pygnulib/GLImport.py (GLImport.__init__): Search for gl_LGPL in gnulib-cache.m4 more carefully.
Bruno Haible 8bb1e170 2024-04-12T16:32:37 gnulib-tool.py: Fix parsing of gnulib-cache.m4. * pygnulib/GLImport.py (GLImport.__init__): While parsing gnulib-cache.m4, stop parsing the identifier starting with 'gl_' when encountering a character that is not a uppercase letter, digit, or underscore.
Bruno Haible 020e1961 2024-04-12T15:51:28 gnulib-tool.py: Fix misspelled option in output. * pygnulib/GLImport.py (GLImport.actioncmd): Fix typo.
Bruno Haible d8caab63 2024-04-12T15:47:54 gnulib-tool.py: Persist the --with-longrunning-tests option. * pygnulib/GLImport.py (GLImport.gnulib_cache): Conditionally add gl_WITH_LONGRUNNING_TESTS to gnulib-cache.m4.
Collin Funk 3bb200bb 2024-04-11T11:27:34 gnulib-tool.py: Remove redundant backslashes from regexps. * pygnulib/GLTestDir.py (GLTestDir.execute): Don't backslash ']' when it is outside of a set. * pygnulib/GLImport.py (GLImport.__init__): Don't use a backslash when ']' is at the start of a '[...]' set. Don't backslash special characters in a '[...]' set since they have their meaning dropped. * pygnulib/main.py (main): Likewise.
Collin Funk b4391cb4 2024-04-11T12:46:46 gnulib-tool.py: Fix sorting of the LINGUAS file. * pygnulib/GLImport.py (GLImport.execute): Sort the list of locales before writing them into the LINGUAS file.
Bruno Haible ab3425fa 2024-04-11T01:55:05 gnulib-tool.py: Skip nonexistent modules instead of failing. * pygnulib/GLModuleSystem.py (GLModuleSystem.find): Use the same warning wording as gnulib-tool.sh. * pygnulib/GLImport.py (GLImport.gnulib_cache): Print the specified modules, not the base modules. (GLImport.prepare): Don't put None elements into base_modules.
Collin Funk d4520b5b 2024-04-10T08:24:58 gnulib-tool.py: Use function arguments instead of magic numbers. * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Remove the 'verifier' integer flag argument. Add the 'module_filter' function argument. Use it to determine if Autoconf snippets should be printed for each module. * pygnulib/GLImport.py (GLImport.gnulib_comp): Update call to use a lambda function. * pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.
Collin Funk 7166faa4 2024-04-09T00:01:49 gnulib-tool.py: Simplify use of GLModuleTable accessors. * pygnulib/GLModuleSystem.py (GLModuleTable.__getitem__): Remove function. * pygnulib/GLImport.py (GLImport.gnulib_cache, GLImport.gnulib_comp) (GLImport.execute): Use function calls on the GLModuleTable to access module lists instead of using keys to emulate a dictionary.
Collin Funk f41781a9 2024-04-08T16:37:48 gnulib-tool.py: Use single-quotes for strings. * pygnulib/*.py: Change double-quoted strings to use single-quotes unless doing so would require adding backslashes.
Collin Funk 965b5c72 2024-04-08T16:08:50 gnulib-tool.py: Prefer 'list.append(item)' over 'list += [item]'. * pygnulib/*.py: Change occurrences '+= [item]' to use '.append(item)' where item is a single element added to the list. See discussion here: <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00091.html>
Collin Funk 5ac9d876 2024-04-07T18:49:24 gnulib-tool.py: Omit some unnecessary list() calls around sorted(). * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Remove the list() call in the argument to sorted. The sorted() function works on any iterable and always returns a list. * pygnulib/GLImport.py (GLImport.rewrite_old_files) (GLImport.rewrite_new_files): Likewise. * pygnulib/GLModuleSystem.py (GLModuleTable.transitive_closure) (GLModuleTable.transitive_closure_separately): Likewise. * pygnulib/GLTestDir.py (GLTestDir.rewrite_files): Likewise.
Collin Funk eaf06caa 2024-04-06T05:57:51 gnulib-tool.py: Use auxdir as given by AC_CONFIG_AUX_DIR. * pygnulib/GLImport.py (GLImport.__init__): Don't modify the path given by AC_CONFIG_AUX_DIR by prefixing it with destdir. Use a more strict regular expression instead of cleaner().
Collin Funk 2c216fb8 2024-04-04T20:42:09 gnulib-tool.py: Fix 'consider-using-set-comprehension' warnings. * pygnulib/GLImport.py (GLImport.prepare): Create a set directly instead of creating a list and passing it to a call of set(). (GLImport.__init__): Likewise. Use max() instead of getting the last element of a sorted list.
Collin Funk 6b97d904 2024-04-04T14:56:12 gnulib-tool.py: Fix pylint 'raise-missing-from' warnings. * pygnulib/*.py: Use explicit exception chaining so that stack trace messages do not seem like bugs. See examples in: <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00056.html>
Collin Funk 51e46581 2024-04-03T02:56:42 gnulib-tool.py: Modernize class declarations to Python 3. * pygnulib/GLConfig.py: Remove the explicit object inheritance from class declarations. This is previously required in Python 2. * pygnulib/GLEmiter.py: Likewise. * pygnulib/GLFileSystem.py: Likewise. * pygnulib/GLImport.py: Likewise. * pygnulib/GLInfo.py: Likewise. * pygnulib/GLMakefileTable.py: Likewise. * pygnulib/GLModuleSystem.py: Likewise. * pygnulib/GLTestDir.py: Likewise.
Collin Funk 519a00ed 2024-04-02T11:35:51 gnulib-tool.py: Use [] instead of list() to initialize empty lists. * pygnulib/*.py: Change occurrences of list() to [].
Collin Funk 4d9bdbf5 2024-04-01T19:13:16 gnulib-tool.py: Don't default to 'build-aux' for --auxdir. * pygnulib/GLConfig.py (GLConfig.__getitem__): Don't map '' to 'build-aux' for the 'auxdir' key. * pygnulib/GLImport.py (GLImport.__init__): Change conditional to use an empty string instead of None since this is returned when --auxdir is not used.
Bruno Haible 52a5f9e3 2024-04-02T13:42:53 gnulib-tool: Remove unused variables. * pygnulib/GLConfig.py: Remove unused variables. * pygnulib/GLEmiter.py: Likewise. * pygnulib/GLFileSystem.py: Likewise. * pygnulib/GLImport.py: Likewise. * pygnulib/GLInfo.py: Likewise. * pygnulib/GLModuleSystem.py: Likewise. * pygnulib/GLTestDir.py: Likewise. * pygnulib/main.py: Likewise. * gnulib-tool.sh (func_emit_tests_Makefile_am): Remove unused variable perhapsLT.
Collin Funk 836bb72b 2024-03-31T18:00:16 gnulib-tool.py: Use case-sensitive sorting for file names. * pygnulib/GLImport.py (GLImport.prepare): Remove the str.lower key from the call to sorted().
Collin Funk b14ce575 2024-03-31T17:41:03 gnulib-tool.py: Add missing quotation mark to reminder. * pygnulib/GLImport.py (GLImport.execute): Add missing end quote around file name in AC_CONFIG_FILES reminder.
Collin Funk 4b99fb11 2024-03-30T22:38:48 gnulib-tool.py: Fix output of 'po/LINGUAS'. * pygnulib/GLImport.py (GLImport.execute): Only use PO files when determining the output for po/LINGUAS.
Collin Funk aa3eb8a6 2024-03-30T03:23:46 gnulib-tool.py: Don't discard the 'dummy' module. * pygnulib/GLImport.py (GLImport.prepare): Don't set modules stored in the GLModuleTable until after the 'dummy' module is added. * pygnulib/GLModuleSystem.py (GLImport.setBaseModules) (GLImport.setFinalModules, GLImport.setMainModules) (GLImport.setTestsModules): Don't sort modules since the 'dummy' module should be placed last in the Makefiles.
Collin Funk cf04b7b1 2024-03-29T20:15:24 gnulib-tool.py: Fix reading of 'gl_VC_FILES' in gnulib-cache.m4. * pygnulib/GLImport.py (GLImport.__init__): Check for an empty string explicitly in conditional so False is not ignored.
Bruno Haible ca54b4ae 2024-03-29T22:48:37 gnulib-tool: Use bold output on Linux, NetBSD, OpenBSD, OmniOS consoles. Reported by Pádraig Brady in <https://lists.gnu.org/archive/html/bug-gnulib/2024-03/msg00399.html>. * gnulib-tool.sh (func_show_module_list): Use 'tput' to determine the "bold" capability of terminal types other than xterm*. * pygnulib/constants.py (get_terminfo_string, bold_escapes): New functions. * pygnulib/GLTestDir.py (GLTestDir.execute): Invoke constants.bold_escapes. * pygnulib/GLImport.py (GLImport.prepare): Likewise.
Collin Funk 89be3fb0 2024-03-29T06:09:20 gnulib-tool.py: Display specified modules in bold. * pygnulib/GLImport.py (GLImport.prepare): Detect terminals starting with 'xterm'. Change hexadecimal numbers to octal, matching gnulib-tool.sh. * pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.
Bruno Haible 4bcd2d10 2024-03-29T12:14:21 gnulib-tool.py: Don't print Makefile.am edits that are already done. * pygnulib/GLMakefileTable.py (GLMakefileTable): Improve comments. (GLMakefileTable.__getitem__): Do not clone the result. * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am, tests_Makefile_am): Avoid a KeyError when testing for 'var'. Use 'del' to remove a dictionary entry. * pygnulib/GLImport.py (GLImport.execute): Avoid a KeyError when testing for 'var'. Simplify loop over makefiletable.
Bruno Haible 628aa8a8 2024-03-28T23:33:56 gnulib-tool: Drop workarounds for Automake < 1.14. Reported by Collin Funk in <https://lists.gnu.org/archive/html/bug-gnulib/2024-03/msg00384.html>. * gnulib-tool.sh (func_emit_lib_Makefile_am): Emit pkgdata_DATA initialization always. (func_emit_tests_Makefile_am): Likewise. (func_import): Don't emit 'AC_REQUIRE([AM_PROG_CC_C_O])' into gnulib-comp.m4. (func_create_testdir): Don't emit AM_PROG_CC_C_O into configure.ac. Bump required Automake version to 1.14. (func_create_megatestdir): Bump required Automake version to 1.14. * pygnulib/constants.py: Update comments. * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Emit pkgdata_DATA initialization always. Don't return uses_subdirs. (GLEmiter.tests_Makefile_am): Likewise. * pygnulib/GLImport.py (GLImport.gnulib_comp): Don't emit 'AC_REQUIRE([AM_PROG_CC_C_O])'. (GLImport.execute): Update. * pygnulib/GLTestDir.py (GLTestDir.execute): Don't emit AM_PROG_CC_C_O into configure.ac. Bump required Automake version to 1.14. (GLMegaTestDir.execute): Bump required Automake version to 1.14.
Collin Funk d6d189fd 2024-03-27T17:39:58 gnulib-tool.py: Inline 'sed' invocations used on library files. * pygnulib/GLFileSystem.py (GLFileAssistant.__init__): Update type hints and docstrings to reflect changes necessary for using re.sub() instead of 'sed'. (GLFileAssistant.add_or_update): Use re.sub() instead of invoking 'sed'. * pygnulib/GLImport.py (GLImport.prepare): Update transformation variables to reflect changes to GLFileAssistant.
Collin Funk 148b623a 2024-03-27T00:56:29 gnulib-tool.py: Add type hints to all functions. * pygnulib/*.py: Add type hints and remove duplicate function signatures from docstrings.
Collin Funk 98b9e9ab 2024-03-26T15:43:21 gnulib-tool.py: Allow the use of both configure.ac and configure.in. * pygnulib/GLImport.py (GLImport.__init__): Remove redundant checks for configure.ac and configure.in. * pygnulib/main.py (main): Check for configure.ac and configure.in before reading it. Pass it to GLImport using the GLConfig object.
Bruno Haible 8cb8cd51 2024-03-25T13:44:24 gnulib-tool.py: Tweak last change. * pygnulib/GLImport.py (GLImport.execute): Recognize #if also at the beginning of an Include snippet.
Collin Funk 4d2e12f8 2024-03-25T01:56:24 gnulib-tool.py: Fix output of #include directive advice. * pygnulib/GLImport.py (GLImport.execute): Copy comment from gnulib-tool.sh with modified variable names. Search the 'Include:' as a whole instead of each individual line.
Bruno Haible 758ac273 2024-03-25T13:19:53 gnulib-tool.py: Simplify last change. * pygnulib/GLImport.py (GLImport.execute): Remove unnecessary list to set and set to list conversion.
Collin Funk 4318aecf 2024-03-24T18:51:29 gnulib-tool.py: Fix "Creating directory" output. * pygnulib/GLImport.py (GLImport.execute): Reorder directories. Use os.path.join instead of joinpath to avoid path normalization.
Bruno Haible 39519878 2024-03-25T12:53:34 gnulib-tool.py: Tweak last change. * pygnulib/GLImport.py (GLImport._update_ignorelist_): Rename some local variables. Use rstrip built-in function.
Collin Funk befde4d3 2024-03-24T22:20:15 gnulib-tool.py: Handle removed files in the vc ignore files. * pygnulib/GLImport.py (GLImport._update_ignorelist_): Handle removed files. Check whether the original lines should be removed too.
Collin Funk b73f7aad 2024-03-24T16:09:34 gnulib-tool.py: Fix filetable construction for ignorelist. * pygnulib/GLImport.py (GLImport.execute): Fix typo in dictionary key that overwrites removed files. Sort ignorelist by directory.
Bruno Haible 50a20932 2024-03-25T00:07:49 gnulib-tool.py: Use Python raw strings for regular expressions. * pygnulib/*.py: Use raw string syntax for regular expression pattern strings and repl strings.
Bruno Haible 4bdc4f17 2024-03-24T12:06:50 gnulib-tool.py: Fix output of notices. * pygnulib/GLTestDir.py (GLTestDir.execute): Don't print notices if the verbosity is < -1. Strip newlines from each notice. * pygnulib/GLImport.py (GLImport.prepare): Don't print notices if the verbosity is < -1. Strip only newlines, not spaces.
Collin Funk ab0c5149 2024-03-23T12:55:58 gnulib-tool.py: Don't print Python bools in gnulib-cache.m4. * pygnulib/GLImport.py (GLImport.gnulib_cache): Convert Python bools to lowercase before printing.
Bruno Haible 28a395a8 2024-03-23T11:20:29 gnulib-tool.py: Refactor. * pygnulib/GLImport.py (GLImport._done_dir_, GLImport._update_ignorelist_, GLImport.execute): Rename some variables. (GLImport._update_ignorelist_): Use constants.substart.
Collin Funk 02ef6091 2024-03-22T19:43:41 gnulib-tool.py: Follow gnulib-tool changes, part 69. Follow gnulib-tool change 2012-08-19 Bruno Haible <bruno@clisp.org> gnulib-tool: Remove old file names from .cvsignore, .gitignore. * pygnulib/GLImport.py (GLImport._update_ignorelist_): Add gnulib-comp.m4 to the added file list. (GLImport.execute): Remove unused variables. Use sets to match the 'join' invocations in gnulib-tool.sh.
Bruno Haible 74f000c7 2024-03-21T15:45:42 gnulib-tool: Make the .gitignore files handling more consistent. * gnulib-tool.sh (func_done_dir): Ignore the presence or absence of a .git directory if there is a .gitignore file in the same place. * pygnulib/GLImport.py (GLImport._done_dir_): Likewise.
Collin Funk 1daf1384 2024-03-19T12:09:57 gnulib-tool.py: Follow gnulib-tool changes, part 68. Follow gnulib-tool change 2022-07-31 Akim Demaille <akim@lrde.epita.fr> gnulib-tool: add support for --automake-subdir-tests * pygnulib/main.py (main): Add support for --automake-subdir-tests. * pygnulib/GLInfo.py (GLInfo.usage): Add --automake-subdir-tests to the help message. * pygnulib/GLConfig.py (GLConfig.__init__): Add 'automake_subdir_tests' to the parameter list. Initialize it. (GLConfig.default): Default --automake-subdir-tests to False. (GLConfig.resetAutomakeSubdir): Fix misleading docstring. (GLConfig.getAutomakeSubdirTests, GLConfig.setAutomakeSubdirTests) (GLConfig.resetAutomakeSubdirTests): New functions to manipulate and access whether --automake-subdir-tests is in use. * pygnulib/GLEmiter.py (GLEmiter.shellvars_init) (GLEmiter.initmacro_end): Use sourcebase when handling tests and --automake-subdir-tests is given. * pygnulib/GLError.py (GLError.__repr__): Update error message to include --automake-subdir-tests. * pygnulib/GLImport.py (GLImport.__init__): Check for the 'subdir-objects' Automake option when --automake-subdir-tests is in use. (GLImport.actioncmd): Add --automake-subdir-tests to the actioncmd printed in generated files.
Collin Funk ec24c247 2024-03-19T12:25:37 gnulib-tool.py: Fix incorrect assignment operator. * pygnulib/GLImport.py (GLImport.actioncmd): Use '+=' instead of '=' to append the string to the actioncmd instead of overwriting it.
Collin Funk 9e1af292 2024-03-18T20:01:50 gnulib-tool.py: Make sure temporary files are removed. * pygnulib/GLImport.py (GLImport.execute): Fix nesting of statement so that both temporary files are removed.
Collin Funk 38c4c2fc 2024-03-18T19:58:37 gnulib-tool.py: Follow gnulib-tool changes, part 67. Follow gnulib-tool change 2022-03-01 Paul Eggert <eggert@cs.ucla.edu> Create lib/Makefile.am after gnulib-comp.m4 * pygnulib/GLImport.py (GLImport.execute): Create library makefile after creating gnulib-comp.m4.
Collin Funk 5572bd3f 2024-03-18T12:23:46 gnulib-tool.py: Follow gnulib-tool changes, part 65. Follow gnulib-tool change 2021-12-19 Bruno Haible <bruno@clisp.org> gnulib-tool: Don't insist on ACLOCAL_AMFLAGS. * pygnulib/GLImport.py (GLImport.execute): Don't add extra '-I' before m4 directory in ACLOCAL_AMFLAGS. Prefer '0' instead of 'int()'. Mention the use of AC_CONFIG_MACRO_DIRS in configure.ac as an alternative to augmenting ACLOCAL_AMFLAGS. * pygnulib/main.py (main): To find the m4 directories, look also for AC_CONFIG_MACRO_DIR and AC_CONFIG_MACRO_DIRS invocations in configure.ac. Remove unnecessary call to 'joinpath' since it accepts a variable length of arguments.
Bruno Haible 2d1da7b3 2024-03-18T00:43:53 gnulib-tool.py: Handle empty lists of lines consistently. * pygnulib/constants.py (lines_to_multiline): New function. (nlremove): Remove unused function. * pygnulib/GLEmiter.py (_eliminate_NMD): Use lines_to_multiline instead of the '\n'.join idiom. (GLEmiter.autoconfSnippet, GLEmiter.autoconfSnippets, GLEmiter.lib_Makefile_am): Likewise. * pygnulib/GLImport.py (GLImport._update_ignorelist_, GLImport.execute): Likewise. * pygnulib/GLModuleSystem.py (GLModule.getDependenciesRecursively, GLModule.getLinkDirectiveRecursively, GLModuleTable.remove_if_blocks): Likewise. * pygnulib/GLTestDir.py (GLTestDir.execute): Likewise. * pygnulib/main.py (main): Likewise.
Bruno Haible ac3f2516 2024-03-17T13:46:04 gnulib-tool: Add undocumented option --gnulib-dir. * gnulib-tool.sh: Accept --gnulib-dir=... option. * pygnulib/constants.py (init_DIRS): New function. * pygnulib/main.py (main): Accept --gnulib-dir=... option. Invoke init_DIRS. Expect .git directory to be present in DIRS['root'], not APP['root']. * pygnulib/GLImport.py (GLImport.execute): Use DIRS['root'], not APP['root'].
Collin Funk 615bd182 2024-03-12T13:01:50 gnulib-tool.py: Follow gnulib-tool changes, part 56. Follow gnulib-tool change 2021-04-26 Paul Eggert <eggert@cs.ucla.edu> gnulib-tool: port better to current Autoconf * pygnulib/GLImport.py (GLImport.execute): Remove exit() call before printing reminders. Suggest replacing AC_PROG_CC_STDC and AC_PROG_CC_C99, as per current Autoconf.
Collin Funk f99424d6 2024-03-11T18:50:28 gnulib-tool.py: Follow gnulib-tool changes, part 55. Follow gnulib-tool changes 2022-01-05 Bruno Haible <bruno@clisp.org> gnulib-tool: Avoid known warnings that reflect Gnulib's coding style. 2022-01-08 Bruno Haible <bruno@clisp.org> gnulib-tool: Remove all *.Po files upon distclean (regr. 2022-01-05). * pygnulib/GLEmiter.py (GLEmiter.initmacro_end): Collect the *.Po or *.Plo files to remove into an AC_SUBSTed variable gl_LIBOBJDEPS. Use Python f-strings instead of string replacements. (GLEmiter.lib_Makefile_am): Add the GL_CFLAG_GNULIB_WARNINGS to the CFLAGS of all the compilation units of the library. Extend the distclean and maintainer-clean rules. (GLEmiter.tests_Makefile_am): Add the GL_CFLAG_GNULIB_WARNINGS to the CFLAGS. * pygnulib/GLImport.py (GLImport.gnulib_comp): Emit an invocation of gl_CC_GNULIB_WARNINGS.
Bruno Haible 2045ee72 2024-03-11T12:49:24 gnulib-tool.py: Make some code more straightforward. * pygnulib/GLImport.py (GLImport.__init__): Reorder assignments and conditions slightly.
Collin Funk b6fe9a16 2024-03-10T21:50:59 gnulib-tool.py: Follow gnulib-tool changes, part 52. Follow gnulib-tool change 2021-12-15 Bruno Haible <bruno@clisp.org> automake-subdir support: Look for 'subdir-objects' also in configure.ac. * pygnulib/GLImport.py (GLImport.__init__): Check for 'subdir-objects' in the AM_INIT_AUTOMAKE macro of configure.ac.
Bruno Haible 3088ee22 2024-03-10T23:47:58 gnulib-tool.py: Tweak last commit. * pygnulib/GLEmiter.py (GLEmiter.initmacro_end): Avoid an implicit str to bool conversion. * pygnulib/GLImport.py (GLImport.__init__): Add a comment. Don't allow a '|' in place of whitespace. Don't emit redundant gl_source_base assignments.
Collin Funk 270c20cb 2024-03-10T14:07:35 gnulib-tool.py: Follow gnulib-tool changes, part 51. Follow gnulib-tool change 2021-12-15 Bruno Haible <bruno@clisp.org> Accommodate non-recursive Automake in a less hacky way. * pygnulib/GLConfig.py (GLConfig.__init__): Add 'automake_subdir' to the parameter list. (GLConfig.default): Set the default value of automake_subdir to a boolean False. (GLConfig.getAutomakeSubdir, GLConfig.setAutomakeSubdir) (GLConfig.resetAutomakeSubdir): New functions to access and manipulate the automake_subdir option. * pygnulib/GLEmiter.py (GLEmiter.shellvars_init): New function. (GLEmiter.initmacro_end): Add second parameter 'gentests'. Use it to prefix each object file name in *_LIBOBJS and *_LTLIBOBJS. * pygnulib/GLError.py (GLError.__init__, GLError.__repr__): Add new error for if --automake-subdir is used without the 'subdir-objects' Automake option. * pygnulib/GLImport.py (GLImport.__init__): Check for 'subdir-objects' in Makefile.am. (GLImport.actioncmd): Emit --automake-subdir in actioncmd. (GLImport.gnulib_cache): Add gl_AUTOMAKE_SUBDIR to gnulib-cache.m4 if --automake-subdir is used. (GLImport.gnulib_comp): Update calls to GLEmiter.initmacro_end. Call GLEmiter.shellvars_init. (GLImport.execute): Likewise. Use the build-aux/prefix-gnulib-mk script. * pygnulib/GLInfo.py (GLInfo.usage): Add --automake-subdir to the usage message. * pygnulib/GLTestDir.py (GLTestDir.execute): Update calls to GLEmiter.initmacro_end. Call GLEmiter.shellvars_init. * pygnulib/main.py (main): Add support for --automake-subdir.
Collin Funk d15237a2 2024-03-09T01:41:02 gnulib-tool.py: Follow gnulib-tool changes, part 50. Follow gnulib-tool changes 2021-12-12 Bruno Haible <bruno@clisp.org> gnulib-tool: Try to support non-recursive-gnulib-prefix-hack with tests. 2021-12-13 Bruno Haible <bruno@clisp.org> gnulib-tool: Fix mistake in last commit. * pygnulib/GLImport.py (GLImport.gnulib_comp): Expect the filetable as a parameter instead of a list of all files. Add type checks. Invoke AC_CONFIG_LIBOBJ_DIR based on the location of alloca.c. (GLImport.execute): Adjust call to GLImport.gnulib_comp to reflect parameter changes.
Collin Funk 6038b3fa 2024-03-06T21:49:21 gnulib-tool.py: Follow gnulib-tool changes, part 45. Follow gnulib-tool changes 2021-12-12 Bruno Haible <bruno@clisp.org> gnulib-tool: Support different basenames for the lib/,tests/ Makefiles. 2022-01-08 Bruno Haible <bruno@clisp.org> gnulib-tool: Fix "Don't forget" messages (regression 2021-12-12). * pygnulib/GLConfig.py (GLConfig.__init__): Add 'tests_makefile_name' argument. (GLConfig.getMakefileName, GLConfig.setMakefileName) (GLConfig.resetMakefileName): Remove references to tests Makefile.am in doc strings. (GLConfig.getTestsMakefileNamem, GLConfig.setTestsMakefileName) (GLConfig.resetTestsMakefileName): New methods used to access value passed with the '--tests-makefile-name' option. * pygnulib/GLImport.py (GLImport.__init__): Check for 'gl_TESTS_MAKEFILE_NAME' in cache. (GLImport.actioncmd): Output --tests-makefile-name when describing gnulib-tool invocation. (GLImport.gnulib_cache): Output 'gl_TESTS_MAKEFILE_NAME' to cache. (GLImport.execute): Use two local variables, source_makefile_am and tests_makefile_am, which are passed to gnulib-tool.py or given default values. * pygnulib/GLInfo.py (GLInfo.usage): Add '--tests-makefile-name' to usage message. * pygnulib/GLMakefileTable.py (GLMakefileTable.parent): Reduce code duplication by expecting Makefile names passed as arguments. * pygnulib/main.py (main): Add support for '--tests-makefile-name'.
Collin Funk 1a54a8c0 2024-03-05T23:47:08 gnulib-tool.py: Follow gnulib-tool changes, part 43. Follow gnulib-tool change 2021-06-10 Bruno Haible <bruno@clisp.org> Clarify that compiler warnings in the Gnulib tests can be ignored. * pygnulib/GLEmiter.py (GLEmiter.initmacro_start): Add boolean argument to control whether gl_CC_ALLOW_WARNINGS and gl_CXX_ALLOW_WARNINGS should be required. (GLEmiter.tests_Makefile_am): Emit overrides for CFLAGS and CXXFLAGS. Emit a dependency of 'all' on 'all-notice' that prints a warning that compiler warnings can be ignored for tests. * pygnulib/GLImport.py (GLImport.gnulib_comp): Add boolean argument to tell whether a tests Makefile.am is being emitted. Update calls to GLEmiter.initmacro_start. (GLImport.execute): Update calls to GLEmiter.initmacro_start. * pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.
Collin Funk 0efb0d92 2024-03-05T20:44:17 gnulib-tool.py: Fix gnulib-cache.m4 output. * pygnulib/GLImport.py (GLImport.gnulib_cache): Don't emit an extra '#' to start the actioncmd comment.
Collin Funk ca739255 2024-03-05T20:32:29 gnulib-tool.py: Follow gnulib-tool changes, part 42. Follow gnulib-tool change 2019-02-15 Bruno Haible <bruno@clisp.org> gnulib-tool: Support --import with just a few tests, not --with-tests. * pygnulib/GLImport.py (GLImport.execute): Use 'gentests' instead of 'inctests' when generating files. * pygnulib/GLMakefileTable.py (GLMakefileTable.parent): Add 'gentests' argument and use it instead of 'inctests'.
Collin Funk ac2a9bba 2024-03-05T16:30:20 gnulib-tool.py: Follow gnulib-tool changes, part 41. Follow gnulib-tool change 2018-09-03 Bruno Haible <bruno@clisp.org> gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase. * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Consider the dotfirst flag. (GLEmiter.tests_Makefile_am): Don't consider the dotfirst flag. * pygnulib/GLImport.py (GLImport.execute): Set the dotfirst for tests. * pygnulib/GLMakefileTable.py (GLMakefileTable.editor): Add optional dotfirst flag to fix build order when $testsbase is a subdir of $sourcebase.
Collin Funk 79207d3a 2024-03-05T02:11:51 gnulib-tool.py: Fix incorrect tests Makefile.am generation. * pygnulib/GLImport.py: Call GLEmiter.tests_Makefile_am instead of GLEmiter.lib_Makefile_am when creating the tests Makefile. Replace incorrect actioncmd argument with witness_macro.
Collin Funk 2ef79f83 2024-03-04T12:35:15 gnulib-tool.py: Follow gnulib-tool changes, part 39. Follow gnulib-tool change 2017-12-28 Bruno Haible <bruno@clisp.org> gnulib-tool: Make --conditional-dependencies work better. * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Add argument referenceable_modules. Use referencable_modules for dependencies. * pygnulib/GLImport.py (GLImport.__init__): Don't reject the combination of --conditional-dependencies with --with-tests when mode is 'import'. (GLImport.gnulib_comp): Pass it. * pygnulib/GLTestDir.py (GLTestDir.execute): Pass it.
Collin Funk 7d60a47a 2024-02-28T22:15:04 gnulib-tool.py: Follow gnulib-tool changes, part 35. Follow gnulib-tool change 2023-05-28 Bruno Haible <bruno@clisp.org> warnings, manywarnings: Assume autoconf >= 2.64. * pygnulib/GLConfig.py (GLConfig.default, GLConfig.getAutoconfVersion) (GLConfig.setAutoconfVersion, resetAutoconfVersion): Set required Autoconf version to 2.64. * pygnulib/GLError.py (GLError.__init__, GLError.__repr__): Likewise. * pygnulib/GLImport.py (GLImport.__init__): Likewise. * pygnulib/constants.py (DEFAULT_AUTOCONF_MINVERSION): Likewise. * pygnulib/main.py: Likewise.
Collin Funk c18439c1 2024-02-28T03:33:15 gnulib-tool.py: Make module sorting more similar to gnulib-tool. * pygnulib/GLImport.py (GLImport.__init__): Sort modules when mode is 'import'. (GLImport.actioncmd): Don't sort modules while creating actioncmd. Use preferred quoting style.
Collin Funk e1f51c8e 2024-02-27T02:01:59 gnulib-tool.py: Follow gnulib-tool changes, part 31. Follow gnulib-tool change 2021-06-04 Bruno Haible <bruno@clisp.org> gnulib-tool: Stop doing license notice replacements. * pygnulib/GLConfig.py (GLConfig.default): Remove 'copyrights' key. Add 'gnu_make' key which returns False. (checkCopyrights): Remove function. (setSymbolic, resetSymbolic): Remove 'copyrights' key. * pygnulib/GLImport.py (GLImport.prepare): Remove copyrights variable. Don't modify license notice on source files. (GLImport.execute): Remove copyrights variable.
Collin Funk fa13cc7a 2024-02-26T21:46:30 gnulib-tool.py: Follow gnulib-tool changes, part 30. Follow gnulib-tool change 2021-05-30 Bruno Haible <bruno@clisp.org> Write 'LGPLv3+ or GPLv2+' instead of 'LGPLv3+ or GPLv2'. * pygnulib/GLImport.py (GLImport.prepare): Change. * pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.
Collin Funk b4bbad42 2024-02-23T20:52:15 gnulib-tool.py: Follow gnulib-tool changes, part 28. Follow gnulib-tool change 2018-07-17 Paul Eggert <eggert@cs.ucla.edu> gnulib-tool: limit line length for git send-email * pygnulib/GLImport.py (GLImport.actioncmd): Break actioncmd into multiple lines. Reorder emitting of arguments to match gnulib-tool. Emit "--witness-c-macro" instead of "--witness_c_macro". Emit "--po-domain" instead of "--podomain". Document ordering of unimplemented options. Add updated comments documenting line length limitations of git send-email and some implementations of AWK. * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Remove comment which was moved to pygnulib/GLImport.py. Remove length limitation on actioncmd since it now spans multiple lines.
Collin Funk 992d5548 2024-02-22T20:16:18 gnulib-tool.py: Follow gnulib-tool changes, part 27. Follow gnulib-tool changes 2017-03-12 Paul Eggert <eggert@cs.ucla.edu> gnulib-tool: new option --gnu-make 2017-03-13 Paul Eggert <eggert@cs.ucla.edu> gnulib-tool: minor --gnu-make fixups 2017-03-14 Paul Eggert <eggert@cs.ucla.edu> gnulib-tool: fix typo in comment output 2017-05-14 Paul Eggert <eggert@cs.ucla.edu> gnulib-tool: improve GNU Make debugging 2018-07-04 Paul Eggert <eggert@cs.ucla.edu> gnulib-tool: minor tweaks for --gnu-make * gnulib-tool.py (main): Add --gnu-make option. Do not allow --gnu-make in test modes, since they all require Automake. * pygnulib/GLConfig.py: Add gnu_make argument to constructor. (getGnuMake, setGnuMake, resetGnuMake): New methods for accessing the gnu_make instance variable. * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Use the "+=" operator with GNU Make and Automake. Transform conditionals to GNU Make syntax if --gnu-make is in use. Use a Autoconf subprocess to define values and check the return code for errors. (GLEmiter.tests_Makefile_am): Likewise. * pygnulib/GLImport.py (GLImport.actioncmd): Add "--gnu-make" to the output comment if it is in use. (GLImport.gnulib_comp): Don't require "AM_PROG_CC_C_O" when using GNU Make. * pygnulib/GLInfo.py (GLInfo.usage): Update help message to reflect addition of --gnu-make. * pygnulib/GLModuleSystem.py (GLModuleTable.transitive_closure): Don't add Automake snippets as unconditional dependencies when using --gnu-make.
Collin Funk e49237df 2024-02-18T16:52:45 gnulib-tool.py: Fix function call on incorrect object. * pygnulib/GLImport.py: Call checkInclTestCategory on the GLConfig member instead of the GLImport object itself. * pygnulib/__init__.py: Update copyright dates. * pygnulib/constants.py: Update copyright dates.
Simon Josefsson 5b92dd0a 2024-01-01T10:31:48 maint: run 'make update-copyright'
Paul Eggert 295cc7fb 2023-06-08T14:53:51 Spelling fixes Most of these were reported by Josh Soref <jsoref@gmail.com> in: https://lists.gnu.org/r/bug-gnulib/2023-06/msg00057.html except that some are omitted because the original is OK (e.g., "obsolescent"), and some are omitted because they are upstream files and I've fixed them upstream or have filed bug reports, and I made a few nearby corrections to grammar.
Mitch Capper 89ddbe82 2023-06-01T15:50:56 gnulib-tool.py: Fix a format string mistake. * pygnulib/GLImport.py (GLImport.execute): Fix a typo in a format string. Copyright-paperwork-exempt: Yes
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 bc3d94bb 2022-08-09T23:59:40 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.
Bruno Haible 98e7ca35 2022-08-09T16:11:09 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.
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 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.