1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
def run_git(d, cmd): try: oeroot = d.getVar('COREBASE', True) return bb.process.run("git --git-dir %s/.git %s" %(oeroot, cmd))[0].strip('\n') except: pass python() { version_id = run_git(d, 'tag') if version_id: d.setVar('VERSION_ID', version_id) build_id = run_git(d, 'describe --dirty') if build_id: d.setVar('BUILD_ID', build_id) } OS_RELEASE_FIELDS_append = " BUILD_ID"