px_update_git_header:Extract latest release tag

This commit is contained in:
David Sidrane 2022-03-23 11:56:56 -07:00 committed by Daniel Agar
parent 82c1ffb8f8
commit d6db06faf3
1 changed files with 3 additions and 2 deletions

View File

@ -148,8 +148,9 @@ if (os.path.exists('src/modules/mavlink/mavlink/.git')):
# NuttX
if (os.path.exists('platforms/nuttx/NuttX/nuttx/.git')):
nuttx_git_tag = subprocess.check_output('git describe --always --tags --match nuttx-* --dirty'.split(),
cwd='platforms/nuttx/NuttX/nuttx', stderr=subprocess.STDOUT).decode('utf-8').strip().replace("nuttx-", "v")
nuttx_git_tags = subprocess.check_output('git -c versionsort.suffix=- tag --sort=v:refname'.split(),
cwd='platforms/nuttx/NuttX/nuttx', stderr=subprocess.STDOUT).decode('utf-8').strip()
nuttx_git_tag = re.findall(r'nuttx-[0-9]+\.[0-9]+\.[0-9]+', nuttx_git_tags)[-1].replace("nuttx-", "v")
nuttx_git_tag = re.sub('-.*', '.0', nuttx_git_tag)
nuttx_git_version = subprocess.check_output('git rev-parse --verify HEAD'.split(),
cwd='platforms/nuttx/NuttX/nuttx', stderr=subprocess.STDOUT).decode('utf-8').strip()