{"id":12470,"url":"https://patchwork.libcamera.org/api/patches/12470/?format=json","web_url":"https://patchwork.libcamera.org/patch/12470/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210528104824.2978880-1-paul.elder@ideasonboard.com>","date":"2021-05-28T10:48:24","name":"[libcamera-devel,v3] utils: ipc: extract-docs: Extract the SPDX header","commit_ref":"3370b6d0a0dfe1b554865d6e5bb8e20049220bf0","pull_url":null,"state":"accepted","archived":false,"hash":"b0420c4af8aba7ae875db172a1eb018d2861a905","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12470/mbox/","series":[{"id":2091,"url":"https://patchwork.libcamera.org/api/series/2091/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2091","date":"2021-05-28T10:48:24","name":"[libcamera-devel,v3] utils: ipc: extract-docs: Extract the SPDX header","version":3,"mbox":"https://patchwork.libcamera.org/series/2091/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12470/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12470/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id A0614C3205\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 28 May 2021 10:48:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 140186891F;\n\tFri, 28 May 2021 12:48:37 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 22991602AA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 May 2021 12:48:36 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D45EA140E;\n\tFri, 28 May 2021 12:48:33 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"SGswJoJR\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1622198915;\n\tbh=d9g+nTar80H6UA9eTxqAfG4uWrpr8ZV01CH5tzQZGzs=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=SGswJoJRhcqjAsaW7b/3vgC+qCncRpJS9H7SBmr/T8/P8Jq2E6cn5ymo5m95W65fN\n\tVPxkurAarQnWmcs4Z/WspOE2IOxetfcD0Q0Tq8fNmyG1CMEJOZkh8A7BojSaTBaX6m\n\t+HmoK+zGSQZt4/m3/kAEgunHxyL8P523wwkeN5y4=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 28 May 2021 19:48:24 +0900","Message-Id":"<20210528104824.2978880-1-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3] utils: ipc: extract-docs: Extract the\n\tSPDX header","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Take the SPDX header from the mojom file. Error out if the mojom file\nhas no SPDX header.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n---\nChanges in v3:\n- make the if nicer\n\nChanges in v2:\n- Error out if SPDX header is unavailable\n- add newline at end of default SPDX string\n---\n utils/ipc/extract-docs.py | 9 +++++++--\n 1 file changed, 7 insertions(+), 2 deletions(-)","diff":"diff --git a/utils/ipc/extract-docs.py b/utils/ipc/extract-docs.py\nindex 56566ce0..8f7fff9f 100755\n--- a/utils/ipc/extract-docs.py\n+++ b/utils/ipc/extract-docs.py\n@@ -12,6 +12,7 @@ import sys\n \n regex_block_start = re.compile('^\\/\\*\\*$')\n regex_block_end = re.compile('^ \\*\\/$')\n+regex_spdx = re.compile('^\\/\\* SPDX-License-Identifier: .* \\*\\/$')\n \n \n def main(argv):\n@@ -28,8 +29,12 @@ def main(argv):\n \n     lines = open(args.input, 'r').readlines()\n     pipeline = args.input.split('/')[-1].replace('.mojom', '')\n-    data = f'''\\\n-/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+\n+    if not regex_spdx.match(lines[0]):\n+        raise Exception(f'Missing SPDX license header in {args.input}')\n+\n+    data = lines[0]\n+    data += f'''\\\n /*\n  * Copyright (C) 2021, Google Inc.\n  *\n","prefixes":["libcamera-devel","v3"]}