]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
scripts/gen-lockedsig-cache: fix race with temp file creation
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Fri, 16 Oct 2015 10:34:39 +0000 (11:34 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 19 Oct 2015 16:54:36 +0000 (17:54 +0100)
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.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/gen-lockedsig-cache

index c93b2c0b99bed52b9bf7d218a4a6c98218472c6f..806c1e4caa29b19b1597bdce194f8b840c5efd03 100755 (executable)
@@ -34,6 +34,10 @@ for s in sigs:
     files |= set(glob.glob(p))
 
 for f in files:
+    _, ext = os.path.splitext(f)
+    if not ext in ['.tgz', '.siginfo', '.sig']:
+        # Most likely a temp file, skip it
+        continue
     dst = f.replace(sys.argv[2], sys.argv[3])
     destdir = os.path.dirname(dst)
     mkdir(destdir)