blob: b112c50d9cb3fc4979bfba06093fd3b852c7582a [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() {
Brad Bishop81cecaf2015-12-18 15:36:47 -05009 version_id = run_git(d, 'describe --abbrev=0')
Brad Bishopa1e856b2015-11-19 22:06:41 -060010 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"
Brad Bishop81cecaf2015-12-18 15:36:47 -050019do_compile[nostamp] = "1"