|
From: | Bruno Haible |
Subject: | Re: updating gnulib-tool.py |
Date: | Mon, 08 Aug 2022 00:59:10 +0200 |
Today's changes: 2022-08-07 Bruno Haible <bruno@clisp.org> gnulib-tool.py: Finish implementing option --extract-test-module. * gnulib-tool.py (main): Accept option --extract-tests-module. gnulib-tool.py: Fix handling of nonexistent module names in --extract-*. * gnulib-tool.py (main): To test whether a module exists, just call GLModuleSystem.find and test its return value. 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. gnulib-tool.py: Rename a method. * 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. 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. * pygnulib/GLModuleSystem.py (GLModule): Rename field 'module' to 'path'. Fix a typo in a TypeError message. gnulib-tool.py: Simplify. * pygnulib/GLModuleSystem.py (GLModule): Convert Windows newlines right after reading the module description, not in every accessor. gnulib-tool.py: Reduce code duplication. * pygnulib/GLModuleSystem.py (GLModule): Declare two regexes are class variables. 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'. gnulib-tool.py: Fix some regexes. * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Use an equivalent regex as gnulib-tool. * pygnulib/GLTestDir.py (GLTestDir.execute): Likewise. 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. 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. 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. gnulib-tool.py: Make regex uses more straightforward. * pygnulib/GLEmiter.py: Don't use flag re.S on regular expressions on regular expressions with no '.'. * pygnulib/GLImport.py: Likewise. 2022-08-06 Bruno Haible <bruno@clisp.org> gnulib-tool.py: Fix output in --dry-run mode. * pygnulib/GLImport.py (GLImport._update_ignorelist_): In dry-run mode, say "Update", not "Updating". gnulib-tool.py: Finish implementing options --vc-files, --no-vc-files. * gnulib-tool.py (main): Accept options --vc-files, --no-vc-files. * pygnulib/GLImport.py (GLImport.__init__): Correct parsing of gl_VC_FILES directive. (GLImport.gnulib_cache): Don't treat the value False like None. (GLImport.execute): Skip the .gitignore file manipulations if vc_files is False. gnulib-tool.py: Finish implementing option --witness-c-macro. * gnulib-tool.py (main): Accept option --witness-c-macro. * pygnulib/GLConfig.py (GLConfig.__init__): Remove wrong type check of witness_c_macro argument.
0001-gnulib-tool.py-Finish-implementing-option-witness-c-.patch
Description: Text Data
0002-gnulib-tool.py-Finish-implementing-options-vc-files-.patch
Description: Text Data
0003-gnulib-tool.py-Fix-output-in-dry-run-mode.patch
Description: Text Data
0005-gnulib-tool.py-Make-regex-uses-more-straightforward.patch
Description: Text Data
0006-gnulib-tool.py-Make-regex-uses-more-straightforward.patch
Description: Text Data
0007-gnulib-tool.py-Make-regex-uses-more-straightforward.patch
Description: Text Data
0008-gnulib-tool.py-Fix-some-regex-uses.patch
Description: Text Data
0009-gnulib-tool.py-Fix-some-regexes.patch
Description: Text Data
0011-gnulib-tool.py-Implement-option-find.patch
Description: Text Data
0012-gnulib-tool.py-Reduce-code-duplication.patch
Description: Text Data
0013-gnulib-tool.py-Simplify.patch
Description: Text Data
0014-gnulib-tool.py-Improve-field-naming.patch
Description: Text Data
0015-gnulib-tool.py-Fix-section-extraction-from-module-de.patch
Description: Text Data
0016-gnulib-tool.py-Rename-a-method.patch
Description: Text Data
0017-gnulib-tool.py-Fix-extract-dependencies-result.patch
Description: Text Data
0018-gnulib-tool.py-Fix-handling-of-nonexistent-module-na.patch
Description: Text Data
0019-gnulib-tool.py-Finish-implementing-option-extract-te.patch
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |