[oe-commits] [openembedded-core] 18/62: gen-lockedsig-cache: ensure symlinks are dereferenced
git at git.openembedded.org
git at git.openembedded.org
Wed Aug 17 09:36:35 UTC 2016
rpurdie pushed a commit to branch master
in repository openembedded-core.
commit d65a6ee9e7a9c63b9a16bdb5025af8a7c6433c4f
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Thu Aug 11 16:44:58 2016 +1200
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.
Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
scripts/gen-lockedsig-cache | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/scripts/gen-lockedsig-cache b/scripts/gen-lockedsig-cache
index de8a20c..49de74e 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!')
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list