1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

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]

(From OE-Core rev: a07d03cc6f67c88feb9813ae7deb6e4a93552dfe)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Robert Yang
2012-05-29 22:53:06 +08:00
committed by Richard Purdie
parent e4c35790d6
commit e40995e569
14 changed files with 74 additions and 52 deletions
+3 -2
View File
@@ -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