From patchwork Thu May 27 09:27:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 12445 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id D9AC5C3203 for ; Thu, 27 May 2021 09:27:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 40EBA68924; Thu, 27 May 2021 11:27:56 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="n9QJMXUe"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A74FB602AA for ; Thu, 27 May 2021 11:27:54 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 19FA6B2C; Thu, 27 May 2021 11:27:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1622107674; bh=2DFVoe6lWM0spw16QQoM2HNR6zY1KS3BwD15JnOnHbg=; h=From:To:Cc:Subject:Date:From; b=n9QJMXUeFbuc+g6U368We2h9yTiH145dwttYtOM4vd+qQCDCMRGasWNs/2XOel61a HXOK0zn6mWCOnFNgT76iK/HZaPyAfNYj0ivUz/KF1L8sMWPd5245uXRmVsOuctOxF+ JX/48TGl3fDQjs7/WilHmoHeo5TP4dvJr3acA9NQ= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 27 May 2021 18:27:43 +0900 Message-Id: <20210527092743.1347857-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] utils: ipc: extract-docs: Extract the SPDX header if it exists X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Take the SPDX header from the mojom file, if it exists. Otherwise default to LGPL-2.1+ as before. Signed-off-by: Paul Elder --- utils/ipc/extract-docs.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/utils/ipc/extract-docs.py b/utils/ipc/extract-docs.py index 56566ce0..b617b6fa 100755 --- a/utils/ipc/extract-docs.py +++ b/utils/ipc/extract-docs.py @@ -12,6 +12,7 @@ import sys regex_block_start = re.compile('^\/\*\*$') regex_block_end = re.compile('^ \*\/$') +regex_spdx = re.compile('^\/\* SPDX-License-Identifier: .* \*\/$') def main(argv): @@ -28,8 +29,13 @@ def main(argv): lines = open(args.input, 'r').readlines() pipeline = args.input.split('/')[-1].replace('.mojom', '') - data = f'''\ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ + + if regex_spdx.match(lines[0]): + data = lines[0] + else: + data = '/* SPDX-License-Identifier: LGPL-2.1-or-later */' + + data += f'''\ /* * Copyright (C) 2021, Google Inc. *