]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Finish implementing option --witness-c-macro.
authorBruno Haible <bruno@clisp.org>
Sat, 6 Aug 2022 19:54:04 +0000 (21:54 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 6 Aug 2022 19:54:04 +0000 (21:54 +0200)
* gnulib-tool.py (main): Accept option --witness-c-macro.
* pygnulib/GLConfig.py (GLConfig.__init__): Remove wrong type check of
witness_c_macro argument.

ChangeLog
gnulib-tool.py
gnulib-tool.py.TODO
pygnulib/GLConfig.py

index dc968b8982c08777e2671507519076bd816bb1f1..00431039144fd20767bede8d0e230dff1739a9e9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-08-06  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool.py: Finish implementing option --witness-c-macro.
+       * gnulib-tool.py (main): Accept option --witness-c-macro.
+       * pygnulib/GLConfig.py (GLConfig.__init__): Remove wrong type check of
+       witness_c_macro argument.
+
 2022-08-05  Bruno Haible  <bruno@clisp.org>
 
        gnulib-tool.py: Don't initialize local variables too early.
index 78bb326a695fc42dc62377a0dff953dc56778a5d..0bf72bf3a0509d3305f32bffbc288ef57a6f9f33 100755 (executable)
@@ -358,6 +358,11 @@ def main():
                         dest='podomain',
                         default=None,
                         nargs=1)
+    # witness-c-macro
+    parser.add_argument('--witness-c-macro',
+                        dest='witness_c_macro',
+                        default=None,
+                        nargs=1)
     # single-configure
     parser.add_argument('--single-configure',
                         dest='single_configure',
@@ -547,7 +552,8 @@ def main():
                  or cmdargs.excl_unportable_tests != None
                  or cmdargs.avoids != None or cmdargs.lgpl != None
                  or cmdargs.makefile_name != None
-                 or cmdargs.macro_prefix != None or cmdargs.podomain != None))):
+                 or cmdargs.macro_prefix != None or cmdargs.podomain != None
+                 or cmdargs.witness_c_macro != None))):
         message = '%s: *** ' % constants.APP['name']
         message += 'invalid options for --%s mode\n' % mode
         message += 'Try \'gnulib-tool --help\' for more information.\n'
@@ -640,6 +646,9 @@ def main():
     podomain = cmdargs.podomain
     if podomain != None:
         podomain = podomain[0]
+    witness_c_macro = cmdargs.witness_c_macro
+    if witness_c_macro != None:
+        witness_c_macro = witness_c_macro[0]
     avoids = cmdargs.avoids
     if avoids != None:
         avoids = [ module
@@ -650,7 +659,6 @@ def main():
     single_configure = cmdargs.single_configure
     docbase = None
     conddeps = None
-    witness_c_macro = None
     vc_files = None
 
     # Create pygnulib configuration.
index b59e89cc59ca4ee6c97e1e026ef89dec39cae342..c37fcbeebfd3aff03b52e762bb81564a1f7bc127 100644 (file)
@@ -29,7 +29,6 @@ Implement the options:
   --gnu-make
   --tests-makefile-name
   --automake-subdir
-  --witness-c-macro
   --vc-files
   --no-vc-files
   -h | --hardlink
index e571dff2b3dfb8ad0eef6fb3564472bcf5d1e91f..5f30a80797b35051db6f1f5c8de0cfd3b9a0b165 100644 (file)
@@ -153,14 +153,7 @@ class GLConfig(object):
         # witness_c_macro
         self.resetWitnessCMacro()
         if witness_c_macro != None:
-            if type(witness_c_macro) is bool:
-                if not witness_c_macro:
-                    self.setWitnessCMacro()
-                else:  # if witness_c_macro
-                    self.resetWitnessCMacro()
-            else:  # if type(witness_c_macro) is not bool
-                raise TypeError('witness_c_macro must be a bool, not %s'
-                                % type(witness_c_macro).__name__)
+            self.setWitnessCMacro(witness_c_macro)
         # vc_files
         self.resetVCFiles()
         if vc_files != None: