From patchwork Thu Jun 20 06:13:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Sangorrin X-Patchwork-Id: 11005939 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C7802112C for ; Thu, 20 Jun 2019 06:13:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2AE228458 for ; Thu, 20 Jun 2019 06:13:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7923284FC; Thu, 20 Jun 2019 06:13:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 32AF528458 for ; Thu, 20 Jun 2019 06:13:24 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 0EF50BA4; Thu, 20 Jun 2019 06:13:24 +0000 (UTC) X-Original-To: cip-dev@lists.cip-project.org Delivered-To: cip-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 34706BA4 for ; Thu, 20 Jun 2019 06:13:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mo-csw.securemx.jp (mo-csw1114.securemx.jp [210.130.202.156]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 6E547E6 for ; Thu, 20 Jun 2019 06:13:21 +0000 (UTC) Received: by mo-csw.securemx.jp (mx-mo-csw1114) id x5K6DCBT031663; Thu, 20 Jun 2019 15:13:12 +0900 X-Iguazu-Qid: 2wHHotYFKI5fjCKzFh X-Iguazu-QSIG: v=2; s=0; t=1561011192; q=2wHHotYFKI5fjCKzFh; m=+fb4saHT1n5JmZyCmpeysTiBPc2pe72tg4JJTeurm8o= Received: from imx12.toshiba.co.jp (imx12.toshiba.co.jp [61.202.160.132]) by relay.securemx.jp (mx-mr1110) id x5K6DBb4027372; Thu, 20 Jun 2019 15:13:12 +0900 Received: from enc02.toshiba.co.jp ([61.202.160.51]) by imx12.toshiba.co.jp with ESMTP id x5K6DBUq023961; Thu, 20 Jun 2019 15:13:11 +0900 (JST) Received: from hop101.toshiba.co.jp ([133.199.85.107]) by enc02.toshiba.co.jp with ESMTP id x5K6DAl3017516; Thu, 20 Jun 2019 15:13:11 +0900 From: Daniel Sangorrin To: ben.hutchings@codethink.co.uk Date: Thu, 20 Jun 2019 15:13:09 +0900 X-TSB-HOP: ON Message-Id: <20190620061309.1252-1-daniel.sangorrin@toshiba.co.jp> X-Mailer: git-send-email 2.17.1 Cc: cip-dev@lists.cip-project.org Subject: [cip-dev] [cip-kernel-sec] report_affected: report cip branches X-BeenThere: cip-dev@lists.cip-project.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: cip-dev-bounces@lists.cip-project.org Errors-To: cip-dev-bounces@lists.cip-project.org X-Virus-Scanned: ClamAV using ClamSMTP Allow reporting on cip branches, instead of returning an error like this one: $ ./scripts/report_affected.py linux-4.4.y-cip Traceback (most recent call last): File "./scripts/report_affected.py", line 105, in args.only_fixed_upstream, args.include_ignored, *args.branches) File "./scripts/report_affected.py", line 33, in main branches.sort(key=kernel_sec.branch.get_sort_key) File "./scripts/kernel_sec/branch.py", line 146, in get_sort_key base_ver = branch['base_ver'] TypeError: 'NoneType' object is not subscriptable Signed-off-by: Daniel Sangorrin --- scripts/kernel_sec/branch.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/scripts/kernel_sec/branch.py b/scripts/kernel_sec/branch.py index fb8785c..828de13 100644 --- a/scripts/kernel_sec/branch.py +++ b/scripts/kernel_sec/branch.py @@ -22,6 +22,7 @@ from . import version _STABLE_BRANCH_RE = re.compile(r'^linux-([\d.]+)\.y$') +_CIP_BRANCH_RE = re.compile(r'^linux-([\d.]+)\.y-cip$') def get_base_ver_stable_branch(base_ver): @@ -34,9 +35,23 @@ def get_base_ver_stable_branch(base_ver): } +def get_base_ver_cip_branch(base_ver): + branch_name = 'linux-%s.y-cip' % base_ver + return { + 'short_name': branch_name, + 'git_remote': 'cip', + 'git_name': branch_name, + 'base_ver': base_ver + } + + def get_stable_branch(branch_name): - match = _STABLE_BRANCH_RE.match(branch_name) - return match and get_base_ver_stable_branch(match.group(1)) + if 'cip' in branch_name: + match = _CIP_BRANCH_RE.match(branch_name) + return match and get_base_ver_cip_branch(match.group(1)) + else: + match = _STABLE_BRANCH_RE.match(branch_name) + return match and get_base_ver_stable_branch(match.group(1)) def _extract_live_stable_branches(doc):