From a98aceb806a9d587010b4299398a7e4f71e63503 Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Thu, 7 Mar 2024 03:11:55 -0800 Subject: [PATCH] gnulib-tool.py: Fix errors when executing --create-megatestdir. * pygnulib/GLTestDir.py (GLMegaTestDir.execute): Create a testdir for each module in its own subdirectory. Create a testdir with all modules in 'ALL'. Add missing join call on str object. Don't emit 'configure.ac' into 'Makefile.am'. Make sure commands are executed in the proper directory. --- ChangeLog | 9 +++++++++ pygnulib/GLTestDir.py | 11 ++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0858f6d878..f85da3af66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2024-03-07 Collin Funk + + gnulib-tool.py: Fix errors when executing --create-megatestdir. + * pygnulib/GLTestDir.py (GLMegaTestDir.execute): Create a testdir for + each module in its own subdirectory. Create a testdir with all modules + in 'ALL'. Add missing join call on str object. Don't emit 'configure.ac' + into 'Makefile.am'. Make sure commands are executed in the proper + directory. + 2024-03-07 Collin Funk gnulib-tool.py: Follow gnulib-tool changes, part 46. diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py index 296356bd91..8a3072ea09 100644 --- a/pygnulib/GLTestDir.py +++ b/pygnulib/GLTestDir.py @@ -894,7 +894,7 @@ class GLMegaTestDir(object): # First, all modules one by one. for module in modules: self.config.setModules([str(module)]) - #GLTestDir(self.config, self.megatestdir).execute() + GLTestDir(self.config, joinpath(self.megatestdir, str(module))).execute() megasubdirs += [str(module)] # Then, all modules all together. @@ -904,7 +904,7 @@ class GLMegaTestDir(object): if str(module) != 'config-h' ] self.config.setModules([ str(module) for module in modules ]) - #GLTestDir(self.config, self.megatestdir).execute() + GLTestDir(self.config, joinpath(self.megatestdir, 'ALL')).execute() megasubdirs += ['ALL'] # Create autobuild. @@ -977,16 +977,16 @@ class GLMegaTestDir(object): emit += 'AC_CONFIG_AUX_DIR([%s])\n' % auxdir emit += 'AM_INIT_AUTOMAKE\n\n' emit += 'AC_PROG_MAKE_SET\n\n' - emit += 'AC_CONFIG_SUBDIRS([%s])\n' % ' '.megasubdirs + 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, 'Makefile.am') + path = joinpath(self.megatestdir, 'configure.ac') with codecs.open(path, 'wb', 'UTF-8') as file: file.write(emit) # Create autogenerated files. - os.chdir(DIRS['cwd']) + os.chdir(self.megatestdir) args = [UTILS['aclocal']] constants.execute(args, verbose) try: # Try to make a directory @@ -999,4 +999,5 @@ class GLMegaTestDir(object): args = [UTILS['automake'], '--add-missing', '--copy'] constants.execute(args, verbose) shutil.rmtree('autom4te.cache') + os.chdir(DIRS['cwd']) sp.call(['rm', '-rf', self.config['tempdir']], shell=False) -- 2.39.5