From patchwork Tue Jul 19 08:12:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 10371 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 C117ACCA485 for ; Tue, 19 Jul 2022 08:12:37 +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.web11.38196.1658218353971745157 for ; Tue, 19 Jul 2022 01:12:34 -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 4C4A440008; Tue, 19 Jul 2022 08:12:30 +0000 (UTC) From: Quentin Schulz To: docs@lists.yoctoproject.org, yocto@lists.yoctoproject.org Cc: Quentin Schulz , Quentin Schulz Subject: [PATCH] auto-generate releases.rst Date: Tue, 19 Jul 2022 10:12:12 +0200 Message-Id: <20220719081214.1924835-1-foss+yocto@0leil.net> X-Mailer: git-send-email 2.36.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 ; Tue, 19 Jul 2022 08:12:37 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/3064 From: Quentin Schulz In order to maintain one less file, let's auto-generate the releases.rst file which contains a link for each release ever released. This gets auto-generated by checking the tags available in this git repo and adding a link for each that exists. A few tags are notoriously missing from this git repo and they are manually listed then, until the tags are pushed for the appropriate commit. Cc: Quentin Schulz Signed-off-by: Quentin Schulz --- documentation/.gitignore | 1 + documentation/releases.rst | 251 ---------------------------------- documentation/set_versions.py | 75 ++++++++++ 3 files changed, 76 insertions(+), 251 deletions(-) delete mode 100644 documentation/releases.rst diff --git a/documentation/.gitignore b/documentation/.gitignore index 096b97ec2..4e077d03f 100644 --- a/documentation/.gitignore +++ b/documentation/.gitignore @@ -2,6 +2,7 @@ _build/ Pipfile.lock poky.yaml sphinx-static/switchers.js +releases.rst .vscode/ */svg/*.png */svg/*.pdf diff --git a/documentation/releases.rst b/documentation/releases.rst deleted file mode 100644 index b2b448615..000000000 --- a/documentation/releases.rst +++ /dev/null @@ -1,251 +0,0 @@ -.. SPDX-License-Identifier: CC-BY-SA-2.0-UK - -.. - NOTE FOR RELEASE MAINTAINERS: - This file only needs updating in the development release ("master" branch) - When documentation for stable releases is built, - the latest version from "master" is used - by https://git.yoctoproject.org/yocto-autobuilder-helper/tree/scripts/run-docs-build - -=========================== - Supported Release Manuals -=========================== - -****************************** -Release Series 4.0 (kirkstone) -****************************** - -- :yocto_docs:`4.0 Documentation ` -- :yocto_docs:`4.0.1 Documentation ` -- :yocto_docs:`4.0.2 Documentation ` - -**************************** -Release Series 3.1 (dunfell) -**************************** - -- :yocto_docs:`3.1 Documentation ` -- :yocto_docs:`3.1.1 Documentation ` -- :yocto_docs:`3.1.2 Documentation ` -- :yocto_docs:`3.1.3 Documentation ` -- :yocto_docs:`3.1.4 Documentation ` -- :yocto_docs:`3.1.5 Documentation ` -- :yocto_docs:`3.1.6 Documentation ` -- :yocto_docs:`3.1.7 Documentation ` -- :yocto_docs:`3.1.8 Documentation ` -- :yocto_docs:`3.1.9 Documentation ` -- :yocto_docs:`3.1.10 Documentation ` -- :yocto_docs:`3.1.11 Documentation ` -- :yocto_docs:`3.1.12 Documentation ` -- :yocto_docs:`3.1.13 Documentation ` -- :yocto_docs:`3.1.14 Documentation ` -- :yocto_docs:`3.1.15 Documentation ` -- :yocto_docs:`3.1.16 Documentation ` -- :yocto_docs:`3.1.17 Documentation ` - -========================== - Outdated Release Manuals -========================== - -****************************** -Release Series 3.4 (honister) -****************************** - -- :yocto_docs:`3.4 Documentation ` -- :yocto_docs:`3.4.1 Documentation ` -- :yocto_docs:`3.4.2 Documentation ` -- :yocto_docs:`3.4.3 Documentation ` -- :yocto_docs:`3.4.4 Documentation ` - -****************************** -Release Series 3.3 (hardknott) -****************************** - -- :yocto_docs:`3.3 Documentation ` -- :yocto_docs:`3.3.1 Documentation ` -- :yocto_docs:`3.3.2 Documentation ` -- :yocto_docs:`3.3.3 Documentation ` -- :yocto_docs:`3.3.4 Documentation ` -- :yocto_docs:`3.3.5 Documentation ` -- :yocto_docs:`3.3.6 Documentation ` - -******************************* -Release Series 3.2 (gatesgarth) -******************************* - -- :yocto_docs:`3.2 Documentation ` -- :yocto_docs:`3.2.1 Documentation ` -- :yocto_docs:`3.2.2 Documentation ` -- :yocto_docs:`3.2.3 Documentation ` -- :yocto_docs:`3.2.4 Documentation ` - -************************* -Release Series 3.0 (zeus) -************************* - -- :yocto_docs:`3.0 Documentation ` -- :yocto_docs:`3.0.1 Documentation ` -- :yocto_docs:`3.0.2 Documentation ` -- :yocto_docs:`3.0.3 Documentation ` -- :yocto_docs:`3.0.4 Documentation ` - -**************************** -Release Series 2.7 (warrior) -**************************** - -- :yocto_docs:`2.7 Documentation ` -- :yocto_docs:`2.7.1 Documentation ` -- :yocto_docs:`2.7.2 Documentation ` -- :yocto_docs:`2.7.3 Documentation ` -- :yocto_docs:`2.7.4 Documentation ` - -************************* -Release Series 2.6 (thud) -************************* - -- :yocto_docs:`2.6 Documentation ` -- :yocto_docs:`2.6.1 Documentation ` -- :yocto_docs:`2.6.2 Documentation ` -- :yocto_docs:`2.6.3 Documentation ` -- :yocto_docs:`2.6.4 Documentation ` - -************************* -Release Series 2.5 (sumo) -************************* - -- :yocto_docs:`2.5 Documentation ` -- :yocto_docs:`2.5.1 Documentation ` -- :yocto_docs:`2.5.2 Documentation ` -- :yocto_docs:`2.5.3 Documentation ` - -************************** -Release Series 2.4 (rocko) -************************** - -- :yocto_docs:`2.4 Documentation ` -- :yocto_docs:`2.4.1 Documentation ` -- :yocto_docs:`2.4.2 Documentation ` -- :yocto_docs:`2.4.3 Documentation ` -- :yocto_docs:`2.4.4 Documentation ` - -************************* -Release Series 2.3 (pyro) -************************* - -- :yocto_docs:`2.3 Documentation ` -- :yocto_docs:`2.3.1 Documentation ` -- :yocto_docs:`2.3.2 Documentation ` -- :yocto_docs:`2.3.3 Documentation ` -- :yocto_docs:`2.3.4 Documentation ` - -************************** -Release Series 2.2 (morty) -************************** - -- :yocto_docs:`2.2 Documentation ` -- :yocto_docs:`2.2.1 Documentation ` -- :yocto_docs:`2.2.2 Documentation ` -- :yocto_docs:`2.2.3 Documentation ` - -**************************** -Release Series 2.1 (krogoth) -**************************** - -- :yocto_docs:`2.1 Documentation ` -- :yocto_docs:`2.1.1 Documentation ` -- :yocto_docs:`2.1.2 Documentation ` -- :yocto_docs:`2.1.3 Documentation ` - -*************************** -Release Series 2.0 (jethro) -*************************** - -- :yocto_docs:`1.9 Documentation ` -- :yocto_docs:`2.0 Documentation ` -- :yocto_docs:`2.0.1 Documentation ` -- :yocto_docs:`2.0.2 Documentation ` -- :yocto_docs:`2.0.3 Documentation ` - -************************* -Release Series 1.8 (fido) -************************* - -- :yocto_docs:`1.8 Documentation ` -- :yocto_docs:`1.8.1 Documentation ` -- :yocto_docs:`1.8.2 Documentation ` - -************************** -Release Series 1.7 (dizzy) -************************** - -- :yocto_docs:`1.7 Documentation ` -- :yocto_docs:`1.7.1 Documentation ` -- :yocto_docs:`1.7.2 Documentation ` -- :yocto_docs:`1.7.3 Documentation ` - -************************** -Release Series 1.6 (daisy) -************************** - -- :yocto_docs:`1.6 Documentation ` -- :yocto_docs:`1.6.1 Documentation ` -- :yocto_docs:`1.6.2 Documentation ` -- :yocto_docs:`1.6.3 Documentation ` - -************************* -Release Series 1.5 (dora) -************************* - -- :yocto_docs:`1.5 Documentation ` -- :yocto_docs:`1.5.1 Documentation ` -- :yocto_docs:`1.5.2 Documentation ` -- :yocto_docs:`1.5.3 Documentation ` -- :yocto_docs:`1.5.4 Documentation ` - -************************** -Release Series 1.4 (dylan) -************************** - -- :yocto_docs:`1.4 Documentation ` -- :yocto_docs:`1.4.1 Documentation ` -- :yocto_docs:`1.4.2 Documentation ` -- :yocto_docs:`1.4.3 Documentation ` -- :yocto_docs:`1.4.4 Documentation ` -- :yocto_docs:`1.4.5 Documentation ` - -************************** -Release Series 1.3 (danny) -************************** - -- :yocto_docs:`1.3 Documentation ` -- :yocto_docs:`1.3.1 Documentation ` -- :yocto_docs:`1.3.2 Documentation ` - -*************************** -Release Series 1.2 (denzil) -*************************** - -- :yocto_docs:`1.2 Documentation ` -- :yocto_docs:`1.2.1 Documentation ` -- :yocto_docs:`1.2.2 Documentation ` - -*************************** -Release Series 1.1 (edison) -*************************** - -- :yocto_docs:`1.1 Documentation ` -- :yocto_docs:`1.1.1 Documentation ` -- :yocto_docs:`1.1.2 Documentation ` - -**************************** -Release Series 1.0 (bernard) -**************************** - -- :yocto_docs:`1.0 Documentation ` -- :yocto_docs:`1.0.1 Documentation ` -- :yocto_docs:`1.0.2 Documentation ` - -**************************** -Release Series 0.9 (laverne) -**************************** - -- :yocto_docs:`0.9 Documentation ` diff --git a/documentation/set_versions.py b/documentation/set_versions.py index a7ceb3455..803d3e4b4 100755 --- a/documentation/set_versions.py +++ b/documentation/set_versions.py @@ -14,6 +14,7 @@ import collections import sys import os import itertools +import re ourversion = None if len(sys.argv) == 2: @@ -231,3 +232,77 @@ with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switch print("switchers.js generated from switchers.js.in") +# generate releases.rst + +# list missing tags in yocto-docs +missing_tags = [ + 'yocto-0.9', + 'yocto-1.0', 'yocto-1.0.1', + 'yocto-1.1', 'yocto-1.1.1', + 'yocto-1.2', + 'yocto-1.4.4', 'yocto-1.4.5', + 'yocto-1.5', 'yocto-1.5.2', 'yocto-1.5.3', 'yocto-1.5.4', + 'yocto-1.6', 'yocto-1.6.1', 'yocto-1.6.2', + 'yocto-1.7', 'yocto-1.7.1', + 'yocto-1.9', + 'yocto-2.5.3', + 'yocto-3.1', 'yocto-3.1.1', 'yocto-3.1.2', 'yocto-3.1.3', + ] + +semver = re.compile(r'yocto-(\d+)\.(\d+)(?:\.)?(\d*)') + +# git is able to properly order semver versions but not python +# instead of adding a dependency on semver module, let's convert the version +# into a decimal number, e.g. 11.23.1 will be 112301 and 1.5 will be 010500 so +# it can be used as a key for the sorting algorithm. +# This can be removed once all the old tags are re-created. +def tag_to_semver_like(v): + v_semver = semver.search(v) + v_maj, v_min, v_patch = v_semver.groups('0') + return int("{:0>2}{:0>2}{:0>2}".format(v_maj, v_min, v_patch), 10) + +yocto_tags = subprocess.run(["git", "tag", "--list", "--sort=version:refname", "yocto-*"], capture_output=True, text=True).stdout +yocto_tags = sorted(yocto_tags.split() + missing_tags, key=tag_to_semver_like) +tags = [tag[6:] for tag in yocto_tags] + +with open('releases.rst', 'w') as f: + f.write('===========================\n') + f.write(' Supported Release Manuals \n') + f.write('===========================\n') + f.write('\n') + + for activerelease in activereleases: + title = "Release Series %s (%s)" % (release_series[activerelease], activerelease) + f.write('*' * len(title) + '\n') + f.write(title + '\n') + f.write('*' * len(title) + '\n') + f.write('\n') + + for tag in tags: + if tag == release_series[activerelease] or tag.startswith('%s.' % release_series[activerelease]): + f.write('- :yocto_docs:`%s Documentation `\n' % (tag, tag)) + f.write('\n') + + f.write('==========================\n') + f.write(' Outdated Release Manuals \n') + f.write('==========================\n') + f.write('\n') + + for series in release_series: + if series == devbranch or series in activereleases: + continue + + if series == "jethro-pre": + continue + + title = "Release Series %s (%s)" % (release_series[series], series) + f.write('*' * len(title) + '\n') + f.write(title + '\n') + f.write('*' * len(title) + '\n') + f.write('\n') + if series == "jethro": + f.write('- :yocto_docs:`1.9 Documentation `\n') + for tag in tags: + if tag == release_series[series] or tag.startswith('%s.' % release_series[series]): + f.write('- :yocto_docs:`%s Documentation `\n' % (tag, tag)) + f.write('\n')