From: Richard Purdie Date: Tue, 1 Feb 2011 12:27:20 +0000 (+0000) Subject: kernel.bbclass: Add fix from OE.dev for tmpnam() usage X-Git-Tag: 2011-1~2611 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=2d9cc7ec314055cd8e2d25df633540bd7ced6885;p=openembedded-core.git kernel.bbclass: Add fix from OE.dev for tmpnam() usage Signed-off-by: Richard Purdie --- diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 9d3b2bbd8a..59de148cc8 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -292,13 +292,16 @@ module_conf_rfcomm = "alias bt-proto-3 rfcomm" python populate_packages_prepend () { def extract_modinfo(file): - import re - tmpfile = os.tmpnam() + import tempfile, re + tempfile.tempdir = bb.data.getVar("WORKDIR", d, 1) + tf = tempfile.mkstemp() + tmpfile = tf[1] cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (bb.data.getVar("PATH", d, 1), bb.data.getVar("HOST_PREFIX", d, 1) or "", file, tmpfile) os.system(cmd) f = open(tmpfile) l = f.read().split("\000") f.close() + os.close(tf[0]) os.unlink(tmpfile) exp = re.compile("([^=]+)=(.*)") vals = {}