gen-lockedsig-cache: catch os.link error
We do a hard link to speed up sdk creation but if your sstate-cache is across a file system boundary, this tries and fails. This patch catches that error and does a copy instead. (From OE-Core rev: fb9fdd7a74917cdcab039aa3a9a9944b18246fea) Signed-off-by: brian avery <brian.avery@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
4ad1148e68
commit
ab34d08772
|
@ -62,7 +62,11 @@ for f in files:
|
||||||
os.remove(dst)
|
os.remove(dst)
|
||||||
if (os.stat(src).st_dev == os.stat(destdir).st_dev):
|
if (os.stat(src).st_dev == os.stat(destdir).st_dev):
|
||||||
print('linking')
|
print('linking')
|
||||||
|
try:
|
||||||
os.link(src, dst)
|
os.link(src, dst)
|
||||||
|
except OSError as e:
|
||||||
|
print('hard linking failed, copying')
|
||||||
|
shutil.copyfile(src, dst)
|
||||||
else:
|
else:
|
||||||
print('copying')
|
print('copying')
|
||||||
shutil.copyfile(src, dst)
|
shutil.copyfile(src, dst)
|
||||||
|
|
Loading…
Reference in New Issue