mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Preserve symlinks when copying files
This commit is contained in:
parent
e02d8706f3
commit
8ae5e58d92
@ -2333,8 +2333,12 @@ def CopyFile(dstfile, srcfile):
|
|||||||
if (fnl < 0): fn = srcfile
|
if (fnl < 0): fn = srcfile
|
||||||
else: fn = srcfile[fnl+1:]
|
else: fn = srcfile[fnl+1:]
|
||||||
dstfile = dstdir + fn
|
dstfile = dstdir + fn
|
||||||
if (NeedsBuild([dstfile], [srcfile])):
|
if NeedsBuild([dstfile], [srcfile]):
|
||||||
WriteBinaryFile(dstfile, ReadBinaryFile(srcfile))
|
if os.path.islink(srcfile):
|
||||||
|
# Preserve symlinks
|
||||||
|
os.symlink(os.readlink(srcfile), dstfile)
|
||||||
|
else:
|
||||||
|
WriteBinaryFile(dstfile, ReadBinaryFile(srcfile))
|
||||||
JustBuilt([dstfile], [srcfile])
|
JustBuilt([dstfile], [srcfile])
|
||||||
|
|
||||||
def CopyAllFiles(dstdir, srcdir, suffix=""):
|
def CopyAllFiles(dstdir, srcdir, suffix=""):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user