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:
10
ChangeLog
10
ChangeLog
@@ -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.
|
||||
|
||||
@@ -208,10 +208,8 @@ 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
|
||||
self.setLCopyMode(lcopymode)
|
||||
if lcopymode != None:
|
||||
self.setLCopyMode(lcopymode)
|
||||
# configure_ac
|
||||
self.resetAutoconfFile()
|
||||
if configure_ac != None:
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user