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 | 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 5af593ae46..62650be675 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): | |||
60 | return revision | 60 | return revision |
61 | 61 | ||
62 | def base_get_metadata_git_branch(path, d): | 62 | def base_get_metadata_git_branch(path, d): |
63 | branch = bb.process.run('cd %s; git branch | grep "^* " | tr -d "* "' % path)[0] | 63 | branch = os.popen('cd %s; git branch 2>&1 | grep "^* " | tr -d "* "' % path).read() |
64 | 64 | ||
65 | if len(branch) != 0: | 65 | if len(branch) != 0: |
66 | return branch | 66 | return branch |
67 | return "<unknown>" | 67 | return "<unknown>" |
68 | 68 | ||
69 | def base_get_metadata_git_revision(path, d): | 69 | def base_get_metadata_git_revision(path, d): |
70 | rev = bb.process.run("cd %s; git log -n 1 --pretty=oneline" % path)[0] | 70 | f = os.popen("cd %s; git log -n 1 --pretty=oneline -- 2>&1" % path) |
71 | if len(rev) != 0: | 71 | data = f.read() |
72 | rev = rev.split(" ")[0] | 72 | if f.close() is None: |
73 | return rev | 73 | rev = data.split(" ")[0] |
74 | if len(rev) != 0: | ||
75 | return rev | ||
74 | return "<unknown>" | 76 | return "<unknown>" |
75 | 77 | ||