From 3088ee223bb986ad51d7c71ca64aaf4b600bc06c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 10 Mar 2024 23:47:58 +0100 Subject: [PATCH] gnulib-tool.py: Tweak last commit. * pygnulib/GLEmiter.py (GLEmiter.initmacro_end): Avoid an implicit str to bool conversion. * pygnulib/GLImport.py (GLImport.__init__): Add a comment. Don't allow a '|' in place of whitespace. Don't emit redundant gl_source_base assignments. --- ChangeLog | 9 +++++++++ pygnulib/GLEmiter.py | 2 +- pygnulib/GLImport.py | 5 ++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d38d67342c..324e0bc04f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2024-03-10 Bruno Haible + + gnulib-tool.py: Tweak last commit. + * pygnulib/GLEmiter.py (GLEmiter.initmacro_end): Avoid an implicit str + to bool conversion. + * pygnulib/GLImport.py (GLImport.__init__): Add a comment. Don't allow + a '|' in place of whitespace. Don't emit redundant gl_source_base + assignments. + 2024-03-10 Collin Funk gnulib-tool.py: Follow gnulib-tool changes, part 51. diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py index 9a889fde5a..a904aee8ad 100644 --- a/pygnulib/GLEmiter.py +++ b/pygnulib/GLEmiter.py @@ -566,7 +566,7 @@ USE_MSGCTXT = no\n""" # arguments. The check is performed only when autoconf is run from the # directory where the configure.ac resides; if it is run from a different # directory, the check is skipped. - if automake_subdir and not gentests and sourcebase and sourcebase != '.': + if automake_subdir and not gentests and sourcebase != '' and sourcebase != '.': subdir = f'{sourcebase}/' else: subdir = '' diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py index 8864bfd7c0..64a0bc9b13 100644 --- a/pygnulib/GLImport.py +++ b/pygnulib/GLImport.py @@ -259,6 +259,7 @@ class GLImport(object): self.config.update_key(config, key) self.config.setModules(modules) + # Determine whether --automake-subdir is supported. if self.config['automake_subdir']: found_subdir_objects = False if self.config['destdir']: @@ -266,7 +267,7 @@ class GLImport(object): else: base = '.' if isfile(joinpath(base, 'Makefile.am')): - pattern = re.compile(r'^AUTOMAKE_OPTIONS[\t| ]*=(.*)$', re.MULTILINE) + pattern = re.compile(r'^AUTOMAKE_OPTIONS[\t ]*=(.*)$', re.MULTILINE) with open(joinpath(base, 'Makefile.am'), encoding='utf-8') as file: data = file.read() automake_options = pattern.findall(data) @@ -702,7 +703,6 @@ AC_DEFUN([%s_INIT], emit += ' gl_m4_base=\'%s\'\n' % m4base emit += self.emitter.initmacro_start(macro_prefix, False) emit += self.emitter.shellvars_init(False, sourcebase) - emit += ' gl_source_base=\'%s\'\n' % sourcebase if witness_c_macro: emit += ' m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [%s])\n' % witness_c_macro # Emit main autoconf snippets. @@ -716,7 +716,6 @@ AC_DEFUN([%s_INIT], emit += ' gltests_ltlibdeps=\n' emit += self.emitter.initmacro_start('%stests' % macro_prefix, gentests) emit += self.emitter.shellvars_init(True, testsbase) - emit += ' gl_source_base=\'%s\'\n' % testsbase # Define a tests witness macro that depends on the package. # PACKAGE is defined by AM_INIT_AUTOMAKE, PACKAGE_TARNAME is defined by # AC_INIT. -- 2.39.5