mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -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):
|
def CopyFile(dstfile, srcfile):
|
||||||
if (dstfile[-1]=='/'):
|
if dstfile[-1] == '/':
|
||||||
dstdir = dstfile
|
dstdir = dstfile
|
||||||
fnl = srcfile.rfind("/")
|
fnl = srcfile.rfind("/")
|
||||||
if (fnl < 0): fn = srcfile
|
if fnl < 0:
|
||||||
else: fn = srcfile[fnl+1:]
|
fn = srcfile
|
||||||
|
else:
|
||||||
|
fn = srcfile[fnl+1:]
|
||||||
dstfile = dstdir + fn
|
dstfile = dstdir + fn
|
||||||
|
|
||||||
if NeedsBuild([dstfile], [srcfile]):
|
if NeedsBuild([dstfile], [srcfile]):
|
||||||
if os.path.islink(srcfile):
|
if os.path.islink(srcfile):
|
||||||
# Preserve symlinks
|
# Preserve symlinks
|
||||||
|
if os.path.exists(dstfile):
|
||||||
|
os.unlink(dstfile)
|
||||||
os.symlink(os.readlink(srcfile), dstfile)
|
os.symlink(os.readlink(srcfile), dstfile)
|
||||||
else:
|
else:
|
||||||
WriteBinaryFile(dstfile, ReadBinaryFile(srcfile))
|
WriteBinaryFile(dstfile, ReadBinaryFile(srcfile))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user