summaryrefslogtreecommitdiff
path: root/meta/classes/metadata_scm.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-30 14:20:04 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-30 14:20:04 +0100
commitf5356062443320c29a19cfd7113128caa185b221 (patch)
treee1458660ec06896311c93ac6f17b1b4c5afc24c5 /meta/classes/metadata_scm.bbclass
parent004ba67298e3e6e618df29597e9166c971a1941c (diff)
downloadopenembedded-core-f5356062443320c29a19cfd7113128caa185b221.tar.gz
openembedded-core-f5356062443320c29a19cfd7113128caa185b221.tar.bz2
openembedded-core-f5356062443320c29a19cfd7113128caa185b221.zip
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.
Diffstat (limited to 'meta/classes/metadata_scm.bbclass')
-rw-r--r--meta/classes/metadata_scm.bbclass12
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):
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>"