From: brian avery Date: Sun, 19 Mar 2017 17:32:40 +0000 (-0700) Subject: gen-lockedsig-cache: catch os.link error X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~21960 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb9fdd7a74917cdcab039aa3a9a9944b18246fea;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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. Signed-off-by: brian avery Signed-off-by: Ross Burton --- diff --git a/scripts/gen-lockedsig-cache b/scripts/gen-lockedsig-cache index 49de74ed9b2..6765891d198 100755 --- a/scripts/gen-lockedsig-cache +++ b/scripts/gen-lockedsig-cache @@ -62,7 +62,11 @@ for f in files: os.remove(dst) if (os.stat(src).st_dev == os.stat(destdir).st_dev): print('linking') - os.link(src, dst) + try: + os.link(src, dst) + except OSError as e: + print('hard linking failed, copying') + shutil.copyfile(src, dst) else: print('copying') shutil.copyfile(src, dst)