replace os.popen with subprocess.Popen
authorRobert Yang <liezhi.yang@windriver.com>
Sun, 20 May 2012 12:36:06 +0000 (20:36 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 23 May 2012 10:29:37 +0000 (11:29 +0100)
commit8d6700255a6d4dda403c89b171a6d4a1883e5aae
treed150ebc7eda3bf29e54f937d1b95d199bdddce84
parentf5b3bf115dc1ffbfb241a49cec0fc3654cb71021
replace os.popen with subprocess.Popen

Replace os.popen with subprocess.Popen since the older function would
fail (more or less) silently if the executed program cannot be found

There is a bb.process.run() which will invoke the Popen to run command,
use it for simplify the code.

For the:
p4file = os.popen("%s%s files %s" % (p4cmd, p4opt, depot))
...
for file in p4file:
    list = file.split()

in bitbake/lib/bb/fetch2/perforce.py, it should be an error in the past,
since it didn't use readline() to read the pipe, but directly used the
split() for the pipe. Use the bb.process.run would fix the problem since
bb.process.run will return strings.

More info:
http://docs.python.org/library/subprocess.html#subprocess-replacements

[YOCTO #2075]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/fetch2/perforce.py
lib/bb/fetch2/svk.py
lib/bb/ui/crumbs/builddetailspage.py
lib/bb/ui/crumbs/hig.py