[OE-core] [PATCH 1/1] gen-lockedsig-cache: catch os.link error

brian avery brian.avery at intel.com
Wed Mar 15 00:04:32 UTC 2017


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 <brian.avery at intel.com>
---
 scripts/gen-lockedsig-cache | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/gen-lockedsig-cache b/scripts/gen-lockedsig-cache
index 49de74ed..1cfbeae 100755
--- a/scripts/gen-lockedsig-cache
+++ b/scripts/gen-lockedsig-cache
@@ -63,6 +63,12 @@ for f in files:
     if (os.stat(src).st_dev == os.stat(destdir).st_dev):
         print('linking')
         os.link(src, dst)
+        try:
+            os.link(src, dst)
+        except Exception:
+            print('hard linking failed, copying')
+            shutil.copyfile(src, dst)
+        os.link(src, dst)
     else:
         print('copying')
         shutil.copyfile(src, dst)
-- 
1.9.1




More information about the Openembedded-core mailing list