summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/metadata_scm.bbclass20
1 files changed, 10 insertions, 10 deletions
diff --git a/meta/classes/metadata_scm.bbclass b/meta/classes/metadata_scm.bbclass
index 64465faa4c..0f7f4235a3 100644
--- a/meta/classes/metadata_scm.bbclass
+++ b/meta/classes/metadata_scm.bbclass
@@ -65,19 +65,19 @@ def base_get_metadata_svn_revision(path, d):
65 return revision 65 return revision
66 66
67def base_get_metadata_git_branch(path, d): 67def base_get_metadata_git_branch(path, d):
68 import subprocess 68 import bb.process
69 69
70 try: 70 try:
71 return subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"], 71 rev, _ = bb.process.run('git rev-parse --abbrev-ref HEAD', cwd=path)
72 cwd=path).strip() 72 except bb.process.ExecutionError:
73 except: 73 rev = '<unknown>'
74 return "<unknown>" 74 return rev.strip()
75 75
76def base_get_metadata_git_revision(path, d): 76def base_get_metadata_git_revision(path, d):
77 import subprocess 77 import bb.process
78 78
79 try: 79 try:
80 return subprocess.check_output(["git", "rev-parse", "HEAD"], 80 rev, _ = bb.process.run('git rev-parse HEAD', cwd=path)
81 cwd=path).strip() 81 except bb.process.ExecutionError:
82 except: 82 rev = '<unknown>'
83 return "<unknown>" 83 return rev.strip()