From 50a6834ef78a1846aa2a3606ee98d48fd992d4cf Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 12 Apr 2024 22:10:54 +0200 Subject: [PATCH] gnulib-tool.py: Implement --no-libtool option correctly. * pygnulib/GLConfig.py (GLConfig.default): For 'libtool', return None, not False. (GLConfig.checkLibtool): Update result type. (resetLibtool): Reset to return None, not False. * pygnulib/GLImport.py (GLImport.actioncmd): Update. --- ChangeLog | 9 +++++++++ pygnulib/GLConfig.py | 8 ++++---- pygnulib/GLImport.py | 4 ++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index c5c7dae203..242ad3ff4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2024-04-12 Bruno Haible + + gnulib-tool.py: Implement --no-libtool option correctly. + * pygnulib/GLConfig.py (GLConfig.default): For 'libtool', return None, + not False. + (GLConfig.checkLibtool): Update result type. + (resetLibtool): Reset to return None, not False. + * pygnulib/GLImport.py (GLImport.actioncmd): Update. + 2024-04-12 Bruno Haible gnulib-tool.py: Accept conditional dependencies with tests. diff --git a/pygnulib/GLConfig.py b/pygnulib/GLConfig.py index 90b7bd984a..1ac40207a3 100644 --- a/pygnulib/GLConfig.py +++ b/pygnulib/GLConfig.py @@ -318,13 +318,13 @@ class GLConfig: elif key in ['localpath', 'modules', 'avoids', 'tests', 'incl_test_categories', 'excl_test_categories']: return [] - elif key in ['incobsolete', 'libtool', 'gnu_make', + elif key in ['incobsolete', 'gnu_make', 'automake_subdir', 'automake_subdir_tests', 'conddeps', 'libtests', 'dryrun']: return False elif key in ['copymode', 'lcopymode']: return CopyAction.Copy - elif key in ['lgpl', 'vc_files']: + elif key in ['lgpl', 'libtool', 'vc_files']: return None elif key == 'errors': return True @@ -788,7 +788,7 @@ class GLConfig: self.table['libname'] = 'libgnu' # Define libtool methods. - def checkLibtool(self) -> bool: + def checkLibtool(self) -> bool | None: '''Check if user enabled libtool rules.''' return self.table['libtool'] @@ -802,7 +802,7 @@ class GLConfig: def resetLibtool(self) -> None: '''Reset libtool rules.''' - self.table['libtool'] = False + self.table['libtool'] = None # Define conddeps methods. def checkCondDeps(self) -> bool: diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py index 31380a0108..5f95706fc7 100644 --- a/pygnulib/GLImport.py +++ b/pygnulib/GLImport.py @@ -448,9 +448,9 @@ class GLImport: actioncmd += ' \\\n# --conditional-dependencies' else: # if not conddeps actioncmd += ' \\\n# --no-conditional-dependencies' - if libtool: + if libtool == True: actioncmd += ' \\\n# --libtool' - else: # if not libtool + else: # if libtool == False or libtool == None actioncmd += ' \\\n# --no-libtool' actioncmd += ' \\\n# --macro-prefix=%s' % macro_prefix if podomain: -- 2.39.5