summaryrefslogtreecommitdiffstats
path: root/scripts/gen-lockedsig-cache
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-10-16 11:34:39 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-19 17:57:59 +0100
commit5febb1dc5b339d68044f549fc046d700aa9124a9 (patch)
treed3c5c484e00b0a186967e73e82fa116bd0bebe3e /scripts/gen-lockedsig-cache
parent3b5d6ffd77a0754aa2771ea50ea8dc2b4d252099 (diff)
downloadpoky-5febb1dc5b339d68044f549fc046d700aa9124a9.tar.gz
scripts/gen-lockedsig-cache: fix race with temp file creation
As part of populating the sstate-cache with an artifact (.tgz file) we create a temp file and then atomically move it to the final name. Due to the glob used in this script such temp files were being matched, and between the time they were matched and the time the script started copying files, the temp file may have vanished. This fixes random "No such file or directory" failures building the extensible SDK on build setups where the sstate-cache directory is shared amongst multiple build machines. (From OE-Core rev: 588de5198c641ea1cfc3e01a6d129296bd2f706b) 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-cache4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/gen-lockedsig-cache b/scripts/gen-lockedsig-cache
index c93b2c0b99..806c1e4caa 100755
--- a/scripts/gen-lockedsig-cache
+++ b/scripts/gen-lockedsig-cache
@@ -34,6 +34,10 @@ for s in sigs:
34 files |= set(glob.glob(p)) 34 files |= set(glob.glob(p))
35 35
36for f in files: 36for f in files:
37 _, ext = os.path.splitext(f)
38 if not ext in ['.tgz', '.siginfo', '.sig']:
39 # Most likely a temp file, skip it
40 continue
37 dst = f.replace(sys.argv[2], sys.argv[3]) 41 dst = f.replace(sys.argv[2], sys.argv[3])
38 destdir = os.path.dirname(dst) 42 destdir = os.path.dirname(dst)
39 mkdir(destdir) 43 mkdir(destdir)