Brad Bishop | a1e856b | 2015-11-19 22:06:41 -0600 | [diff] [blame] | 1 | def 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 Bishop | 7e3e11d | 2015-11-11 13:56:17 -0500 | [diff] [blame] | 7 | |
Brad Bishop | a1e856b | 2015-11-19 22:06:41 -0600 | [diff] [blame] | 8 | python() { |
| 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 Bishop | 7e3e11d | 2015-11-11 13:56:17 -0500 | [diff] [blame] | 18 | OS_RELEASE_FIELDS_append = " BUILD_ID" |