diff options
Diffstat (limited to 'meta/classes/metadata_scm.bbclass')
-rw-r--r-- | meta/classes/metadata_scm.bbclass | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/meta/classes/metadata_scm.bbclass b/meta/classes/metadata_scm.bbclass index 62650be675..5af593ae46 100644 --- a/meta/classes/metadata_scm.bbclass +++ b/meta/classes/metadata_scm.bbclass | |||
@@ -60,18 +60,16 @@ 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 = os.popen('cd %s; git branch 2>&1 | grep "^* " | tr -d "* "' % path).read() | 63 | branch = bb.process.run('cd %s; git branch | grep "^* " | tr -d "* "' % path)[0] |
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 | f = os.popen("cd %s; git log -n 1 --pretty=oneline -- 2>&1" % path) | 70 | rev = bb.process.run("cd %s; git log -n 1 --pretty=oneline" % path)[0] |
71 | data = f.read() | 71 | if len(rev) != 0: |
72 | if f.close() is None: | 72 | rev = rev.split(" ")[0] |
73 | rev = data.split(" ")[0] | 73 | return rev |
74 | if len(rev) != 0: | ||
75 | return rev | ||
76 | return "<unknown>" | 74 | return "<unknown>" |
77 | 75 | ||