[oe-commits] Robert Yang : kernel.bbclass: replace os.system with subprocess.call
git at git.openembedded.org
git at git.openembedded.org
Wed Oct 17 07:05:34 UTC 2012
Module: meta-openembedded.git
Branch: denzil
Commit: 623337a4de73b6eab8c189f21f081cfe4465acc5
URL: http://git.openembedded.org/?p=meta-openembedded.git&a=commit;h=623337a4de73b6eab8c189f21f081cfe4465acc5
Author: Robert Yang <liezhi.yang at windriver.com>
Date: Tue Jul 17 12:38:00 2012 +0000
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 at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
Signed-off-by: Koen Kooi <koen at dominion.thruhere.net>
---
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 f68d8a9..d5b3914 100644
--- a/meta-oe/classes/kernel.bbclass
+++ b/meta-oe/classes/kernel.bbclass
@@ -315,12 +315,12 @@ module_conf_rfcomm = "alias bt-proto-3 rfcomm"
python populate_packages_prepend () {
def extract_modinfo(file):
- import tempfile, re
+ import tempfile, re, subprocess
tempfile.tempdir = d.getVar("WORKDIR", True)
tf = tempfile.mkstemp()
tmpfile = tf[1]
cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("PATH", True), d.getVar("HOST_PREFIX", True) or "", file, tmpfile)
- os.system(cmd)
+ subprocess.call(cmd, shell=True)
f = open(tmpfile)
l = f.read().split("\000")
f.close()
More information about the Openembedded-commits
mailing list