]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Implement options --cache-modules, --no-cache-modules.
authorBruno Haible <bruno@clisp.org>
Thu, 4 Aug 2022 16:35:49 +0000 (18:35 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 4 Aug 2022 16:35:49 +0000 (18:35 +0200)
* gnulib-tool.py (main): Accept options --cache-modules,
--no-cache-modules.
* pygnulib/GLConfig.py: Remove modcache property and constructor
argument.
* pygnulib/GLInfo.py (GLInfo.usage): Don't document these no-op options.

ChangeLog
gnulib-tool.py
pygnulib/GLConfig.py
pygnulib/GLEmiter.py
pygnulib/GLInfo.py

index e54a572c0918857e8ca25e6c412a6a0e41e23709..14ecd4b31a4c827511db267cf7c6db82682a4d47 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2022-08-04  Bruno Haible  <bruno@clisp.org>
 
+       gnulib-tool.py: Implement options --cache-modules, --no-cache-modules.
+       * gnulib-tool.py (main): Accept options --cache-modules,
+       --no-cache-modules.
+       * pygnulib/GLConfig.py: Remove modcache property and constructor
+       argument.
+       * pygnulib/GLInfo.py (GLInfo.usage): Don't document these no-op options.
+
        gnulib-tool.py: Use mainstream/GNU coding style.
        * gnulib-tool.py: Break lines before the % operator, not after.
        * pygnulib/*.py: Likewise. Avoid line breaks when the resulting lines
index 4f5494655d5fe3968a6b21540f10f506473881d4..6ca364760421d8e7b4dc43c0d822174bae114151 100755 (executable)
@@ -68,7 +68,6 @@ def main():
     mode = None
     destdir = None
     localpath = None
-    modcache = None
     verbose = None
     auxdir = None
     modules = None
@@ -233,6 +232,15 @@ def main():
                         dest='localpath',
                         default=None,
                         nargs=1)
+    # cache-modules: a no-op for backward compatibility
+    parser.add_argument('--cache-modules',
+                        dest='cache_modules',
+                        default=None,
+                        action='store_true')
+    parser.add_argument('--no-cache-modules',
+                        dest='cache_modules',
+                        default=None,
+                        action='store_false')
     # verbose
     parser.add_argument('--verbose',
                         default=0,
@@ -648,7 +656,6 @@ def main():
         vc_files=vc_files,
         symbolic=symlink,
         lsymbolic=lsymlink,
-        modcache=modcache,
         single_configure=single_configure,
         verbose=verbose,
         dryrun=dryrun,
index a9c2319e2c4feef7cc247787c0c72a2ddf02f792..4a38473efb53859a32016822cba811b5766b4c9d 100644 (file)
@@ -62,7 +62,7 @@ class GLConfig(object):
                  incl_test_categories=None, excl_test_categories=None, libname=None,
                  lgpl=None, makefile=None, libtool=None, conddeps=None, macro_prefix=None,
                  podomain=None, witness_c_macro=None, vc_files=None, symbolic=None,
-                 lsymbolic=None, modcache=None, configure_ac=None, ac_version=None,
+                 lsymbolic=None, configure_ac=None, ac_version=None,
                  libtests=None, single_configure=None, verbose=None, dryrun=None,
                  errors=None):
         '''GLConfig.__init__(arguments) -> GLConfig
@@ -212,17 +212,6 @@ class GLConfig(object):
             else:  # if type(lsymbolic) is not bool
                 raise TypeError('lsymbolic must be a bool, not %s'
                                 % type(lsymbolic).__name__)
-        # modcache
-        self.resetModuleCaching()
-        if modcache != None:
-            if type(modcache) is bool:
-                if not modcache:
-                    self.disableModuleCaching()
-                else:  # if modcache
-                    self.enableModuleCaching()
-            else:  # if type(modcache) is not bool
-                raise TypeError('modcache must be a bool, not %s'
-                                % type(modcache).__name__)
         # configure_ac
         self.resetAutoconfFile()
         if configure_ac != None:
@@ -358,8 +347,8 @@ class GLConfig(object):
                 return True
             elif key in ['modules', 'avoids', 'tests', 'incl_test_categories', 'excl_test_categories']:
                 return list()
-            elif key in ['libtool', 'lgpl', 'conddeps', 'modcache', 'symbolic',
-                         'lsymbolic', 'libtests', 'dryrun']:
+            elif key in ['libtool', 'lgpl', 'conddeps', 'symbolic', 'lsymbolic',
+                         'libtests', 'dryrun']:
                 return False
             if key == 'vc_files':
                 return None
@@ -976,23 +965,6 @@ class GLConfig(object):
         '''Reset update of the version control files and set it to None.'''
         self.table['vc_files'] = None
 
-    # Define modcache methods.
-    def checkModuleCaching(self):
-        '''Get status of module caching optimization.'''
-        return self.table['modcache']
-
-    def enableModuleCaching(self):
-        '''Enable module caching optimization.'''
-        self.table['modcache'] = True
-
-    def disableModuleCaching(self):
-        '''Disable module caching optimization.'''
-        self.table['modcache'] = False
-
-    def resetModuleCaching(self):
-        '''Reset module caching optimization.'''
-        self.table['modcache'] = False
-
     # Define configure_ac methods.
     def getAutoconfFile(self):
         '''Return path of autoconf file relative to destdir.'''
index 223e1ee55356b35ac027c87fa4ac641b5d64295d..4e4ce4a053a9b03a7b4820726c41875d08c2bcf6 100644 (file)
@@ -636,7 +636,6 @@ AC_DEFUN([%V1%_LIBSOURCES], [
                             % type(for_test).__name__)
         emit = ''
         sourcebase = self.config['sourcebase']
-        modcache = self.config['modcache']
         libname = self.config['libname']
         pobase = self.config['pobase']
         auxdir = self.config['auxdir']
@@ -908,7 +907,6 @@ AC_DEFUN([%V1%_LIBSOURCES], [
         emit = ''
         auxdir = self.config['auxdir']
         sourcebase = self.config['sourcebase']
-        modcache = self.config['modcache']
         libname = self.config['libname']
         m4base = self.config['m4base']
         pobase = self.config['pobase']
index 720e357c90b5747491934e4737dffb75c62dc797..34b38db7eb504faa5b8073ad39ccf24b013993fe 100644 (file)
@@ -184,8 +184,6 @@ General options:
                             directory.
       --local-dir=DIRECTORY  Specify a local override directory where to look
                             up files before looking in gnulib's directory.
-      --cache-modules       Enable module caching optimization.
-      --no-cache-modules    Disable module caching optimization.
       --verbose             Increase verbosity. May be repeated.
       --quiet               Decrease verbosity. May be repeated.