diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2012-07-17 12:38:00 +0000 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2012-07-18 09:23:08 +0200 |
commit | 778f8b62c597f0550c33db4ab00f44979e02daa1 (patch) | |
tree | f376e48d13352fd461f4e98e98e178261c6e1723 /meta-oe/classes | |
parent | c1952180fe80b5769d12f8247ab3d652d2d5c053 (diff) | |
download | meta-openembedded-778f8b62c597f0550c33db4ab00f44979e02daa1.tar.gz |
kernel.bbclass: replace os.system with subprocess.call
Replace os.system with subprocess.call since the older function would
fail (more or less) silently if the executed program cannot be found
More info:
http://docs.python.org/library/subprocess.html#subprocess-replacements
[YOCTO #2454]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/classes')
-rw-r--r-- | meta-oe/classes/kernel.bbclass | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta-oe/classes/kernel.bbclass b/meta-oe/classes/kernel.bbclass index 248cd2803..810d6de68 100644 --- a/meta-oe/classes/kernel.bbclass +++ b/meta-oe/classes/kernel.bbclass | |||
@@ -316,12 +316,12 @@ module_conf_rfcomm = "alias bt-proto-3 rfcomm" | |||
316 | 316 | ||
317 | python populate_packages_prepend () { | 317 | python populate_packages_prepend () { |
318 | def extract_modinfo(file): | 318 | def extract_modinfo(file): |
319 | import tempfile, re | 319 | import tempfile, re, subprocess |
320 | tempfile.tempdir = d.getVar("WORKDIR", True) | 320 | tempfile.tempdir = d.getVar("WORKDIR", True) |
321 | tf = tempfile.mkstemp() | 321 | tf = tempfile.mkstemp() |
322 | tmpfile = tf[1] | 322 | tmpfile = tf[1] |
323 | cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("PATH", True), d.getVar("HOST_PREFIX", True) or "", file, tmpfile) | 323 | cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("PATH", True), d.getVar("HOST_PREFIX", True) or "", file, tmpfile) |
324 | os.system(cmd) | 324 | subprocess.call(cmd, shell=True) |
325 | f = open(tmpfile) | 325 | f = open(tmpfile) |
326 | l = f.read().split("\000") | 326 | l = f.read().split("\000") |
327 | f.close() | 327 | f.close() |