From patchwork Fri Nov 20 08:14:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 105041 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.2019.1795162534532079570 for ; Fri, 20 Nov 2026 00:15:35 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=SbqwW2cM; spf=pass (domain: bootlin.com, ip: 185.171.202.116, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 87545C2F4E0 for ; Fri, 20 Nov 2026 08:15:35 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id DB0AD6017D; Fri, 20 Nov 2026 08:15:29 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D710F11BC0FCE; Fri, 20 Nov 2026 09:15:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1795162529; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=UO+b4z4pqYmjY+RTvbAkfDcDlVb8OIW+8LL3diqDCXM=; b=SbqwW2cMwgtsLT9FFgjYKTRtpBln5Zd0c+v+r3QXhNMLN+sU/88eBGQAvjXMc6sjGNvPL4 xIbFZPQw+yAlkiWcQf6+DOzb0Uui+sIR+tRlvl8hALpTTTYRX15AW1HHrNvdGInKDo7Ke8 CfI4Jo1kvX7ow0bpEthX+CtI6qPdGYsl+O5lSns9Ar+4OaOdTWan0DACbkhPCvvXjX8B72 5tjDyzjwD0I7SqVaHxaczBOgC4byjYxiOtEVjhgeXWp/scesQtuxImVFpTEOdBZFYSsJNM bfnEu8eT2MvKdKnvwf6xgZcCc5McA+G/nrnIcMbwMd2Ij5Ek/c647YS+k8KxNQ== From: Antonin Godard Date: Fri, 20 Nov 2026 09:14:53 +0100 Subject: [PATCH v2 1/4] tools/gen-releases-svg: use subprocess check_call instead of run MIME-Version: 1.0 Message-Id: <20261120-gen-releases-svg-fixes-v2-1-abc66b9dd7da@bootlin.com> References: <20261120-gen-releases-svg-fixes-v2-0-abc66b9dd7da@bootlin.com> In-Reply-To: <20261120-gen-releases-svg-fixes-v2-0-abc66b9dd7da@bootlin.com> To: docs@lists.yoctoproject.org Cc: Thomas Petazzoni , Antonin Godard , Quentin Schulz X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1015; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=XmO7LFpguAwpFMRn8AJTDDOXmbAsH7G+8QIEVcE9Cpo=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBrAAGEkx2fr6omS9hpiVbiI0QgNJ2ncMWi+jesQ cUXIqzAVguJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCawABhAAKCRDRgEFAKaOo NidND/9Lu7PYX+a3Ui3ennBi/Cn/rBynHBBGKS18nrBPqlLhI56Gtkn4rFbbgIMmC4ZYYTB/AjF XYHf4o4VAIv2b9qwOuuqk223m2ms9qzwas+BgkjxxE4PlTGxJ5fmWx910fmxx7eWiK+9YxWUZi6 hjrOxed/bVDdx6GyMZbll9anhx/Vgmxo1z01hC9q/vHqPckMGIU1T9AP9wN+Zs09SgqgQ3rrMyc SqmutKCdXxXXA59cBVJt2hQkCM+LkFyg4aiI8Xnb45BOTdEZQPcXK6YC7I7yPfFuim9kwgUE7fL O3Qx4aQ+Eo385bBFT5W6fGvoPB+Ku2h+CvFbWxekR/l76LrHlvXkSksvPLnVAuQdW2w8Qt0zBUF fiwuxPyueTkdSxSAxFNakukiPpfTBQ1gkUpL3rWwdQmSGyLbX4gdLOnGlephyOSxSMykvyZ2n/3 4535pitp1eHj5NJaVcfW0/P16ibpjFCEbdF7xp0Kv2L/nxSyYNx55XRG3qjqnZXYgN9Wm3sHg2T fHWvV8mFNAYBEYoAMKJrIeBcwbJsrg4jy74afvH68tAbVGKW4LG+G2UIDk8rtZIguX73+6CxPt2 6lcSSJvUhWS6+bEDuXTVXWjqu6YNlGd10hsR/iJ1Jb3bKr+WWCdq5h/cylkxq8L/6gp7NGuNJQ8 GLrCi6J3oBPNjWA== 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 lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 20 Nov 2026 08:15:37 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/10810 We don't use the result of the command, so use check_call instead. Suggested-by: Quentin Schulz Reviewed-by: Quentin Schulz Signed-off-by: Antonin Godard --- documentation/tools/gen-releases-svg | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/documentation/tools/gen-releases-svg b/documentation/tools/gen-releases-svg index e091c02de..6a601b010 100755 --- a/documentation/tools/gen-releases-svg +++ b/documentation/tools/gen-releases-svg @@ -89,7 +89,4 @@ with tempfile.TemporaryDirectory() as tmpdir: mmd.write(f" {codename} {series_version}{" (LTS)" if lts else ""}" f" :{status}, {original_release_date}, {end_date}\n") - result = subprocess.run( - ["mmdc", "--input", mmdpath, "--output", args.output], - check=True, - ) + subprocess.check_call(["mmdc", "--input", mmdpath, "--output", args.output]) From patchwork Fri Nov 20 08:14:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 105043 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.2021.1795162536700587761 for ; Fri, 20 Nov 2026 00:15:38 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bootlin.com header.s=dkim header.b=dtJ+yQyG; spf=pass (domain: bootlin.com, ip: 185.171.202.116, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 5D0EDC2BB2F for ; Fri, 20 Nov 2026 08:15:36 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id BED4F6017D; Fri, 20 Nov 2026 08:15:30 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id AE7F111BC1127; Fri, 20 Nov 2026 09:15:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1795162530; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=rGWlKOA7JQSSk75P+uhr9gZFeKaClWyvZ5t09quNRR4=; b=dtJ+yQyG6MxuzY1GI7tyz+Z0SNSiZebWnaF3MDzyHBOdjXPwCA8W/x056oX9k1+fuVmBSp N9rwaC1TibQolD90I2yUxGgEXLkVIt7nMWIxX+t7VdjqGf1+ATai2osxdEtrIqpG7byAsk hOFv3cS8lQf3rCwxFlxQABFbDZT9YNe8TXmwavslsL8J8BoliSUr16X5lcNHwQ8yixVLvu m/jU7mQ4EWJqybby2ljm7BXGlWZNh0BUbNGvg+sSiNRRdyepTMan/0uR2s+9uf6F5/xC1q LtKj5khlO8deLZwXBWp2nzkS0gmMxFexDpeyTlZ+8igl/CLkMMcSEKeKic1w5w== From: Antonin Godard Date: Fri, 20 Nov 2026 09:14:54 +0100 Subject: [PATCH v2 2/4] tools/gen-releases-svg: start showing releases from oldest active one MIME-Version: 1.0 Message-Id: <20261120-gen-releases-svg-fixes-v2-2-abc66b9dd7da@bootlin.com> References: <20261120-gen-releases-svg-fixes-v2-0-abc66b9dd7da@bootlin.com> In-Reply-To: <20261120-gen-releases-svg-fixes-v2-0-abc66b9dd7da@bootlin.com> To: docs@lists.yoctoproject.org Cc: Thomas Petazzoni , Antonin Godard , Quentin Schulz X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=27407; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=cfXAT53/KRhmp4qgnu7u1ILDWqFmukCCJ2pI2mxItig=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBrAAGEK7GnEnM5BnsvaWkTLrwyJMQSmUSnjqM2P DJ0zZ26QmqJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCawABhAAKCRDRgEFAKaOo NouSD/9sYRExA6YSwSzSlv75Svp0CJEfdqmq+cubV2bc48ayNJUWk5mMWgy+2V6m1kWdyYiPozM UyyqPvW/1fq2a53MovhmmfaKvw+aHUd7qveUDlDEChlOrXE00tcsPdfoztTriCkTj6CW2J1WVTU vZfkoo7erRMxOC4jd+KsAUx2gMdPhvk/VFz/tfrf+NjBIimIFIrwtoYcXTsowX+TMhQJeuBPHo8 efUDX7emgY5l2ADa4qa+TfZ4vq+uc7ozA57HEJGntrKBSzXkdMVTeqaTO4NlzbluyKIH1Vp/col doFbKInXdFRYHLhQI0DEYcInYXTgS4Z/plNLbhG5/P3YcPJht5+GWWitZY3INYK/DyFDKsqDIL7 ndPIuLci5E3RjvUWK3hulJ70tF9gAWpJeNmxOcgR4Jp1IPE6zsZgWcBh8CpdGNdGhVbFWSXQf3Y 7adD4Yb6orpHzfYcCNPADG3ksHlraHloZA+SN+aOAhV11d87Sa05GZxtZxLN7nCe4aow4bTJFmD 3KFgpVL809vp4vBqoy3ix7cHSAlNv0sjf9rgUhK1VuUYwhn98+MjShLrJ16Wz4sQUStARl/k56y iAHLhUOqwNdF3IgAlVoW6flL8Das7qL7T0YDZ0Emg/d+LGctlIsMKVh/WehFOrP1WHfYggzRg5x YxXVXNrSugfwMZw== 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 lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 20 Nov 2026 08:15:47 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/10812 Instead of a fixed date (2022-04-01, which represented the Kirkstone release date), show the releases from the oldest active one. Suggested-by: Quentin Schulz Signed-off-by: Antonin Godard Reviewed-by: Quentin Schulz --- documentation/ref-manual/svg/releases.svg | 2 +- documentation/tools/gen-releases-svg | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/documentation/ref-manual/svg/releases.svg b/documentation/ref-manual/svg/releases.svg index 386491997..c4a7b611f 100644 --- a/documentation/ref-manual/svg/releases.svg +++ b/documentation/ref-manual/svg/releases.svg @@ -1 +1 @@ -Jul 2022Jan 2023Jul 2023Jan 2024Jul 2024Jan 2025Jul 2025Jan 2026Jul 2026Jan 2027Jul 2027Jan 2028Jul 2028Jan 2029Jul 2029Jan 2030Kirkstone 4.0 Langdale 4.1 Mickledore 4.2 Nanbield 4.3 Scarthgap 5.0 (LTS) Styhead 5.1 Walnascar 5.2 Whi nlatter 5.3 Wrynose 6.0 (LTS) Blacksail 6.1 Garburn 6.2 \ No newline at end of file +Jul 2024Jan 2025Jul 2025Jan 2026Jul 2026Jan 2027Jul 2027Jan 2028Jul 2028Jan 2029Jul 2029Jan 2030Scarthgap 5.0 (LTS) Styhead 5.1 Walnascar 5.2 Whinlatter 5.3 Wrynose 6.0 (LTS) Blacksail 6.1 Garburn 6.2 \ No newline at end of file diff --git a/documentation/tools/gen-releases-svg b/documentation/tools/gen-releases-svg index 6a601b010..32458bd9e 100755 --- a/documentation/tools/gen-releases-svg +++ b/documentation/tools/gen-releases-svg @@ -54,6 +54,16 @@ gantt with open(args.releases_json_path, "r") as f: releases_from_json = json.load(f) +# Find the oldest active release release date to make it the start of our timeline. +oldest_supported_release_date = datetime.datetime.now(datetime.timezone.utc) +for release in releases_from_json: + if release["series"] == "previous": + continue + if not release["original_release_date"]: + continue + oldest_supported_release_date = min(oldest_supported_release_date, datetime.datetime.strptime( + release["original_release_date"], "%Y-%m-%dT%H:%M:%S%z")) + with tempfile.TemporaryDirectory() as tmpdir: mmdpath = Path(tmpdir) / "diagram.mmd" with open(mmdpath, "w", encoding="utf-8") as mmd: @@ -69,7 +79,7 @@ with tempfile.TemporaryDirectory() as tmpdir: if not release["original_release_date"]: continue original_release_date = datetime.datetime.strptime(release["original_release_date"], "%Y-%m-%dT%H:%M:%S%z") - if original_release_date < datetime.datetime(2022, 4, 1, tzinfo=datetime.timezone.utc): + if original_release_date < oldest_supported_release_date: continue original_release_date = original_release_date.date().isoformat() end_date = datetime.datetime.strptime(release["latest_release_date"], "%Y-%m-%dT%H:%M:%S%z") From patchwork Fri Nov 20 08:14:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 105040 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.2018.1795162534091253149 for ; Fri, 20 Nov 2026 00:15:34 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=nr/csIXc; 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 474544E41670 for ; Fri, 20 Nov 2026 08:15:32 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 1D9CC6017D; Fri, 20 Nov 2026 08:15:32 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 8EAE711BC1185; Fri, 20 Nov 2026 09:15:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1795162531; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=4SrR01R3gx/z/3jrf1PvrYvqUVDvyrnM3AadxLJq7Y4=; b=nr/csIXcu+E7nULbEttChP/YlId+vt0McPKeLnkRk1DOPvy2h3+PYYWQwI7pCy/wJrXGyl VhUT1KM3k8fFoPQOw6lnFOerWexMBaBBGXL3tWTtNoXHOccFra4El0O3xZGVAwrG+8mWJ3 pT4xg7RSZpIFP1VPDY0Tbj+lnVeDAoRWxmkwRmfqkAy9hWDcx4lsGhoF+3IyLuJ40vrhfH ChY1JSKww7ceqvpvUCIU+MpU9yQlYQazrow4fZY6Xe+PScY14hSjhnVG3GmMkBV8esIoZe 1bKyPmUpuZwiNHsfYnddjMkOM4rDBb18LIuuzkz88oeIqBszy3R0X8ml6zYMiQ== From: Antonin Godard Date: Fri, 20 Nov 2026 09:14:55 +0100 Subject: [PATCH v2 3/4] tools/gen-releases-svg: store docs root dir in variable MIME-Version: 1.0 Message-Id: <20261120-gen-releases-svg-fixes-v2-3-abc66b9dd7da@bootlin.com> References: <20261120-gen-releases-svg-fixes-v2-0-abc66b9dd7da@bootlin.com> In-Reply-To: <20261120-gen-releases-svg-fixes-v2-0-abc66b9dd7da@bootlin.com> To: docs@lists.yoctoproject.org Cc: Thomas Petazzoni , Antonin Godard , Quentin Schulz X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1445; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=7lNZwtMz0Vn0ybxRrzYvtgsF1FClClAgLUBrWeAQPKY=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBrAAGEZeUWdf4Gg7VulJIdVOdFfhk2ZVaeEJfwu SmsUujFuVWJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCawABhAAKCRDRgEFAKaOo NhlwD/9tZF20VSTw02B7RC6CkWKaXDIAgnCxeKDDy8HDUKr9UTbVYMF9YTwjfJrIsIs4ZSISRf4 Evt2PCCJXV1dbYhvMBUqpz0OzfrU6zoBZe/YgN7pjjg4yHOhiUNec7pBwAMnPt1fwsSMvRVJ/Gg W38BNlfEA3FL+HcbClt+2Iiqx1dij3QaCWMJuGV8wJq+SZnUxs3HE22iQMqZ/lPCmfWjdZEpzVW C1/kMJq64Z/paLWkpT98zpY3zUZTK+R4gMrdGYPbZuF5ujZvS+LAvEBOqhpuF2mv1D7YyQv75cj QDVXiaHvY6IRN2QKLzHaZ0auTQneu8ovFsDjtnu1UGJ3Z7e8Uu9zAptZHRnj31e5u7uBONE5AjG yaYaY4nM2aQ8HxJUM9DXH6A3kGZVKEWAtNX4uHCX0ZNO6tSuFkzHhemJ8iXXzBCacphBX5L8NZR 237BoF3IDjzIboysGjNYtSWler74zED3hQxCCKAfxY76AlPmqjmS8ysZq2jP6B6H08PzYFGJgxM jQIbKfjUvyxw23nWbvl3He2FTMh6yo/1yWM5RKm5hdS8Z46Z8MIUWcwfW8LWT3znT76AI7Nw7in MhauJn5tgjHu/sor5qq8a+0GU+ZN2yQajjmlkgneKy6jXu9TELx20cUnk6USFWcevVam6I65jgP /QCmoCge2wuD1xw== 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 lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 20 Nov 2026 08:15:36 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/10809 To improve readability, store the documentation root directory in a variable and reuse it in the default assignment for -i and -o. Suggested-by: Quentin Schulz Signed-off-by: Antonin Godard Reviewed-by: Quentin Schulz --- documentation/tools/gen-releases-svg | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/documentation/tools/gen-releases-svg b/documentation/tools/gen-releases-svg index 32458bd9e..f8dc8e72d 100755 --- a/documentation/tools/gen-releases-svg +++ b/documentation/tools/gen-releases-svg @@ -18,13 +18,16 @@ import tempfile from pathlib import Path +# documentation/ directory in yocto-docs +documentation_dir = Path(__file__).resolve().parent.parent + parser = argparse.ArgumentParser( description="Parse releases.json and output a releases.svg file" ) parser.add_argument("-i", help="Path to the releases.json file", dest="releases_json_path", - default=Path(__file__).resolve().parent.parent / "releases.json") + default=documentation_dir / "releases.json") parser.add_argument("-o", help="Path to the output SVG", dest="output", - default=Path(__file__).resolve().parent.parent / "ref-manual/svg/releases.svg") + default=documentation_dir / "ref-manual/svg/releases.svg") args = parser.parse_args() if not shutil.which("mmdc"): From patchwork Fri Nov 20 08:14:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 105042 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.2020.1795162535908264211 for ; Fri, 20 Nov 2026 00:15:37 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=dkim header.b=LF42AcwE; spf=pass (domain: bootlin.com, ip: 185.171.202.116, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 38BC2C2BB30; Fri, 20 Nov 2026 08:15:38 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 97A716017D; Fri, 20 Nov 2026 08:15:32 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 8550011BC120C; Fri, 20 Nov 2026 09:15:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1795162532; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=pprA5B0KEJeK2lLkOgPPz9SukFzCYGG1Shm83jcoRbE=; b=LF42AcwEzdT3zQKUpWeGewpvsOnGIYZJFEHTKb98I4y3hFac0ZwcSLLngFeM7P6IVTTx/e vMQfl7xiJaAgbAgs3dXZBvSMTJ9rBB3pzno0MlsjXQFMJwf9dEAkJri3cyvOmNY1bBX/wO aWLUlSnWnlOMGcgNamfGC6NDwVainRR5nJajkqamKGkkpU3ifO07RNbb6Q/VZtnCHb7xkK lpCyGt5lckihaQtsW6iE3oONVWjfJFXhB7FQ9RAFkcSzDsyGzqQWsCZrIU0IBnhBlHZcdS JtagudSdieDsZfvr/L28Dniahs9Zi3daMtF7GCrrlWWZk8+gVnad8TuXgYqAjA== From: Antonin Godard Date: Fri, 20 Nov 2026 09:14:56 +0100 Subject: [PATCH v2 4/4] tools/gen-releases-svg: simplify tempfile usage MIME-Version: 1.0 Message-Id: <20261120-gen-releases-svg-fixes-v2-4-abc66b9dd7da@bootlin.com> References: <20261120-gen-releases-svg-fixes-v2-0-abc66b9dd7da@bootlin.com> In-Reply-To: <20261120-gen-releases-svg-fixes-v2-0-abc66b9dd7da@bootlin.com> To: docs@lists.yoctoproject.org Cc: Thomas Petazzoni , Antonin Godard , Quentin Schulz X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=4406; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=5/iHTlEIygXMNNRAOsUXYSLqmwf0gSZagMtlpfB7omI=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBrAAGFUIgm/odN5d8XGclKYFVuJm9FYkPZ/AY8C Sz3+6Ob3aGJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCawABhQAKCRDRgEFAKaOo NkpbD/9RyV/Ff0oPmpSfo2ebNaAkJgPWEcFkOyz5V5Z1s9px68+FmcrXnMmgl5bGyb19GnKYKcn mddv790dcL5cFJiGzHojUvWhII3jrGtSjMZ/vx/fItYetCTBMHd/Y2ikBk1n5VwHk2bstc70th9 3mE5p4fBNctTqQfQbOe2a5IOONb6aVy0mPbbWx9sU91bZhOpH+Zwe+vEYXco6nG4NPOoi9wgo+A ZiDT5Poi6n90PmSGvQNHMQBYxKNM22nn3HPGTWkM9MHJNMhGpXMBUsnii/z5e9eXFXl/e1pjV+h 0qSwpVPxuyWyIlfTdg9UnQbiqjfwMusq0IhikCqTI1Ev5ZQd7Pn72+vBI5hyd6YFw9HSyPVefau /uamQCS0mhQ/SYmDH8TZq5ozS7s1CnRn6MQ3vq0eT/C/XgNe3/r/AF6KG0Zzkc5uc7tGs+lrSCT KHVOSVfFkCRhE3QRdAbAf9RIhl8gAERg1VWkGR/myxypE+ChcV4bqVXMM17BIalMw72WSSHUF8O u1iLTHJ61lUfLROxRZWt6z9+M9GEJ5FUwF9dgWm9Z2sM4jEZkhhi4Exbsqs1fiGqflolqLxoatU g8/meFe+OsGvDPZqUVAW6rlY0TNFdNjmxxiSyErto82RDLdwerZ5V2JDFp8e/SPhKfFY1vZW5iE 8yN5dyeXvB/IdCg== 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 lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 20 Nov 2026 08:15:47 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/10811 We can directly use tempfile.NamedTemporaryFile() to open a temporary file and use it for the diagram passed too mmdc. Make sure it's flushed before mmdc reads it. This simplifies code complexity. Suggested-by: Quentin Schulz Reviewed-by: Quentin Schulz Signed-off-by: Antonin Godard --- documentation/tools/gen-releases-svg | 68 ++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/documentation/tools/gen-releases-svg b/documentation/tools/gen-releases-svg index f8dc8e72d..e2370bf8f 100755 --- a/documentation/tools/gen-releases-svg +++ b/documentation/tools/gen-releases-svg @@ -67,39 +67,39 @@ for release in releases_from_json: oldest_supported_release_date = min(oldest_supported_release_date, datetime.datetime.strptime( release["original_release_date"], "%Y-%m-%dT%H:%M:%S%z")) -with tempfile.TemporaryDirectory() as tmpdir: - mmdpath = Path(tmpdir) / "diagram.mmd" - with open(mmdpath, "w", encoding="utf-8") as mmd: - mmd.write(MMD_HEADER) +with tempfile.NamedTemporaryFile("w") as mmd: + mmd.write(MMD_HEADER) - first_active_rel_found = False - for release in releases_from_json: - codename = release["release_codename"] - series_version = release["series_version"] - if release["status"] == "Active Development": - mmd.write(f" {codename} {series_version} :done, after current_rel, 6M\n") - continue - if not release["original_release_date"]: - continue - original_release_date = datetime.datetime.strptime(release["original_release_date"], "%Y-%m-%dT%H:%M:%S%z") - if original_release_date < oldest_supported_release_date: - continue - original_release_date = original_release_date.date().isoformat() - end_date = datetime.datetime.strptime(release["latest_release_date"], "%Y-%m-%dT%H:%M:%S%z") - end_date = end_date.date().isoformat() - lts = False - if "LTS until" in release["status"]: - lts = True - status = "done" - if release["series"] == "current": - status = "active" - if not first_active_rel_found: - status += ", current_rel" - first_active_rel_found = True - end_date = "6M" - if lts: - end_date = "4y" - mmd.write(f" {codename} {series_version}{" (LTS)" if lts else ""}" - f" :{status}, {original_release_date}, {end_date}\n") + first_active_rel_found = False + for release in releases_from_json: + codename = release["release_codename"] + series_version = release["series_version"] + if release["status"] == "Active Development": + mmd.write(f" {codename} {series_version} :done, after current_rel, 6M\n") + continue + if not release["original_release_date"]: + continue + original_release_date = datetime.datetime.strptime(release["original_release_date"], "%Y-%m-%dT%H:%M:%S%z") + if original_release_date < oldest_supported_release_date: + continue + original_release_date = original_release_date.date().isoformat() + end_date = datetime.datetime.strptime(release["latest_release_date"], "%Y-%m-%dT%H:%M:%S%z") + end_date = end_date.date().isoformat() + lts = False + if "LTS until" in release["status"]: + lts = True + status = "done" + if release["series"] == "current": + status = "active" + if not first_active_rel_found: + status += ", current_rel" + first_active_rel_found = True + end_date = "6M" + if lts: + end_date = "4y" + mmd.write(f" {codename} {series_version}{" (LTS)" if lts else ""}" + f" :{status}, {original_release_date}, {end_date}\n") - subprocess.check_call(["mmdc", "--input", mmdpath, "--output", args.output]) + mmd.flush() + + subprocess.check_call(["mmdc", "--input", mmd.name, "--output", args.output])