blob: ba6a7721e7f13cb0a49be703aa1286132859b394 [file] [log] [blame]
Brad Bishopa1e856b2015-11-19 22:06:41 -06001def run_git(d, cmd):
2 try:
3 oeroot = d.getVar('COREBASE', True)
4 return bb.process.run("git --git-dir %s/.git %s" %(oeroot, cmd))[0].strip('\n')
5 except:
6 pass
Brad Bishop7e3e11d2015-11-11 13:56:17 -05007
Brad Bishopa1e856b2015-11-19 22:06:41 -06008python() {
9 version_id = run_git(d, 'tag')
10 if version_id:
11 d.setVar('VERSION_ID', version_id)
12
13 build_id = run_git(d, 'describe --dirty')
14 if build_id:
15 d.setVar('BUILD_ID', build_id)
16}
17
Brad Bishop7e3e11d2015-11-11 13:56:17 -050018OS_RELEASE_FIELDS_append = " BUILD_ID"