]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Write newlines consistently.
authorCollin Funk <collin.funk1@gmail.com>
Sun, 14 Apr 2024 17:31:34 +0000 (10:31 -0700)
committerBruno Haible <bruno@clisp.org>
Sun, 14 Apr 2024 22:02:51 +0000 (00:02 +0200)
* 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.

ChangeLog
pygnulib/GLImport.py
pygnulib/GLModuleSystem.py
pygnulib/constants.py
pygnulib/main.py

index e4cc059cc760d10ceeaf4a21b0b05b89dfcfa82a..806b77faa6f314d86435e667a2cdd6c741235c53 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-04-14  Collin Funk  <collin.funk1@gmail.com>
+
+       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.
+
 2024-04-14  Collin Funk  <collin.funk1@gmail.com>
 
        gnulib-tool.py: Don't perform newline conversions.
index eaff520fa43dfe754a4ac98c8ae7e9942eda5a0c..c6a4693c90433f8bf549c7f41dd8c55f25a5d696 100644 (file)
@@ -649,7 +649,7 @@ AC_DEFUN([%s_EARLY],
             emit += '  # Code from module %s:\n' % str(module)
             snippet = module.getAutoconfEarlySnippet()
             lines = [ line
-                      for line in snippet.split(constants.NL)
+                      for line in snippet.split('\n')
                       if line != '' ]
             if lines:
                 emit += '  %s\n' % '\n  '.join(lines)
index 11cd6ef78a51f2ec0c306fd1aab25c7a75b726a0..82b3c2f6e5a6d55924609597a9b7dd0194b81a9f 100644 (file)
@@ -592,11 +592,11 @@ class GLModule:
                 # *-tests module live in tests/, not lib/.
                 # Synthesize an EXTRA_DIST augmentation.
                 files = self.getFiles()
-                extra_files = filter_filelist(constants.NL, files,
+                extra_files = filter_filelist('\n', files,
                                               'tests/', '', 'tests/', '')
                 if extra_files != '':
-                    result += 'EXTRA_DIST += %s' % ' '.join(extra_files.split(constants.NL))
-                    result += constants.NL * 2
+                    result += 'EXTRA_DIST += %s' % ' '.join(extra_files.split('\n'))
+                    result += '\n' * 2
             else:  # if not tests module
                 # Synthesize an EXTRA_DIST augmentation.
                 snippet = self.getAutomakeSnippet_Conditional()
@@ -609,10 +609,10 @@ class GLModule:
                                         for line in mentioned_files
                                         for filename in line.split() }
                 all_files = self.getFiles()
-                lib_files = filter_filelist(constants.NL, all_files,
+                lib_files = filter_filelist('\n', all_files,
                                             'lib/', '', 'lib/', '')
                 if lib_files != '':
-                    lib_files = set(lib_files.split(constants.NL))
+                    lib_files = set(lib_files.split('\n'))
                 else:
                     lib_files = set()
                 # Remove mentioned_files from lib_files.
@@ -632,17 +632,17 @@ class GLModule:
                 # a .c file is preprocessed into another .c file for BUILT_SOURCES -,
                 # automake will generate a useless dependency; this is harmless.
                 if str(self) != 'relocatable-prog-wrapper' and str(self) != 'pt_chown':
-                    extra_files = filter_filelist(constants.NL, extra_files,
+                    extra_files = filter_filelist('\n', extra_files,
                                                   '', '.c', '', '')
                     if extra_files != '':
-                        result += 'EXTRA_lib_SOURCES += %s' % ' '.join(extra_files.split(constants.NL))
+                        result += 'EXTRA_lib_SOURCES += %s' % ' '.join(extra_files.split('\n'))
                         result += '\n\n'
                 # Synthesize an EXTRA_DIST augmentation also for the files in build-aux
-                buildaux_files = filter_filelist(constants.NL, all_files,
+                buildaux_files = filter_filelist('\n', all_files,
                                                  'build-aux/', '', 'build-aux/', '')
                 if buildaux_files != '':
                     buildaux_files = [ os.path.join('$(top_srcdir)', joinpath(auxdir, filename))
-                                       for filename in buildaux_files.split(constants.NL) ]
+                                       for filename in buildaux_files.split('\n') ]
                     result += 'EXTRA_DIST += %s' % ' '.join(buildaux_files)
                     result += '\n\n'
             self.cache['makefile-unconditional'] = result
index 2eedad40eb2b3889b8112c02b85d445468f9f058..899ba46efdb40e79260a89beabfc609c26281691 100644 (file)
@@ -55,8 +55,6 @@ UTILS = dict()  # Utilities
 ENCS = dict()  # Encodings
 MODES = dict()  # Modes
 TESTS = dict()  # Tests
-NL = '''
-'''  # Newline character
 
 # Set ENCS dictionary
 if not hasattr(interpreter, '__file__'):
index b24db139b54b4d37084a86a667de539306f3b7c4..fd39cf07a68f7115f6b88e80a58a9de1c2632751 100644 (file)
@@ -1414,11 +1414,11 @@ def main_with_exception_handling() -> None:
                 message += 'missing --lib option'
             elif errno == 11:
                 incompatibilities = ''
-                message += 'incompatible license on modules:%s' % constants.NL
+                message += 'incompatible license on modules:\n'
                 for pair in errinfo:
                     incompatibilities += pair[0]
                     incompatibilities += ' %s' % pair[1]
-                    incompatibilities += constants.NL
+                    incompatibilities += '\n'
                 tempname = mktemp()
                 with open(tempname, mode='w', newline='\n', encoding='utf-8') as file:
                     file.write(incompatibilities)