get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 45484,
    "url": "https://patches.dpdk.org/api/patches/45484/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1538038690-15595-1-git-send-email-arnon@qwilt.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1538038690-15595-1-git-send-email-arnon@qwilt.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1538038690-15595-1-git-send-email-arnon@qwilt.com",
    "date": "2018-09-27T08:58:10",
    "name": "[v2] devtools: move forbidden tokens awk script to a separate file",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "70166e28f533668c2c1b84826c0169b2f4b42405",
    "submitter": {
        "id": 986,
        "url": "https://patches.dpdk.org/api/people/986/?format=api",
        "name": "Arnon Warshavsky",
        "email": "arnon@qwilt.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1538038690-15595-1-git-send-email-arnon@qwilt.com/mbox/",
    "series": [
        {
            "id": 1539,
            "url": "https://patches.dpdk.org/api/series/1539/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1539",
            "date": "2018-09-27T08:58:10",
            "name": "[v2] devtools: move forbidden tokens awk script to a separate file",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/1539/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/45484/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/45484/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9330C1B110;\n\tThu, 27 Sep 2018 10:58:22 +0200 (CEST)",
            "from mta.qwilt.com (unknown [52.9.191.255])\n\tby dpdk.org (Postfix) with ESMTP id 331381B10F\n\tfor <dev@dpdk.org>; Thu, 27 Sep 2018 10:58:21 +0200 (CEST)",
            "from localhost (localhost [127.0.0.1])\n\tby mta.qwilt.com (Postfix) with ESMTP id 4F72280C51D;\n\tThu, 27 Sep 2018 08:58:18 +0000 (UTC)",
            "from mta.qwilt.com ([127.0.0.1])\n\tby localhost (mta.qwilt.com [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id dCvHIALsHNFN; Thu, 27 Sep 2018 08:58:17 +0000 (UTC)",
            "from rd01.it.qwilt.com.qwilt.com (80.179.204.39.cable.012.net.il\n\t[80.179.204.39])\n\tby mta.qwilt.com (Postfix) with ESMTPSA id 5363180C51C;\n\tThu, 27 Sep 2018 08:58:15 +0000 (UTC)"
        ],
        "X-Virus-Scanned": "amavisd-new at qwilt.com",
        "From": "Arnon Warshavsky <arnon@qwilt.com>",
        "To": "amo@semihalf.com, i.maximets@samsung.com, thomas@monjalon.net,\n\tstephen@networkplumber.org, david.marchand@6wind.com",
        "Cc": "dev@dpdk.org,\n\tarnon@qwilt.com",
        "Date": "Thu, 27 Sep 2018 11:58:10 +0300",
        "Message-Id": "<1538038690-15595-1-git-send-email-arnon@qwilt.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "Subject": "[dpdk-dev] [PATCH v2] devtools: move forbidden tokens awk script to\n\ta separate file",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The awk code previously read inline in checkpatches.pl\nwas using -d which is a bash option,\nwhile bash is not the default shell in all distributions.\nNow moved to be read from a separate file.\n\nSigned-off-by: Arnon Warshavsky <arnon@qwilt.com>\n---\n\nv2 - place original comment in the awk file\n\n devtools/check-forbidden-tokens.awk | 74 ++++++++++++++++++++++++++++++++++++\n devtools/checkpatches.sh            | 75 +------------------------------------\n 2 files changed, 75 insertions(+), 74 deletions(-)\n create mode 100755 devtools/check-forbidden-tokens.awk",
    "diff": "diff --git a/devtools/check-forbidden-tokens.awk b/devtools/check-forbidden-tokens.awk\nnew file mode 100755\nindex 0000000..fd77cdd\n--- /dev/null\n+++ b/devtools/check-forbidden-tokens.awk\n@@ -0,0 +1,74 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright 2018 Arnon Warshavsky <arnon@qwilt.com>\n+\n+# This awk script receives a list of expressions to monitor\n+# and a list of folders to search these expressions in\n+# - No search is done inside comments\n+# - Both additions and removals of the expressions are checked\n+#   A positive balance of additions fails the check\n+\n+BEGIN {\n+\tsplit(FOLDERS,deny_folders,\" \");\n+\tsplit(EXPRESSIONS,deny_expr,\" \");\n+\tin_file=0;\n+\tin_comment=0;\n+\tcount=0;\n+\tcomment_start=\"/*\"\n+\tcomment_end=\"*/\"\n+}\n+# search for add/remove instances in current file\n+# state machine assumes the comments structure is enforced by\n+# checkpatches.pl\n+(in_file) {\n+\t# comment start\n+\tif (index($0,comment_start) > 0) {\n+\t\tin_comment = 1\n+\t}\n+\t# non comment code\n+\tif (in_comment == 0) {\n+\t\tfor (i in deny_expr) {\n+\t\t\tforbidden_added = \"^\\\\+.*\" deny_expr[i];\n+\t\t\tforbidden_removed=\"^-.*\" deny_expr[i];\n+\t\t\tcurrent = expressions[deny_expr[i]]\n+\t\t\tif ($0 ~ forbidden_added) {\n+\t\t\t\tcount = count + 1;\n+\t\t\t\texpressions[deny_expr[i]] = current + 1\n+\t\t\t}\n+\t\t\tif ($0 ~ forbidden_removed) {\n+\t\t\t\tcount = count - 1;\n+\t\t\t\texpressions[deny_expr[i]] = current - 1\n+\t\t\t}\n+\t\t}\n+\t}\n+\t# comment end\n+\tif (index($0,comment_end) > 0) {\n+\t\tin_comment = 0\n+\t}\n+}\n+# switch to next file , check if the balance of add/remove\n+# of previous filehad new additions\n+($0 ~ \"^\\\\+\\\\+\\\\+ b/\") {\n+\tin_file = 0;\n+\tif (count > 0) {\n+\t\texit;\n+\t}\n+\tfor (i in deny_folders) {\n+\t\tre = \"^\\\\+\\\\+\\\\+ b/\" deny_folders[i];\n+\t\tif ($0 ~ deny_folders[i]) {\n+\t\t\tin_file = 1\n+\t\t\tlast_file = $0\n+\t\t}\n+\t}\n+}\n+END {\n+\tif (count > 0) {\n+\t\tprint \"Warning in \" substr(last_file,6) \":\"\n+\t\tprint \"are you sure you want to add the following:\"\n+\t\tfor (key in expressions) {\n+\t\t\tif (expressions[key] > 0) {\n+\t\t\t\tprint key\n+\t\t\t}\n+\t\t}\n+\t\texit RET_ON_FAIL\n+\t}\n+}\ndiff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh\nindex ba795ad..18e474f 100755\n--- a/devtools/checkpatches.sh\n+++ b/devtools/checkpatches.sh\n@@ -44,85 +44,12 @@ print_usage () {\n }\n \n check_forbidden_additions() {\n-    # This awk script receives a list of expressions to monitor\n-    # and a list of folders to search these expressions in\n-    # - No search is done inside comments\n-    # - Both additions and removals of the expressions are checked\n-    #   A positive balance of additions fails the check\n-\tread -d '' awk_script << 'EOF'\n-\tBEGIN {\n-\t\tsplit(FOLDERS,deny_folders,\" \");\n-\t\tsplit(EXPRESSIONS,deny_expr,\" \");\n-\t\tin_file=0;\n-\t\tin_comment=0;\n-\t\tcount=0;\n-\t\tcomment_start=\"/*\"\n-\t\tcomment_end=\"*/\"\n-\t}\n-\t# search for add/remove instances in current file\n-\t# state machine assumes the comments structure is enforced by\n-\t# checkpatches.pl\n-\t(in_file) {\n-\t\t# comment start\n-\t\tif (index($0,comment_start) > 0) {\n-\t\t\tin_comment = 1\n-\t\t}\n-\t\t# non comment code\n-\t\tif (in_comment == 0) {\n-\t\t\tfor (i in deny_expr) {\n-\t\t\t\tforbidden_added = \"^\\+.*\" deny_expr[i];\n-\t\t\t\tforbidden_removed=\"^-.*\" deny_expr[i];\n-\t\t\t\tcurrent = expressions[deny_expr[i]]\n-\t\t\t\tif ($0 ~ forbidden_added) {\n-\t\t\t\t\tcount = count + 1;\n-\t\t\t\t\texpressions[deny_expr[i]] = current + 1\n-\t\t\t\t}\n-\t\t\t\tif ($0 ~ forbidden_removed) {\n-\t\t\t\t\tcount = count - 1;\n-\t\t\t\t\texpressions[deny_expr[i]] = current - 1\n-\t\t\t\t}\n-\t\t\t}\n-\t\t}\n-\t\t# comment end\n-\t\tif (index($0,comment_end) > 0) {\n-\t\t\tin_comment = 0\n-\t\t}\n-\t}\n-\t# switch to next file , check if the balance of add/remove\n-\t# of previous filehad new additions\n-\t($0 ~ \"^\\+\\+\\+ b/\") {\n-\t\tin_file = 0;\n-\t\tif (count > 0) {\n-\t\t\texit;\n-\t\t}\n-\t\tfor (i in deny_folders) {\n-\t\t\tre = \"^\\+\\+\\+ b/\" deny_folders[i];\n-\t\t\tif ($0 ~ deny_folders[i]) {\n-\t\t\t\tin_file = 1\n-\t\t\t\tlast_file = $0\n-\t\t\t}\n-\t\t}\n-\t}\n-\tEND {\n-\t\tif (count > 0) {\n-\t\t\tprint \"Warning in \" substr(last_file,6) \":\"\n-\t\t\tprint \"are you sure you want to add the following:\"\n-\t\t\tfor (key in expressions) {\n-\t\t\t\tif (expressions[key] > 0) {\n-\t\t\t\t\tprint key\n-\t\t\t\t}\n-\t\t\t}\n-\t\t\texit RET_ON_FAIL\n-\t\t}\n-\t}\n-EOF\n-\t# ---------------------------------\n \t# refrain from new additions of rte_panic() and rte_exit()\n \t# multiple folders and expressions are separated by spaces\n \tawk -v FOLDERS=\"lib drivers\" \\\n \t\t-v EXPRESSIONS=\"rte_panic\\\\\\( rte_exit\\\\\\(\" \\\n \t\t-v RET_ON_FAIL=1 \\\n-\t\t\"$awk_script\" -\n+\t\t-f $(dirname $(readlink -e $0))/check-forbidden-tokens.awk -\n }\n \n number=0\n",
    "prefixes": [
        "v2"
    ]
}