Preserve all version fields (#286)
Up to now extra version fields were ignored: only name and date fields were accepted. This changes that by retaining the full JSON data when reading the file, making it possible in the future to support custom fields. This also fixes a bug with versions having released on the same date: they was not ordered as expected (reverse order).
This commit is contained in:
@@ -75,10 +75,8 @@ for product_name in VERSION_PATTERNS:
|
||||
date = dates.parse_date(date_str)
|
||||
for version_pattern in VERSION_PATTERNS[product.name]:
|
||||
for version in version_pattern.findall(version_text):
|
||||
if not product.has_version(version):
|
||||
if not product.has_version(version) or product.get_version(version).date() > date:
|
||||
product.declare_version(version, date)
|
||||
elif product.get_version_date(version) > date:
|
||||
product.replace_version(version, date)
|
||||
else:
|
||||
logging.info(f"ignoring version {version} ({date}) for {product.name}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user