Patchwork [bitbake-devel,0/2] V3 replace os.system and os.popen with subbprocess module

mail settings
Submitter Robert Yang
Date May 16, 2012, 5:55 a.m.
Message ID <>
Download mbox
Permalink /patch/27801/
State New
Headers show


git:// robert/subprocess


Robert Yang - May 16, 2012, 5:55 a.m.
* Changes of V3:
  Use rather than bb.process.Popen() to replace os.popen()

* Changes of V2:

  - Remove the 2>/dev/null since we dont' need it.
  - Use the wrapped Popen from bb.process, which is simpler than

* Original message of V1:
Replace os.popen and os.system with subprocess.Popen and, since the older functions would fail (more or less) if
the executed program cannot be found, this would cause potential errors
since we don't know whether the problem executed well or not.

For the performance issue, I've done the testing before the patches and
after with the oe-core layer (also the oe-core have applied the similar

# The sources are on local disk

1) Before applied these pacthes to bitbake and similar patches to oe-core:
$ time bitbake core-image-sato
real    177m50.723s
user    436m1.551s
sys     71m29.588s

2) After applied the pathes:
$ time bitbake core-image-sato
real    176m26.194s
user    436m7.931s
sys     71m1.994s

After applied these patches, the time has reduced 84 seconds, this is
very slight, I think that we can assume this is just a deviation, it
doesn't cause performance problems.

// Robert

The following changes since commit f3ba3cb6af96aebf5167bb1565edf11cceb7897f:

  gdk-pixbuf: Fix lsb builds where dependency may be missing (2012-05-15 19:44:37 +0100)

are available in the git repository at:
  git:// robert/subprocess

Robert Yang (2):
  replace os.system with
  replace os.popen with subprocess.Popen

 bitbake/lib/bb/fetch2/            |    9 +++++----
 bitbake/lib/bb/fetch2/                 |    2 +-
 bitbake/lib/bb/                      |    6 +++---
 bitbake/lib/bb/ui/crumbs/ |    3 ++-
 bitbake/lib/bb/ui/crumbs/              |    7 ++++---
 bitbake/lib/bb/ui/crumbs/ |    3 ++-
 bitbake/lib/bb/ui/                 |    4 ++--
 7 files changed, 19 insertions(+), 15 deletions(-)