diff options
author | Quentin Schulz <quentin.schulz@theobroma-systems.com> | 2022-04-19 17:30:48 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-19 22:07:52 +0100 |
commit | b5882ec9083185201e1a9b94a45b6bf5e8c214c7 (patch) | |
tree | a42397e4179e38761f13761c8728dca7aa9eeed6 /documentation/set_versions.py | |
parent | 36ccca5cba0967e8f4560c24fcc8a058bc19d491 (diff) | |
download | poky-b5882ec9083185201e1a9b94a45b6bf5e8c214c7.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/set_versions.py')
-rwxr-xr-x | documentation/set_versions.py | 7 |
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 | ||
202 | if ourseries not in activereleases: | ||
203 | activereleases.append(ourseries) | ||
204 | |||
205 | versions = [] | 202 | versions = [] |
206 | with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switchers.js", "w") as w: | 203 | with 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: |