Patch Detail
Show a patch.
GET /api/1.1/patches/2860/?format=api
{ "id": 2860, "url": "https://patchwork.libcamera.org/api/1.1/patches/2860/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2860/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20200220165704.23600-2-kieran.bingham@ideasonboard.com>", "date": "2020-02-20T16:56:59", "name": "[libcamera-devel,v3,1/6] libcamera: utils: Add an internal dirname helper", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "42c2f3aa520dbfd7a408a1ed69bb089f5139fbf0", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/1.1/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/2860/mbox/", "series": [ { "id": 688, "url": "https://patchwork.libcamera.org/api/1.1/series/688/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=688", "date": "2020-02-20T16:56:58", "name": "Support loading IPAs from the build tree", "version": 3, "mbox": "https://patchwork.libcamera.org/series/688/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2860/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2860/checks/", "tags": {}, "headers": { "Return-Path": "<kieran.bingham@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 02537625B1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 20 Feb 2020 17:57:08 +0100 (CET)", "from localhost.localdomain\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 76925E7C;\n\tThu, 20 Feb 2020 17:57:07 +0100 (CET)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1582217827;\n\tbh=7KuIpS0hSgzefw/xKnhDvgRgggJ1uIYE/5Q7Ei2GHqU=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=XKzs1Xg2azfQHel+irIedj5OBhFUFk7m6IJfiP5elAaIyPYLjcZBplChndVuYIdCg\n\t3igb+eagF1HEOlI3fbAqh9lv2LbW3laG0L3GtC4WYU3znb0oGNQdv+mzu/ALq96rq1\n\t3EvSFnFuVJ6IzyXGHfiwMoTuh0DsSgfag6t+GNVk=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "libcamera devel <libcamera-devel@lists.libcamera.org>", "Date": "Thu, 20 Feb 2020 16:56:59 +0000", "Message-Id": "<20200220165704.23600-2-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20200220165704.23600-1-kieran.bingham@ideasonboard.com>", "References": "<20200220165704.23600-1-kieran.bingham@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 1/6] libcamera: utils: Add an internal\n\tdirname helper", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "X-List-Received-Date": "Thu, 20 Feb 2020 16:57:08 -0000" }, "content": "Provide a wrapped dirname call which returns a std::string.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/libcamera/include/utils.h | 1 +\n src/libcamera/utils.cpp | 17 +++++++++++++++++\n 2 files changed, 18 insertions(+)", "diff": "diff --git a/src/libcamera/include/utils.h b/src/libcamera/include/utils.h\nindex 080ea6614de0..940597760ee2 100644\n--- a/src/libcamera/include/utils.h\n+++ b/src/libcamera/include/utils.h\n@@ -33,6 +33,7 @@ namespace utils {\n const char *basename(const char *path);\n \n char *secure_getenv(const char *name);\n+std::string dirname(const std::string &path);\n \n template<class InputIt1, class InputIt2>\n unsigned int set_overlap(InputIt1 first1, InputIt1 last1,\ndiff --git a/src/libcamera/utils.cpp b/src/libcamera/utils.cpp\nindex 453e3b3b5995..3fd3aeaf822a 100644\n--- a/src/libcamera/utils.cpp\n+++ b/src/libcamera/utils.cpp\n@@ -70,6 +70,23 @@ char *secure_getenv(const char *name)\n #endif\n }\n \n+/**\n+ * \\brief identify the dirname portion of a path\n+ * \\param[in] path The full path to parse\n+ *\n+ * \\returns A string of the directory component of the path\n+ */\n+std::string dirname(const std::string &path)\n+{\n+\tsize_t pos = path.rfind('/', path.length());\n+\n+\tif (pos != std::string::npos) {\n+\t\treturn (path.substr(0, pos));\n+\t}\n+\n+\treturn path;\n+}\n+\n /**\n * \\fn libcamera::utils::set_overlap(InputIt1 first1, InputIt1 last1,\n *\t\t\t\t InputIt2 first2, InputIt2 last2)\n", "prefixes": [ "libcamera-devel", "v3", "1/6" ] }