From ee6d170d87ee38c6abbba2e800853d98395cdf93 Mon Sep 17 00:00:00 2001 From: Quentin Schulz Date: Tue, 19 Apr 2022 17:30:48 +0200 Subject: 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 (From yocto-docs rev: f16b633211b97b2cdf2c65d83c99cd3853d2bb5c) Signed-off-by: Quentin Schulz Signed-off-by: Richard Purdie --- documentation/set_versions.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'documentation/set_versions.py') 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"): # - current doc version # (with duplicates removed) -if ourseries not in activereleases: - activereleases.append(ourseries) - versions = [] with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switchers.js", "w") as w: lines = r.readlines() for line in lines: if "VERSIONS_PLACEHOLDER" in line: w.write(" 'dev': { 'title': 'dev (%s)', 'obsolete': false,},\n" % release_series[devbranch]) - for branch in activereleases: + for branch in activereleases + ([ourseries] if ourseries not in activereleases else []): if branch == devbranch: continue 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 if branch_versions[-1] != "0": version = version + "." + branch_versions[-1] versions.append(version) - w.write(" '%s': {'title': '%s', 'obsolete': %s,},\n" % (version, version, str(branch == ourseries).lower())) + w.write(" '%s': {'title': '%s', 'obsolete': %s,},\n" % (version, version, str(branch not in activereleases).lower())) if ourversion not in versions and ourseries != devbranch: w.write(" '%s': {'title': '%s', 'obsolete': true,},\n" % (ourversion, ourversion)) else: -- cgit v1.2.3-54-g00ecf