get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 811603,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/811603/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/swupdate/patch/20170908134547.9170-1-christian.storm@siemens.com/",
    "project": {
        "id": 58,
        "url": "http://patchwork.ozlabs.org/api/1.2/projects/58/?format=api",
        "name": "swupdate development",
        "link_name": "swupdate",
        "list_id": "swupdate.googlegroups.com",
        "list_email": "swupdate@googlegroups.com",
        "web_url": "https://github.com/sbabic/swupdate",
        "scm_url": "git://github.com/sbabic/swupdate",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170908134547.9170-1-christian.storm@siemens.com>",
    "list_archive_url": null,
    "date": "2017-09-08T13:45:45",
    "name": "[1/3] tmpdir: introduce get_tmpdir() respecting TMPDIR",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "541b762472ae19154319ada6ee1932777720bbe8",
    "submitter": {
        "id": 72180,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/72180/?format=api",
        "name": "Storm, Christian",
        "email": "christian.storm@siemens.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/swupdate/patch/20170908134547.9170-1-christian.storm@siemens.com/mbox/",
    "series": [
        {
            "id": 2217,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/2217/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/swupdate/list/?series=2217",
            "date": "2017-09-08T13:45:47",
            "name": "[1/3] tmpdir: introduce get_tmpdir() respecting TMPDIR",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/2217/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/811603/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/811603/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<swupdate+bncBDD6BWV65QPBBHF7ZLGQKGQE3XAO3JQ@googlegroups.com>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=googlegroups.com\n\t(client-ip=2a00:1450:4010:c07::238;\n\thelo=mail-lf0-x238.google.com;\n\tenvelope-from=swupdate+bncbdd6bwv65qpbbhf7zlgqkgqe3xao3jq@googlegroups.com;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=googlegroups.com header.i=@googlegroups.com\n\theader.b=\"kqFf4kJ4\"; dkim-atps=neutral"
        ],
        "Received": [
            "from mail-lf0-x238.google.com (mail-lf0-x238.google.com\n\t[IPv6:2a00:1450:4010:c07::238])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xpdv54G2Xz9sBd\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  8 Sep 2017 23:48:17 +1000 (AEST)",
            "by mail-lf0-x238.google.com with SMTP id 80sf396646lfy.11\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 08 Sep 2017 06:48:17 -0700 (PDT)",
            "by 10.25.166.8 with SMTP id p8ls17309lfe.23.gmail; Fri, 08 Sep 2017\n\t06:48:12 -0700 (PDT)",
            "from david.siemens.de (david.siemens.de. [192.35.17.14])\n\tby gmr-mx.google.com with ESMTPS id\n\t200si286505wmj.0.2017.09.08.06.48.12\n\tfor <swupdate@googlegroups.com>\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 08 Sep 2017 06:48:12 -0700 (PDT)",
            "from mail2.siemens.de (mail2.siemens.de [139.25.208.11])\n\tby david.siemens.de (8.15.2/8.15.2) with ESMTPS id v88DmCE4000486\n\t(version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK)\n\tfor <swupdate@googlegroups.com>; Fri, 8 Sep 2017 15:48:12 +0200",
            "from MD1KR9XC.ad001.siemens.net ([139.25.69.251])\n\tby mail2.siemens.de (8.15.2/8.15.2) with ESMTP id v88DmBKk021896;\n\tFri, 8 Sep 2017 15:48:11 +0200"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; t=1504878493; cv=pass;\n\td=google.com; s=arc-20160816;\n\tb=v0awOKM5qUMHUNxLoLxgMIvHNa81443BDtsSDLhfBiTQFy+W90wgxpi2gsOqA+vFGS\n\tL3dvJ16q5SuBENuVgcwlSPTuk3guBPRIT0/avs8WpafrXCJmOLeOv6/NO8qSTFpmjGmp\n\tvVYVoWWGNcN5GL65eRkawHMHxDs+ap2sVhQHMvdABoMeA/zPahB3F+aNy6W/KBlezPIQ\n\t3mfPS3mC2QhyOCYLPMMzNSwzKK5pjmEFVgvWsP/EirRqYoIIb9l4YoDgysoaLN5EPb0s\n\tnxVN8X7dFKukqEOYZ8+jP3zSWLGIj6whADZ2dtn3SCRjdP7Bvdu1CErVSNWRL1vtG5MB\n\ttfRg==",
            "i=1; a=rsa-sha256; t=1504878492; cv=none;\n\td=google.com; s=arc-20160816;\n\tb=L03+37vtEYaq/GO4wYVloYgcS4LzjEmNLygPHth14Mt3YYsnogVSC/Xm44L/yAOTXv\n\tSrYCHuGY+JxsMJpelIWakMsCkG4RiU9y52Plw7XMkuiLvFOLpvpggXbQIkn/dHtuqye3\n\tapcjjF7acLXaWJytDjGmPtCr56uBlB6OUYSqs6iRzfFnIs/4NRx0lsvfkFK4FqmkS71+\n\taAI6O5E60+VeKKP0p+kuGWWvHLJZreG22YWidGgIiKkI3C1AYzUAmg4TObBLNDS5WlxN\n\tRC7+hMQP6yYWReAp0Jk/gjgTHbmaK728alGytWv5p0b6lg2kR3TaWjjck6PksdGt4qry\n\tIyoQ=="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=arc-20160816; \n\th=list-unsubscribe:list-subscribe:list-archive:list-help:list-post\n\t:list-id:mailing-list:precedence:message-id:date:subject:cc:to:from\n\t:arc-authentication-results:arc-message-signature:mime-version\n\t:sender:dkim-signature:arc-authentication-results;\n\tbh=XYTOuDIjEY5lCx6F4mCaKcdJyEVNX/fcOuorxv0qcSE=;\n\tb=jKkWaAjttxKy6V8glfmzcrszdwDGUeLql9k7/sJLDy7ye/fRfn+fT/5E1rPEsf47o9\n\t18AabB62PxkJaW2y/X1wjhkTqMoBqmrfcBzFXS7vwytRKohTEKtzjJi+q0kvxt0bYEJ+\n\tH3kDDrOo9r75HL3UWwYEIdNUmbOld4/+vusgvDphFrHFcxA5r2zUIVLlLedlAfcDOB9K\n\tfp35slgXp6eN45OkHSo10WZbjo8x1KvtYRS6C7RR9DNJ3zYhA62srr1k1ZLYPX+TFjfB\n\tXAp2LI+ssAtT3J7i2F8hr/8UI6IVolEiwxdhagd8mM2bWpS5T+Yez5tCKbnIupGL4Bhz\n\tLztg==",
            "i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=arc-20160816; \n\th=message-id:date:subject:cc:to:from:arc-authentication-results;\n\tbh=POesLmUtky4nmGZMdwD7wEtIaooRKPOUQKGOZiqDdUA=;\n\tb=H3CGYoUmn9Hw/4uP7V/RDSS3Dp8rhWg8ZfBxHqA/RTO6u0g71qz45X3wZTsecucHSJ\n\tAXosnz52va6GeVld94mukvjFWxz5Ie1grqgD62Aod7AYgxQVtIKZ59Al9BKPZT79tC+b\n\tj3E/qtsh2R9l2D1+wqMYZ5G+kYHBVNz0UXdZb3yitVsqIwbx9T2z8HB03Oe88JA7QcT9\n\tq4UWiFxiL0UvcVeXLDDOKXAtZrUJZdvHwEo2KuGY5rwS8e0DgI7lqVQHGiAE71l4OQc1\n\tIOpILfTqh3uaPs4zLFxWYiLW6w6sQ9KKT/T0lIJUbnyRykh+E0z2yOmj6Z2zREOCRCus\n\twS+g=="
        ],
        "ARC-Authentication-Results": [
            "i=2; gmr-mx.google.com;\n\tspf=neutral (google.com: 192.35.17.14 is neither permitted nor denied\n\tby best guess record for domain of\n\tchristian.storm@siemens.com)\n\tsmtp.mailfrom=christian.storm@siemens.com",
            "i=1; gmr-mx.google.com;\n\tspf=neutral (google.com: 192.35.17.14 is neither permitted nor denied\n\tby best guess record for domain of\n\tchristian.storm@siemens.com)\n\tsmtp.mailfrom=christian.storm@siemens.com"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=googlegroups.com; s=20161025;\n\th=sender:mime-version:from:to:cc:subject:date:message-id\n\t:x-original-sender:x-original-authentication-results:precedence\n\t:mailing-list:list-id:list-post:list-help:list-archive\n\t:list-subscribe:list-unsubscribe;\n\tbh=XYTOuDIjEY5lCx6F4mCaKcdJyEVNX/fcOuorxv0qcSE=;\n\tb=kqFf4kJ4breis4wf/UnhnSKtwRBRODb1Z8dfwEfIZS8GMAyzPGB0HBUnHlyDse7RZ9\n\thA/nRBLXEZjhl+WooyHjL9Lvm7OdPbWcFtsMe3PGKHRjphYpyLXtBDKB+m6CN5slnAAB\n\tRKPLXARWg3MIIU8ydEURbnUyMMvHP9WfutEBN4uoMS1jc8EXyYuiM/24x2hLqcyUlbwD\n\tzI3KJSC7a0SgE7WFr5WrEPe8QCflibNrQsgkTMf1FzUaLiwI5objWpCTI0rsKFJeCJZV\n\t1iCV3KCNxex/sLmG2Z//B1seVuIjvVLXiC5ukD/WMYH39t90XSyUTehpv4uzQRhLjMoJ\n\tQdCg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=sender:x-gm-message-state:mime-version:from:to:cc:subject:date\n\t:message-id:x-original-sender:x-original-authentication-results\n\t:precedence:mailing-list:list-id:x-spam-checked-in-group:list-post\n\t:list-help:list-archive:list-subscribe:list-unsubscribe;\n\tbh=XYTOuDIjEY5lCx6F4mCaKcdJyEVNX/fcOuorxv0qcSE=;\n\tb=Fqg0idjUXcv0O792Ew7R8A9SQJxhd/WO0/b2jRToWz+sRflXtha97jFRFEJK8EzgUm\n\tnOsqubqyGf0krWNB+OUgFzr4JLlNTxjAsHfS8rm3vW6mZ0ce9kW0MoiNsqCGJnkIKsLI\n\tlrWktckQHRUHc1A27MJQ1T0PdSRwcDymfZDC3aP18mQd+OmNcxJjq4s69ZpKf+AVeOPR\n\tPCLAkGL9pIDnd8VgOa2ZkM0jwQ7IQ9QG+MBOpJGfUUTN1E9rvJBMVi6Cns4+0ylhVYd3\n\tuxuGH4g7Ribajs6BvcOHIXA5C7LrijqKesgmAU3GpZStCr4wmKyO6JyQl1huUW2j4KQe\n\tamPg==",
        "Sender": "swupdate@googlegroups.com",
        "X-Gm-Message-State": "AHPjjUhi/N7KM/1pc9Adyag+etfArgFIaTO8LtNARukCGYh3zTMumcOV\n\t0w/kcT65LYGdzA==",
        "X-Google-Smtp-Source": "AOwi7QBRlIXZcHsQGJPnBAUctnyp/p86sBqxcze1vmoLYyR1sA/E2P9KeYaT2vzSvkZODSxwyCwHZQ==",
        "X-Received": [
            "by 10.46.22.9 with SMTP id w9mr4973ljd.9.1504878492979;\n\tFri, 08 Sep 2017 06:48:12 -0700 (PDT)",
            "by 10.46.86.74 with SMTP id k71mr240771ljb.0.1504878492530;\n\tFri, 08 Sep 2017 06:48:12 -0700 (PDT)"
        ],
        "MIME-Version": "1.0",
        "X-BeenThere": "swupdate@googlegroups.com",
        "Received-SPF": "neutral (google.com: 192.35.17.14 is neither permitted nor\n\tdenied by best guess record for domain of\n\tchristian.storm@siemens.com) client-ip=192.35.17.14; ",
        "From": "Christian Storm <christian.storm@siemens.com>",
        "To": "swupdate@googlegroups.com",
        "Cc": "Christian Storm <christian.storm@siemens.com>",
        "Subject": "[swupdate] [PATCH 1/3] tmpdir: introduce get_tmpdir() respecting\n\tTMPDIR",
        "Date": "Fri,  8 Sep 2017 15:45:45 +0200",
        "Message-Id": "<20170908134547.9170-1-christian.storm@siemens.com>",
        "X-Mailer": "git-send-email 2.14.1",
        "X-Original-Sender": "christian.storm@siemens.com",
        "X-Original-Authentication-Results": "gmr-mx.google.com;       spf=neutral\n\t(google.com: 192.35.17.14 is neither permitted nor denied by best\n\tguess\n\trecord for domain of christian.storm@siemens.com)\n\tsmtp.mailfrom=christian.storm@siemens.com",
        "Content-Type": "text/plain; charset=\"UTF-8\"",
        "Precedence": "list",
        "Mailing-list": "list swupdate@googlegroups.com;\n\tcontact swupdate+owners@googlegroups.com",
        "List-ID": "<swupdate.googlegroups.com>",
        "X-Spam-Checked-In-Group": "swupdate@googlegroups.com",
        "X-Google-Group-Id": "605343134186",
        "List-Post": "<https://groups.google.com/group/swupdate/post>,\n\t<mailto:swupdate@googlegroups.com>",
        "List-Help": "<https://groups.google.com/support/>,\n\t<mailto:swupdate+help@googlegroups.com>",
        "List-Archive": "<https://groups.google.com/group/swupdate",
        "List-Subscribe": "<https://groups.google.com/group/swupdate/subscribe>,\n\t<mailto:swupdate+subscribe@googlegroups.com>",
        "List-Unsubscribe": "<mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>,\n\t<https://groups.google.com/group/swupdate/subscribe>"
    },
    "content": "Introduce a get_tmpdir() method that is to be used instead\nof the #define'd TMPDIR hard-coded to /tmp so that SWUpdate\nrespects the TMPDIR environment variable or, if it is unset,\nfalls back to /tmp as sane default and current behavior.\n\nSigned-off-by: Christian Storm <christian.storm@siemens.com>\n---\n core/util.c    | 23 +++++++++++++++++++++++\n include/util.h |  2 +-\n 2 files changed, 24 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/core/util.c b/core/util.c\nindex b714f29..fe2a657 100644\n--- a/core/util.c\n+++ b/core/util.c\n@@ -52,6 +52,29 @@ char *sdup(const char *str) {\n \treturn p;\n }\n \n+static char* TMPDIR = NULL;\n+\n+const char* get_tmpdir(void)\n+{\n+\tif (TMPDIR != NULL) {\n+\t\treturn TMPDIR;\n+\t}\n+\n+\tchar *env_tmpdir = getenv(\"TMPDIR\");\n+\tif (env_tmpdir == NULL) {\n+\t\tTMPDIR = (char*)\"/tmp/\";\n+\t\treturn TMPDIR;\n+\t}\n+\n+\tif (env_tmpdir[strlen(env_tmpdir)] == '/') {\n+\t\tTMPDIR = env_tmpdir;\n+\t\treturn TMPDIR;\n+\t}\n+\n+\tasprintf(&TMPDIR, \"%s/\", env_tmpdir);\n+\treturn TMPDIR;\n+}\n+\n static int countargc(char *args, char **argv)\n {\n \tint count = 0;\ndiff --git a/include/util.h b/include/util.h\nindex 70a0acc..9fb7860 100644\n--- a/include/util.h\n+++ b/include/util.h\n@@ -112,7 +112,6 @@ typedef void (*notifier) (RECOVERY_STATUS status, int level, const char *msg);\n \n #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))\n \n-#define TMPDIR\t\t\"/tmp/\"\n \n #define LG_16 4\n #define FROM_HEX(f) from_ascii (f, sizeof f, LG_16)\n@@ -196,5 +195,6 @@ static inline int decompress_image(int __attribute__ ((__unused__))infile,\n }\n #endif\n \n+const char* get_tmpdir(void);\n \n #endif\n",
    "prefixes": [
        "1/3"
    ]
}