summaryrefslogtreecommitdiffstats
path: root/documentation/set_versions.py
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/set_versions.py')
-rwxr-xr-xdocumentation/set_versions.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/documentation/set_versions.py b/documentation/set_versions.py
index 5c55f470d7..b94a7daad0 100755
--- a/documentation/set_versions.py
+++ b/documentation/set_versions.py
@@ -170,17 +170,29 @@ series = [k for k in release_series]
170previousseries = series[series.index(ourseries)+1:] or [""] 170previousseries = series[series.index(ourseries)+1:] or [""]
171lastlts = [k for k in previousseries if k in ltsseries] or "dunfell" 171lastlts = [k for k in previousseries if k in ltsseries] or "dunfell"
172 172
173latestreltag = subprocess.run(["git", "describe", "--abbrev=0", "--tags", "--match", "yocto-*"], capture_output=True, text=True).stdout
174latestreltag = latestreltag.strip()
175if latestreltag:
176 if latestreltag.startswith("yocto-"):
177 latesttag = latestreltag[6:]
178else:
179 # fallback on the calculated version
180 print("Did not find a tag with 'git describe', falling back to %s" % ourversion)
181 latestreltag = "yocto-" + ourversion
182 latesttag = ourversion
183
173print("Version calculated to be %s" % ourversion) 184print("Version calculated to be %s" % ourversion)
185print("Latest release tag found is %s" % latestreltag)
174print("Release series calculated to be %s" % ourseries) 186print("Release series calculated to be %s" % ourseries)
175 187
176replacements = { 188replacements = {
177 "DISTRO" : ourversion, 189 "DISTRO" : ourversion,
190 "DISTRO_LATEST_TAG": latesttag,
178 "DISTRO_NAME_NO_CAP" : ourseries, 191 "DISTRO_NAME_NO_CAP" : ourseries,
179 "DISTRO_NAME" : ourseries.capitalize(), 192 "DISTRO_NAME" : ourseries.capitalize(),
180 "DISTRO_NAME_NO_CAP_MINUS_ONE" : previousseries[0], 193 "DISTRO_NAME_NO_CAP_MINUS_ONE" : previousseries[0],
181 "DISTRO_NAME_NO_CAP_LTS" : lastlts[0], 194 "DISTRO_NAME_NO_CAP_LTS" : lastlts[0],
182 "YOCTO_DOC_VERSION" : ourversion, 195 "YOCTO_DOC_VERSION" : ourversion,
183 "DISTRO_REL_TAG" : "yocto-" + ourversion,
184 "DOCCONF_VERSION" : docconfver, 196 "DOCCONF_VERSION" : docconfver,
185 "BITBAKE_SERIES" : bitbakeversion, 197 "BITBAKE_SERIES" : bitbakeversion,
186} 198}
@@ -318,3 +330,5 @@ with open('releases.rst', 'w') as f:
318 if tag == release_series[series] or tag.startswith('%s.' % release_series[series]): 330 if tag == release_series[series] or tag.startswith('%s.' % release_series[series]):
319 f.write('- :yocto_docs:`%s Documentation </%s>`\n' % (tag, tag)) 331 f.write('- :yocto_docs:`%s Documentation </%s>`\n' % (tag, tag))
320 f.write('\n') 332 f.write('\n')
333
334