[oe-commits] Ross Burton : patch.bbclass: unset TMPDIR after use

git at git.openembedded.org git at git.openembedded.org
Mon Jun 30 15:37:35 UTC 2014


Module: openembedded-core.git
Branch: master-next
Commit: 51ea4378864f1468df2ca282a84f78a17d6861aa
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=51ea4378864f1468df2ca282a84f78a17d6861aa

Author: Ross Burton <ross.burton at intel.com>
Date:   Thu Jun 26 15:16:55 2014 +0100

patch.bbclass: unset TMPDIR after use

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 at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/patch.bbclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass
index 86c65b3..1e2aab0 100644
--- a/meta/classes/patch.bbclass
+++ b/meta/classes/patch.bbclass
@@ -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"
 



More information about the Openembedded-commits mailing list