]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
gen-lockedsig-cache: catch os.link error
authorbrian avery <avery.brian@gmail.com>
Sun, 19 Mar 2017 17:32:40 +0000 (10:32 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 21 Mar 2017 22:43:02 +0000 (22:43 +0000)
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@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/gen-lockedsig-cache

index 49de74ed9b21a0a1cb1307508dd399f7b419eac1..6765891d1986f9ef4bec8bb753791ba5ce148767 100755 (executable)
@@ -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)