Skip to content
Snippets Groups Projects
Commit d89a5ea6 authored by Nam Tran's avatar Nam Tran Committed by Jonas Höppner
Browse files

config: add distro-info.inc

Add git log function to get timestamp of tag, merge with the git-describe.inc file into distro-info.inc
parent d4da2a81
No related branches found
No related tags found
1 merge request!294setup-environment: set default timestamp to latest manifest tag
def distro_match(distro="seconorth-wayland"):
if 'seconorth-fngsystem' in distro:
tagmatch="fngsystem[-/]*"
else:
tagmatch="kirkstone[-/]*"
return tagmatch
def git_describe(dir, distro):
tagmatch = distro_match(distro)
cmd="cd {} && git describe --tags --match '{}'".format( dir, tagmatch)
process = os.popen(cmd)
version = process.read().strip().replace('/', '-')
bb.note( "Set DISTRO_VERSION='{}' for distro {} (matches tags with {})".format(version,distro,tagmatch))
if len(version) < 5:
bb.warn("git describe on manifest failed, unable to determine correct version string.")
bb.warn("Command executed was: {}.".format(cmd))
process.close()
return version
def git_log(dir, distro):
tagmatch = distro_match(distro)
cmd="cd {} && git log --tags='{}' --simplify-by-decoration -n 1 --pretty='format:%ct'".format( dir, tagmatch)
process = os.popen(cmd)
date = process.read().strip()
bb.note( "Set REPRODUCIBLE_TIMESTAMP_ROOTFS='{}' for distro {} (matches tags with {})".format(date,distro,tagmatch))
if len(date) < 10:
bb.warn("git log on manifest failed, unable to determine correct version string.")
bb.warn("Command executed was: {}.".format(cmd))
process.close()
return date
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment