All of lore.kernel.org
 help / color / mirror / Atom feed
From: daniel.sangorrin@toshiba.co.jp (Daniel Sangorrin)
To: cip-dev@lists.cip-project.org
Subject: [cip-dev] [cip-kernel-sec] report_affected: report cip branches
Date: Thu, 20 Jun 2019 15:13:09 +0900	[thread overview]
Message-ID: <20190620061309.1252-1-daniel.sangorrin@toshiba.co.jp> (raw)

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 <module>
    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 <daniel.sangorrin@toshiba.co.jp>
---
 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):
-- 
2.17.1

             reply	other threads:[~2019-06-20  6:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20  6:13 Daniel Sangorrin [this message]
2019-06-20 19:51 ` Ben Hutchings
2019-06-20 20:03   ` Ben Hutchings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190620061309.1252-1-daniel.sangorrin@toshiba.co.jp \
    --to=daniel.sangorrin@toshiba.co.jp \
    --cc=cip-dev@lists.cip-project.org \
    --subject='Re: [cip-dev] [cip-kernel-sec] report_affected: report cip branches' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.