Align custom scripts with generic scripts, making them configurable. This has a few advantages: - script code is more unified, - no more hard-coded method names in scripts, which is less error prone and make it easier to rename scripts, - no more hard coded product names in scripts, which is less error prone and make it easier to rename products, - less hard-coded URLs and regexes in scripts, which makes auto-configuration more expressive / updatable, Also added method `endoflife.list_configs_from_argv()` so that it is easier to manipulate scripts arguments.
25 lines
989 B
Python
25 lines
989 B
Python
from common import dates, endoflife, releasedata
|
|
from common.git import Git
|
|
|
|
"""Fetches Apache HTTP Server versions and release date from its git repository
|
|
by looking at the STATUS file of each <major>.<minor>.x branch."""
|
|
|
|
for config in endoflife.list_configs_from_argv():
|
|
with releasedata.ProductData(config.product) as product_data:
|
|
git = Git(config.url)
|
|
git.setup()
|
|
|
|
for branch in git.list_branches("refs/heads/?.?.x"):
|
|
git.checkout(branch, file_list=["STATUS"])
|
|
|
|
release_notes_file = git.repo_dir / "STATUS"
|
|
if not release_notes_file.exists():
|
|
continue
|
|
|
|
with release_notes_file.open("rb") as f:
|
|
release_notes = f.read().decode("utf-8", errors="ignore")
|
|
|
|
for pattern in config.include_version_patterns:
|
|
for (version, date_str) in pattern.findall(release_notes):
|
|
product_data.declare_version(version, dates.parse_date(date_str))
|