]> code.ossystems Code Review - openembedded-core.git/commitdiff
patch.bbclass: unset TMPDIR after use
authorRoss Burton <ross.burton@intel.com>
Thu, 26 Jun 2014 14:16:55 +0000 (15:16 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 29 Jun 2014 07:58:30 +0000 (08:58 +0100)
GNU Patch < 2.6.1 has a race condition so we create a per-instance TMPDIR to
avoid this.  This was implemented by setting os.environ[TMPDIR] but at the end
of do_patch the temporary directory is deleted but TMPDIR is not unset.

In general this doesn't cause a problem but if do_patch is embedded in a larger
function then TMPDIR is set to a directory that doesn't exist.  Avoid this by
removing TMPDIR from os.environ when the directory is deleted.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/patch.bbclass

index 86c65b3b8d72b116024d4e56d834e7220ba38d47..1e2aab04186537f2f50df92b68614c3166e2f611 100644 (file)
@@ -177,6 +177,7 @@ python patch_do_patch() {
             bb.fatal(str(e))
 
     bb.utils.remove(process_tmpdir, True)
+    del os.environ['TMPDIR']
 }
 patch_do_patch[vardepsexclude] = "PATCHRESOLVE"