Merge pull request #243563 from tjni/asterisk-update-fix

asterisk: update the update script version regex
This commit is contained in:
Yorick 2023-07-15 15:54:53 +02:00 committed by GitHub
commit fc66814d6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,14 +7,14 @@ import re, requests, json
import os, sys
from pathlib import Path
URL = "https://downloads.asterisk.org/pub/telephony/asterisk"
URL = "https://downloads.asterisk.org/pub/telephony/asterisk/"
page = requests.get(URL)
changelog = re.compile("^ChangeLog-\d+\.\d+\.\d+$")
changelog = re.compile("^ChangeLog-\d+\.\d+\.\d+\.md$")
changelogs = [a.get_text() for a in BeautifulSoup(page.text, 'html.parser').find_all('a') if changelog.match(a.get_text())]
major_versions = {}
for changelog in changelogs:
v = version.parse(changelog.removeprefix("ChangeLog-"))
v = version.parse(changelog.removeprefix("ChangeLog-").removesuffix(".md"))
major_versions.setdefault(v.major, []).append(v)
out = {}