mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 01:44:06 -04:00
Unlink symlink before re-creating
This commit is contained in:
parent
7785426d2c
commit
3d5118d406
@ -2328,15 +2328,20 @@ def SetupBuildEnvironment(compiler):
|
||||
########################################################################
|
||||
|
||||
def CopyFile(dstfile, srcfile):
|
||||
if (dstfile[-1]=='/'):
|
||||
if dstfile[-1] == '/':
|
||||
dstdir = dstfile
|
||||
fnl = srcfile.rfind("/")
|
||||
if (fnl < 0): fn = srcfile
|
||||
else: fn = srcfile[fnl+1:]
|
||||
if fnl < 0:
|
||||
fn = srcfile
|
||||
else:
|
||||
fn = srcfile[fnl+1:]
|
||||
dstfile = dstdir + fn
|
||||
|
||||
if NeedsBuild([dstfile], [srcfile]):
|
||||
if os.path.islink(srcfile):
|
||||
# Preserve symlinks
|
||||
if os.path.exists(dstfile):
|
||||
os.unlink(dstfile)
|
||||
os.symlink(os.readlink(srcfile), dstfile)
|
||||
else:
|
||||
WriteBinaryFile(dstfile, ReadBinaryFile(srcfile))
|
||||
|
Loading…
x
Reference in New Issue
Block a user