- remove the use of environment variables to get directory paths, - make use of arguments / argparse instead of environment variables in `update.py` and `report.py`, - automatically guess the data directory in `latest.py` based on the script's location, - propagate log level to auto scripts, - move `list_configs_from_argv` from `endoflife` module to `releasedata` module, - use `list_products` in `latest.py` to load the product's frontmatters.
25 lines
980 B
Python
25 lines
980 B
Python
from common import dates, 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 releasedata.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))
|