From 2fee5e30aa64e912949166f4335b00c8442b3b09 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 12 Apr 2024 22:21:57 +0200 Subject: [PATCH] gnulib-tool.py: Implement --no-conditional-dependencies correctly. * pygnulib/GLConfig.py (GLConfig.default): For 'conddeps', return None, not False. (GLConfig.checkCondDeps): Update result type. (resetCondDeps): Reset to return None, not False. * pygnulib/GLImport.py (GLImport.actioncmd): Update. --- pygnulib/GLConfig.py | 8 ++++---- pygnulib/GLImport.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pygnulib/GLConfig.py b/pygnulib/GLConfig.py index 1ac40207a3..e938b30a5e 100644 --- a/pygnulib/GLConfig.py +++ b/pygnulib/GLConfig.py @@ -319,12 +319,12 @@ class GLConfig: 'incl_test_categories', 'excl_test_categories']: return [] elif key in ['incobsolete', 'gnu_make', - 'automake_subdir', 'automake_subdir_tests', 'conddeps', + 'automake_subdir', 'automake_subdir_tests', 'libtests', 'dryrun']: return False elif key in ['copymode', 'lcopymode']: return CopyAction.Copy - elif key in ['lgpl', 'libtool', 'vc_files']: + elif key in ['lgpl', 'libtool', 'conddeps', 'vc_files']: return None elif key == 'errors': return True @@ -805,7 +805,7 @@ class GLConfig: self.table['libtool'] = None # Define conddeps methods. - def checkCondDeps(self) -> bool: + def checkCondDeps(self) -> bool | None: '''Check if user enabled conditional dependencies.''' return self.table['conddeps'] @@ -819,7 +819,7 @@ class GLConfig: def resetCondDeps(self) -> None: '''Reset conditional dependencies (may save configure time and object code).''' - self.table['conddeps'] = False + self.table['conddeps'] = None # Define lgpl methods. def getLGPL(self) -> str | bool | None: diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py index 5f95706fc7..b6c9bbeea3 100644 --- a/pygnulib/GLImport.py +++ b/pygnulib/GLImport.py @@ -444,9 +444,9 @@ class GLImport: actioncmd += ' \\\n# --automake-subdir' if automake_subdir_tests: actioncmd += ' \\\n# --automake-subdir-tests' - if conddeps: + if conddeps == True: actioncmd += ' \\\n# --conditional-dependencies' - else: # if not conddeps + else: # if conddeps == False or conddeps == None actioncmd += ' \\\n# --no-conditional-dependencies' if libtool == True: actioncmd += ' \\\n# --libtool' -- 2.39.5