get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2090677,
    "url": "http://patchwork.ozlabs.org/api/patches/2090677/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20250527111932.3058650-2-sjg@chromium.org/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20250527111932.3058650-2-sjg@chromium.org>",
    "list_archive_url": null,
    "date": "2025-05-27T11:19:21",
    "name": "[2/2] buildman: Support an in-tree build in the current dir",
    "commit_ref": "919ba46d7283c33026178dad8a0c6cc28ee58001",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "84476a7df2df055ff8aa351066bfd46404db6241",
    "submitter": {
        "id": 6170,
        "url": "http://patchwork.ozlabs.org/api/people/6170/?format=api",
        "name": "Simon Glass",
        "email": "sjg@chromium.org"
    },
    "delegate": {
        "id": 3184,
        "url": "http://patchwork.ozlabs.org/api/users/3184/?format=api",
        "username": "sjg",
        "first_name": "Simon",
        "last_name": "Glass",
        "email": "sjg@chromium.org"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20250527111932.3058650-2-sjg@chromium.org/mbox/",
    "series": [
        {
            "id": 458533,
            "url": "http://patchwork.ozlabs.org/api/series/458533/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=458533",
            "date": "2025-05-27T11:19:20",
            "name": "[1/2] buildman: Correct behaviour of --in-tree",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/458533/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2090677/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2090677/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=XMzfBUMC;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org\n header.b=\"XMzfBUMC\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=sjg@chromium.org"
        ],
        "Received": [
            "from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\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 4b69C5271Sz1yDX\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 27 May 2025 21:19:45 +1000 (AEST)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 8268682F8E;\n\tTue, 27 May 2025 13:19:48 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 587248301F; Tue, 27 May 2025 13:19:47 +0200 (CEST)",
            "from mail-io1-xd44.google.com (mail-io1-xd44.google.com\n [IPv6:2607:f8b0:4864:20::d44])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 3D2F982116\n for <u-boot@lists.denx.de>; Tue, 27 May 2025 13:19:44 +0200 (CEST)",
            "by mail-io1-xd44.google.com with SMTP id\n ca18e2360f4ac-8647e143f28so243413639f.1\n for <u-boot@lists.denx.de>; Tue, 27 May 2025 04:19:44 -0700 (PDT)",
            "from chromium.org (c-73-203-119-151.hsd1.co.comcast.net.\n [73.203.119.151]) by smtp.gmail.com with ESMTPSA id\n e9e14a558f8ab-3dc82e014f4sm36362755ab.40.2025.05.27.04.19.40\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 27 May 2025 04:19:41 -0700 (PDT)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-3.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS\n autolearn=ham autolearn_force=no version=3.4.2",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=chromium.org; s=google; t=1748344782; x=1748949582; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=tGfItuoPWFyUiLR7DYnDPqpEoS+RKz+ORMD9Htqo43k=;\n b=XMzfBUMCeQZWHJVPt3mxcPo1xjFG/X+xgmji2zyVpQ48hxTmQxdskv/FysqYs+b17z\n Fp6umqaJiYf0r2I5snN4kcruc6tbFQlxHGV8fxL3E6iHg9WU8CZdwSPyvO1i7ReIXcbv\n 5xKldNK7Ku54WLUsemZ36IO1c3pQTmvVMn1vs=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1748344782; x=1748949582;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=tGfItuoPWFyUiLR7DYnDPqpEoS+RKz+ORMD9Htqo43k=;\n b=CrkXFZJ4rpocTogkVFDW11VKYKz3gOmwA2h82x4agbjsIfhT+iPwmoFKZvhQkvHsbQ\n uL9S3d+cE1qMu5cxSfrddeLDklVFe2ywYZgY1e3HJJkT4FfQu8tMMaEQr/xn5vH+21rz\n 53qdcMmgxbHfIF5GflZ2dh7Va0QWN75E/r04muzQNklRZQANAKxt+qeOsyRrhNbA3fZg\n XjhYfHEW5AOapzrWfTGyoXLQFXxJlMintUxzM2LMIxkB5XMC2jSFvCAZUoScjtrmBDJH\n HQbhUqHdnQQdLuZX91uqMMVuUGBaUkeMoxIFYK7ydi6FOqfBnGyM4GD1U7CVrIDfeurS\n VMoA==",
        "X-Gm-Message-State": "AOJu0Ywvl2a9mm+iELIOBlZ7rrhMsEwRAPg9RuuLKl6MbfSoUOem27bJ\n JAdby8hAtusm8YPUotTZ/RtTLL5jq6QIB30ZgcbSEJKnSiEOs7OeClvmLTRgXurm9ppmVN7lNU8\n 6k4mgayuLxJY=",
        "X-Gm-Gg": "ASbGncuHIp1+cGhP2KX1kfc4S94W5vba312LlGrRzU7BlZiacr9bFmE8PWBmozLLcRD\n 1WbtdPUQI7uvl8tGASUH/241EcDr36kbijJeHCVObBjJu0wNhXFJwfTkN56+JJx+wDfbdUvSjnt\n JdIMTzKoW4lsTpe7n+I8tHxc6jeOwVvLxQ90oLUOEdck3KHSXGUFZAb7gexVpaeQ5CbEQ3CPosx\n hPSysrCQgLZopisyGQqKcddfBjFsEX7S8wiVkxbHmprRH89E7t/UTMgPSfNH5CyL+fma0/hFbxO\n E8n4TFn90NLeAqj1wGAYtT+mgHdoAD33T+OpKY8kjIDNSwYVHEcb7LYaxC1tSwlCoU5WDJvEumi\n j1OZQQ8d4qJlh",
        "X-Google-Smtp-Source": "\n AGHT+IH9PcXV9Hd2O3W2nRfJAKqtPzAMH4IjneFvs6dEuuvvAyaiQ+tNG0eGJ9x5YmPVvB4jNoTPkg==",
        "X-Received": "by 2002:a05:6e02:1d94:b0:3dc:7a9a:44d3 with SMTP id\n e9e14a558f8ab-3dc9b7279f4mr124600055ab.21.1748344782339;\n Tue, 27 May 2025 04:19:42 -0700 (PDT)",
        "From": "Simon Glass <sjg@chromium.org>",
        "To": "U-Boot Mailing List <u-boot@lists.denx.de>",
        "Cc": "Heinrich Schuchardt <xypron.glpk@gmx.de>, Simon Glass <sjg@chromium.org>,\n Andrejs Cainikovs <andrejs.cainikovs@toradex.com>,\n Tom Rini <trini@konsulko.com>",
        "Subject": "[PATCH 2/2] buildman: Support an in-tree build in the current dir",
        "Date": "Tue, 27 May 2025 05:19:21 -0600",
        "Message-ID": "<20250527111932.3058650-2-sjg@chromium.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20250527111932.3058650-1-sjg@chromium.org>",
        "References": "<20250527111932.3058650-1-sjg@chromium.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.39",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>",
        "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de",
        "X-Virus-Status": "Clean"
    },
    "content": "Allow -w to be used with -i to do a build without a separate output\ndirectory.\n\nSigned-off-by: Simon Glass <sjg@chromium.org>\n---\n\n tools/buildman/builder.py       |  7 +++++--\n tools/buildman/builderthread.py | 28 ++++++++++++++++------------\n tools/buildman/buildman.rst     |  2 ++\n tools/buildman/control.py       | 17 ++++++++++-------\n 4 files changed, 33 insertions(+), 21 deletions(-)",
    "diff": "diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py\nindex 6538a3d296f..9516e25e215 100644\n--- a/tools/buildman/builder.py\n+++ b/tools/buildman/builder.py\n@@ -631,10 +631,13 @@ class Builder:\n         Args:\n             commit_upto: Commit number to use (0..self.count-1)\n             target: Target name\n+\n+        Return:\n+            str: Output directory to use, or '' if None\n         \"\"\"\n         output_dir = self.get_output_dir(commit_upto)\n         if self.work_in_output:\n-            return output_dir\n+            return output_dir or ''\n         return os.path.join(output_dir, target)\n \n     def get_done_file(self, commit_upto, target):\n@@ -1683,7 +1686,7 @@ class Builder:\n         \"\"\"\n         thread_dir = self.get_thread_dir(thread_num)\n         builderthread.mkdir(thread_dir)\n-        git_dir = os.path.join(thread_dir, '.git')\n+        git_dir = os.path.join(thread_dir, '.git') if thread_dir else None\n \n         # Create a worktree or a git repo clone for this thread if it\n         # doesn't already exist\ndiff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py\nindex 4617f516f40..a249174f158 100644\n--- a/tools/buildman/builderthread.py\n+++ b/tools/buildman/builderthread.py\n@@ -31,13 +31,13 @@ def mkdir(dirname, parents=False):\n     \"\"\"Make a directory if it doesn't already exist.\n \n     Args:\n-        dirname (str): Directory to create\n+        dirname (str): Directory to create, or None to do nothing\n         parents (bool): True to also make parent directories\n \n     Raises:\n         OSError: File already exists\n     \"\"\"\n-    if os.path.exists(dirname):\n+    if not dirname or os.path.exists(dirname):\n         return\n     try:\n         if parents:\n@@ -57,7 +57,7 @@ def _remove_old_outputs(out_dir):\n     \"\"\"Remove any old output-target files\n \n     Args:\n-        out_dir (str): Output directory for the build\n+        out_dir (str): Output directory for the build, or None for current dir\n \n     Since we use a build directory that was previously used by another\n     board, it may have produced an SPL image. If we don't remove it (i.e.\n@@ -65,7 +65,7 @@ def _remove_old_outputs(out_dir):\n     output of this build, even if it does not produce SPL images.\n     \"\"\"\n     for elf in BASE_ELF_FILENAMES:\n-        fname = os.path.join(out_dir, elf)\n+        fname = os.path.join(out_dir or '', elf)\n         if os.path.exists(fname):\n             os.remove(fname)\n \n@@ -193,9 +193,11 @@ class BuilderThread(threading.Thread):\n \n         Args:\n             brd (Board): Board to create arguments for\n-            out_dir (str): Path to output directory containing the files\n+            out_dir (str): Path to output directory containing the files, or\n+                or None to not use a separate output directory\n             out_rel_dir (str): Output directory relative to the current dir\n-            work_dir (str): Directory to which the source will be checked out\n+            work_dir (str): Directory to which the source will be checked out,\n+                or None to use current directory\n             commit_upto (int): Commit number to build (0...n-1)\n \n         Returns:\n@@ -206,7 +208,7 @@ class BuilderThread(threading.Thread):\n         \"\"\"\n         args = []\n         cwd = work_dir\n-        src_dir = os.path.realpath(work_dir)\n+        src_dir = os.path.realpath(work_dir) if work_dir else os.getcwd()\n         if commit_upto is None:\n             # In this case we are building in the original source directory\n             # (i.e. the current directory where buildman is invoked. The\n@@ -215,8 +217,9 @@ class BuilderThread(threading.Thread):\n             #\n             # Symlinks can confuse U-Boot's Makefile since we may use '..'\n             # in our path, so remove them.\n-            real_dir = os.path.realpath(out_dir)\n-            args.append(f'O={real_dir}')\n+            if out_dir:\n+                real_dir = os.path.realpath(out_dir)\n+                args.append(f'O={real_dir}')\n             cwd = None\n             src_dir = os.getcwd()\n         elif out_rel_dir:\n@@ -398,7 +401,8 @@ class BuilderThread(threading.Thread):\n             config_only (bool): Only configure the source, do not build it\n             adjust_cfg (list of str): See the cfgutil module and run_commit()\n             commit (Commit): Commit only being built\n-            out_dir (str): Output directory for the build\n+            out_dir (str): Output directory for the build, or None to use\n+               current\n             out_rel_dir (str): Output directory relatie to the current dir\n             result (CommandResult): Previous result\n \n@@ -410,7 +414,7 @@ class BuilderThread(threading.Thread):\n         \"\"\"\n         # Set up the environment and command line\n         env = self.builder.make_environment(self.toolchain)\n-        if not os.path.exists(out_dir):\n+        if out_dir and not os.path.exists(out_dir):\n             mkdir(out_dir)\n \n         args, cwd, src_dir = self._build_args(brd, out_dir, out_rel_dir,\n@@ -421,7 +425,7 @@ class BuilderThread(threading.Thread):\n         _remove_old_outputs(out_dir)\n \n         # If we need to reconfigure, do that now\n-        cfg_file = os.path.join(out_dir, '.config')\n+        cfg_file = os.path.join(out_dir or '', '.config')\n         cmd_list = []\n         if do_config or adjust_cfg:\n             result = self._reconfigure(\ndiff --git a/tools/buildman/buildman.rst b/tools/buildman/buildman.rst\nindex 2555139334f..8c45a841024 100644\n--- a/tools/buildman/buildman.rst\n+++ b/tools/buildman/buildman.rst\n@@ -1338,6 +1338,8 @@ disturbed by the build. Use `-i` to do an in-tree build instead. Note that this\n does not affect the source directory, since buildman creates a separate git\n 'worktree' for each board. This means that it is possible to do an in-tree\n build of an entire branch, or even a 'current source' build for multiple boards.\n+As a special case, you can use `-wi` to do an in-tree build in the current\n+directory.\n \n Build summary\n -------------\ndiff --git a/tools/buildman/control.py b/tools/buildman/control.py\nindex 4c9489126c1..4dedd333551 100644\n--- a/tools/buildman/control.py\n+++ b/tools/buildman/control.py\n@@ -390,7 +390,7 @@ def get_boards_obj(output_dir, regen_board_list, maintainer_check, full_check,\n     read it in.\n \n     Args:\n-        output_dir (str): Output directory to use\n+        output_dir (str): Output directory to use, or None to use current dir\n         regen_board_list (bool): True to just regenerate the board list\n         maintainer_check (bool): True to just run a maintainer check\n         full_check (bool): True to just run a full check of Kconfig and\n@@ -414,9 +414,9 @@ def get_boards_obj(output_dir, regen_board_list, maintainer_check, full_check,\n             return 2\n         return 0\n \n-    if not os.path.exists(output_dir):\n+    if output_dir and not os.path.exists(output_dir):\n         os.makedirs(output_dir)\n-    board_file = os.path.join(output_dir, 'boards.cfg')\n+    board_file = os.path.join(output_dir or '', 'boards.cfg')\n     if regen_board_list and regen_board_list != '-':\n         board_file = regen_board_list\n \n@@ -501,7 +501,7 @@ def adjust_args(args, series, selected):\n \n \n def setup_output_dir(output_dir, work_in_output, branch, no_subdirs, col,\n-                     clean_dir):\n+                     in_tree, clean_dir):\n     \"\"\"Set up the output directory\n \n     Args:\n@@ -509,6 +509,7 @@ def setup_output_dir(output_dir, work_in_output, branch, no_subdirs, col,\n         work_in_output (bool): True to work in the output directory\n         branch (str): Name of branch to build, or None if none\n         no_subdirs (bool): True to put the output in the top-level output dir\n+        in_tree (bool): True if doing an in-tree build\n         clean_dir: Used for tests only, indicates that the existing output_dir\n             should be removed before starting the build\n \n@@ -516,9 +517,11 @@ def setup_output_dir(output_dir, work_in_output, branch, no_subdirs, col,\n         str: Updated output directory pathname\n     \"\"\"\n     if not output_dir:\n-        if work_in_output:\n-            sys.exit(col.build(col.RED, '-w requires that you specify -o'))\n         output_dir = '..'\n+        if work_in_output:\n+            if not in_tree:\n+                sys.exit(col.build(col.RED, '-w requires that you specify -o'))\n+            output_dir = None\n     if branch and not no_subdirs:\n         # As a special case allow the board directory to be placed in the\n         # output directory itself rather than any subdirectory.\n@@ -751,7 +754,7 @@ def do_buildman(args, toolchains=None, make_func=None, brds=None,\n \n     output_dir = setup_output_dir(\n         args.output_dir, args.work_in_output, args.branch,\n-        args.no_subdirs, col, clean_dir)\n+        args.no_subdirs, col, args.in_tree, clean_dir)\n \n     # Work out what subset of the boards we are building\n     if not brds:\n",
    "prefixes": [
        "2/2"
    ]
}