about summary refs log tree commit diff
path: root/pkgs/applications/networking/browsers
diff options
context:
space:
mode:
authorMichael Weiss <dev.primeos@gmail.com>2021-07-16 12:14:45 +0200
committerMichael Weiss <dev.primeos@gmail.com>2021-07-16 12:24:26 +0200
commit3e93811d93b2bc88f047e9a989b456ab3ae3291c (patch)
treecb0391d66770b07a3eb3ab6978bc89ea068a15f8 /pkgs/applications/networking/browsers
parentd38d4e060b01ff330197a29149b230364599d646 (diff)
chromium: get-commit-message.py: Improve the parsing
The current stable release announcement [0] uses more HTML tags which
broke the detection of "fixes" and "zero_days". Proper HTML parsing
could be done using html.parser [1] but for our purposes the naive regex
trick works well enough.

[0]: https://chromereleases.googleblog.com/2021/07/stable-channel-update-for-desktop.html
[1]: https://docs.python.org/3/library/html.parser.html
Diffstat (limited to 'pkgs/applications/networking/browsers')
-rwxr-xr-xpkgs/applications/networking/browsers/chromium/get-commit-message.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/applications/networking/browsers/chromium/get-commit-message.py b/pkgs/applications/networking/browsers/chromium/get-commit-message.py
index 2768e31bd0325..7a91b74c83d57 100755
--- a/pkgs/applications/networking/browsers/chromium/get-commit-message.py
+++ b/pkgs/applications/networking/browsers/chromium/get-commit-message.py
@@ -19,14 +19,14 @@ for entry in feed.entries:
         continue
     url = requests.get(entry.link).url.split('?')[0]
     content = entry.content[0].value
+    content = html_tags.sub('', content)  # Remove any HTML tags
     if re.search(r'Linux', content) is None:
         continue
     #print(url)  # For debugging purposes
     version = re.search(r'\d+(\.\d+){3}', content).group(0)
     print('chromium: TODO -> ' + version)
     print('\n' + url)
-    if fixes := re.search(r'This update includes .+ security fixes\.', content):
-        fixes = html_tags.sub('', fixes.group(0))
+    if fixes := re.search(r'This update includes .+ security fixes\.', content).group(0):
         zero_days = re.search(r'Google is aware( of reports)? that .+ in the wild\.', content)
         if zero_days:
             fixes += " " + zero_days.group(0)