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 12:04:45 +0100 |
| commit | e40995e569289598a1d9d71e19734402f2b54718 (patch) | |
| tree | 108328e272a149da0e27dec0e0f0bebe602b80b8 /meta/lib/oe | |
| parent | e4c35790d6dc23a0933f188f52fa4434784e1d98 (diff) | |
| download | poky-e40995e569289598a1d9d71e19734402f2b54718.tar.gz | |
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>
Diffstat (limited to 'meta/lib/oe')
| -rw-r--r-- | meta/lib/oe/distro_check.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/lib/oe/distro_check.py b/meta/lib/oe/distro_check.py index cc836de38d..455135e650 100644 --- a/meta/lib/oe/distro_check.py +++ b/meta/lib/oe/distro_check.py | |||
| @@ -343,6 +343,7 @@ def compare_in_distro_packages_list(distro_check_dir, d): | |||
| 343 | return matching_distros | 343 | return matching_distros |
| 344 | 344 | ||
| 345 | def create_log_file(d, logname): | 345 | def create_log_file(d, logname): |
| 346 | import subprocess | ||
| 346 | logpath = d.getVar('LOG_DIR', True) | 347 | logpath = d.getVar('LOG_DIR', True) |
| 347 | bb.utils.mkdirhier(logpath) | 348 | bb.utils.mkdirhier(logpath) |
| 348 | logfn, logsuffix = os.path.splitext(logname) | 349 | logfn, logsuffix = os.path.splitext(logname) |
| @@ -351,7 +352,7 @@ def create_log_file(d, logname): | |||
| 351 | slogfile = os.path.join(logpath, logname) | 352 | slogfile = os.path.join(logpath, logname) |
| 352 | if os.path.exists(slogfile): | 353 | if os.path.exists(slogfile): |
| 353 | os.remove(slogfile) | 354 | os.remove(slogfile) |
| 354 | os.system("touch %s" % logfile) | 355 | subprocess.call("touch %s" % logfile, shell=True) |
| 355 | os.symlink(logfile, slogfile) | 356 | os.symlink(logfile, slogfile) |
| 356 | d.setVar('LOG_FILE', logfile) | 357 | d.setVar('LOG_FILE', logfile) |
| 357 | return logfile | 358 | return logfile |
