1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-04-28 06:33:36 +00:00

gnulib-tool.py: Fix default handling for --local-{symlink,hardlink}.

* pygnulib/GLConfig.py (GLConfig.__init__): Allow lcopymode to remain
None.
(GLConfig.default): Change lcopymode's default to be None.
(GLConfig.checkLCopyMode): Update signature.
(GLConfig.resetLCopyMode): Change default value to None.
* pygnulib/GLFileSystem.py (GLFileSystem.shouldLink): Update.
This commit is contained in:
Bruno Haible
2026-03-06 09:47:50 +01:00
parent ddea1a41eb
commit 11d02ecc71
3 changed files with 18 additions and 10 deletions

View File

@@ -1,3 +1,13 @@
2026-03-06 Bruno Haible <bruno@clisp.org>
gnulib-tool.py: Fix default handling for --local-{symlink,hardlink}.
* pygnulib/GLConfig.py (GLConfig.__init__): Allow lcopymode to remain
None.
(GLConfig.default): Change lcopymode's default to be None.
(GLConfig.checkLCopyMode): Update signature.
(GLConfig.resetLCopyMode): Change default value to None.
* pygnulib/GLFileSystem.py (GLFileSystem.shouldLink): Update.
2026-03-05 Collin Funk <collin.funk1@gmail.com>
gnulib-tool.py: Use --symlink or --hardlink for local modules.

View File

@@ -208,9 +208,7 @@ class GLConfig:
self.setCopyMode(copymode)
# lcopymode (--local-symlink and --local-hardlink)
self.resetLCopyMode()
if lcopymode == None:
# Default to the mode used for non-local modules.
lcopymode = copymode
if lcopymode != None:
self.setLCopyMode(lcopymode)
# configure_ac
self.resetAutoconfFile()
@@ -321,9 +319,9 @@ class GLConfig:
'automake_subdir', 'automake_subdir_tests',
'libtests', 'dryrun']:
return False
elif key in ['copymode', 'lcopymode']:
elif key in ['copymode']:
return CopyAction.Copy
elif key in ['lgpl', 'gpl', 'libtool', 'conddeps', 'vc_files']:
elif key in ['lgpl', 'gpl', 'libtool', 'conddeps', 'vc_files', 'lcopymode']:
return None
elif key == 'errors':
return True
@@ -1113,7 +1111,7 @@ class GLConfig:
self.table['copymode'] = CopyAction.Copy
# Define lcopymode methods.
def checkLCopyMode(self) -> CopyAction:
def checkLCopyMode(self) -> CopyAction | None:
'''Check if pygnulib will copy files, create symlinks, or create hard links,
only for files from the local override directories.'''
return self.table['lcopymode']
@@ -1128,9 +1126,9 @@ class GLConfig:
% type(value).__name__)
def resetLCopyMode(self) -> None:
'''Reset the method used for creating files to copying instead of linking,
'''Reset the method used for creating files,
only for files from the local override directories.'''
self.table['lcopymode'] = CopyAction.Copy
self.table['lcopymode'] = None
# Define verbosity methods.
def getVerbosity(self) -> int:

View File

@@ -130,7 +130,7 @@ class GLFileSystem:
# Don't bother checking the localpath's if we end up performing the same
# action anyways.
if copymode != lcopymode:
if lcopymode != None and lcopymode != copymode:
for localdir in localpath:
if lookedup == joinpath(localdir, original):
return lcopymode