From: Maxim Uvarov Date: Tue, 17 Apr 2012 18:16:31 +0000 (-0700) Subject: git-changelog: parse Oracle bug X-Git-Tag: v2.6.39-400.9.0~426^2~13 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7ee4b2c21d0e70d9bfec46176cb9abb7800df8ee;p=users%2Fjedix%2Flinux-maple.git git-changelog: parse Oracle bug Some commits has Orabug or Oracle bug not at first line, this patch fixed it. Signed-off-by: Maxim Uvarov --- diff --git a/scripts/git-changelog b/scripts/git-changelog index b1ff75c67f93..16da0446c6a8 100755 --- a/scripts/git-changelog +++ b/scripts/git-changelog @@ -56,12 +56,25 @@ class ChangeLog: "--pretty=format:%b", commit], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() - - ret = proc[0].strip('\n').split('\n') - if len(ret[0]) > 0 and len(ret[0]) > 7 and ret[0].find("Orabug") != -1: - return "[%s]" % ret[0] - else: - return "" + bugz = [] + m = re.search("Orabug:.*$", proc[0], re.MULTILINE) + if m: + bugz.append(m.group()) + ret = "" + if len(bugz) > 0: + for bug in bugz: + ret += "%s " % bug + bugz = [] + m = re.search("Oracle bug:.*$", proc[0], re.MULTILINE) + if m: + bugz.append(m.group()) + if len(bugz) > 0: + for bug in bugz: + ret += "%s " % bug + if len(ret) > 0: + return "[%s]" % ret.rstrip() + else: + return ret def _get_cve(self, commit): proc = subprocess.Popen(['git', 'log', '-1',