diff options
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 | ||