mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
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>
This commit is contained in:
@@ -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>"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user