summaryrefslogtreecommitdiffstats
path: root/documentation/set_versions.py
diff options
context:
space:
mode:
authorAntonin Godard <antonin.godard@bootlin.com>2025-04-09 11:55:41 +0200
committerSteve Sakoman <steve@sakoman.com>2025-04-28 08:18:53 -0700
commit2323e6e07a9b5641f97dd6df7ebccd7b10964141 (patch)
tree569a36e0d3f26eab27bd4e93cda30228348b6e18 /documentation/set_versions.py
parentc9de4c568e965d9dff6501827acdf8fbd455a4b5 (diff)
downloadpoky-2323e6e07a9b5641f97dd6df7ebccd7b10964141.tar.gz
poky.yaml: introduce DISTRO_LATEST_TAG
Introduce the DISTRO_LATEST_TAG macro, which should always point to the latest existing tag in the documentation, unlike DISTRO which may point to A.B.999 to represent the tip of a branch. This variable is needed to fix dead links in the documentation that currently use the DISTRO macro. Also, make DISTRO_REL_TAG use the DISTRO macro directly, to avoid repetition, and add a DISTRO_REL_LATEST_TAG macro that has the same role as DISTRO_LATEST_TAG but with "yocto-" prepended to it. In set_versions.py, run the "git describe --abbrev=0 --tags --match='yocto-*'" command to get the latest existing tag on the currently checked out commit. Fallback to ourversion in case we didn't find any. (From yocto-docs rev: 4195f52117b8132b46dd562acaf40e6e4480be33) Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> (cherry picked from commit a85b0e500c94921f77fa7b7dbb877e4945f96d1e) Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
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 dec0780834..820bd64036 100755
--- a/documentation/set_versions.py
+++ b/documentation/set_versions.py
@@ -168,17 +168,29 @@ series = [k for k in release_series]
168previousseries = series[series.index(ourseries)+1:] or [""] 168previousseries = series[series.index(ourseries)+1:] or [""]
169lastlts = [k for k in previousseries if k in ltsseries] or "dunfell" 169lastlts = [k for k in previousseries if k in ltsseries] or "dunfell"
170 170
171latestreltag = subprocess.run(["git", "describe", "--abbrev=0", "--tags", "--match", "yocto-*"], capture_output=True, text=True).stdout
172latestreltag = latestreltag.strip()
173if latestreltag:
174 if latestreltag.startswith("yocto-"):
175 latesttag = latestreltag[6:]
176else:
177 # fallback on the calculated version
178 print("Did not find a tag with 'git describe', falling back to %s" % ourversion)
179 latestreltag = "yocto-" + ourversion
180 latesttag = ourversion
181
171print("Version calculated to be %s" % ourversion) 182print("Version calculated to be %s" % ourversion)
183print("Latest release tag found is %s" % latestreltag)
172print("Release series calculated to be %s" % ourseries) 184print("Release series calculated to be %s" % ourseries)
173 185
174replacements = { 186replacements = {
175 "DISTRO" : ourversion, 187 "DISTRO" : ourversion,
188 "DISTRO_LATEST_TAG": latesttag,
176 "DISTRO_NAME_NO_CAP" : ourseries, 189 "DISTRO_NAME_NO_CAP" : ourseries,
177 "DISTRO_NAME" : ourseries.capitalize(), 190 "DISTRO_NAME" : ourseries.capitalize(),
178 "DISTRO_NAME_NO_CAP_MINUS_ONE" : previousseries[0], 191 "DISTRO_NAME_NO_CAP_MINUS_ONE" : previousseries[0],
179 "DISTRO_NAME_NO_CAP_LTS" : lastlts[0], 192 "DISTRO_NAME_NO_CAP_LTS" : lastlts[0],
180 "YOCTO_DOC_VERSION" : ourversion, 193 "YOCTO_DOC_VERSION" : ourversion,
181 "DISTRO_REL_TAG" : "yocto-" + ourversion,
182 "DOCCONF_VERSION" : docconfver, 194 "DOCCONF_VERSION" : docconfver,
183 "BITBAKE_SERIES" : bitbakeversion, 195 "BITBAKE_SERIES" : bitbakeversion,
184} 196}
@@ -316,3 +328,5 @@ with open('releases.rst', 'w') as f:
316 if tag == release_series[series] or tag.startswith('%s.' % release_series[series]): 328 if tag == release_series[series] or tag.startswith('%s.' % release_series[series]):
317 f.write('- :yocto_docs:`%s Documentation </%s>`\n' % (tag, tag)) 329 f.write('- :yocto_docs:`%s Documentation </%s>`\n' % (tag, tag))
318 f.write('\n') 330 f.write('\n')
331
332