get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2220625/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2220625,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2220625/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/buildroot/patch/20260407-generate-cyclonedx-br-v1-1-03c45ccba2ed@cherry.de/",
    "project": {
        "id": 27,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/27/?format=api",
        "name": "Buildroot development",
        "link_name": "buildroot",
        "list_id": "buildroot.buildroot.org",
        "list_email": "buildroot@buildroot.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20260407-generate-cyclonedx-br-v1-1-03c45ccba2ed@cherry.de>",
    "date": "2026-04-07T17:37:07",
    "name": "[1/4] utils/generate-cyclonedx: remove \"support\" for bz2 and gzip compressed patches",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "50022c6b56bdf89f2ce07b3c4c1c9b4b4e2dfc3e",
    "submitter": {
        "id": 83602,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/83602/?format=api",
        "name": "Quentin Schulz",
        "email": "foss+buildroot@0leil.net"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/buildroot/patch/20260407-generate-cyclonedx-br-v1-1-03c45ccba2ed@cherry.de/mbox/",
    "series": [
        {
            "id": 499014,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/499014/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/buildroot/list/?series=499014",
            "date": "2026-04-07T17:37:07",
            "name": "make utils/generate-cyclonedx runnable with Buildroot host packages",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/499014/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2220625/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2220625/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<buildroot-bounces@buildroot.org>",
        "X-Original-To": [
            "incoming-buildroot@patchwork.ozlabs.org",
            "buildroot@buildroot.org"
        ],
        "Delivered-To": [
            "patchwork-incoming-buildroot@legolas.ozlabs.org",
            "buildroot@buildroot.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=buildroot.org header.i=@buildroot.org\n header.a=rsa-sha256 header.s=default header.b=SlMufzSc;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org\n (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org;\n envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fqtgR3Mtfz1yGM\n\tfor <incoming-buildroot@patchwork.ozlabs.org>;\n Wed, 08 Apr 2026 03:37:23 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id 0671740583;\n\tTue,  7 Apr 2026 17:37:22 +0000 (UTC)",
            "from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id Z3YRR4k3BsNX; Tue,  7 Apr 2026 17:37:21 +0000 (UTC)",
            "from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id 3AF0840C21;\n\tTue,  7 Apr 2026 17:37:21 +0000 (UTC)",
            "from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n by lists1.osuosl.org (Postfix) with ESMTP id 9E511237\n for <buildroot@buildroot.org>; Tue,  7 Apr 2026 17:37:18 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp1.osuosl.org (Postfix) with ESMTP id 848B7811C4\n for <buildroot@buildroot.org>; Tue,  7 Apr 2026 17:37:18 +0000 (UTC)",
            "from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id Z9yCUQGts1Fn for <buildroot@buildroot.org>;\n Tue,  7 Apr 2026 17:37:17 +0000 (UTC)",
            "from smtp-42ac.mail.infomaniak.ch (smtp-42ac.mail.infomaniak.ch\n [IPv6:2001:1600:4:17::42ac])\n by smtp1.osuosl.org (Postfix) with ESMTPS id 8661281189\n for <buildroot@buildroot.org>; Tue,  7 Apr 2026 17:37:16 +0000 (UTC)",
            "from smtp-3-0001.mail.infomaniak.ch (unknown\n [IPv6:2001:1600:4:17::246c])\n by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4fqtgH0CtKzBDn;\n Tue,  7 Apr 2026 19:37:15 +0200 (CEST)",
            "from unknown by smtp-3-0001.mail.infomaniak.ch (Postfix) with ESMTPA\n id 4fqtgG3SHWzJ5; Tue,  7 Apr 2026 19:37:14 +0200 (CEST)"
        ],
        "X-Virus-Scanned": [
            "amavis at osuosl.org",
            "amavis at osuosl.org"
        ],
        "X-Comment": "SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org;\n receiver=<UNKNOWN> ",
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 smtp4.osuosl.org 3AF0840C21",
            "OpenDKIM Filter v2.11.0 smtp1.osuosl.org 8661281189"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=buildroot.org;\n\ts=default; t=1775583441;\n\tbh=p1End3LgdGLgZt9rt9Lgi++ke21a72sWd/UTpfmMX/U=;\n\th=Date:References:In-Reply-To:To:Cc:Subject:List-Id:\n\t List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:\n\t From:Reply-To:From;\n\tb=SlMufzScab3jFt3FUgPIS3Qb6Fn1/rfgpy9fWVA2SeLhpcpjvTDjG5FAkXww2zeJm\n\t jyeZbSC+D9kYlBIzii6BqDPReYipA1cUq8LcXABKPTL4mLZ0oh0/8SQUm7sI1nF+Wy\n\t EZZR9r35h8w1+oggNbzedLUVjMAOWlJkdYfJ0qEvHrf30GgfQPAhv8T/0ZbGBJkPfg\n\t 63cYSJ9mINWxZTLb9y1ZF3jCgNNhoOcYaeP8rVGRqMhu3WTbVRL9SgRPIWLA/mE0mu\n\t UwAIUfzd0G4fZ0fC7pG3zxkRverO+Kw19Do+YIJmYb+ik4r8gkBSnTz3qO1ZKJkJhe\n\t G5q4UCsExUyhQ==",
        "Received-SPF": "Pass (mailfrom) identity=mailfrom;\n client-ip=2001:1600:4:17::42ac;\n helo=smtp-42ac.mail.infomaniak.ch; envelope-from=foss+buildroot@0leil.net;\n receiver=<UNKNOWN>",
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp1.osuosl.org 8661281189",
        "Date": "Tue, 07 Apr 2026 19:37:07 +0200",
        "MIME-Version": "1.0",
        "Message-Id": "<20260407-generate-cyclonedx-br-v1-1-03c45ccba2ed@cherry.de>",
        "References": "<20260407-generate-cyclonedx-br-v1-0-03c45ccba2ed@cherry.de>",
        "In-Reply-To": "<20260407-generate-cyclonedx-br-v1-0-03c45ccba2ed@cherry.de>",
        "To": "buildroot@buildroot.org",
        "Cc": "Thomas Perale <thomas.perale@mind.be>, Martin Bark <martin@barkynet.com>,\n Thomas Petazzoni <thomas.petazzoni@bootlin.com>,\n Quentin Schulz <quentin.schulz@cherry.de>",
        "X-Mailer": "b4 0.15-dev-47773",
        "X-Infomaniak-Routing": "alpha",
        "X-Mailman-Original-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=0leil.net; s=20231125; t=1775583434;\n bh=M12nU030M+gdaTdmzvpQGK3BOl4fZWgPtke/skEJdOA=;\n h=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n b=KX5KfJPZhLKoWfitrE2zcZ1T1qHCic2GlW1ZANOEs4yPy9N/zQHxY09366VTMdIZZ\n U7TBqfcUxYnTd7u6De7ebDh6aHmFpIji63h2o4rqRXM+6p483cvi8t2NpgQv1/bgQJ\n y3/Q/c8KeLSth3eXjTMZQvOmXZ4Wtgac3ddnw1/MLatWr4oZztOOK/hQBCNrKKxlUX\n aXY/H3HAH+N0C5k/ZwiRHs7AYJ1SM7BULRkj/trKP03bsbndOQzZm2RnMxYM2biva7\n xZj7lxn/moM78v93aozo1+Sjg67nKTezpsEU9+wtZEEkTv2PR9KzrHcFjgWcTcZ74u\n 95ErAGXvaag3Q==",
        "X-Mailman-Original-Authentication-Results": [
            "smtp1.osuosl.org;\n dmarc=pass (p=reject dis=none)\n header.from=0leil.net",
            "smtp1.osuosl.org;\n dkim=pass (2048-bit key,\n unprotected) header.d=0leil.net header.i=@0leil.net header.a=rsa-sha256\n header.s=20231125 header.b=KX5KfJPZ"
        ],
        "Subject": "[Buildroot] [PATCH 1/4] utils/generate-cyclonedx: remove \"support\"\n for bz2 and gzip compressed patches",
        "X-BeenThere": "buildroot@buildroot.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "Discussion and development of buildroot <buildroot.buildroot.org>",
        "List-Unsubscribe": "<https://lists.buildroot.org/mailman/options/buildroot>,\n <mailto:buildroot-request@buildroot.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.buildroot.org/pipermail/buildroot/>",
        "List-Post": "<mailto:buildroot@buildroot.org>",
        "List-Help": "<mailto:buildroot-request@buildroot.org?subject=help>",
        "List-Subscribe": "<https://lists.buildroot.org/mailman/listinfo/buildroot>,\n <mailto:buildroot-request@buildroot.org?subject=subscribe>",
        "From": "Quentin Schulz via buildroot <buildroot@buildroot.org>",
        "Reply-To": "Quentin Schulz <foss+buildroot@0leil.net>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "buildroot-bounces@buildroot.org",
        "Sender": "\"buildroot\" <buildroot-bounces@buildroot.org>"
    },
    "content": "From: Quentin Schulz <quentin.schulz@cherry.de>\n\nBuildroot-local patches can only be suffixed by .patch, otherwise they\neither need to be downloaded via <PKG>_PATCH or manually applied via\n$(APPLY_PATCHES) in a <PKG>_{PRE,POST}_PATCH_HOOKS like in\nlinux/linux.mk. In the former case, they are then listed in the\nshow-info output with a full URL (prefixed by '<PKG>_SITE_METHOD+'). In\nthe latter case, they are simply not listed at all at the moment.\n\nBy removing \"support\" for those compressed patches, we can avoid the bz2\ndependency and can now use Buildroot's host-python3 package without\nBR2_PACKAGE_HOST_PYTHON3_BZIP2 to run utils/generate-cyclonedx (though\nthe initial downloading of the SPDX schema in JSON format doesn't work\nyet, though that is something that one can handle with a simple\nwget/curl to the appropriate place).\n\nSigned-off-by: Quentin Schulz <quentin.schulz@cherry.de>\n---\n utils/generate-cyclonedx | 16 +++-------------\n 1 file changed, 3 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/utils/generate-cyclonedx b/utils/generate-cyclonedx\nindex 35198a47cf..d17aa805b7 100755\n--- a/utils/generate-cyclonedx\n+++ b/utils/generate-cyclonedx\n@@ -9,8 +9,6 @@\n \n \n import argparse\n-import bz2\n-import gzip\n import json\n import os\n from pathlib import Path\n@@ -177,7 +175,7 @@ def patch_retrieve_header(content: str) -> str:\n \n \n def read_patch_file(patch_path: Path) -> str:\n-    \"\"\"Read the content of a patch file, handling compression.\n+    \"\"\"Read the content of a patch file.\n \n     Args:\n         patch_path (Path): Patch path.\n@@ -185,16 +183,8 @@ def read_patch_file(patch_path: Path) -> str:\n     Returns:\n         str: Patch content.\n     \"\"\"\n-    if patch_path.suffix == \".gz\":\n-        f = gzip.open(patch_path, mode=\"rt\")\n-    elif patch_path.suffix == \".bz\":\n-        f = bz2.open(patch_path, mode=\"rt\")\n-    else:\n-        f = open(patch_path)\n-\n-    content = f.read()\n-    f.close()\n-    return content\n+    with open(patch_path) as f:\n+        return f.read()\n \n \n def cyclonedx_patches(patch_list: list[str]):\n",
    "prefixes": [
        "1/4"
    ]
}