+2024-03-09 Collin Funk <collin.funk1@gmail.com>
+
+ gnulib-tool.py: Follow gnulib-tool changes, part 48.
+ Follow gnulib-tool change
+ 2019-01-23 Bruno Haible <bruno@clisp.org>
+ gnulib-tool: Support running testdirs on Android.
+ * pygnulib/GLError.py (GLError.__init__, GLError.__repr__): Add errno 20
+ to print an error if patching build-aux/test-driver fails.
+ * pygnulib/main.py (main): Likewise.
+ * pygnulib/GLTestDir.py (_patch_test_driver): New private function which
+ runs patch on build-aux/test-driver with build-aux/test-driver.diff.
+ (GLTestDir.execute, GLMegaTestDir.execute): Check for
+ build-aux/test-driver in each testdir and patch it after running
+ automake.
+
2024-03-08 Collin Funk <collin.funk1@gmail.com>
gnulib-tool: Don't remove comments referencing @NMD@.
--------------------------------------------------------------------------------
-commit 425ee42259b04956aae20afc5204775ae6e79744
-Author: Bruno Haible <bruno@clisp.org>
-Date: Wed Jan 23 05:11:54 2019 +0100
-
- gnulib-tool: Support running testdirs on Android.
-
- * build-aux/test-driver.diff: New file.
- * gnulib-tool (func_create_testdir, func_create_megatestdir): Patch
- build-aux/test-driver after running automake.
-
---------------------------------------------------------------------------------
-
commit ce8a5edbc49dea0cb859207c2d063dbd3be0f96c
Author: Bruno Haible <bruno@clisp.org>
Date: Fri Jan 4 19:34:19 2019 +0100
17: cannot update the given file: <file>
18: module lacks a license: <module>
19: could not create destination directory: <directory>
+ 20: could not patch test-driver script
errinfo: additional information'''
self.errno = errno
self.errinfo = errinfo
message = "module lacks a license: %s" % repr(errinfo)
elif errno == 19:
message = "error when running subprocess: %s" % repr(errinfo)
+ elif errno == 20:
+ message = 'could not patch test-driver script'
self.message = '[Errno %d] %s' % (errno, message)
return self.message
normpath = os.path.normpath
+def _patch_test_driver() -> None:
+ '''Patch the test-driver script in testdirs.'''
+ test_driver = joinpath('build-aux', 'test-driver')
+ diff = joinpath(DIRS['root'], joinpath('build-aux', 'test-driver.diff'))
+ command = f'patch {test_driver} < {diff}'
+ try:
+ result = sp.call(command, shell=True)
+ if result != 0:
+ raise GLError(20, None)
+ except OSError:
+ raise GLError(20, None)
+
+
#===============================================================================
# Define GLTestDir class
#===============================================================================
'LIBTOOLIZE=%s' % UTILS['libtoolize'],
'distclean']
sp.call(args)
+ os.chdir(self.testdir)
+ if isfile(joinpath('build-aux', 'test-driver')):
+ _patch_test_driver()
+ os.chdir(DIRS['cwd'])
sp.call(['rm', '-rf', self.config['tempdir']], shell=False)
args = [UTILS['automake'], '--add-missing', '--copy']
constants.execute(args, verbose)
shutil.rmtree('autom4te.cache')
+ if isfile(joinpath('build-aux', 'test-driver')):
+ _patch_test_driver()
os.chdir(DIRS['cwd'])
sp.call(['rm', '-rf', self.config['tempdir']], shell=False)
message += 'module %s lacks a license' % errinfo
elif errno == 19:
message += 'could not create destination directory: %s' % errinfo
+ elif errno == 20:
+ message += 'could not patch test-driver script'
message += '\n%s: *** Stop.\n' % constants.APP['name']
sys.stderr.write(message)
sys.exit(1)