mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
sb: Fix copy_tree coping links on Linux
Overwriting symlinks did not work on Linux. This change manages the coping of links with special code. The copy worked on FreeBSD.
This commit is contained in:
parent
75aa2db1c6
commit
85007c35d1
@ -153,6 +153,18 @@ def copy_tree(src, dst):
|
||||
try:
|
||||
if os.path.islink(srcname):
|
||||
linkto = os.readlink(srcname)
|
||||
if os.path.exists(dstname):
|
||||
if os.path.islink(dstname):
|
||||
dstlinkto = os.readlink(dstname)
|
||||
if linkto != dstlinkto:
|
||||
log.warning('copying tree: update of link does not match: %s -> %s: %s' % \
|
||||
(dstname, dstlinkto))
|
||||
os.remove(dstname)
|
||||
else:
|
||||
log.warning('copying tree: destination is not a link: %s -> %s: %s' % \
|
||||
(dstname, dstlinkto))
|
||||
os.remove(dstname)
|
||||
else:
|
||||
os.symlink(linkto, dstname)
|
||||
elif os.path.isdir(srcname):
|
||||
copy_tree(srcname, dstname)
|
||||
|
Loading…
x
Reference in New Issue
Block a user