get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 92166,
    "url": "http://patches.dpdk.org/api/patches/92166/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210426105403.226004-1-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20210426105403.226004-1-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210426105403.226004-1-bruce.richardson@intel.com",
    "date": "2021-04-26T10:54:02",
    "name": "[v2,1/2] devtools: script to check meson indentation of lists",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "8a680e499ac9e0f166d950fea1a9d1f45cb8f7b3",
    "submitter": {
        "id": 20,
        "url": "http://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210426105403.226004-1-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 16671,
            "url": "http://patches.dpdk.org/api/series/16671/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=16671",
            "date": "2021-04-26T10:54:02",
            "name": "[v2,1/2] devtools: script to check meson indentation of lists",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/16671/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/92166/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/92166/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id B6094A0548;\n\tMon, 26 Apr 2021 12:54:18 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3277741104;\n\tMon, 26 Apr 2021 12:54:18 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id E03F740140\n for <dev@dpdk.org>; Mon, 26 Apr 2021 12:54:15 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 26 Apr 2021 03:54:12 -0700",
            "from silpixa00399126.ir.intel.com ([10.237.223.81])\n by fmsmga006.fm.intel.com with ESMTP; 26 Apr 2021 03:54:11 -0700"
        ],
        "IronPort-SDR": [
            "\n tziwa8vRhs9bw9WpokY8RDXDMdB2bSulP9Fxjb2l8HDtWuXzbas7iVBTmHypr0m0jUej0HjSCD\n 0Rii2tx/0C5Q==",
            "\n ge6JjpTJyTRd+7FljM383D4wqHXPcI18JNJci6uv1e/6jCJAUTofG3ibYsFbJLr5RxXob1FFjg\n ze7Av4S64+NA=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,9965\"; a=\"193129092\"",
            "E=Sophos;i=\"5.82,252,1613462400\"; d=\"scan'208\";a=\"193129092\"",
            "E=Sophos;i=\"5.82,252,1613462400\"; d=\"scan'208\";a=\"615338335\""
        ],
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, anatoly.burakov@intel.com,\n Bruce Richardson <bruce.richardson@intel.com>",
        "Date": "Mon, 26 Apr 2021 11:54:02 +0100",
        "Message-Id": "<20210426105403.226004-1-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20210422090211.320855-1-bruce.richardson@intel.com>",
        "References": "<20210422090211.320855-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2 1/2] devtools: script to check meson\n indentation of lists",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This is a script to fix up minor formatting issues in meson files.\nIt scans for, and can optionally fix, indentation issues and missing\ntrailing commas in the lists in meson.build files. It also detects,\nand can fix, multi-line lists where more than one entry appears on a\nline.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n devtools/dpdk_meson_check.py | 125 +++++++++++++++++++++++++++++++++++\n 1 file changed, 125 insertions(+)\n create mode 100755 devtools/dpdk_meson_check.py",
    "diff": "diff --git a/devtools/dpdk_meson_check.py b/devtools/dpdk_meson_check.py\nnew file mode 100755\nindex 000000000..29f788796\n--- /dev/null\n+++ b/devtools/dpdk_meson_check.py\n@@ -0,0 +1,125 @@\n+#!/usr/bin/env python3\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2021 Intel Corporation\n+\n+'''\n+A Python script to run some checks on meson.build files in DPDK\n+'''\n+\n+import sys\n+import os\n+from os.path import relpath, join\n+from argparse import ArgumentParser\n+\n+VERBOSE = False\n+\n+\n+def scan_dir(path):\n+    '''return meson.build files found in path'''\n+    for root, dirs, files in os.walk(path):\n+        if 'meson.build' in files:\n+            yield(relpath(join(root, 'meson.build')))\n+\n+\n+def split_code_comments(line):\n+    'splits a line into a code part and a comment part, returns (code, comment) tuple'\n+    if line.lstrip().startswith('#'):\n+        return ('', line)\n+    elif '#' in line and '#include' not in line:  # catch 99% of cases, not 100%\n+        idx = line.index('#')\n+        while (line[idx - 1].isspace()):\n+            idx -= 1\n+        return line[:idx], line[idx:]\n+    else:\n+        return (line, '')\n+\n+\n+def setline(contents, index, value):\n+    'sets the contents[index] to value. Returns the line, along with code and comments part'\n+    line = contents[index] = value\n+    code, comments = split_code_comments(line)\n+    return line, code, comments\n+\n+\n+def check_indentation(filename, contents):\n+    '''check that a list or files() is correctly indented'''\n+    infiles = False\n+    inlist = False\n+    edit_count = 0\n+    for lineno, line in enumerate(contents):\n+        code, comments = split_code_comments(line)\n+        if not code.strip():\n+            continue\n+        if code.endswith('files('):\n+            if infiles:\n+                raise(f'Error parsing {filename}:{lineno}, got \"files(\" when already parsing files list')\n+            if inlist:\n+                print(f'Error parsing {filename}:{lineno}, got \"files(\" when already parsing array list')\n+            infiles = True\n+            indent_count = len(code) - len(code.lstrip(' '))\n+            indent = ' ' * (indent_count + 8)  # double indent required\n+        elif code.endswith('= ['):\n+            if infiles:\n+                raise(f'Error parsing {filename}:{lineno}, got start of array when already parsing files list')\n+            if inlist:\n+                print(f'Error parsing {filename}:{lineno}, got start of array when already parsing array list')\n+            inlist = True\n+            indent_count = len(code) - len(code.lstrip(' '))\n+            indent = ' ' * (indent_count + 8)  # double indent required\n+        elif infiles and (code.endswith(')') or code.strip().startswith(')')):\n+            infiles = False\n+            continue\n+        elif inlist and (code.endswith(']') or code.strip().startswith(']')):\n+            inlist = False\n+            continue\n+        elif inlist or infiles:\n+            # skip further subarrays or lists\n+            if '[' in code or ']' in code:\n+                continue\n+            if not code.startswith(indent) or code[len(indent)] == ' ':\n+                print(f'Error: Incorrect indent at {filename}:{lineno + 1}')\n+                line, code, comments = setline(contents, lineno, indent + line.strip())\n+                edit_count += 1\n+            if not code.endswith(','):\n+                print(f'Error: Missing trailing \",\" in list at {filename}:{lineno + 1}')\n+                line, code, comments = setline(contents, lineno, code + ',' + comments)\n+                edit_count += 1\n+            if len(code.split(',')) > 2:  # only one comma per line\n+                print(f'Error: multiple entries per line in list at {filename}:{lineno +1}')\n+                entries = [e.strip() for e in code.split(',') if e.strip()]\n+                line, code, comments = setline(contents, lineno,\n+                                               indent + (',\\n' + indent).join(entries) +\n+                                               ',' + comments)\n+                edit_count += 1\n+    return edit_count\n+\n+\n+def process_file(filename, fix):\n+    '''run checks on file \"filename\"'''\n+    if VERBOSE:\n+        print(f'Processing {filename}')\n+    with open(filename) as f:\n+        contents = [ln.rstrip() for ln in f.readlines()]\n+\n+    if check_indentation(filename, contents) > 0 and fix:\n+        print(f\"Fixing {filename}\")\n+        with open(filename, 'w') as f:\n+            f.writelines([f'{ln}\\n' for ln in contents])\n+\n+\n+def main():\n+    '''parse arguments and then call other functions to do work'''\n+    global VERBOSE\n+    parser = ArgumentParser(description='Run syntax checks on DPDK meson.build files')\n+    parser.add_argument('-d', metavar='directory', default='.', help='Directory to process')\n+    parser.add_argument('--fix', action='store_true', help='Attempt to fix errors')\n+    parser.add_argument('-v', action='store_true', help='Verbose output')\n+    args = parser.parse_args()\n+\n+    VERBOSE = args.v\n+    for f in scan_dir(args.d):\n+        process_file(f, args.fix)\n+\n+\n+if __name__ == \"__main__\":\n+    main()\n",
    "prefixes": [
        "v2",
        "1/2"
    ]
}