chromium: Make get-commit-message.py more robust

Not all updates contain security fixes.
This commit is contained in:
Michael Weiss 2021-03-07 12:04:12 +01:00
parent 9279d307f3
commit 17c4f6fa36
No known key found for this signature in database
GPG Key ID: 5BE487C4D4771D83

View File

@ -21,15 +21,15 @@ for entry in feed.entries:
continue continue
#print(url) # For debugging purposes #print(url) # For debugging purposes
version = re.search(r'\d+(\.\d+){3}', content).group(0) version = re.search(r'\d+(\.\d+){3}', content).group(0)
fixes = re.search(r'This update includes .+ security fixes\.', content).group(0) print('chromium: TODO -> ' + version)
fixes = html_tags.sub('', fixes) print('\n' + url)
zero_days = re.search(r'Google is aware of reports that .+ in the wild\.', content) if fixes := re.search(r'This update includes .+ security fixes\.', content):
if zero_days: fixes = html_tags.sub('', fixes.group(0))
fixes += " " + zero_days.group(0) zero_days = re.search(r'Google is aware of reports that .+ in the wild\.', content)
cve_list = re.findall(r'CVE-[^: ]+', content) if zero_days:
cve_string = ' '.join(cve_list) fixes += " " + zero_days.group(0)
print('chromium: TODO -> ' + version + '\n') print('\n' + '\n'.join(textwrap.wrap(fixes, width=72)))
print(url + '\n') if cve_list := re.findall(r'CVE-[^: ]+', content):
print('\n'.join(textwrap.wrap(fixes, width=72)) + '\n') cve_string = ' '.join(cve_list)
print("CVEs:\n" + '\n'.join(textwrap.wrap(cve_string, width=72))) print("\nCVEs:\n" + '\n'.join(textwrap.wrap(cve_string, width=72)))
break # We only care about the most recent stable channel update break # We only care about the most recent stable channel update