All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Jansa <martin.jansa@gmail.com>
To: openembedded-devel@lists.openembedded.org
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
Subject: [meta-oe][PATCH 7/7] kernel.bbclass: replace os.system with subprocess.call
Date: Tue, 17 Jul 2012 14:38:00 +0200	[thread overview]
Message-ID: <1342528680-6336-7-git-send-email-Martin.Jansa@gmail.com> (raw)
In-Reply-To: <1342528680-6336-1-git-send-email-Martin.Jansa@gmail.com>

From: Robert Yang <liezhi.yang@windriver.com>

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>
---
 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 248cd28..810d6de 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"
 
 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()
-- 
1.7.8.6




      parent reply	other threads:[~2012-07-17 12:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-16 17:38 [RFC][meta-oe][PATCH 1/3] kernel.bbclass: Rename to machine_kernel_pr.bbclass which provides added functionality Khem Raj
2012-07-16 17:38 ` [RFC][meta-oe][PATCH 2/3] testlab.bbclass: Delete Khem Raj
2012-07-16 17:38 ` [RFC][meta-oe][PATCH 3/3] blacklist.bbclass: Move to meta-angstrom Khem Raj
2012-07-16 17:46   ` Martin Jansa
2012-07-16 17:50     ` Khem Raj
2012-07-16 17:58       ` Martin Jansa
2012-07-16 18:00         ` Khem Raj
2012-07-16 18:04           ` Martin Jansa
2012-07-18 11:25             ` Martin Jansa
2012-07-16 17:50 ` [RFC][meta-oe][PATCH 1/3] kernel.bbclass: Rename to machine_kernel_pr.bbclass which provides added functionality Martin Jansa
2012-07-16 17:55   ` Khem Raj
2012-07-17 12:39     ` Martin Jansa
2012-07-17 12:37   ` [meta-oe][PATCH 1/7] kernel: save $kerndir/tools and $kerndir/lib from pruning Martin Jansa
2012-07-17 12:37     ` [meta-oe][PATCH 2/7] recipes-kernel: make perf a standalone package Martin Jansa
2012-07-17 12:37     ` [meta-oe][PATCH 3/7] kernel: Add kernel headers to kernel-dev package Martin Jansa
2012-07-17 12:37     ` [meta-oe][PATCH 4/7] kernel.bbclass: add non-santized kernel provides Martin Jansa
2012-07-17 12:37     ` [meta-oe][PATCH 5/7] kernel.bbclass: Dont package kxgettext.o Martin Jansa
2012-07-17 12:37     ` [meta-oe][PATCH 6/7] kernel.bbclass: add deploy link to KERNEL_IMAGETYPE Martin Jansa
2012-07-17 12:38     ` Martin Jansa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1342528680-6336-7-git-send-email-Martin.Jansa@gmail.com \
    --to=martin.jansa@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.