summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonin Godard <antonin.godard@bootlin.com>2025-04-09 11:55:41 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-04-21 21:17:02 +0100
commit5c4cf4b57362172064d2d1d290b9e02763784a45 (patch)
tree5a13d32f29e323c73e7a386a6c7f5d25799ef935
parente5577538c3161f8782e025abea05d30ad5f93139 (diff)
downloadpoky-5c4cf4b57362172064d2d1d290b9e02763784a45.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: a85b0e500c94921f77fa7b7dbb877e4945f96d1e) Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--documentation/poky.yaml.in11
-rwxr-xr-xdocumentation/set_versions.py16
2 files changed, 25 insertions, 2 deletions
diff --git a/documentation/poky.yaml.in b/documentation/poky.yaml.in
index 836f114543..26c21e346f 100644
--- a/documentation/poky.yaml.in
+++ b/documentation/poky.yaml.in
@@ -2,13 +2,22 @@
2# Macros used in the documentation 2# Macros used in the documentation
3# 3#
4 4
5# The DISTRO variable represents the current docs version. It should be used
6# when referring to the current docs version. See also DISTRO_LATEST_TAG.
5DISTRO : "5.1" 7DISTRO : "5.1"
8# The DISTRO_LATEST_TAG represents the latest tag on the current branch. It
9# should be used in HTTP link referring to the current docs version. In these
10# cases, the DISTRO may point to A.B.999 which does not exist (just used to
11# represent the latest HEAD revision on the branch). DISTRO_LATEST_TAG should
12# always point to an existing tag.
13DISTRO_LATEST_TAG : "5.1"
6DISTRO_NAME_NO_CAP : "styhead" 14DISTRO_NAME_NO_CAP : "styhead"
7DISTRO_NAME : "Styhead" 15DISTRO_NAME : "Styhead"
8DISTRO_NAME_NO_CAP_MINUS_ONE : "scarthgap" 16DISTRO_NAME_NO_CAP_MINUS_ONE : "scarthgap"
9DISTRO_NAME_NO_CAP_LTS : "scarthgap" 17DISTRO_NAME_NO_CAP_LTS : "scarthgap"
10YOCTO_DOC_VERSION : "5.1" 18YOCTO_DOC_VERSION : "5.1"
11DISTRO_REL_TAG : "yocto-5.1" 19DISTRO_REL_TAG : "yocto-$DISTRO;"
20DISTRO_REL_LATEST_TAG : "yocto-&DISTRO_LATEST_TAG;"
12DOCCONF_VERSION : "dev" 21DOCCONF_VERSION : "dev"
13BITBAKE_SERIES : "" 22BITBAKE_SERIES : ""
14YOCTO_DL_URL : "https://downloads.yoctoproject.org" 23YOCTO_DL_URL : "https://downloads.yoctoproject.org"
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