From patchwork Tue Mar 17 10:08:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 83614 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 63B88FB5E95 for ; Tue, 17 Mar 2026 10:08:59 +0000 (UTC) Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.72663.1773742128757002338 for ; Tue, 17 Mar 2026 03:08:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=aueYV5GB; spf=pass (domain: bootlin.com, ip: 185.246.85.4, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 3703D4E42639 for ; Tue, 17 Mar 2026 10:08:47 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 0DDCE5FC9A; Tue, 17 Mar 2026 10:08:47 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 395F51045044E; Tue, 17 Mar 2026 11:08:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1773742126; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=4bhjxJfYr/aYs0FwhIh33DLkeEokScSlFrQbI4IlKkU=; b=aueYV5GBJ7WmZPGQa4dTap3SldH5GRG0TXZvC74Utgej/2fRnSEbon+6UHYIDOId1TOl55 J1xW6cCMzXpDlt/HvcF/CTrPZsSdMVAJrXdN4T/7iETSumFmboUmS4jsOpjcHrqNe05ZbU rYKcQSnXDge23W/LUsvmBbpXAr+5vzdmFy4Hn8MaVQEpfXm1ac295Z1yyXbD3pCIyl6be2 nbhD1DZSBDkMGMMBWlSyDn2CdR5D+lUjcDH/EEsMKThSjBZ02w98kqP7cc0qVOhVMQVLxe SWzAaG1dScEAIEhhObb/2imQD5MLJs6za0TLuHdZtMs4e7BeUpsfmRHTHHuJrA== From: Antonin Godard Date: Tue, 17 Mar 2026 11:08:36 +0100 Subject: [PATCH 1/5] doc: move the Git repo check to the conf.py file MIME-Version: 1.0 Message-Id: <20260317-docs-releases-json-v1-1-492d0b256349@bootlin.com> References: <20260317-docs-releases-json-v1-0-492d0b256349@bootlin.com> In-Reply-To: <20260317-docs-releases-json-v1-0-492d0b256349@bootlin.com> To: bitbake-devel@lists.openembedded.org Cc: Thomas Petazzoni , docs@lists.yoctoproject.org, Antonin Godard X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2054; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=FHYmFPUZgMCWrYhvzc9Onprgp/Dog47NjKb0itlRpQA=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBpuSgqpOP5xwL/9aM3fkPbVl65niN6H3OKqXw6i l/eDRs7bT+JAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCabkoKgAKCRDRgEFAKaOo NgGFEACqR8bLn27z2bjcO+zcp/1CaY6YUUdtKW8PmUVs+Htdg5/DBqf1Ui07X8++QOs8oF7AnSo ffDqauQExkDlBVzqqHVZCG/62z8tQVTt/UJm0FbquKpMn1gICl8Im5zmkzkyIyA2JBCa3q9VKxA k4xvu9hkjmE6HU12uZGtrh5H+K6jPoU+3g4xnisD3MTg1z0oMZgxmjJha2WZ6ec0iH1rjq8Kixh ngviwy8EjFmmsYv4f8vveQNbaQLdtqkOkIfxXOPmeDERUYBeaNLMVYKEQQvrhFgEgmNvH6gpJtW NZ15Bo/iM9LJ2ZfhfMsDqnB4LGPwmj2jV8h+tZ0M4J+kPQQMs1FhRPtyGI7YiFCKntQnFCveyB0 kzr7+d/pbpj2wur+UoeneeHYbFhwBXxnZdzxUf2hEtITltADMy2F86IgjzRbCPd3en7yod5uYW8 dgkfXODXICien/WXCs5/fp9cQKze01ZFLRYYngvuGr7exV6V+UEuFT7obE21Aqu6mglA9fqqN0t MiJ/3HRCUTb/mFWW2qEzCZcJm1o6FiaIkPiO4VRv+NHNUnGaXvemRIv1+OjwNAa5L6p4w7+T14m uCIhqw/i5UjuwSH8c6iOW/sKwbz6gwtz1BPduotXfsxQKNDGcU+wDTJKOnuRzM/PnRcYp0wiyNW 7VgM+k81vC85lUg== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 17 Mar 2026 10:08:59 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/9085 This check can be done earlier when building the documentation, and does not need any version information. Move it to the beginning of conf.py. Signed-off-by: Antonin Godard --- doc/conf.py | 10 ++++++++++ doc/setversions.py | 9 --------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 9318358731c..40a022eaa00 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -8,10 +8,20 @@ import datetime import os +import subprocess import sys from pathlib import Path +# Test that we are building from a Git repository +try: + subprocess.run(["git", "rev-parse", "--is-inside-work-tree"], + stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True) +except subprocess.CalledProcessError: + sys.exit("Building bitbake's documentation must be done from its Git repository.\n" + "Clone the repository with the following command:\n" + "git clone https://git.openembedded.org/bitbake ") + sys.path.insert(0, os.path.abspath('.')) import setversions diff --git a/doc/setversions.py b/doc/setversions.py index 9e4138025ac..2ec68ac9945 100755 --- a/doc/setversions.py +++ b/doc/setversions.py @@ -43,15 +43,6 @@ BB_RELEASE_TAG_RE = re.compile(r"^[0-9]+\.[0-9]+\.[0-9]+$") def get_current_version(): ourversion = None - # Test that we are building from a Git repository - try: - subprocess.run(["git", "rev-parse", "--is-inside-work-tree"], - stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True) - except subprocess.CalledProcessError: - sys.exit("Building bitbake's documentation must be done from its Git repository.\n" - "Clone the repository with the following command:\n" - "git clone https://git.openembedded.org/bitbake ") - # Test tags exist and inform the user to fetch if not try: subprocess.run(["git", "show", f"{LTSSERIES[0]}.0"], From patchwork Tue Mar 17 10:08:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 83613 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 99D6DF3383F for ; Tue, 17 Mar 2026 10:08:58 +0000 (UTC) Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.72664.1773742130033869095 for ; Tue, 17 Mar 2026 03:08:50 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=ja4gbJBn; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 8A7E11A2DE6 for ; Tue, 17 Mar 2026 10:08:48 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 562DA60050; Tue, 17 Mar 2026 10:08:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C988A10450450; Tue, 17 Mar 2026 11:08:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1773742127; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=QDdtqu20O4WqinqGWbwx8ikZqH+xw4msVCf8rItarbQ=; b=ja4gbJBnmC9275x6SEtW72a99qxtDyIOX1spTvGaLdpwEi/53UUR62LuqRaxoS275hObZu 82udHMI/nlBmRPVNF/th+PJBtK7B4SBpfapB7S4PW/9+RoYEWWHgmRoTzsVcCzwbqodQpV On5PvEyMjppms3MWtgguSuK/FU411YHCLsSOUcQnIZnLxEGZq1SKMVHoil4h4DtnqPXpFX knWbKAiZxrWOkM4GRRgOXL7pBpGOq7BCJLu8zluvTzT1DRs22JCuUwAGRKkQ/dJvv2jZU/ +G6+d1w2vuTkU0eKMScKePpxuBW0Cd+CIzezkKzFuOxCQ9lBPAsqs7/jaPDPjA== From: Antonin Godard Date: Tue, 17 Mar 2026 11:08:37 +0100 Subject: [PATCH 2/5] doc/setversions.py: simplify the get_current_version() function MIME-Version: 1.0 Message-Id: <20260317-docs-releases-json-v1-2-492d0b256349@bootlin.com> References: <20260317-docs-releases-json-v1-0-492d0b256349@bootlin.com> In-Reply-To: <20260317-docs-releases-json-v1-0-492d0b256349@bootlin.com> To: bitbake-devel@lists.openembedded.org Cc: Thomas Petazzoni , docs@lists.yoctoproject.org, Antonin Godard X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=6618; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=BbwKzVuiJq6T2z7hybisISWhmCbokJGR5W/ACCpgeiQ=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBpuSgr4E/ciHrYME0bAjaFRT2gnigtx1T2p0com /KU7U2MWhOJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCabkoKwAKCRDRgEFAKaOo NrS5EACTeTLaastEs2PTB7GnBLKRgJp4MwA8xIZEoreQJeGkVcpN9FpTW/dNkbt8YEiCH9sqC43 peyuoyPuj7dZ/l6ZSRx0IHzCkysB0wbKDd7JfxoeC39Rc1/KXHdXzcwiBeeU3wP+J8OmapeSNwU t0cARHD9o0Z0azrcVSGiABMA31/RYwiEf1KX/DVjVT7mVQQ2JHrdhqqfP/2wn5fQ6X5YudsxEAi 9Eu1M50YqVWcDi3BZyxU/z901ogvoAjzNRwIwL4QkbHqLrRSya+PYK+B8mZnK2xAcn7PWvg8ecr x5GMwSxbgb3kt95GMDN46vS1WFmZTEC1AJgEL2zvg74ZBPUc648WgV0XlrtXhIkUe/aUE3UIY2p B55JbXYXqWijSvNZMzQmoX23ovEebc5ijdcbyo5yQF0wL6ygte706Tx5K/pxAaWMpfOdcnyra2I QTSlc2wg2PNJtKW+pHniIiHgRgxjblq6qbyMXydn/GuQGjlWbmBJ1rmEY/T1Gbfbxg9t8VVHr9O jNYK8y+p3iX+tfN/8Qe3Xs9wXWhtKw4lFblTS5S8aG/vNGdkXjGT4LF+gMFReOES5gJJO5cVjxR R39Ct++nLbwSFpvZcebHSMKE16stKWhnLwFef6V+L0Wmb1SFu8j6MdX3VA03HNABei3pkZXr3oV Hm3MPlOc1kze1lg== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 17 Mar 2026 10:08:58 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/9086 While this was inspired with yocto-docs' set_versions.py file[1], some of the logic here can be simplified with early returns. As a consequence of these early returns, move the print() call showing the computed version to the conf.py file. Signed-off-by: Antonin Godard --- doc/conf.py | 1 + doc/setversions.py | 90 +++++++++++++++++++++++++----------------------------- 2 files changed, 42 insertions(+), 49 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 40a022eaa00..315fb7d06a7 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -26,6 +26,7 @@ sys.path.insert(0, os.path.abspath('.')) import setversions current_version = setversions.get_current_version() +print(f"Version calculated to be {current_version}") # String used in sidebar version = 'Version: ' + current_version diff --git a/doc/setversions.py b/doc/setversions.py index 2ec68ac9945..4130df67695 100755 --- a/doc/setversions.py +++ b/doc/setversions.py @@ -41,8 +41,6 @@ YOCTO_MAPPING = { BB_RELEASE_TAG_RE = re.compile(r"^[0-9]+\.[0-9]+\.[0-9]+$") def get_current_version(): - ourversion = None - # Test tags exist and inform the user to fetch if not try: subprocess.run(["git", "show", f"{LTSSERIES[0]}.0"], @@ -50,63 +48,57 @@ def get_current_version(): except subprocess.CalledProcessError: sys.exit("Please run 'git fetch --tags' before building the documentation") - # Try and figure out what we are tags = subprocess.run(["git", "tag", "--points-at", "HEAD"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True).stdout for t in tags.split(): if re.match(BB_RELEASE_TAG_RE, t): - ourversion = t - break + return t - if ourversion: - # We're a tagged release - components = ourversion.split(".") - else: - # We're floating on a branch - branch = subprocess.run(["git", "branch", "--show-current"], - stdout=subprocess.PIPE, stderr=subprocess.PIPE, - universal_newlines=True).stdout.strip() - - if branch == "" or branch not in list(YOCTO_MAPPING.keys()) + ["master", "master-next"]: - # We're not on a known release branch so we have to guess. Compare the - # numbers of commits from each release branch and assume the smallest - # number of commits is the one we're based off - possible_branch = None - branch_count = 0 - for b in itertools.chain(YOCTO_MAPPING.keys(), ["master"]): - result = subprocess.run(["git", "log", "--format=oneline", "HEAD..origin/" + b], - stdout=subprocess.PIPE, stderr=subprocess.PIPE, - universal_newlines=True) - if result.returncode == 0: - count = result.stdout.count('\n') - if not possible_branch or count < branch_count: - print("Branch %s has count %s" % (b, count)) - possible_branch = b - branch_count = count - if possible_branch: - branch = possible_branch - else: - branch = "master" - print("Nearest release branch estimated to be %s" % branch) + # We're floating on a branch + branch = subprocess.run(["git", "branch", "--show-current"], + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + universal_newlines=True).stdout.strip() - if branch == "master": - ourversion = "dev" - elif branch == "master-next": - ourversion = "next" + if branch == "" or branch not in list(YOCTO_MAPPING.keys()) + ["master", "master-next"]: + # We're not on a known release branch so we have to guess. Compare the + # numbers of commits from each release branch and assume the smallest + # number of commits is the one we're based off + possible_branch = None + branch_count = 0 + for b in itertools.chain(YOCTO_MAPPING.keys(), ["master"]): + result = subprocess.run(["git", "log", "--format=oneline", "HEAD..origin/" + b], + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + universal_newlines=True) + if result.returncode == 0: + count = result.stdout.count('\n') + if not possible_branch or count < branch_count: + print("Branch %s has count %s" % (b, count)) + possible_branch = b + branch_count = count + if possible_branch: + branch = possible_branch else: - ourversion = branch - head_commit = subprocess.run(["git", "rev-parse", "--short", "HEAD"], - stdout=subprocess.PIPE, stderr=subprocess.PIPE, - universal_newlines=True).stdout.strip() - branch_commit = subprocess.run(["git", "rev-parse", "--short", branch], - stdout=subprocess.PIPE, stderr=subprocess.PIPE, - universal_newlines=True).stdout.strip() - if head_commit != branch_commit: - ourversion += f" ({head_commit})" + branch = "master" + print("Nearest release branch estimated to be %s" % branch) + + if branch == "master": + return "dev" + + if branch == "master-next": + return "next" + + ourversion = branch + head_commit = subprocess.run(["git", "rev-parse", "--short", "HEAD"], + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + universal_newlines=True).stdout.strip() + branch_commit = subprocess.run(["git", "rev-parse", "--short", branch], + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + universal_newlines=True).stdout.strip() + if head_commit != branch_commit: + ourversion += f" ({head_commit})" - print("Version calculated to be %s" % ourversion) return ourversion def write_switchers_js(js_in, js_out, current_version): From patchwork Tue Mar 17 10:08:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 83611 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 0176EF33838 for ; Tue, 17 Mar 2026 10:08:58 +0000 (UTC) Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.72665.1773742130390225952 for ; Tue, 17 Mar 2026 03:08:50 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=HeYOtn7I; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id D7EA11A2E84 for ; Tue, 17 Mar 2026 10:08:48 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id AF1F06003C; Tue, 17 Mar 2026 10:08:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E072A1045044D; Tue, 17 Mar 2026 11:08:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1773742128; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ObKiYMGXzfPvo4X/7e1kaXMQ4ot7f1QVtdrt3phofG4=; b=HeYOtn7I64aVl/Ae5peri/jOgTHMkKAFOWZ99c1j6k+g6y+h4qLTaRp8sAKYy66nc2d4vh 3Jqi7RiQWMxFaBUBJGqEpfoMoCA/ds0dfdsne99Koh590D++ZAaXIe0wGbig+Vw4XfZHkf 9FyMlRK3bcuICYi8tlELWuyL1ZQraXC7IckpzLB2fGCSxbvw1uVfBMmlJefLkk3WKlrOvT VlVjRWBFnyGagfeYYmQg/Un11bCqi0f0x7dCMiWzxoBvr+37t70R1sdPslLH4gnjNYq03L RQNeVu+QKI8WB25HePymMGZPweWFoKLXn2tAznWM2HWOd97P7sE2CvbaZWHixA== From: Antonin Godard Date: Tue, 17 Mar 2026 11:08:38 +0100 Subject: [PATCH 3/5] doc/setversions.py: fix an f-string without placeholders MIME-Version: 1.0 Message-Id: <20260317-docs-releases-json-v1-3-492d0b256349@bootlin.com> References: <20260317-docs-releases-json-v1-0-492d0b256349@bootlin.com> In-Reply-To: <20260317-docs-releases-json-v1-0-492d0b256349@bootlin.com> To: bitbake-devel@lists.openembedded.org Cc: Thomas Petazzoni , docs@lists.yoctoproject.org, Antonin Godard X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=873; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=dQnOrT832+pQWerwYny4ZFWT9XJRE7QMbZm19hTNOQg=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBpuSgrSwhyqRyiXc6HOoclpwusIW75xWCdP5X0E vh0tUClAQaJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCabkoKwAKCRDRgEFAKaOo Nnz9D/9CTKYjePPaWtHKRWl+vvRaZArz5eeJOdgmMwpe1sm6eVfm8XJkyCldhU6xbXzhAFo1k21 xdVUHoe+1g1//wFWJVZJjiP1832wNxedWAxy/NyE6xUckwGj90TjkfXqSy0eAtG2H4dAXbFOT5d NJWznzuBYrdUGUEC6FU7bGgnZkugMHdKvTYEuVKL82LqqdErwNwWJlYOyDmLdA0xl30D310YycW Kv1BpjQXs9FbndXggr3b0MqXeyIiy08L2c1C2graJxhucx/hqyYDLhUBm5RkgdOQq5aOT2wuBSC XQC4wwPzp5ayblIqSxYvtUr0sI7uMhu8rS1G+Z5njnURw/6IJIg+DbP+1LKpPqpsKxzVIRoxb7s 0l2e9BAuroEuYfnoTETqP09UpyoJclAbFoWflh0OIXX7isjRBbsnZILJmHoPE1rTVufFu+2Lik8 xq4v4xcY0LDQdAl2RZhElk+28cWvdgbGXiAez77g/wR0l9Ip6OSh5Hhf7Qa/Zpj7MgaJ1JATCmY XYErm2SCD0pKHjKJ2BCdLSE7KvFi/nAU43e+skMJJoucXBLcbnnq1A6Zgnzf8La1cDzDljBFOyD fUe4wqqFymqZ0hNCCIjHTMndqAuDWrYBt++XT5dlltel2geuzF+37IIO/1yY+NVBz5cctKONCsR wnYzb+xzi7EQGkg== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 17 Mar 2026 10:08:58 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/9087 This f-string does not have any placeholders. Turn it into a regular string. Signed-off-by: Antonin Godard --- doc/setversions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/setversions.py b/doc/setversions.py index 4130df67695..967a0ba5a64 100755 --- a/doc/setversions.py +++ b/doc/setversions.py @@ -107,7 +107,7 @@ def write_switchers_js(js_in, js_out, current_version): for line in lines: if "VERSIONS_PLACEHOLDER" in line: if current_version != "dev": - w.write(f" 'dev': 'Unstable (dev)',\n") + w.write(" 'dev': 'Unstable (dev)',\n") for series in ACTIVERELEASES: w.write(f" '{series}': '{series} ({YOCTO_MAPPING[series]})',\n") else: From patchwork Tue Mar 17 10:08:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 83612 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 2D86BF33839 for ; Tue, 17 Mar 2026 10:08:58 +0000 (UTC) Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.72666.1773742131259633966 for ; Tue, 17 Mar 2026 03:08:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=CoRqbVzE; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 90A441A2E86 for ; Tue, 17 Mar 2026 10:08:49 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 65E9C6003C; Tue, 17 Mar 2026 10:08:49 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7DBD610450451; Tue, 17 Mar 2026 11:08:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1773742128; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=UW6ZP52706CRGSl1x5Y8LlDxeJRhtlVOmn23SELbxwo=; b=CoRqbVzE1V4Wgb5ziJz3p8lDlzH0MAKJAAhzkET/IIb5Vqll0foHXhnjf/eHLd0nnwFSW5 p/uGo8hMV8dL3yZXNyY3neQAuRR/cBZFeNb+Puf/hLz8JxmiUbryouWi6YLy7WFXkDyWZE udbCdCPs/lBeEfN9nXYojlMOfmcJj5w0apwAfqA4Pd3JIZLrxEJnvbeRQ3GROkmhgwp5fW zuk810f0cReyTfTIG0P4co3Ll5J4QDs80VG05FVdZh9oHZrohXjwrL6IAUgmGHHoq5Ysc2 //qAp8Ym79odhasZq3gQjoXLuMFobbxYVahandeLqg/x21w7TLuarn4HZcu73Q== From: Antonin Godard Date: Tue, 17 Mar 2026 11:08:39 +0100 Subject: [PATCH 4/5] doc: build using remote releases.json MIME-Version: 1.0 Message-Id: <20260317-docs-releases-json-v1-4-492d0b256349@bootlin.com> References: <20260317-docs-releases-json-v1-0-492d0b256349@bootlin.com> In-Reply-To: <20260317-docs-releases-json-v1-0-492d0b256349@bootlin.com> To: bitbake-devel@lists.openembedded.org Cc: Thomas Petazzoni , docs@lists.yoctoproject.org, Antonin Godard X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=4223; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=ngZ+rrsxtF5KxJEmcdhfJGyJuxOhBqYFd916F7TpBqk=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBpuSgrVQw0U5eOVYcL+INyBWA681dXsZDkyy0s4 +qFJJU4WOyJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCabkoKwAKCRDRgEFAKaOo NuEuEACmjIKW5SkF3NldZRvO1VIXWnchHwiACWoGUVvYkheqlKTxrd0e5vQ3/lRqA2N3lG3b5K2 Dhjsvr7XJ3SU0pMSEJl6JR9l7l8+n85l3+iT1LJzedq1fUcjsnJ8wKrk7UJW5hjCPGOGFkhMFkF Dhdf8GxZVQG8sh7LYE91JhNrnvf6RcwYqI0DZ512BvWp5pjZ6vmKyGxjzApYkojPhKdjAVw0Mzj G8gmVeo61bJpMGBDYDZRFS4N9TwObKgE9KErW5F1dNa/75pHzPo15nlhN9SJseUQAJ7Ib0QbSPd Ts+dxd8r6n5xGPFLFlc/I1rNaCwPgcrscLIMU661PdwtvYzJHz1V3YGtYT0se9LKOJ/FAmWyaTx 9XP5CtfzyZ24tP0+BdjXoq5P+JAjyukIzCTWXDd9h6jhMZT0cjXbEvMn4FG+PeOEVNBL0uhgYye 9sGSAVGUOVdEfblAXWcyRpQlnrBNVqEUhMo/ppVZVkRVmv9DQAlzoYdLemSRXW9gJfrUX/AnCbJ 5+ChHw8pbF8mt4441yMbSof71thehISEMEe+JKDmjZIHa07QEXjrwSZ+/FIYqLV/qV+Xe7IlJfg teCvXAi0xFREu4qvNV53tTpcL8RFZZB1L+XAy3nTfACLQq7oA3xk+AR51ecdwtdv72U4bxDhMW3 17v8juLeCBp8Ftg== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 17 Mar 2026 10:08:58 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/9088 Like what was done for yocto-docs[1], build using the remote releases.json file we can fetch from [2]. The file is downloaded if not present, and not re-downloaded for subsequent builds. In case of fetch failure, fallback to default values. [1]: https://git.yoctoproject.org/yocto-docs/commit/?id=5bebe38a808a33fea3deefc21dda39a35d90a7dd [2]: https://dashboard.yoctoproject.org/releases.json Signed-off-by: Antonin Godard --- doc/.gitignore | 1 + doc/Makefile | 2 +- doc/setversions.py | 59 +++++++++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 51 insertions(+), 11 deletions(-) diff --git a/doc/.gitignore b/doc/.gitignore index dee9494dcaf..1ee009c2012 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,2 +1,3 @@ _build/ sphinx-static/switchers.js +releases.json diff --git a/doc/Makefile b/doc/Makefile index 5e1632314c5..752f9b53b3e 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -27,7 +27,7 @@ publish: Makefile html singlehtml sed -i -e 's@index.html#@singleindex.html#@g' $(BUILDDIR)/$(DESTDIR)/singleindex.html clean: - @rm -rf $(BUILDDIR) sphinx-static/switchers.js + @rm -rf $(BUILDDIR) sphinx-static/switchers.js releases.json # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). diff --git a/doc/setversions.py b/doc/setversions.py index 967a0ba5a64..bcc3194b63c 100755 --- a/doc/setversions.py +++ b/doc/setversions.py @@ -14,30 +14,69 @@ # import itertools +import json +import os import re import subprocess import sys +from urllib.request import urlopen, URLError + +# NOTE: the following variables contain default values in case we are not able to fetch +# the releases.json file from https://dashboard.yoctoproject.org/releases.json DEVBRANCH = "2.18" LTSSERIES = ["2.8", "2.0"] ACTIVERELEASES = ["2.16"] + LTSSERIES - YOCTO_MAPPING = { "2.18": "wrynose", "2.16": "whinlatter", - "2.12": "walnascar", - "2.10": "styhead", "2.8": "scarthgap", - "2.6": "nanbield", - "2.4": "mickledore", - "2.2": "langdale", "2.0": "kirkstone", - "1.52": "honister", - "1.50": "hardknott", - "1.48": "gatesgarth", - "1.46": "dunfell", } +RELEASES_FROM_JSON = {} + +# Use the local releases.json file if found, fetch it from the dashboard otherwise +releases_json_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "releases.json") +try: + with open(releases_json_path, "r") as f: + RELEASES_FROM_JSON = json.load(f) +except FileNotFoundError: + print("Fetching releases.json from https://dashboard.yoctoproject.org/releases.json...", + file=sys.stderr) + try: + with urlopen("https://dashboard.yoctoproject.org/releases.json") as r, \ + open(releases_json_path, "w") as f: + RELEASES_FROM_JSON = json.load(r) + json.dump(RELEASES_FROM_JSON, f) + except URLError: + print("WARNING: tried to fetch https://dashboard.yoctoproject.org/releases.json " + "but failed, using default values for active releases", file=sys.stderr) + pass + +if RELEASES_FROM_JSON: + ACTIVERELEASES = [] + DEVBRANCH = "" + LTSSERIES = [] + YOCTO_MAPPING = {} + + for release in RELEASES_FROM_JSON: + bb_ver = release["bitbake_version"] + if release["status"] == "Active Development": + DEVBRANCH = bb_ver + if release["series"] == "current": + ACTIVERELEASES.append(bb_ver) + if "LTS until" in release["status"]: + LTSSERIES.append(bb_ver) + if release["bitbake_version"]: + YOCTO_MAPPING[bb_ver] = release["release_codename"] + + ACTIVERELEASES.remove(DEVBRANCH) + +print(f"ACTIVERELEASES calculated to be {ACTIVERELEASES}", file=sys.stderr) +print(f"DEVBRANCH calculated to be {DEVBRANCH}", file=sys.stderr) +print(f"LTSSERIES calculated to be {LTSSERIES}", file=sys.stderr) + BB_RELEASE_TAG_RE = re.compile(r"^[0-9]+\.[0-9]+\.[0-9]+$") def get_current_version(): From patchwork Tue Mar 17 10:08:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 83615 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 CAF2FFD7068 for ; Tue, 17 Mar 2026 10:09:00 +0000 (UTC) Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.72452.1773742131863477708 for ; Tue, 17 Mar 2026 03:08:52 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=C/yiFCrn; spf=pass (domain: bootlin.com, ip: 185.246.85.4, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 49E0B4E42629 for ; Tue, 17 Mar 2026 10:08:50 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 206E560050; Tue, 17 Mar 2026 10:08:50 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 3756310450452; Tue, 17 Mar 2026 11:08:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1773742129; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=wwpQW9mWKbuzMuyKUcHjXZ2tIQFntUWd39UP37vFCBI=; b=C/yiFCrnpHWe8ydhRis1unChTZ7WGdSM9/42zbD7VwCEU79VAQ+WCmlhaP+8+Sq7zyJiaT 7oSTejCF74XOSRc1nLpMqomoIhAsqplqFG199Fua9+oemHhBcly3eUADkUjDlgbfH6ZVTJ figvkoUISmxzVpSUpWCFcVjcOMLVRSiaq5MiDbrz+mgYOdQudGsjYV952YU7tIlYoefXth KQhYGMhoml1kjbYXxabxlBGbyOvq8Dgc+IsYNqBEaGGfr29BbrpbIa6SowVDZntLInwX3i pC9CiljZw4uN3eJPbcNNdhMEAFa/WTA5FT3gSvq6WGBen05rwY5RiMNC3qzTJQ== From: Antonin Godard Date: Tue, 17 Mar 2026 11:08:40 +0100 Subject: [PATCH 5/5] doc: generate the releases.rst file MIME-Version: 1.0 Message-Id: <20260317-docs-releases-json-v1-5-492d0b256349@bootlin.com> References: <20260317-docs-releases-json-v1-0-492d0b256349@bootlin.com> In-Reply-To: <20260317-docs-releases-json-v1-0-492d0b256349@bootlin.com> To: bitbake-devel@lists.openembedded.org Cc: Thomas Petazzoni , docs@lists.yoctoproject.org, Antonin Godard X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=21071; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=8rC8QFNqPXGHVHDW7K8vvzWF3SM83sDGXsoSrjdtBE0=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBpuSgr24v5PlyCwslNGkpvmhV8keC7IRQdl0C1d WcASgjNmv6JAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCabkoKwAKCRDRgEFAKaOo Nh14EACdUbug8TIj1mxdsslEQ5lrWaEw4yrFaV1/Q02gZl+ST9Sd9VU91tyQ7UPeEp7rKors06S bKKlwa+jROUH/93TmuGQQ5ONymaxaY/Km+yr0ep5DVk9uI+TpakKMx8VpRn1zJrug/DRVARme6Z 2yyKK4G5wGCK7PzjFLq6BZhURJKCgDsVYrrUjbMsYktgvsSr8oDiHV8uwWGPdjMex3x0O2vd2++ WMYaa1cmN+ckt3/NEDmTu026xvE3NqwYYeH5cXgJmyPC4v/dgUzdGI5evoLywIAwEsJB3IylRgI hBnBWCdcICouucskOa7WiU0cbTEoObqNovstjnC7sNKbGJeUMb853aRTZhCeZ8tlcQkXwbFkJQN 500vbJ1yOVhRaZGXV5WicfFwc3oCerr/9gm2cPXdtwf2GWp7ZIhf5LF2U2xYB+AqduecM/97KaO jypWRGhuVMRKcw8ZPpjIcrSxXVMd+mVxPhzKXGbatS3tE3vVeK39R7m8GNQqSjHKdsy+Ab9dmP+ cuWxA0rVlF72shBBwsZecIkpn+0mUAqEKyG7XWgX863NZr4SB2Gzy+Jj+pC69HZLPmRc5JACUUJ KBr1cDUyhHWDW/UsxtsOEdlG4xjrrMyBf2071g0xr/qltqg0WIElq5d2cfM2CB43cwU7GADLY3t STZzKd4hixKkuCg== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 17 Mar 2026 10:09:00 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/9089 Use the information we gather from releases.json to automatically create the supported and outdated releases document. The older releases do not follow the same linking scheme, so add them statically at the bottom of the file from script. Signed-off-by: Antonin Godard --- doc/.gitignore | 1 + doc/Makefile | 2 +- doc/conf.py | 2 + doc/releases.rst | 199 ----------------------------------------------------- doc/setversions.py | 191 ++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 195 insertions(+), 200 deletions(-) diff --git a/doc/.gitignore b/doc/.gitignore index 1ee009c2012..3a570d8c655 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,3 +1,4 @@ _build/ sphinx-static/switchers.js releases.json +releases.rst diff --git a/doc/Makefile b/doc/Makefile index 752f9b53b3e..2f8e898c4fc 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -27,7 +27,7 @@ publish: Makefile html singlehtml sed -i -e 's@index.html#@singleindex.html#@g' $(BUILDDIR)/$(DESTDIR)/singleindex.html clean: - @rm -rf $(BUILDDIR) sphinx-static/switchers.js releases.json + @rm -rf $(BUILDDIR) sphinx-static/switchers.js releases.json releases.rst # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). diff --git a/doc/conf.py b/doc/conf.py index 315fb7d06a7..9a53e55c938 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -39,6 +39,8 @@ setversions.write_switchers_js("sphinx-static/switchers.js.in", "sphinx-static/switchers.js", current_version) +setversions.write_releases_rst("releases.rst") + # -- Project information ----------------------------------------------------- project = 'Bitbake' diff --git a/doc/releases.rst b/doc/releases.rst deleted file mode 100644 index a0b0ce766ea..00000000000 --- a/doc/releases.rst +++ /dev/null @@ -1,199 +0,0 @@ -.. SPDX-License-Identifier: CC-BY-2.5 - -================================= -BitBake Supported Release Manuals -================================= - -******************************* -Release Series 5.3 (whinlatter) -******************************* - -- :yocto_docs:`BitBake 2.16 User Manual ` - -******************************* -Release Series 5.0 (scarthgap) -******************************* - -- :yocto_docs:`BitBake 2.8 User Manual ` - -****************************** -Release Series 4.0 (kirkstone) -****************************** - -- :yocto_docs:`BitBake 2.0 User Manual ` - -================================ -BitBake Outdated Release Manuals -================================ - -****************************** -Release Series 5.2 (walnascar) -****************************** - -- :yocto_docs:`BitBake 2.12 User Manual ` - -**************************** -Release Series 5.1 (styhead) -**************************** - -- :yocto_docs:`BitBake 2.10 User Manual ` - -******************************* -Release Series 4.3 (nanbield) -******************************* - -- :yocto_docs:`BitBake 2.6 User Manual ` - -******************************* -Release Series 4.2 (mickledore) -******************************* - -- :yocto_docs:`BitBake 2.4 User Manual ` - -***************************** -Release Series 4.1 (langdale) -***************************** - -- :yocto_docs:`BitBake 2.2 User Manual ` - -****************************** -Release Series 3.4 (honister) -****************************** - -- :yocto_docs:`BitBake 1.52 User Manual ` - -****************************** -Release Series 3.3 (hardknott) -****************************** - -- :yocto_docs:`BitBake 1.50 User Manual ` - -******************************* -Release Series 3.2 (gatesgarth) -******************************* - -- :yocto_docs:`BitBake 1.48 User Manual ` - -**************************** -Release Series 3.1 (dunfell) -**************************** - -- :yocto_docs:`BitBake 1.46 User Manual ` -- :yocto_docs:`3.1 BitBake User Manual ` -- :yocto_docs:`3.1.1 BitBake User Manual ` -- :yocto_docs:`3.1.2 BitBake User Manual ` -- :yocto_docs:`3.1.3 BitBake User Manual ` - -************************* -Release Series 3.0 (zeus) -************************* - -- :yocto_docs:`3.0 BitBake User Manual ` -- :yocto_docs:`3.0.1 BitBake User Manual ` -- :yocto_docs:`3.0.2 BitBake User Manual ` -- :yocto_docs:`3.0.3 BitBake User Manual ` -- :yocto_docs:`3.0.4 BitBake User Manual ` - -**************************** -Release Series 2.7 (warrior) -**************************** - -- :yocto_docs:`2.7 BitBake User Manual ` -- :yocto_docs:`2.7.1 BitBake User Manual ` -- :yocto_docs:`2.7.2 BitBake User Manual ` -- :yocto_docs:`2.7.3 BitBake User Manual ` -- :yocto_docs:`2.7.4 BitBake User Manual ` - -************************* -Release Series 2.6 (thud) -************************* - -- :yocto_docs:`2.6 BitBake User Manual ` -- :yocto_docs:`2.6.1 BitBake User Manual ` -- :yocto_docs:`2.6.2 BitBake User Manual ` -- :yocto_docs:`2.6.3 BitBake User Manual ` -- :yocto_docs:`2.6.4 BitBake User Manual ` - -************************* -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 BitBake User Manual ` -- :yocto_docs:`2.4.1 BitBake User Manual ` -- :yocto_docs:`2.4.2 BitBake User Manual ` -- :yocto_docs:`2.4.3 BitBake User Manual ` -- :yocto_docs:`2.4.4 BitBake User Manual ` - -************************* -Release Series 2.3 (pyro) -************************* - -- :yocto_docs:`2.3 BitBake User Manual ` -- :yocto_docs:`2.3.1 BitBake User Manual ` -- :yocto_docs:`2.3.2 BitBake User Manual ` -- :yocto_docs:`2.3.3 BitBake User Manual ` -- :yocto_docs:`2.3.4 BitBake User Manual ` - -************************** -Release Series 2.2 (morty) -************************** - -- :yocto_docs:`2.2 BitBake User Manual ` -- :yocto_docs:`2.2.1 BitBake User Manual ` -- :yocto_docs:`2.2.2 BitBake User Manual ` -- :yocto_docs:`2.2.3 BitBake User Manual ` - -**************************** -Release Series 2.1 (krogoth) -**************************** - -- :yocto_docs:`2.1 BitBake User Manual ` -- :yocto_docs:`2.1.1 BitBake User Manual ` -- :yocto_docs:`2.1.2 BitBake User Manual ` -- :yocto_docs:`2.1.3 BitBake User Manual ` - -*************************** -Release Series 2.0 (jethro) -*************************** - -- :yocto_docs:`1.9 BitBake User Manual ` -- :yocto_docs:`2.0 BitBake User Manual ` -- :yocto_docs:`2.0.1 BitBake User Manual ` -- :yocto_docs:`2.0.2 BitBake User Manual ` -- :yocto_docs:`2.0.3 BitBake User Manual ` - -************************* -Release Series 1.8 (fido) -************************* - -- :yocto_docs:`1.8 BitBake User Manual ` -- :yocto_docs:`1.8.1 BitBake User Manual ` -- :yocto_docs:`1.8.2 BitBake User Manual ` - -************************** -Release Series 1.7 (dizzy) -************************** - -- :yocto_docs:`1.7 BitBake User Manual ` -- :yocto_docs:`1.7.1 BitBake User Manual ` -- :yocto_docs:`1.7.2 BitBake User Manual ` -- :yocto_docs:`1.7.3 BitBake User Manual ` - -************************** -Release Series 1.6 (daisy) -************************** - -- :yocto_docs:`1.6 BitBake User Manual ` -- :yocto_docs:`1.6.1 BitBake User Manual ` -- :yocto_docs:`1.6.2 BitBake User Manual ` -- :yocto_docs:`1.6.3 BitBake User Manual ` - diff --git a/doc/setversions.py b/doc/setversions.py index bcc3194b63c..82a0e8b191b 100755 --- a/doc/setversions.py +++ b/doc/setversions.py @@ -19,6 +19,7 @@ import os import re import subprocess import sys +import textwrap from urllib.request import urlopen, URLError @@ -152,3 +153,193 @@ def write_switchers_js(js_in, js_out, current_version): else: w.write(line) print("switchers.js generated from switchers.js.in") + +def _release_section(series_version: str, codename: str, bitbake_version: str) -> str: + """ + Helper function to generate a release section, as: + + ******************** + Release Series xxxxx + ******************** + + - + """ + section_length = len(series_version) + len(codename) + 18 + return textwrap.dedent( + f"""\ + {'*' * section_length} + Release Series {series_version} ({codename}) + {'*' * section_length} + + - :yocto_docs:`BitBake {bitbake_version} User Manual ` + + """) + +def write_releases_rst(releases_rst_out: str): + """ + Generates the releases.rst file automatically, based on what is found + in the releases.json file. + """ + with open(releases_rst_out, "w") as f: + f.write(textwrap.dedent("""\ + .. SPDX-License-Identifier: CC-BY-2.5 + + ================================= + BitBake Supported Release Manuals + ================================= + + """)) + + for release in RELEASES_FROM_JSON: + if release["status"] == "Active Development": + continue + + if not release["bitbake_version"]: + continue + + if release["series"] == "current": + f.write(_release_section( + release["series_version"], + release["release_codename"], + release["bitbake_version"])) + + f.write(textwrap.dedent("""\ + ================================ + BitBake Outdated Release Manuals + ================================ + + """)) + + for release in RELEASES_FROM_JSON: + if not release["series"] == "previous": + continue + + if not release["bitbake_version"]: + continue + + f.write(_release_section( + release["series_version"], + release["release_codename"], + release["bitbake_version"])) + + # old legacy links, which cannot be auto-generated + f.write(textwrap.dedent( + """\ + - :yocto_docs:`3.1.2 BitBake User Manual ` + - :yocto_docs:`3.1 BitBake User Manual ` + - :yocto_docs:`3.1.1 BitBake User Manual ` + - :yocto_docs:`3.1.3 BitBake User Manual ` + + ************************* + Release Series 3.0 (Zeus) + ************************* + + - :yocto_docs:`3.0 BitBake User Manual ` + - :yocto_docs:`3.0.1 BitBake User Manual ` + - :yocto_docs:`3.0.2 BitBake User Manual ` + - :yocto_docs:`3.0.3 BitBake User Manual ` + - :yocto_docs:`3.0.4 BitBake User Manual ` + + **************************** + Release Series 2.7 (Warrior) + **************************** + + - :yocto_docs:`2.7 BitBake User Manual ` + - :yocto_docs:`2.7.1 BitBake User Manual ` + - :yocto_docs:`2.7.2 BitBake User Manual ` + - :yocto_docs:`2.7.3 BitBake User Manual ` + - :yocto_docs:`2.7.4 BitBake User Manual ` + + ************************* + Release Series 2.6 (Thud) + ************************* + + - :yocto_docs:`2.6 BitBake User Manual ` + - :yocto_docs:`2.6.1 BitBake User Manual ` + - :yocto_docs:`2.6.2 BitBake User Manual ` + - :yocto_docs:`2.6.3 BitBake User Manual ` + - :yocto_docs:`2.6.4 BitBake User Manual ` + + ************************* + 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 BitBake User Manual ` + - :yocto_docs:`2.4.1 BitBake User Manual ` + - :yocto_docs:`2.4.2 BitBake User Manual ` + - :yocto_docs:`2.4.3 BitBake User Manual ` + - :yocto_docs:`2.4.4 BitBake User Manual ` + + ************************* + Release Series 2.3 (Pyro) + ************************* + + - :yocto_docs:`2.3 BitBake User Manual ` + - :yocto_docs:`2.3.1 BitBake User Manual ` + - :yocto_docs:`2.3.2 BitBake User Manual ` + - :yocto_docs:`2.3.3 BitBake User Manual ` + - :yocto_docs:`2.3.4 BitBake User Manual ` + + ************************** + Release Series 2.2 (Morty) + ************************** + + - :yocto_docs:`2.2 BitBake User Manual ` + - :yocto_docs:`2.2.1 BitBake User Manual ` + - :yocto_docs:`2.2.2 BitBake User Manual ` + - :yocto_docs:`2.2.3 BitBake User Manual ` + + **************************** + Release Series 2.1 (Krogoth) + **************************** + + - :yocto_docs:`2.1 BitBake User Manual ` + - :yocto_docs:`2.1.1 BitBake User Manual ` + - :yocto_docs:`2.1.2 BitBake User Manual ` + - :yocto_docs:`2.1.3 BitBake User Manual ` + + *************************** + Release Series 2.0 (Jethro) + *************************** + + - :yocto_docs:`1.9 BitBake User Manual ` + - :yocto_docs:`2.0 BitBake User Manual ` + - :yocto_docs:`2.0.1 BitBake User Manual ` + - :yocto_docs:`2.0.2 BitBake User Manual ` + - :yocto_docs:`2.0.3 BitBake User Manual ` + + ************************* + Release Series 1.8 (Fido) + ************************* + + - :yocto_docs:`1.8 BitBake User Manual ` + - :yocto_docs:`1.8.1 BitBake User Manual ` + - :yocto_docs:`1.8.2 BitBake User Manual ` + + ************************** + Release Series 1.7 (Dizzy) + ************************** + + - :yocto_docs:`1.7 BitBake User Manual ` + - :yocto_docs:`1.7.1 BitBake User Manual ` + - :yocto_docs:`1.7.2 BitBake User Manual ` + - :yocto_docs:`1.7.3 BitBake User Manual ` + + ************************** + Release Series 1.6 (Daisy) + ************************** + + - :yocto_docs:`1.6 BitBake User Manual ` + - :yocto_docs:`1.6.1 BitBake User Manual ` + - :yocto_docs:`1.6.2 BitBake User Manual ` + - :yocto_docs:`1.6.3 BitBake User Manual ` + """))