diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-30 14:20:04 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-30 14:21:29 +0100 |
commit | 0d9e89371158c4c329eebab3bc6609250b4c86c0 (patch) | |
tree | 3bc4b02ee601a1a4be6f7cf8c33a60251bde9032 /meta/classes/metadata_scm.bbclass | |
parent | bc386b89345d1a4c941744f911065d498028d9d3 (diff) | |
download | ast2050-yocto-poky-0d9e89371158c4c329eebab3bc6609250b4c86c0.zip ast2050-yocto-poky-0d9e89371158c4c329eebab3bc6609250b4c86c0.tar.gz |
Revert "meta: replace os.popen with subprocess.Popen"
This reverts commit e83d8e58a6b107eea87df0ec233a1bc932b2c6e as the conversion
is not correct. Its replacing readlines() calls which generate an array with
what are effectively strings. There are split("\n") calls missing in many
cases so this needs to be reverted until it gets fixed.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/metadata_scm.bbclass')
-rw-r--r-- | meta/classes/metadata_scm.bbclass | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/meta/classes/metadata_scm.bbclass b/meta/classes/metadata_scm.bbclass index 5af593a..62650be 100644 --- a/meta/classes/metadata_scm.bbclass +++ b/meta/classes/metadata_scm.bbclass @@ -60,16 +60,18 @@ def base_get_metadata_svn_revision(path, d): return revision def base_get_metadata_git_branch(path, d): - branch = bb.process.run('cd %s; git branch | grep "^* " | tr -d "* "' % path)[0] + branch = os.popen('cd %s; git branch 2>&1 | grep "^* " | tr -d "* "' % path).read() if len(branch) != 0: return branch return "<unknown>" def base_get_metadata_git_revision(path, d): - rev = bb.process.run("cd %s; git log -n 1 --pretty=oneline" % path)[0] - if len(rev) != 0: - rev = rev.split(" ")[0] - return rev + f = os.popen("cd %s; git log -n 1 --pretty=oneline -- 2>&1" % path) + data = f.read() + if f.close() is None: + rev = data.split(" ")[0] + if len(rev) != 0: + return rev return "<unknown>" |