mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-12-02 14:28:54 -06:00
fix: check the tag core_version names, per build
version_basis now answers which tag core_version names for each build mode and repository: the basis tag for a tag basis, core_version otherwise. check_version, the run report and the triage read that answer instead of the raw core_version string, so a describe-form version (armsx2 2.9.2-77-gfc4ab0b) and a mode-keyed one (jgenesis, rpcs3, xemu) can raise the newer and passed release warnings again. A pin at the distance core_version states is not warned about, and a version page is held against the build it announces.
This commit is contained in:
1 parent
14dc75c6fb
commit
2559dfba79
7 files changed
+233
-61
No files matched your search
@@ -111,6 +111,48 @@ def version_repo(
|
||||
return upstream.parse_repo(_by_mode(profile, field, mode) or ""), field
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class VersionTag:
|
||||
"""The tag core_version names for one build mode, and where it lives."""
|
||||
|
||||
mode: str
|
||||
declared: str
|
||||
tag: str
|
||||
distance: int
|
||||
repo: upstream.Repo | None
|
||||
field: str
|
||||
|
||||
|
||||
def version_tags(profile: dict) -> list[VersionTag]:
|
||||
"""Which tag core_version names, for each build mode and repository.
|
||||
|
||||
A tag basis holds the tag apart from core_version, which writes git
|
||||
describe's long form past it (armsx2 2.9.2-77-gfc4ab0b names tag 2.9.2).
|
||||
Any other basis names the tag by core_version itself. Builds naming the
|
||||
same tag in the same repository are one answer.
|
||||
"""
|
||||
found = bases(profile)
|
||||
value = profile.get("core_version")
|
||||
modes = list(found) or ([str(mode) for mode in value] if isinstance(value, dict) else [""])
|
||||
answers: list[VersionTag] = []
|
||||
seen: set[tuple] = set()
|
||||
for mode in modes:
|
||||
stated = declared(profile, mode)
|
||||
if not stated:
|
||||
continue
|
||||
basis = found.get(mode)
|
||||
tag, distance = stated, 0
|
||||
if basis and basis.get("kind") == "tag" and basis.get("tag"):
|
||||
tag, distance = str(basis["tag"]), int(basis.get("distance") or 0)
|
||||
repo, field = version_repo(profile, mode, basis)
|
||||
key = (repo.host, repo.slug) if repo else None, field, stated, tag
|
||||
if key in seen:
|
||||
continue
|
||||
seen.add(key)
|
||||
answers.append(VersionTag(mode, stated, tag, distance, repo, field))
|
||||
return answers
|
||||
|
||||
|
||||
def is_placeholder(value: object) -> bool:
|
||||
"""A VCS or branch word standing for a version, alone or annotated
|
||||
("SVN (2015 snapshot)"). The schema refuses the same strings."""
|
||||
|
||||
Reference in new issue
Block a user