summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>2022-04-19 17:30:48 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-25 15:22:12 +0100
commitee6d170d87ee38c6abbba2e800853d98395cdf93 (patch)
tree1cc82c83236c8245c24cf826e62670364084fca7 /documentation
parent4a0acaf3ccb572f37b63e6778f15cfaca18a48b3 (diff)
downloadpoky-ee6d170d87ee38c6abbba2e800853d98395cdf93.tar.gz
docs: set_versions.py: fix latest version of an active release shown as obsolete
ourseries can be an active release and therefore shouldn't be marked as obsolete. By adding ourseries to activereleases, it is impossible to know if ourseries is actually an active release or not. Instead let's loop on the active releases with ourseries too (only if it's not active release, otherwise it'd appear twice). Fixes: 6f40ef56054ec "docs: set_versions.py: add information about obsolescence of a release" Cc: Quentin Schulz <foss+yocto@0leil.net> (From yocto-docs rev: f16b633211b97b2cdf2c65d83c99cd3853d2bb5c) Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
-rwxr-xr-xdocumentation/set_versions.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/documentation/set_versions.py b/documentation/set_versions.py
index 4114ae5737..8ae02b11f9 100755
--- a/documentation/set_versions.py
+++ b/documentation/set_versions.py
@@ -199,16 +199,13 @@ if os.path.exists("poky.yaml.in"):
199# - current doc version 199# - current doc version
200# (with duplicates removed) 200# (with duplicates removed)
201 201
202if ourseries not in activereleases:
203 activereleases.append(ourseries)
204
205versions = [] 202versions = []
206with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switchers.js", "w") as w: 203with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switchers.js", "w") as w:
207 lines = r.readlines() 204 lines = r.readlines()
208 for line in lines: 205 for line in lines:
209 if "VERSIONS_PLACEHOLDER" in line: 206 if "VERSIONS_PLACEHOLDER" in line:
210 w.write(" 'dev': { 'title': 'dev (%s)', 'obsolete': false,},\n" % release_series[devbranch]) 207 w.write(" 'dev': { 'title': 'dev (%s)', 'obsolete': false,},\n" % release_series[devbranch])
211 for branch in activereleases: 208 for branch in activereleases + ([ourseries] if ourseries not in activereleases else []):
212 if branch == devbranch: 209 if branch == devbranch:
213 continue 210 continue
214 branch_versions = subprocess.run('git tag --list yocto-%s*' % (release_series[branch]), shell=True, capture_output=True, text=True).stdout.split() 211 branch_versions = subprocess.run('git tag --list yocto-%s*' % (release_series[branch]), shell=True, capture_output=True, text=True).stdout.split()
@@ -219,7 +216,7 @@ with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switch
219 if branch_versions[-1] != "0": 216 if branch_versions[-1] != "0":
220 version = version + "." + branch_versions[-1] 217 version = version + "." + branch_versions[-1]
221 versions.append(version) 218 versions.append(version)
222 w.write(" '%s': {'title': '%s', 'obsolete': %s,},\n" % (version, version, str(branch == ourseries).lower())) 219 w.write(" '%s': {'title': '%s', 'obsolete': %s,},\n" % (version, version, str(branch not in activereleases).lower()))
223 if ourversion not in versions and ourseries != devbranch: 220 if ourversion not in versions and ourseries != devbranch:
224 w.write(" '%s': {'title': '%s', 'obsolete': true,},\n" % (ourversion, ourversion)) 221 w.write(" '%s': {'title': '%s', 'obsolete': true,},\n" % (ourversion, ourversion))
225 else: 222 else: