From patchwork Thu Sep 6 11:23:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [meta-oe, for-denzil, 6/8] kernel.bbclass: replace os.system with subprocess.call Date: Thu, 06 Sep 2012 11:23:28 -0000 From: Koen Kooi X-Patchwork-Id: 36043 Message-Id: <1346930610-2977-6-git-send-email-koen@dominion.thruhere.net> To: openembedded-devel@lists.openembedded.org Cc: Koen Kooi , =?UTF-8?q?Eric=20B=C3=A9nard?= From: Robert Yang 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 Signed-off-by: Richard Purdie Signed-off-by: Martin Jansa Signed-off-by: Koen Kooi --- 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()