+2024-04-14 Collin Funk <collin.funk1@gmail.com>
+
+ 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.
+
2024-04-14 Bruno Haible <bruno@clisp.org>
users.txt: Update some more entries.
if file.startswith('m4/'):
file = constants.substart('m4/', '', file)
emit += 'EXTRA_DIST += %s\n' % file
- emit = constants.nlconvert(emit)
with open(destfile, mode='w', newline='\n', encoding='utf-8') as file:
file.write(emit)
emit += 'AH_TOP([#include \"../config.h\"])\n\n'
emit += 'AC_CONFIG_FILES([Makefile])\n'
emit += 'AC_OUTPUT\n'
- emit = constants.nlconvert(emit)
path = joinpath(self.testdir, testsbase, 'configure.ac')
with open(path, mode='w', newline='\n', encoding='utf-8') as file:
file.write(emit)
emit += 'AUTOMAKE_OPTIONS = 1.14 foreign\n\n'
emit += 'SUBDIRS = %s\n\n' % ' '.join(subdirs)
emit += 'ACLOCAL_AMFLAGS = -I %s\n' % m4base
- emit = constants.nlconvert(emit)
path = joinpath(self.testdir, 'Makefile.am')
with open(path, mode='w', newline='\n', encoding='utf-8') as file:
file.write(emit)
emit += ' ) 2>&1 | { if test -n "$AUTOBUILD_SUBST"; then '
emit += 'sed -e "$AUTOBUILD_SUBST"; else cat; fi; } > logs/$safemodule\n'
emit += 'done\n'
- emit = constants.nlconvert(emit)
path = joinpath(self.megatestdir, 'do-autobuild')
with open(path, mode='w', newline='\n', encoding='utf-8') as file:
file.write(emit)
emit += 'AUTOMAKE_OPTIONS = 1.14 foreign\n\n'
emit += 'SUBDIRS = %s\n\n' % ' '.join(megasubdirs)
emit += 'EXTRA_DIST = do-autobuild\n'
- emit = constants.nlconvert(emit)
path = joinpath(self.megatestdir, 'Makefile.am')
with open(path, mode='w', newline='\n', encoding='utf-8') as file:
file.write(emit)
emit += 'AC_CONFIG_SUBDIRS([%s])\n' % ' '.join(megasubdirs)
emit += 'AC_CONFIG_FILES([Makefile])\n'
emit += 'AC_OUTPUT\n'
- emit = constants.nlconvert(emit)
path = joinpath(self.megatestdir, 'configure.ac')
with open(path, mode='w', newline='\n', encoding='utf-8') as file:
file.write(emit)
import os
import sys
import stat
-import platform
import shutil
import tempfile
import subprocess as sp
return result
-def nlconvert(text: str) -> str:
- '''Convert line-endings to specific for this platform.'''
- system = platform.system().lower()
- text = text.replace('\r\n', '\n')
- if system == 'windows':
- text = text.replace('\n', '\r\n')
- return text
-
-
def remove_trailing_slashes(text: str) -> str:
'''Remove trailing slashes from a file name, except when the file name
consists only of slashes.'''