diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2012-05-29 22:53:06 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-30 10:56:15 +0100 |
commit | a07d03cc6f67c88feb9813ae7deb6e4a93552dfe (patch) | |
tree | d95be4dce79dfdce785d92b18f82dfa656a529f4 /meta/classes/distrodata.bbclass | |
parent | b1ea93143a473f006b31ab22f88baf41661971a7 (diff) | |
download | openembedded-core-a07d03cc6f67c88feb9813ae7deb6e4a93552dfe.tar.gz openembedded-core-a07d03cc6f67c88feb9813ae7deb6e4a93552dfe.tar.bz2 openembedded-core-a07d03cc6f67c88feb9813ae7deb6e4a93552dfe.zip |
meta: 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>
Diffstat (limited to 'meta/classes/distrodata.bbclass')
-rw-r--r-- | meta/classes/distrodata.bbclass | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/classes/distrodata.bbclass b/meta/classes/distrodata.bbclass index 4b2dee5b10..df6d300666 100644 --- a/meta/classes/distrodata.bbclass +++ b/meta/classes/distrodata.bbclass @@ -231,6 +231,7 @@ python do_checkpkg() { import sys import re import tempfile + import subprocess """ sanity check to ensure same name and type. Match as many patterns as possible @@ -373,7 +374,7 @@ python do_checkpkg() { f.close() if status != "ErrHostNoDir" and re.match("Err", status): logpath = d.getVar('LOG_DIR', True) - os.system("cp %s %s/" % (f.name, logpath)) + subprocess.call("cp %s %s/" % (f.name, logpath), shell=True) os.unlink(f.name) return status @@ -432,7 +433,7 @@ python do_checkpkg() { """if host hasn't directory information, no need to save tmp file""" if status != "ErrHostNoDir" and re.match("Err", status): logpath = d.getVar('LOG_DIR', True) - os.system("cp %s %s/" % (f.name, logpath)) + subprocess.call("cp %s %s/" % (f.name, logpath), shell=True) os.unlink(f.name) return status |