Switch haproxy to all changelogs

This commit is contained in:
Nemo
2022-05-24 18:09:14 +05:30
parent dd4d932fc7
commit 869a866e7e
3 changed files with 132 additions and 19 deletions

View File

@@ -3,18 +3,20 @@ import re
import urllib.request
# https://regex101.com/r/1JCnFC/1
URL = "https://www.haproxy.org/download/2.6/src/CHANGELOG"
REGEX = r'^(\d{4})\/(\d{2})\/(\d{2})\s+:\s+(\d+\.\d+\.\d.?)$'
list = {}
with urllib.request.urlopen(URL) as response:
for line in response:
m = re.match(REGEX, line.decode('utf-8'))
if m:
year,month,date,version = m.groups()
abs_date = "%s-%s-%s" % (year, month, date)
list[abs_date] = version
for i in range(17, 27):
url = "https://www.haproxy.org/download/%s/src/CHANGELOG" % (i/10)
print(url)
with urllib.request.urlopen(url) as response:
for line in response:
m = re.match(REGEX, line.decode('utf-8'))
if m:
year,month,date,version = m.groups()
abs_date = "%s-%s-%s" % (year, month, date)
list[abs_date] = version
with open('releases/haproxy.json', 'w') as f:
f.write(json.dumps(list, indent=2))