get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 812794,
    "url": "http://patchwork.ozlabs.org/api/patches/812794/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/swupdate/patch/1505215260-21152-1-git-send-email-sbabic@denx.de/",
    "project": {
        "id": 58,
        "url": "http://patchwork.ozlabs.org/api/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": "<1505215260-21152-1-git-send-email-sbabic@denx.de>",
    "list_archive_url": null,
    "date": "2017-09-12T11:21:00",
    "name": "[V2] Fix usage of TMPDIR",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "a9d6997bde798f2fa3a4fa63b3a660c0b441b074",
    "submitter": {
        "id": 5771,
        "url": "http://patchwork.ozlabs.org/api/people/5771/?format=api",
        "name": "Stefano Babic",
        "email": "sbabic@denx.de"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/swupdate/patch/1505215260-21152-1-git-send-email-sbabic@denx.de/mbox/",
    "series": [
        {
            "id": 2671,
            "url": "http://patchwork.ozlabs.org/api/series/2671/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/swupdate/list/?series=2671",
            "date": "2017-09-12T11:21:00",
            "name": "[V2] Fix usage of TMPDIR",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/2671/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/812794/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/812794/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<swupdate+bncBAABBIUG37GQKGQELFJUVHY@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::23d;\n\thelo=mail-lf0-x23d.google.com;\n\tenvelope-from=swupdate+bncbaabbiug37gqkgqelfjuvhy@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=\"VcVq6kxF\"; dkim-atps=neutral"
        ],
        "Received": [
            "from mail-lf0-x23d.google.com (mail-lf0-x23d.google.com\n\t[IPv6:2a00:1450:4010:c07::23d])\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 3xs2RW4pRdz9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 21:21:10 +1000 (AEST)",
            "by mail-lf0-x23d.google.com with SMTP id u21sf328122lfk.20\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 04:21:10 -0700 (PDT)",
            "by 10.46.65.217 with SMTP id d86ls51334ljf.21.gmail; Tue, 12 Sep\n\t2017 04:21:06 -0700 (PDT)",
            "from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9])\n\tby gmr-mx.google.com with ESMTPS id\n\tp200si588237wmg.4.2017.09.12.04.21.06\n\tfor <swupdate@googlegroups.com>\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 12 Sep 2017 04:21:06 -0700 (PDT)",
            "from frontend03.mail.m-online.net (unknown [192.168.6.182])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 3xs2RQ1V6kz1qxxN;\n\tTue, 12 Sep 2017 13:21:06 +0200 (CEST)",
            "from localhost (dynscan3.mnet-online.de [192.168.6.84])\n\tby mail.m-online.net (Postfix) with ESMTP id 3xs2RQ1HxSz1qsQG;\n\tTue, 12 Sep 2017 13:21:06 +0200 (CEST)",
            "from mail.mnet-online.de ([192.168.8.182])\n\tby localhost (dynscan3.mail.m-online.net [192.168.6.84]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id V1vVukjRsAA3; Tue, 12 Sep 2017 13:21:05 +0200 (CEST)",
            "from babic.homelinux.org\n\t(host-88-217-136-221.customer.m-online.net [88.217.136.221])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mail.mnet-online.de (Postfix) with ESMTPS;\n\tTue, 12 Sep 2017 13:21:05 +0200 (CEST)",
            "from localhost (mail.babic.homelinux.org [127.0.0.1])\n\tby babic.homelinux.org (Postfix) with ESMTP id 0BA6645405CE;\n\tTue, 12 Sep 2017 13:21:05 +0200 (CEST)",
            "from babic.homelinux.org ([127.0.0.1])\n\tby localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id 2hDLiv-wXtYB; Tue, 12 Sep 2017 13:21:02 +0200 (CEST)",
            "from papero.fritz.box (papero.fritz.box [192.168.178.132])\n\tby babic.homelinux.org (Postfix) with ESMTP id 93D1745405CD;\n\tTue, 12 Sep 2017 13:21:02 +0200 (CEST)"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; t=1505215267; cv=pass;\n\td=google.com; s=arc-20160816;\n\tb=pzthRG66HV3Gu+dhLJnJLGgp7bcNntOIsCUz2RhNoRNA9CEcmCFskYOS1uC80g6AEB\n\t5UlroOB9yjzy7Nn4J2A6ginOxu298rLa848J81J51rFbzeBrePQ8IXxtlE95OALJoC8h\n\t4oi9UyVQxA2pd9GQvSAD/hgeyBzN5oY0QFILSR1E4KNWh/f8stlMOvbZJwcr5wCU4Yly\n\tbdYkWSE0cro56hJGOWs9y05Tgn6Sm8jFsTgPvndyl7OcDEGqPC0XQnkHQYVCF4yeRypw\n\t1nulrVkEZYUrd1tN6n6GPGo8+TWbhY9XSYspeSomkpCUA/IQhTaUHuiXztVkwDt2wWuv\n\tw7Qw==",
            "i=1; a=rsa-sha256; t=1505215266; cv=none;\n\td=google.com; s=arc-20160816;\n\tb=xwDwT7bf6poa6wbBUMf7dLSC1MlPoxX16sqeYTdsyPVUwHcW5LWjAqtolhil5sOfNO\n\tUu0xAQE9Q9lHEf26Z5xtlJTOXpI7ZbelMuQEg3Ld20P0GbzkBbqxTabXipNQ/wWPpYw/\n\trfaQ5/KwqhS/nMbMNRGwvopx8A6b+j06po+D2L/dbi8Rgmkn47IQVGikP6zi1xaBrk7Q\n\tAGBN5UQX2ohZnzchm4f+B4mKu9g+skTVk0qvDlVWoPrUaIqveJfNvR/h1/KKcytfaWsr\n\tTxL7i3+Lt7GIVxFpb3dH5xyzozCmVYioaD6vAQLOJGpnuLIur+sxpWLJTLf1rraw7BQB\n\tsVsg=="
        ],
        "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=FPCoxIMQ8Jytay3AxJ8LWCS/O80yOTHs6YevChe9vEo=;\n\tb=GcXbBC24G7lXa0m16WGse3b+BWdtNYSmajaktOhNZ2U3N6Gyt3cQOHaFwamDCr7Pjp\n\tDanBmRyOiCWrAPgcquz4e3G9MPeDfIpM93+5tUGgTZPHVhz5+QuDz4wbpaPPwln358fV\n\teLuI16wbtO/xmee7jx0xeo7tOaUcOzNFzpyAGgaTrFBtG6/5uhjQM+ad3ESa/DeZYjj1\n\tBo9hCJUNEDxlVDjTL41tdPupVPAiz/XIGeDFRFyK4L3CWVyzPe+L9b/OOGZbDcS1FQMp\n\tKmTBmi5GqUZXhg8uSEk2Ux9V+PNbUpN7DVLPiHJmd4IVbazfLPZa/BRLBpfjN1SvCbAv\n\tfiDg==",
            "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=tZj+4N1Pcig1Rx42v5AUS65CcEF2cDimhCxZf6bXnBM=;\n\tb=tbhn6csAXWTa9aKfIs4D37Dc6Hw8rcgmx8FwD8nWrUu/FOxXL7muC5HNreYe5QdK8l\n\tYS7GXM2nTFgJl/C/H4O2mQjxgZXN/M7tO1ZCcw03xC2nLYUArUhKxkBIbNhlkAt1Hsts\n\t4BqWcx2yHEVgESNCxMIrgWQ+uDWHhYf3oDPEkSlHrElv9Mg6A277Pyqc/j0MzCpC7oYw\n\tuJNGkUs/QS05KmswtnN3pgyky1LFG5WIe23pNI5XD9GGqm8Cn2toxMDoLF4I9cnmZfFt\n\tfAhjddUTa24A6PVDqolY7TeKCR9rL2hIxGrQRtwruy5hCNzhi/T0kXnp6oigTn2hlOI8\n\tBsCQ=="
        ],
        "ARC-Authentication-Results": [
            "i=2; gmr-mx.google.com;\n\tspf=neutral (google.com: 212.18.0.9 is neither permitted nor denied\n\tby best guess record for domain of sbabic@denx.de)\n\tsmtp.mailfrom=sbabic@denx.de",
            "i=1; gmr-mx.google.com;\n\tspf=neutral (google.com: 212.18.0.9 is neither permitted nor denied\n\tby best guess record for domain of sbabic@denx.de)\n\tsmtp.mailfrom=sbabic@denx.de"
        ],
        "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=FPCoxIMQ8Jytay3AxJ8LWCS/O80yOTHs6YevChe9vEo=;\n\tb=VcVq6kxFzxNO/beS5mj9vlfQqIC/tOWBT7rW8tjVj8Y3BmtZGFGglsiHHX/950ULz1\n\tQEkljB4Hg7Btxp3PGlj82FN8JIOAVTczuJghL97228qpNqiN/yf6cFlgLSSpKO+hAx6D\n\t2bLX4SZ1g3gc9o40wvpjN6m3mLRNAWDa5nmAgZbuu/ptjEGL2Jj7OWQ+FZBtf6lVxuOF\n\tMjAu/Si5UnYRhZBxykjDxBXDaK6uv8IN7BEoC52sgUZF0TYTci8WGTjMoD5e5Phf/RPJ\n\tuyxG0FM412RsO1geMWvPcSaSHRU4tTCARQfT6SEKyTR6ZchsxQyKZKqCx0lqC6KWR4mf\n\t0nfA==",
        "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=FPCoxIMQ8Jytay3AxJ8LWCS/O80yOTHs6YevChe9vEo=;\n\tb=knRZqEeakZKS87C4mB3tHtoeaIQUjiIZRJcXh7XfmtVL6CyvYx7rGklo2+LnzNX5f1\n\tCmEbgQPlDP47yJBM1QK4WBD4uOOU7RHm4iNE+tRbGraITAmQnYbQ0AcB48ZJ5A4uHTh0\n\tR7ixxZzbDET9T2KgPeu3B47fObLh5itByuG/e0EDUyY4JKMePGoAkIUZYLDZ7VUV+y2u\n\tLgK7lzTyi0LzGt9sBGY7WfgsUKSxC1J5M0RN63vS0NrdNLOBfGejwbVkiULZvDkX9RDR\n\tjZsakN0OKpvwXuCXnSokkUHiK6ik//m9IBs9v8NPyhxwMIaDkeRC4JBDBAY0mFCtVWxL\n\t+Fag==",
        "Sender": "swupdate@googlegroups.com",
        "X-Gm-Message-State": "AHPjjUhGVpbOh4wnKlSR0irqJOFjaqHObcpJuDXAEpSj+12QmZAy6bTN\n\t4Y5QYhEpt125Yw==",
        "X-Google-Smtp-Source": "AOwi7QDmII3gP7T/SSti+feRVlDQ4yLWkSzZy7GKb6yzbSeIisnYhkoy1oZdh+7eplM7ORXaZ2daUw==",
        "X-Received": [
            "by 10.46.86.211 with SMTP id k80mr29195lje.14.1505215267022;\n\tTue, 12 Sep 2017 04:21:07 -0700 (PDT)",
            "by 10.46.29.11 with SMTP id d11mr941127ljd.8.1505215266450;\n\tTue, 12 Sep 2017 04:21:06 -0700 (PDT)"
        ],
        "MIME-Version": "1.0",
        "X-BeenThere": "swupdate@googlegroups.com",
        "Received-SPF": "neutral (google.com: 212.18.0.9 is neither permitted nor\n\tdenied by best guess record for domain of sbabic@denx.de)\n\tclient-ip=212.18.0.9; ",
        "X-Virus-Scanned": [
            "amavisd-new at mnet-online.de",
            "Debian amavisd-new at babic.homelinux.org"
        ],
        "From": "Stefano Babic <sbabic@denx.de>",
        "To": "swupdate@googlegroups.com",
        "Cc": "Stefano Babic <sbabic@denx.de>",
        "Subject": "[swupdate] [PATCH V2] Fix usage of TMPDIR",
        "Date": "Tue, 12 Sep 2017 13:21:00 +0200",
        "Message-Id": "<1505215260-21152-1-git-send-email-sbabic@denx.de>",
        "X-Mailer": "git-send-email 2.7.4",
        "X-Original-Sender": "sbabic@denx.de",
        "X-Original-Authentication-Results": "gmr-mx.google.com;       spf=neutral\n\t(google.com: 212.18.0.9 is neither permitted nor denied by best guess\n\trecord\n\tfor domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de",
        "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": "Commit 7ce284c5401c64bcd54e469ce8a3f7639e28ed3a makes TMPDIR\nconfigurable. Fix the remaining sources that use the TMPDIR variable.\n\nSigned-off-by: Stefano Babic <sbabic@denx.de>\n---\n\nChanges since V1:\n\t- flash handler was not fixed\n\n corelib/lua_interface.c      | 1 +\n handlers/flash_handler.c     | 1 +\n handlers/lua_scripthandler.c | 7 +++++--\n 3 files changed, 7 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c\nindex 90c2230..5717807 100644\n--- a/corelib/lua_interface.c\n+++ b/corelib/lua_interface.c\n@@ -401,6 +401,7 @@ static int l_handler_wrapper(struct img_type *img, void *data) {\n \tlua_Number result;\n \tint l_func_ref;\n \tint fdout;\n+\tconst char* TMPDIR = get_tmpdir();\n \n \tif (!gL || !img || !data) {\n \t\treturn -1;\ndiff --git a/handlers/flash_handler.c b/handlers/flash_handler.c\nindex 081c2a4..ff27aa7 100644\n--- a/handlers/flash_handler.c\n+++ b/handlers/flash_handler.c\n@@ -312,6 +312,7 @@ static int install_flash_image(struct img_type *img,\n \tchar filename[64];\n \tint mtdnum;\n \tint n;\n+\tconst char* TMPDIR = get_tmpdir();\n \n \tn = snprintf(filename, sizeof(filename), \"%s%s\", TMPDIR, img->fname);\n \tif (n < 0 || n >= sizeof(filename)) {\ndiff --git a/handlers/lua_scripthandler.c b/handlers/lua_scripthandler.c\nindex a3df317..1793878 100644\n--- a/handlers/lua_scripthandler.c\n+++ b/handlers/lua_scripthandler.c\n@@ -44,9 +44,11 @@ static int start_lua_script(struct img_type *img, void *data)\n \tint ret;\n \tconst char *fnname;\n \tconst char *output;\n-\tchar filename[64];\n \tscript_fn scriptfn;\n \tlua_State *L = luaL_newstate(); /* opens Lua */\n+\tconst char* TMPDIR = get_tmpdir();\n+\tchar filename[MAX_IMAGE_FNAME + strlen(TMPDIR) +\n+\t\tstrlen(SCRIPTS_DIR_SUFFIX) + 2];\n \n \tif (!data)\n \t\treturn -1;\n@@ -65,7 +67,8 @@ static int start_lua_script(struct img_type *img, void *data)\n \t\treturn 0;\n \t}\n \n-\tsnprintf(filename, sizeof(filename), \"%s%s\", TMPDIR, img->fname);\n+\tsnprintf(filename, sizeof(filename),\n+\t\t\"%s%s%s\", TMPDIR, SCRIPTS_DIR_SUFFIX, img->fname);\n \tTRACE(\"Calling Lua %s\", filename);\n \n \tluaL_openlibs(L); /* opens the standard libraries */\n",
    "prefixes": [
        "V2"
    ]
}