diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2012-06-01 16:03:58 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-06-05 22:49:19 +0100 |
commit | 0efe773c1752ab28b6cc488da19892d490b5b92b (patch) | |
tree | 91234e5f655dc7c592591887d9e243026e340a43 /scripts/lib/bsp/kernel.py | |
parent | de4cdfd6bc1280ac7ac0559b87734d26294ef773 (diff) | |
download | poky-0efe773c1752ab28b6cc488da19892d490b5b92b.tar.gz |
kernel.py: 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
More info:
http://docs.python.org/library/subprocess.html#subprocess-replacements
[YOCTO #2454]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Diffstat (limited to 'scripts/lib/bsp/kernel.py')
-rw-r--r-- | scripts/lib/bsp/kernel.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py index 8b3aa72c9c..7c6da4e2eb 100644 --- a/scripts/lib/bsp/kernel.py +++ b/scripts/lib/bsp/kernel.py | |||
@@ -31,6 +31,7 @@ import os | |||
31 | import shutil | 31 | import shutil |
32 | from tags import * | 32 | from tags import * |
33 | import glob | 33 | import glob |
34 | import subprocess | ||
34 | 35 | ||
35 | 36 | ||
36 | def find_bblayers(scripts_path): | 37 | def find_bblayers(scripts_path): |
@@ -678,7 +679,7 @@ def base_branches(context): | |||
678 | print "Getting branches from remote repo %s..." % giturl | 679 | print "Getting branches from remote repo %s..." % giturl |
679 | 680 | ||
680 | gitcmd = "git ls-remote %s *heads* 2>&1" % (giturl) | 681 | gitcmd = "git ls-remote %s *heads* 2>&1" % (giturl) |
681 | tmp = os.popen(gitcmd).read() | 682 | tmp = subprocess.Popen(gitcmd, shell=True, stdout=subprocess.PIPE).stdout.read() |
682 | 683 | ||
683 | branches = [] | 684 | branches = [] |
684 | 685 | ||
@@ -708,7 +709,7 @@ def all_branches(context): | |||
708 | print "Getting branches from remote repo %s..." % giturl | 709 | print "Getting branches from remote repo %s..." % giturl |
709 | 710 | ||
710 | gitcmd = "git ls-remote %s *heads* 2>&1" % (giturl) | 711 | gitcmd = "git ls-remote %s *heads* 2>&1" % (giturl) |
711 | tmp = os.popen(gitcmd).read() | 712 | tmp = subprocess.Popen(gitcmd, shell=True, stdout=subprocess.PIPE).stdout.read() |
712 | 713 | ||
713 | branches = [] | 714 | branches = [] |
714 | 715 | ||