From 0a78f987de9528c042500c5cd756b9c2bae64db0 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Thu, 11 Aug 2016 16:44:58 +1200 Subject: 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 Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- scripts/gen-lockedsig-cache | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts/gen-lockedsig-cache') 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: destdir = os.path.dirname(dst) mkdir(destdir) + src = os.path.realpath(f) if os.path.exists(dst): os.remove(dst) - if (os.stat(f).st_dev == os.stat(destdir).st_dev): + if (os.stat(src).st_dev == os.stat(destdir).st_dev): print('linking') - os.link(f, dst) + os.link(src, dst) else: print('copying') - shutil.copyfile(f, dst) + shutil.copyfile(src, dst) print('Done!') -- cgit v1.2.3-54-g00ecf