diff options
author | Quentin Schulz <quentin.schulz@theobroma-systems.com> | 2022-04-19 17:30:47 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-19 22:07:52 +0100 |
commit | 36ccca5cba0967e8f4560c24fcc8a058bc19d491 (patch) | |
tree | e387993d6f29853b9cc2073370902d8d6486fd94 /documentation | |
parent | 460012e04a89e0b84fd5949c9a2229ef46e7a341 (diff) | |
download | poky-36ccca5cba0967e8f4560c24fcc8a058bc19d491.tar.gz |
docs: set_versions.py: fix latest release of a branch being shown twice in switchers.js
versions array is supposed to store the latest version of all active
releases. However, in the loop it is reassigned and therefore, the check
on whether our version is already in the versions array will always
return false (except for the latest version of the last active release)
and write our version again in the list.
By using a local variable for the logic instead of versions array, the
check now works properly.
Fixes: f2b069be8c307 "set_versions: Various improvements"
Cc: Quentin Schulz <foss+yocto@0leil.net>
(From yocto-docs rev: 36a088c8c99dd37f5ca07ec8f90f2c51ef8b36f2)
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-x | documentation/set_versions.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/documentation/set_versions.py b/documentation/set_versions.py index 0fcbb993be..4114ae5737 100755 --- a/documentation/set_versions.py +++ b/documentation/set_versions.py | |||
@@ -211,13 +211,13 @@ with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switch | |||
211 | for branch in activereleases: | 211 | for branch in activereleases: |
212 | if branch == devbranch: | 212 | if branch == devbranch: |
213 | continue | 213 | continue |
214 | versions = subprocess.run('git tag --list yocto-%s*' % (release_series[branch]), shell=True, capture_output=True, text=True).stdout.split() | 214 | branch_versions = subprocess.run('git tag --list yocto-%s*' % (release_series[branch]), shell=True, capture_output=True, text=True).stdout.split() |
215 | versions = sorted([v.replace("yocto-" + release_series[branch] + ".", "").replace("yocto-" + release_series[branch], "0") for v in versions], key=int) | 215 | branch_versions = sorted([v.replace("yocto-" + release_series[branch] + ".", "").replace("yocto-" + release_series[branch], "0") for v in branch_versions], key=int) |
216 | if not versions: | 216 | if not branch_versions: |
217 | continue | 217 | continue |
218 | version = release_series[branch] | 218 | version = release_series[branch] |
219 | if versions[-1] != "0": | 219 | if branch_versions[-1] != "0": |
220 | version = version + "." + versions[-1] | 220 | version = version + "." + branch_versions[-1] |
221 | versions.append(version) | 221 | versions.append(version) |
222 | w.write(" '%s': {'title': '%s', 'obsolete': %s,},\n" % (version, version, str(branch == ourseries).lower())) | 222 | w.write(" '%s': {'title': '%s', 'obsolete': %s,},\n" % (version, version, str(branch == ourseries).lower())) |
223 | if ourversion not in versions and ourseries != devbranch: | 223 | if ourversion not in versions and ourseries != devbranch: |