get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 51237,
    "url": "http://patches.dpdk.org/api/patches/51237/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190315182022.39976-4-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": "<20190315182022.39976-4-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190315182022.39976-4-bruce.richardson@intel.com",
    "date": "2019-03-15T18:20:21",
    "name": "[v3,3/4] build: use version number from config file",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "6e55bb7387c10c0c3f5f5a1f2349279292af6540",
    "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/20190315182022.39976-4-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 3763,
            "url": "http://patches.dpdk.org/api/series/3763/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3763",
            "date": "2019-03-15T18:20:18",
            "name": "One versionfile to rule them all...",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/3763/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/51237/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/51237/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 75F194F94;\n\tFri, 15 Mar 2019 19:20:49 +0100 (CET)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id C4D544D27\n\tfor <dev@dpdk.org>; Fri, 15 Mar 2019 19:20:45 +0100 (CET)",
            "from fmsmga007.fm.intel.com ([10.253.24.52])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t15 Mar 2019 11:20:45 -0700",
            "from silpixa00399126.ir.intel.com (HELO\n\tsilpixa00399126.ger.corp.intel.com) ([10.237.222.236])\n\tby fmsmga007.fm.intel.com with ESMTP; 15 Mar 2019 11:20:44 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.58,483,1544515200\"; d=\"scan'208\";a=\"134701261\"",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "David Marchand <david.marchand@redhat.com>,\n\tThomas Monjalon <thomas@monjalon.net>, Luca Boccassi <bluca@debian.org>, \n\tBruce Richardson <bruce.richardson@intel.com>",
        "Date": "Fri, 15 Mar 2019 18:20:21 +0000",
        "Message-Id": "<20190315182022.39976-4-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190315182022.39976-1-bruce.richardson@intel.com>",
        "References": "<20190307115448.54041-1-bruce.richardson@intel.com>\n\t<20190315182022.39976-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 3/4] build: use version number from config 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": "Since we have the version number in a separate file at the root level,\nwe should not need to duplicate this in rte_version.h too. Best\napproach here is to move the macros for specifying the year/month/etc.\nparts from the version header file to the build config file - leaving\nthe other utility macros for e.g. printing the version string, where they\nare.\n\nFor \"make\", this is done by having a little bit of awk parse the version\nfile and pass the results through to the preprocessor for the config\ngeneration stage.\n\nFor \"meson\", this is done by parsing the version and adding it to the\nstandard dpdk_conf object.\n\nIn both cases, we need to append a large number - in this case \"99\",\npreviously 16 in original code - to the version number when we want to do\nversion number comparisons. Without this, the release version e.g. 19.05.0\nwill compare as less than it's RC's e.g. 19.05.0-rc4. With it, the\ncomparison is correct as \"19.05.0.99 > 19.05.0-rc4.99\".\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nAcked-by: Luca Boccassi <bluca@debian.org>\n---\nV3: following Thomas review, include appending .99 to version numbers to\n    ensure correct comparison. Make sure the reason for this is properly\n    documented in the code for future reference. Add in \"int\" casts for\n    numeric values to strip leading zeros e.g. in \"05\" month.\nV2: removed extra change to DPDK_VERSION that crept into patch. Added ack\n---\n config/common_base                          | 14 +++++++++\n config/meson.build                          | 16 +++++++++++\n config/rte_config.h                         |  3 ++\n lib/librte_eal/common/include/rte_version.h | 32 ---------------------\n mk/rte.sdkconfig.mk                         |  7 +++++\n 5 files changed, 40 insertions(+), 32 deletions(-)",
    "diff": "diff --git a/config/common_base b/config/common_base\nindex 0b09a9348..6292bc4af 100644\n--- a/config/common_base\n+++ b/config/common_base\n@@ -1,6 +1,20 @@\n # SPDX-License-Identifier: BSD-3-Clause\n # Copyright(c) 2010-2017 Intel Corporation\n \n+#\n+# String that appears before the version number\n+#\n+CONFIG_RTE_VER_PREFIX=\"DPDK\"\n+\n+#\n+# Version information completed when this file is processed for a build\n+#\n+CONFIG_RTE_VER_YEAR=__YEAR\n+CONFIG_RTE_VER_MONTH=__MONTH\n+CONFIG_RTE_VER_MINOR=__MINOR\n+CONFIG_RTE_VER_SUFFIX=__SUFFIX\n+CONFIG_RTE_VER_RELEASE=__RELEASE\n+\n #\n # define executive environment\n # RTE_EXEC_ENV values are the directories in mk/exec-env/\ndiff --git a/config/meson.build b/config/meson.build\nindex 999dea91e..30a7261a5 100644\n--- a/config/meson.build\n+++ b/config/meson.build\n@@ -6,6 +6,22 @@\n pver = meson.project_version().split('.')\n major_version = '@0@.@1@'.format(pver.get(0), pver.get(1))\n \n+# extract all version information into the build configuration\n+dpdk_conf.set('RTE_VER_YEAR', pver.get(0).to_int())\n+dpdk_conf.set('RTE_VER_MONTH', pver.get(1).to_int())\n+if pver.get(2).contains('-rc')\n+\trc_ver = pver.get(2).split('-rc')\n+\tdpdk_conf.set('RTE_VER_MINOR', rc_ver.get(0).to_int())\n+\tdpdk_conf.set_quoted('RTE_VER_SUFFIX', '-rc')\n+\tdpdk_conf.set('RTE_VER_RELEASE', rc_ver.get(1).to_int())\n+else\n+\tdpdk_conf.set('RTE_VER_MINOR', pver.get(2).to_int())\n+\tdpdk_conf.set_quoted('RTE_VER_SUFFIX', '')\n+# for actual, non-rc releases, set the release value to 99 to ensure releases\n+# have higher version numbers than their respective release candidates\n+\tdpdk_conf.set('RTE_VER_RELEASE', 99)\n+endif\n+\n pmd_subdir_opt = get_option('drivers_install_subdir')\n if pmd_subdir_opt.contains('<VERSION>')\n \tpmd_subdir_opt = major_version.join(pmd_subdir_opt.split('<VERSION>'))\ndiff --git a/config/rte_config.h b/config/rte_config.h\nindex 1690f4d98..cda51af47 100644\n--- a/config/rte_config.h\n+++ b/config/rte_config.h\n@@ -26,6 +26,9 @@\n #define RTE_EXEC_ENV_BSDAPP 1\n #endif\n \n+/* String that appears before the version number */\n+#define RTE_VER_PREFIX \"DPDK\"\n+\n /****** library defines ********/\n \n /* compat defines */\ndiff --git a/lib/librte_eal/common/include/rte_version.h b/lib/librte_eal/common/include/rte_version.h\nindex a7eed7ab7..50867ea81 100644\n--- a/lib/librte_eal/common/include/rte_version.h\n+++ b/lib/librte_eal/common/include/rte_version.h\n@@ -19,38 +19,6 @@ extern \"C\" {\n #include <stdio.h>\n #include <rte_common.h>\n \n-/**\n- * String that appears before the version number\n- */\n-#define RTE_VER_PREFIX \"DPDK\"\n-\n-/**\n- * Major version/year number i.e. the yy in yy.mm.z\n- */\n-#define RTE_VER_YEAR 19\n-\n-/**\n- * Minor version/month number i.e. the mm in yy.mm.z\n- */\n-#define RTE_VER_MONTH 5\n-\n-/**\n- * Patch level number i.e. the z in yy.mm.z\n- */\n-#define RTE_VER_MINOR 0\n-\n-/**\n- * Extra string to be appended to version number\n- */\n-#define RTE_VER_SUFFIX \"-rc\"\n-\n-/**\n- * Patch release number\n- *   0-15 = release candidates\n- *   16   = release\n- */\n-#define RTE_VER_RELEASE 0\n-\n /**\n  * Macro to compute a version number usable for comparisons\n  */\ndiff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk\nindex 46ec9e76d..f538649f2 100644\n--- a/mk/rte.sdkconfig.mk\n+++ b/mk/rte.sdkconfig.mk\n@@ -74,9 +74,16 @@ else\n # To do so the temp config is checked for duplicate keys with cut/sort/uniq\n # Then for each of those identified duplicates as long as there are more than\n # just one left the last match is removed.\n+# Part of the config includes the version information taken from \"VERSION\"\n+# in the repo. This needs to be split into the various parts using sed and awk.\n+# To ensure correct version comparison, we append \".99\" to the version number\n+# so that the version of a release is higher than that of its rc's.\n $(RTE_OUTPUT)/.config: $(RTE_CONFIG_TEMPLATE) FORCE | $(RTE_OUTPUT)\n \t$(Q)if [ \"$(RTE_CONFIG_TEMPLATE)\" != \"\" -a -f \"$(RTE_CONFIG_TEMPLATE)\" ]; then \\\n \t\t$(CPP) -undef -P -x assembler-with-cpp \\\n+\t\t`cat $(RTE_SRCDIR)/VERSION | \\\n+\t\tsed -e 's/-rc/.-rc./' -e 's/$$/..99/' | \\\n+\t\tawk -F '.' '{print \"-D__YEAR=\"int($$1), \"-D__MONTH=\"int($$2), \"-D__MINOR=\"int($$3), \"-D__SUFFIX=\\\"\"$$4\"\\\"\", \"-D__RELEASE=\"int($$5)}'` \\\n \t\t-ffreestanding \\\n \t\t-o $(RTE_OUTPUT)/.config_tmp $(RTE_CONFIG_TEMPLATE) ; \\\n \t\tconfig=$$(cat $(RTE_OUTPUT)/.config_tmp) ; \\\n",
    "prefixes": [
        "v3",
        "3/4"
    ]
}