summaryrefslogtreecommitdiffstats
path: root/scripts/gen-lockedsig-cache
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-08-11 16:44:58 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-17 10:35:40 +0100
commit0a78f987de9528c042500c5cd756b9c2bae64db0 (patch)
tree8df49b2bf98bfe6308da57e12937b10de081f529 /scripts/gen-lockedsig-cache
parent65ff9f5e0a8fb07379a384cba5c9510827fc6ae8 (diff)
downloadpoky-0a78f987de9528c042500c5cd756b9c2bae64db0.tar.gz
gen-lockedsig-cache: ensure symlinks are dereferenced
If you set up a local mirror in SSTATE_MIRRORS then you can end up with symlinks in SSTATE_DIR rather than real files. We don't want these symlinks in the sstate-cache prodcued by gen-lockedsig-cache, so dereference any symlinks before copying. (From OE-Core rev: d65a6ee9e7a9c63b9a16bdb5025af8a7c6433c4f) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/gen-lockedsig-cache')
-rwxr-xr-xscripts/gen-lockedsig-cache7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/gen-lockedsig-cache b/scripts/gen-lockedsig-cache
index de8a20c787..49de74ed9b 100755
--- a/scripts/gen-lockedsig-cache
+++ b/scripts/gen-lockedsig-cache
@@ -57,13 +57,14 @@ for f in files:
57 destdir = os.path.dirname(dst) 57 destdir = os.path.dirname(dst)
58 mkdir(destdir) 58 mkdir(destdir)
59 59
60 src = os.path.realpath(f)
60 if os.path.exists(dst): 61 if os.path.exists(dst):
61 os.remove(dst) 62 os.remove(dst)
62 if (os.stat(f).st_dev == os.stat(destdir).st_dev): 63 if (os.stat(src).st_dev == os.stat(destdir).st_dev):
63 print('linking') 64 print('linking')
64 os.link(f, dst) 65 os.link(src, dst)
65 else: 66 else:
66 print('copying') 67 print('copying')
67 shutil.copyfile(f, dst) 68 shutil.copyfile(src, dst)
68 69
69print('Done!') 70print('Done!')