]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Fix 'Undefined variable' errors.
authorBruno Haible <bruno@clisp.org>
Fri, 5 Aug 2022 13:15:16 +0000 (15:15 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 5 Aug 2022 13:15:16 +0000 (15:15 +0200)
* pygnulib/constants.py: Import codecs.
* pygnulib/GLConfig.py (GLConfig.setLibName): Fix local variable
reference.
* pygnulib/GLFileSystem.py (GLFileSystem.lookup,
GLFileAssistant.update): Fix local variable references.
* pygnulib/GLEmiter.py (GLEmiter.po_POTFILES_in): Fix reference.
* pygnulib/GLTestDir.py (GLMegaTestDir.execute): Define missing local
variables.

ChangeLog
pygnulib/GLConfig.py
pygnulib/GLEmiter.py
pygnulib/GLFileSystem.py
pygnulib/GLTestDir.py
pygnulib/constants.py

index 81871735d2989e2d83a4d84e9ccdadbd2ee67d43..1d3630beeaf598ec6e05555be87f570105a709bd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2022-08-05  Bruno Haible  <bruno@clisp.org>
 
+       gnulib-tool.py: Fix 'Undefined variable' errors.
+       * pygnulib/constants.py: Import codecs.
+       * pygnulib/GLConfig.py (GLConfig.setLibName): Fix local variable
+       reference.
+       * pygnulib/GLFileSystem.py (GLFileSystem.lookup,
+       GLFileAssistant.update): Fix local variable references.
+       * pygnulib/GLEmiter.py (GLEmiter.po_POTFILES_in): Fix reference.
+       * pygnulib/GLTestDir.py (GLMegaTestDir.execute): Define missing local
+       variables.
+
        gnulib-tool.py: Make option --version work.
        * pygnulib/constants.py (__copyright__): Bump copyright year.
        * pygnulib/GLInfo.py (GLInfo.authors): Add a comma after the
index 039b4f012d41643917566cb2a1f0ea11f7765674..cda218e423303c91c27194bbdeb72ab35898bb76 100644 (file)
@@ -764,7 +764,7 @@ class GLConfig(object):
                 self.table['libname'] = libname
         else:  # if type of libname is not str
             raise TypeError('libname must be a string, not %s'
-                            % type(module).__name__)
+                            % type(libname).__name__)
 
     def resetLibName(self):
         '''Reset the library name to 'libgnu'.'''
index b56e551f1dfd7a1c84ee5e9d1237b7f7c7ee10e5..b547fde7e75c2f408ae89770a547fb09e7fd7507 100644 (file)
@@ -450,7 +450,7 @@ USE_MSGCTXT = no\n"""
         emit = ''
         sourcebase = self.config['sourcebase']
         sourcebase = '%s%s' % (self.sourcebase, os.path.sep)
-        files = [ substart('lib/', sourcebase, file)
+        files = [ constants.substart('lib/', sourcebase, file)
                   for file in files ]
         files = [ file
                   for file in files
index 7bec0f9e6e0da80bd3ac7ce181f6ce87aa27e4fd..9e6161a24df8a2a38f4e10667218e8ec512399f2 100644 (file)
@@ -88,7 +88,7 @@ class GLFileSystem(object):
         GLConfig: localpath.'''
         if type(name) is not str:
             raise TypeError('name must be a string, not %s'
-                            % type(module).__name__)
+                            % type(name).__name__)
         localpath = self.config['localpath']
         # Each element in localpath is a directory whose contents overrides
         # or amends the result of the lookup in the rest of localpath and
@@ -322,9 +322,9 @@ class GLFileAssistant(object):
                         raise GLError(17, original)
             else:  # if self.config['dryrun']
                 if already_present:
-                    print('Update file %s (backup in %s)' % (rewritten, backup))
+                    print('Update file %s (backup in %s)' % (rewritten, backupname))
                 else:  # if not already_present
-                    print('Replace file %s (backup in %s)' % (rewritten, backup))
+                    print('Replace file %s (backup in %s)' % (rewritten, backupname))
 
     def add_or_update(self, already_present):
         '''GLFileAssistant.add_or_update(already_present)
index 624a38317eacd2ed054a313d3f24b2d2f1829317..db74b9b4e3862a4a9b4dd2a371281f10ea70dfa4 100644 (file)
@@ -906,6 +906,9 @@ class GLMegaTestDir(object):
 
         Create a mega scratch package with the given modules one by one and all
         together.'''
+        auxdir = self.config['auxdir']
+        verbose = self.config['verbosity']
+
         megasubdirs = list()
         modules = [ self.modulesystem.find(m)
                     for m in self.config['modules'] ]
index ffee05846ecd8bc6878273e7e3c4e94ce4720ca6..313aac94a1dcc1caa08dca7a2781327cebfea345 100644 (file)
@@ -25,6 +25,7 @@ import sys
 import platform
 import shutil
 import tempfile
+import codecs
 import subprocess as sp
 import __main__ as interpreter