* gnulib-tool.py (main): Handle options --symlink and --local-symlink.
* pygnulib/constants.py (link_if_changed): Ignore FileNotFoundError from
os.remove call.
2022-07-31 Bruno Haible <bruno@clisp.org>
+ gnulib-tool.py: Implement options --symlink and --local-symlink.
+ * gnulib-tool.py (main): Handle options --symlink and --local-symlink.
+ * pygnulib/constants.py (link_if_changed): Ignore FileNotFoundError from
+ os.remove call.
+
gnulib-tool.py: Make --copy-file work.
* gnulib-tool.py (main) [copy-file]: Fix reference to uninitialized
variable. Fix error handling of os.makedirs. Pass the destdir to the
dest="makefile",
default=None,
type=str)
+ # symlink
+ parser.add_argument('-s', '--symbolic', '--symlink',
+ dest='symlink',
+ default=None,
+ action='store_true')
+ # local-symlink
+ parser.add_argument('--local-symlink',
+ dest='lsymlink',
+ default=None,
+ action='store_true')
# All other arguments are collected.
parser.add_argument("non_option_arguments",
nargs='*')
avoids = [ module
for list1 in avoids
for module in list1 ]
+ symlink = cmdargs.symlink == True
+ lsymlink = cmdargs.lsymlink == True
# Create pygnulib configuration.
config = classes.GLConfig(
podomain=podomain,
witness_c_macro=witness_c_macro,
vc_files=vc_files,
+ symbolic=symlink,
+ lsymbolic=lsymlink,
modcache=modcache,
verbose=verbose,
dryrun=dryrun,
'''Create a symlink, but avoids munging timestamps if the link is correct.'''
ln_target = os.path.realpath(src)
if not (os.path.islink(dest) and src == ln_target):
- os.remove(dest)
+ try:
+ os.remove(dest)
+ except FileNotFoundError:
+ pass
link_relative(src, dest)