+2022-07-31 Bruno Haible <bruno@clisp.org>
+
+ gnulib-tool.py: Follow gnulib-tool changes, part 18.
+ Follow gnulib-tool change
+ 2005-09-20 Bruno Haible <bruno@clisp.org>
+ gnulib-tool: Remove trailing slashes
+ * pygnulib/constants.py (remove_trailing_slashes): New function.
+ * pygnulib/GLConfig.py (GLConfig): Use it in the setters.
+
2022-07-31 Bruno Haible <bruno@clisp.org>
avltree-omap, avltree-oset, avltreehash-list, rbtree-omap: Pacify GCC.
TESTS = constants.TESTS
joinpath = constants.joinpath
relpath = constants.relativize
+remove_trailing_slashes = constants.remove_trailing_slashes
isfile = os.path.isfile
normpath = os.path.normpath
Create new GLConfig instance.'''
self.table = dict()
self.table['tempdir'] = tempfile.mkdtemp()
+ # Check and store the attributes.
+ # Remove trailing slashes from the directory names. This is necessary
+ # for m4base (to avoid an error in func_import) and optional for the
+ # others.
# destdir
self.resetDestDir()
if destdir != None:
in gnulib's directory.'''
if type(localdir) is str:
if localdir:
- self.table['localdir'] = localdir
+ self.table['localdir'] = remove_trailing_slashes(localdir)
else: # if localdir has not str type
raise TypeError('localdir must be a string, not %s' %
type(localdir).__name__)
placed. Default comes from configure.ac or configure.in.'''
if type(auxdir) is str:
if auxdir:
- self.table['auxdir'] = auxdir
+ self.table['auxdir'] = remove_trailing_slashes(auxdir)
else: # if type of auxdir is not str
raise TypeError('auxdir must be a string, not %s' %
type(auxdir).__name__)
'''Specify directory relative to destdir where source code is placed.'''
if type(sourcebase) is str:
if sourcebase:
- self.table['sourcebase'] = sourcebase
+ self.table['sourcebase'] = remove_trailing_slashes(sourcebase)
else: # if type of sourcebase is not str
raise TypeError('sourcebase must be a string, not %s' %
type(sourcebase).__name__)
'''Specify directory relative to destdir where *.m4 macros are placed.'''
if type(m4base) is str:
if m4base:
- self.table['m4base'] = m4base
+ self.table['m4base'] = remove_trailing_slashes(m4base)
else: # if type of m4base is not str
raise TypeError('m4base must be a string, not %s' %
type(m4base).__name__)
'''Specify directory relative to destdir where *.po files are placed.'''
if type(pobase) is str:
if pobase:
- self.table['pobase'] = pobase
+ self.table['pobase'] = remove_trailing_slashes(pobase)
else: # if type of pobase is not str
raise TypeError('pobase must be a string, not %s' %
type(pobase).__name__)
Default value for this variable is 'doc').'''
if type(docbase) is str:
if docbase:
- self.table['docbase'] = docbase
+ self.table['docbase'] = remove_trailing_slashes(docbase)
else: # if type of docbase is not str
raise TypeError('docbase must be a string, not %s' %
type(docbase).__name__)
Default value for this variable is 'tests').'''
if type(testsbase) is str:
if testsbase:
- self.table['testsbase'] = testsbase
+ self.table['testsbase'] = remove_trailing_slashes(testsbase)
else: # if type of testsbase is not str
raise TypeError('testsbase must be a string, not %s' %
type(testsbase).__name__)