[1/3] docs: sphinx-static: switchers.js.in: remove duplicate for outdated versions

Message ID 20220414113327.176534-1-foss+yocto@0leil.net
State New
Headers show
Series [1/3] docs: sphinx-static: switchers.js.in: remove duplicate for outdated versions | expand

Commit Message

Quentin Schulz April 14, 2022, 11:33 a.m. UTC
From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

Since commit f2b069be8c307 "set_versions: Various improvements", an
outdated version will always appear in all_versions, meaning there'll
always be an exact match in the loop (just above the git context of this
patch) so there's no need to add the current_version to the dropdown
menu manually.

This issue showed up only for outdated versions of obsolete releases,
e.g. 3.2.3. In that case, 3.2.4 (latest version of the obsolete release)
will appear in the all_versions array in addition to 3.2.3, which means
the check on release series (3.2) will be matched twice, and 3.2.3 will
be printed once in the 3.2.4 loop because version != current_version and
once in the 3.2.3 because it is an exact match to an entry in
all_versions.

Cc: Quentin Schulz <foss+yocto@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 documentation/sphinx-static/switchers.js.in | 3 ---
 1 file changed, 3 deletions(-)

Patch

diff --git a/documentation/sphinx-static/switchers.js.in b/documentation/sphinx-static/switchers.js.in
index 5d3a4d793..e7ef2ce5f 100644
--- a/documentation/sphinx-static/switchers.js.in
+++ b/documentation/sphinx-static/switchers.js.in
@@ -72,9 +72,6 @@  by https://git.yoctoproject.org/yocto-autobuilder-helper/tree/scripts/run-docs-b
             buf.push('<option value="' + version + '" selected="selected">' + title + '</option>');
         else
             buf.push('<option value="' + version + '">' + title + '</option>');
-
-        if (version != current_version)
-            buf.push('<option value="' + current_version + '" selected="selected">' + current_version + '</option>');
       } else {
         buf.push('<option value="' + version + '">' + title + '</option>');
       }