From patchwork Thu Apr 14 11:33:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 6684 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF7A4C4332F for ; Thu, 14 Apr 2022 16:03:56 +0000 (UTC) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by mx.groups.io with SMTP id smtpd.web09.10474.1649936034378035396 for ; Thu, 14 Apr 2022 04:33:54 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: 0leil.net, ip: 217.70.183.194, mailfrom: foss+yocto@0leil.net) Received: (Authenticated sender: foss@0leil.net) by mail.gandi.net (Postfix) with ESMTPSA id 3F68F40006; Thu, 14 Apr 2022 11:33:51 +0000 (UTC) From: Quentin Schulz To: docs@lists.yoctoproject.org Cc: Quentin Schulz , Quentin Schulz Subject: [PATCH 1/3] docs: sphinx-static: switchers.js.in: remove duplicate for outdated versions Date: Thu, 14 Apr 2022 13:33:25 +0200 Message-Id: <20220414113327.176534-1-foss+yocto@0leil.net> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 14 Apr 2022 16:03:56 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/2767 From: Quentin Schulz 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 Signed-off-by: Quentin Schulz --- documentation/sphinx-static/switchers.js.in | 3 --- 1 file changed, 3 deletions(-) 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(''); else buf.push(''); - - if (version != current_version) - buf.push(''); } else { buf.push(''); } From patchwork Thu Apr 14 11:33:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 6686 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA416C63701 for ; Thu, 14 Apr 2022 16:03:56 +0000 (UTC) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by mx.groups.io with SMTP id smtpd.web10.10568.1649936034649699775 for ; Thu, 14 Apr 2022 04:33:55 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: 0leil.net, ip: 217.70.183.194, mailfrom: foss+yocto@0leil.net) Received: (Authenticated sender: foss@0leil.net) by mail.gandi.net (Postfix) with ESMTPSA id D9F414000D; Thu, 14 Apr 2022 11:33:52 +0000 (UTC) From: Quentin Schulz To: docs@lists.yoctoproject.org Cc: Quentin Schulz , Quentin Schulz Subject: [PATCH 2/3] docs: set_versions.py: add information about obsolescence of a release Date: Thu, 14 Apr 2022 13:33:26 +0200 Message-Id: <20220414113327.176534-2-foss+yocto@0leil.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220414113327.176534-1-foss+yocto@0leil.net> References: <20220414113327.176534-1-foss+yocto@0leil.net> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 14 Apr 2022 16:03:56 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/2768 From: Quentin Schulz This adds support for marking releases as obsolete to make the detection algorithm smarter (in a later commit) than just checking if it's older than dunfell. Cc: Quentin Schulz Signed-off-by: Quentin Schulz --- documentation/set_versions.py | 6 +++--- documentation/sphinx-static/switchers.js.in | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/documentation/set_versions.py b/documentation/set_versions.py index fceff4dbc..0fcbb993b 100755 --- a/documentation/set_versions.py +++ b/documentation/set_versions.py @@ -207,7 +207,7 @@ with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switch lines = r.readlines() for line in lines: if "VERSIONS_PLACEHOLDER" in line: - w.write(" 'dev': 'dev (%s)',\n" % release_series[devbranch]) + w.write(" 'dev': { 'title': 'dev (%s)', 'obsolete': false,},\n" % release_series[devbranch]) for branch in activereleases: if branch == devbranch: continue @@ -219,9 +219,9 @@ with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switch if versions[-1] != "0": version = version + "." + versions[-1] versions.append(version) - w.write(" '%s': '%s',\n" % (version, version)) + w.write(" '%s': {'title': '%s', 'obsolete': %s,},\n" % (version, version, str(branch == ourseries).lower())) if ourversion not in versions and ourseries != devbranch: - w.write(" '%s': '%s',\n" % (ourversion, ourversion)) + w.write(" '%s': {'title': '%s', 'obsolete': true,},\n" % (ourversion, ourversion)) else: w.write(line) diff --git a/documentation/sphinx-static/switchers.js.in b/documentation/sphinx-static/switchers.js.in index e7ef2ce5f..5ae0325e6 100644 --- a/documentation/sphinx-static/switchers.js.in +++ b/documentation/sphinx-static/switchers.js.in @@ -65,15 +65,15 @@ by https://git.yoctoproject.org/yocto-autobuilder-helper/tree/scripts/run-docs-b function build_version_select(current_series, current_version) { var buf = ['