get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 41139,
    "url": "https://patches.dpdk.org/api/patches/41139/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20180614133020.15604-1-nhorman@tuxdriver.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": "<20180614133020.15604-1-nhorman@tuxdriver.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180614133020.15604-1-nhorman@tuxdriver.com",
    "date": "2018-06-14T13:30:20",
    "name": "[v8] checkpatches.sh: Add checks for ABI symbol addition",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "da4482b319d0fcbb315c6e6c1e1f0c2ed1326bb8",
    "submitter": {
        "id": 32,
        "url": "https://patches.dpdk.org/api/people/32/?format=api",
        "name": "Neil Horman",
        "email": "nhorman@tuxdriver.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20180614133020.15604-1-nhorman@tuxdriver.com/mbox/",
    "series": [
        {
            "id": 128,
            "url": "https://patches.dpdk.org/api/series/128/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=128",
            "date": "2018-06-14T13:30:20",
            "name": "[v8] checkpatches.sh: Add checks for ABI symbol addition",
            "version": 8,
            "mbox": "https://patches.dpdk.org/series/128/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/41139/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/41139/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 9F90F1DF12;\n\tThu, 14 Jun 2018 15:31:21 +0200 (CEST)",
            "from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58])\n\tby dpdk.org (Postfix) with ESMTP id 729FE1DF12\n\tfor <dev@dpdk.org>; Thu, 14 Jun 2018 15:31:20 +0200 (CEST)",
            "from cpe-2606-a000-111b-40b7-640c-26a-4e16-9225.dyn6.twc.com\n\t([2606:a000:111b:40b7:640c:26a:4e16:9225]\n\thelo=hmswarspite.think-freely.org)\n\tby smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63)\n\t(envelope-from <nhorman@tuxdriver.com>)\n\tid 1fTSL9-000467-LN; Thu, 14 Jun 2018 09:31:16 -0400",
            "from hmswarspite.think-freely.org (localhost [127.0.0.1])\n\tby hmswarspite.think-freely.org (8.15.2/8.15.2) with ESMTP id\n\tw5EDUUUw015655; Thu, 14 Jun 2018 09:30:30 -0400",
            "(from nhorman@localhost)\n\tby hmswarspite.think-freely.org (8.15.2/8.15.2/Submit) id\n\tw5EDURRk015651; Thu, 14 Jun 2018 09:30:27 -0400"
        ],
        "From": "Neil Horman <nhorman@tuxdriver.com>",
        "To": "dev@dpdk.org",
        "Cc": "Neil Horman <nhorman@tuxdriver.com>, thomas@monjalon.net,\n\tjohn.mcnamara@intel.com, bruce.richardson@intel.com,\n\tFerruh Yigit <ferruh.yigit@intel.com>,\n\tStephen Hemminger <stephen@networkplumber.org>",
        "Date": "Thu, 14 Jun 2018 09:30:20 -0400",
        "Message-Id": "<20180614133020.15604-1-nhorman@tuxdriver.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20180115190545.25687-1-nhorman@tuxdriver.com>",
        "References": "<20180115190545.25687-1-nhorman@tuxdriver.com>",
        "X-Spam-Score": "-2.9 (--)",
        "X-Spam-Status": "No",
        "Subject": "[dpdk-dev] [PATCH v8] checkpatches.sh: Add checks for ABI symbol\n\taddition",
        "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://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Recently, some additional patches were added to allow for programmatic\nmarking of C symbols as experimental.  The addition of these markers is\ndependent on the manual addition of exported symbols to the EXPERIMENTAL\nsection of the corresponding libraries version map file.  The consensus\non review is that, in addition to mandating the addition of symbols to\nthe EXPERIMENTAL version in the map, we need a mechanism to enforce our\ndocumented process of mandating that addition when they are introduced.\nTo that end, I am proposing this change.  It is an addition to the\ncheckpatches script, which scan incoming patches for additions and\nremovals of symbols to the map file, and warns the user appropriately\n\nSigned-off-by: Neil Horman <nhorman@tuxdriver.com>\nCC: thomas@monjalon.net\nCC: john.mcnamara@intel.com\nCC: bruce.richardson@intel.com\nCC: Ferruh Yigit <ferruh.yigit@intel.com>\nCC: Stephen Hemminger <stephen@networkplumber.org>\n\n---\nChange notes\n\nv2)\n * Cleaned up and documented awk script (shemminger)\n * fixed sort/uniq usage (shemminger)\n * moved checking to new script (tmonjalon)\n * added maintainer entry (tmonjalon)\n * added license (tmonjalon)\n\nv3)\n * Changed symbol check script name (tmonjalon)\n * Trapped exit to clean temp file (tmonjalon)\n * Honored verbose command (tmonjalon)\n * Cleaned left over debug bits (tmonjalon)\n * Updated location in MAINTAINERS file (tmonjalon)\n\nv4)\n * Updated maintainers file (tmonjalon)\n\nv5)\n * undo V4 (tmojalon)\n\nv6)\n * Cleaning up more nits (tmonjalon)\n * Combining some lines (tmonjalon)\n * Fixing error print condition (tmonjalon)\n * Redirect stdin to a file to allow rewinding for\n   Multiple passes on tools (nhorman)\n\nv7)\n * More nits (tmonjalon)\n * consoloidating some common report lines (tmonjalon)\n * move SPDX identifier to line 2 (nhorman)\n * fix some checkpatch errors\n\nv8)\n * spelling fix (nhorman)\n * found a way to eliminate the use of filterdiff (new awk rules)\n---\n MAINTAINERS                     |   1 +\n devtools/check-symbol-change.sh | 161 ++++++++++++++++++++++++++++++++\n devtools/checkpatches.sh        |  50 ++++++++--\n 3 files changed, 205 insertions(+), 7 deletions(-)\n create mode 100755 devtools/check-symbol-change.sh",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 4667fa7fb..7b1180fe0 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -122,6 +122,7 @@ M: Neil Horman <nhorman@tuxdriver.com>\n F: lib/librte_compat/\n F: doc/guides/rel_notes/deprecation.rst\n F: devtools/validate-abi.sh\n+F: devtools/check-symbol-change.sh\n F: buildtools/check-experimental-syms.sh\n \n Driver information\ndiff --git a/devtools/check-symbol-change.sh b/devtools/check-symbol-change.sh\nnew file mode 100755\nindex 000000000..6d7d83db4\n--- /dev/null\n+++ b/devtools/check-symbol-change.sh\n@@ -0,0 +1,161 @@\n+#!/bin/sh\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2018 Neil Horman <nhorman@tuxdriver.com>\n+\n+build_map_changes()\n+{\n+\tlocal fname=$1\n+\tlocal mapdb=$2\n+\n+\tcat $fname | awk '\n+\t\t# Initialize our variables\n+\t\tBEGIN {map=\"\";sym=\"\";ar=\"\";sec=\"\"; in_sec=0; in_map=0}\n+\n+\t\t# Anything that starts with + or -, followed by an a\n+\t\t# and ends in the string .map is the name of our map file\n+\t\t# This may appear multiple times in a patch if multiple\n+\t\t# map files are altered, and all section/symbol names\n+\t\t# appearing between a triggering of this rule and the\n+\t\t# next trigger of this rule are associated with this file\n+\t\t/[-+] a\\/.*\\.map/ {map=$2; in_map=1}\n+\n+\t\t# Same pattern as above, only it matches on anything that\n+\t\t# doesnt end in 'map', indicating we have left the map chunk.\n+\t\t# When we hit this, turn off the in_map variable, which\n+\t\t# supresses the subordonate rules below\n+\t\t/[-+] a\\/.*\\.^(map)/ {in_map=0}\n+\n+\t\t# Triggering this rule, which starts a line with a + and ends it\n+\t\t# with a { identifies a versioned section.  The section name is\n+\t\t# the rest of the line with the + and { symbols remvoed.\n+\t\t# Triggering this rule sets in_sec to 1, which actives the\n+\t\t# symbol rule below\n+\t\t/+.*{/ {gsub(\"+\",\"\");\n+\t\t\tif (in_map == 1) {\n+\t\t\t\tsec=$1; in_sec=1;\n+\t\t\t}\n+\t\t}\n+\n+\t\t# This rule idenfies the end of a section, and disables the\n+\t\t# symbol rule\n+\t\t/.*}/ {in_sec=0}\n+\n+\t\t# This rule matches on a + followed by any characters except a :\n+\t\t# (which denotes a global vs local segment), and ends with a ;.\n+\t\t# The semicolon is removed and the symbol is printed with its\n+\t\t# association file name and version section, along with an\n+\t\t# indicator that the symbol is a new addition.  Note this rule\n+\t\t# only works if we have found a version section in the rule\n+\t\t# above (hence the in_sec check) And found a map file (the\n+\t\t# in_map check).  If we are not in a map chunk, do nothing.  If\n+\t\t# we are in a map chunk but not a section chunk, record it as\n+\t\t# unknown.\n+\t\t/^+[^}].*[^:*];/ {gsub(\";\",\"\");sym=$2;\n+\t\t\tif (in_map == 1) {\n+\t\t\t\tif (in_sec == 1) {\n+\t\t\t\t\tprint map \" \" sym \" \" sec \" add\"\n+\t\t\t\t} else {\n+\t\t\t\t\tprint map \" \" sym \" unknown add\"\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\n+\t\t# This is the same rule as above, but the rule matches on a\n+\t\t# leading - rather than a +, denoting that the symbol is being\n+\t\t# removed.\n+\t\t/^-[^}].*[^:*];/ {gsub(\";\",\"\");sym=$2;\n+\t\t\tif (in_map == 1) {\n+\t\t\t\tif (in_sec == 1) {\n+\t\t\t\t\tprint map \" \" sym \" \" sec \" del\"\n+\t\t\t\t} else {\n+\t\t\t\t\tprint map \" \" sym \" unknown del\"\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}' > ./$mapdb\n+\n+\t\tsort -u $mapdb > ./$mapdb.2\n+\t\tmv -f $mapdb.2 $mapdb\n+\n+}\n+\n+check_for_rule_violations()\n+{\n+\tlocal mapdb=$1\n+\tlocal mname\n+\tlocal symname\n+\tlocal secname\n+\tlocal ar\n+\tlocal ret=0\n+\n+\twhile read mname symname secname ar\n+\tdo\n+\t\tif [ \"$ar\" == \"add\" ]\n+\t\tthen\n+\n+\t\t\tif [ \"$secname\" == \"unknown\" ]\n+\t\t\tthen\n+\t\t\t\t# Just inform the user of this occurrence, but\n+\t\t\t\t# don't flag it as an error\n+\t\t\t\techo -n \"INFO: symbol $syname is added but \"\n+\t\t\t\techo -n \"patch has insuficient context \"\n+\t\t\t\techo -n \"to determine the section name \"\n+\t\t\t\techo -n \"please ensure the version is \"\n+\t\t\t\techo \"EXPERIMENTAL\"\n+\t\t\t\tcontinue\n+\t\t\tfi\n+\n+\t\t\tif [ \"$secname\" != \"EXPERIMENTAL\" ]\n+\t\t\tthen\n+\t\t\t\t# Symbols that are getting added in a section\n+\t\t\t\t# other than the experimental section\n+\t\t\t\t# to be moving from an already supported\n+\t\t\t\t# section or its a violation\n+\t\t\t\tgrep -q \\\n+\t\t\t\t\"$mname $symname [^EXPERIMENTAL] del\" $mapdb\n+\t\t\t\tif [ $? -ne 0 ]\n+\t\t\t\tthen\n+\t\t\t\t\techo -n \"ERROR: symbol $symname \"\n+\t\t\t\t\techo -n \"is added in a section \"\n+\t\t\t\t\techo -n \"other than the EXPERIMENTAL \"\n+\t\t\t\t\techo \"section of the version map\"\n+\t\t\t\t\tret=1\n+\t\t\t\tfi\n+\t\t\tfi\n+\t\telse\n+\n+\t\t\tif [ \"$secname\" != \"EXPERIMENTAL\" ]\n+\t\t\tthen\n+\t\t\t\t# Just inform users that non-experimenal\n+\t\t\t\t# symbols need to go through a deprecation\n+\t\t\t\t# process\n+\t\t\t\techo -n \"INFO: symbol $symname is being \"\n+\t\t\t\techo -n \"removed, ensure that it has \"\n+\t\t\t\techo \"gone through the deprecation process\"\n+\t\t\tfi\n+\t\tfi\n+\tdone < $mapdb\n+\n+\treturn $ret\n+}\n+\n+trap clean_and_exit_on_sig EXIT\n+\n+mapfile=`mktemp mapdb.XXXXXX`\n+patch=$1\n+exit_code=1\n+\n+clean_and_exit_on_sig()\n+{\n+\trm -f $mapfile\n+\texit $exit_code\n+}\n+\n+build_map_changes $patch $mapfile\n+check_for_rule_violations $mapfile\n+exit_code=$?\n+\n+rm -f $mapfile\n+\n+exit $exit_code\n+\n+\ndiff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh\nindex 663b7c426..10ba35340 100755\n--- a/devtools/checkpatches.sh\n+++ b/devtools/checkpatches.sh\n@@ -7,6 +7,9 @@\n # - DPDK_CHECKPATCH_LINE_LENGTH\n . $(dirname $(readlink -e $0))/load-devel-config\n \n+\n+VALIDATE_NEW_API=$(dirname $(readlink -e $0))/check-symbol-change.sh\n+\n length=${DPDK_CHECKPATCH_LINE_LENGTH:-80}\n \n # override default Linux options\n@@ -21,6 +24,15 @@ SPLIT_STRING,LONG_LINE_STRING,\\\n LINE_SPACING,PARENTHESIS_ALIGNMENT,NETWORKING_BLOCK_COMMENT_STYLE,\\\n NEW_TYPEDEFS,COMPARISON_TO_NULL\"\n \n+clean_tmp_files() {\n+\techo $TMPINPUT | grep -q checkpaches\n+\tif [ $? -eq 0 ]; then\n+\t\trm -f $TMPINPUT\n+\tfi\n+}\n+\n+trap \"clean_tmp_files\" SIGINT\n+\n print_usage () {\n \tcat <<- END_OF_HELP\n \tusage: $(basename $0) [-q] [-v] [-nX|patch1 [patch2] ...]]\n@@ -58,19 +70,43 @@ total=0\n status=0\n \n check () { # <patch> <commit> <title>\n+\tlocal ret=0\n+\n \ttotal=$(($total + 1))\n \t! $verbose || printf '\\n### %s\\n\\n' \"$3\"\n \tif [ -n \"$1\" ] ; then\n-\t\treport=$($DPDK_CHECKPATCH_PATH $options \"$1\" 2>/dev/null)\n+\t\tTMPINPUT=$1\n \telif [ -n \"$2\" ] ; then\n-\t\treport=$(git format-patch --find-renames --no-stat --stdout -1 $commit |\n-\t\t\t$DPDK_CHECKPATCH_PATH $options - 2>/dev/null)\n+\t\tTMPINPUT=$(mktemp checkpatches.XXXXXX)\n+\t\tgit format-patch --find-renames \\\n+\t\t--no-stat --stdout -1 $commit > ./$TMPINPUT\n \telse\n-\t\treport=$($DPDK_CHECKPATCH_PATH $options - 2>/dev/null)\n+\t\tTMPINPUT=$(mktemp checkpatches.XXXXXX)\n+\t\tcat > ./$TMPINPUT\n+\tfi\n+\n+\treport=$($DPDK_CHECKPATCH_PATH $options $TMPINPUT 2>/dev/null)\n+\n+\tif [ $? -ne 0 ]\n+\tthen\n+\t\t$verbose || printf '\\n### %s\\n\\n' \"$3\"\n+\t\tprintf '%s\\n' \"$report\" | sed -n '1,/^total:.*lines checked$/p'\n+\t\tret=1\n+\tfi\n+\n+\t! $verbose || printf '\\nChecking API additions/removals:\\n'\n+\n+\treport=$($VALIDATE_NEW_API \"$TMPINPUT\")\n+\n+\tif [ $? -ne 0 ]; then\n+\t\tprintf '%s\\n' \"$report\"\n+\t\tret=1\n+\tfi\n+\n+\tclean_tmp_files\n+\tif [ $ret -eq 0 ]; then\n+\t\treturn 0\n \tfi\n-\t[ $? -ne 0 ] || return 0\n-\t$verbose || printf '\\n### %s\\n\\n' \"$3\"\n-\tprintf '%s\\n' \"$report\" | sed -n '1,/^total:.*lines checked$/p'\n \tstatus=$(($status + 1))\n }\n \n",
    "prefixes": [
        "v8"
    ]
}