We must use one TMPDIR per process (/tmp/${PID}) so that the patching processes don't generate the same temp file name (the "patch" program uses the TMPDIR environment variable for deciding where to create the temp files).
[YOCTO #3070] Signed-off-by: Constantin Musca <constantinx.mu...@intel.com> --- meta/classes/patch.bbclass | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass index a724972..d010438 100644 --- a/meta/classes/patch.bbclass +++ b/meta/classes/patch.bbclass @@ -139,6 +139,13 @@ python patch_do_patch() { path = os.getenv('PATH') os.putenv('PATH', d.getVar('PATH', True)) + import shutil + process_tmpdir = os.path.join('/tmp', str(os.getpid())) + if os.path.exists(process_tmpdir): + shutil.rmtree(process_tmpdir) + os.makedirs(process_tmpdir) + os.environ['TMPDIR'] = process_tmpdir + for patch in src_patches(d): _, _, local, _, _, parm = bb.decodeurl(patch) @@ -161,11 +168,15 @@ python patch_do_patch() { try: patchset.Import({"file":local, "strippath": parm['striplevel']}, True) except Exception as exc: + shutil.rmtree(process_tmpdir) bb.fatal(str(exc)) try: resolver.Resolve() except bb.BBHandledException as e: + shutil.rmtree(process_tmpdir) bb.fatal(str(e)) + + shutil.rmtree(process_tmpdir) } patch_do_patch[vardepsexclude] = "PATCHRESOLVE" -- 1.7.9.5 _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core