From 6bdf668e5748a511082efed773b2b127e93fcb1d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 31 Jul 2022 18:39:19 +0200 Subject: gnulib-tool.py: Follow gnulib-tool changes, part 19. Follow gnulib-tool changes 2015-12-09 Pavel Raiskup gnulib-tool: allow multiple --local-dir usage 2019-02-14 Bruno Haible gnulib-tool: Improve handling of multiple --local-dir options. * gnulib-tool (func_reconstruct_cached_dir): When the argument is absolute, return it unmodified. (func_compute_relative_local_gnulib_path): Renamed from func_count_relative_local_gnulib_path. Add comment. * gnulib-tool.py: Accept multiple --local-dir options and collect the values into localpath. * pygnulib/GLConfig.py: Take a localpath argument instead of a localdir argument. (getLocalDir, setLocalDir, resetLocalDir): Remove methods. (getLocalPath, setLocalPath, resetLocalPath): New methods. * pygnulib/GLFileSystem.py (CopyAction): New class. (GLFileSystem.lookup): Consider all dirs in localpath. (GLFileSystem.shouldLink): New method. (GLFileAssistant): Use shouldLink. * pygnulib/GLModuleSystem.py (GLModuleSystem.exists): Iterate over all dirs in localpath. (GLModuleSystem.list): Likewise. * pygnulib/GLEmiter.py: Update. * pygnulib/GLImport.py (GLImport.__init__): Put the argument of gl_LOCAL_DIR into localpath, not localdir. (GLImport.actioncmd): Consider all dirs in localpath. (GLImport.relative_to_destdir, GLImport.relative_to_currdir): New methods. (GLImport.gnulib_cache): Combine all dirs in localpath. Use self.relative_to_destdir. * pygnulib/GLTestDir.py (GLTestDir.execute): Use shouldLink. --- pygnulib/GLTestDir.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'pygnulib/GLTestDir.py') diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py index 79f67a8fdc..7a7f5c52fb 100644 --- a/pygnulib/GLTestDir.py +++ b/pygnulib/GLTestDir.py @@ -30,6 +30,7 @@ from .GLConfig import GLConfig from .GLModuleSystem import GLModule from .GLModuleSystem import GLModuleTable from .GLModuleSystem import GLModuleSystem +from .GLFileSystem import CopyAction from .GLFileSystem import GLFileSystem from .GLFileSystem import GLFileAssistant from .GLMakefileTable import GLMakefileTable @@ -143,7 +144,6 @@ class GLTestDir(object): '''GLTestDir.execute() Create a scratch package with the given modules.''' - localdir = self.config['localdir'] auxdir = self.config['auxdir'] testflags = list(self.config['testflags']) sourcebase = self.config['sourcebase'] @@ -154,8 +154,6 @@ class GLTestDir(object): libname = self.config['libname'] libtool = self.config['libtool'] witness_c_macro = self.config['witness_c_macro'] - symbolic = self.config['symbolic'] - lsymbolic = self.config['lsymbolic'] single_configure = self.config['single_configure'] include_guard_prefix = self.config['include_guard_prefix'] macro_prefix = self.config['macro_prefix'] @@ -337,7 +335,7 @@ class GLTestDir(object): if flag: shutil.copy(lookedup, destpath) else: # if not flag - if symbolic or (lsymbolic and lookedup == joinpath(localdir, src)): + if self.filesystem.shouldLink(src, lookedup) == CopyAction.Symlink: constants.link_relative(lookedup, destpath) else: shutil.copy(lookedup, destpath) -- cgit v1.2.1