From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bin Meng Date: Fri, 11 Dec 2015 02:55:46 -0800 Subject: [U-Boot] [PATCH 03/10] tools: microcode-tool: Support parsing header file with a license block In-Reply-To: <1449831353-933-1-git-send-email-bmeng.cn@gmail.com> References: <1449831353-933-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <1449831353-933-4-git-send-email-bmeng.cn@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de The microcode header files in the Intel Chief River FSP package have a license comment block. Update the microcode-tool to support parsing it and extract the license text to the .dtsi file. Signed-off-by: Bin Meng --- tools/microcode-tool.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/microcode-tool.py b/tools/microcode-tool.py index 71c2e91..790c27e 100755 --- a/tools/microcode-tool.py +++ b/tools/microcode-tool.py @@ -95,9 +95,23 @@ def ParseHeaderFiles(fname_list): name = os.path.splitext(name)[0] data = [] with open(fname) as fd: + license_start = False + license_end = False for line in fd: line = line.rstrip() + if len(line) >= 2: + if line[0] == '/' and line[1] == '*': + license_start = True + continue + if line[0] == '*' and line[1] == '/': + license_end = True + continue + if license_start and not license_end: + # Ignore blank line + if len(line) > 0: + license_text.append(line) + continue # Omit anything after the last comma words = line.split(',')[:-1] data += [word + ',' for word in words] -- 1.8.2.1