chore: merge round 2 fixes (pins)

# Conflicts:
#	install.ps1
#	install.sh
This commit is contained in:
Abdessamad Derraz committed 2026-10-21 10:31:09 +02:00
commit fd1d1b7b96
28 files changed
+525 -176

No files matched your search

+4
View File
@@ -537,6 +537,10 @@ def landed_changes(exporter: object, systems: dict) -> LandedChanges:
"added", entry, None, None, _added_fields(exporter, entry)
))
continue
if entry.name and exporter.names_anew(entry):
records.append(_change(
"added", entry, None, None, _added_fields(exporter, entry)
))
# Asked of the exporter: a format that names each entry's cores
# reads every entry of those cores, not only the paired one.
if (
+7
View File
@@ -155,6 +155,13 @@ class BaseExporter(ABC):
the render learned from the platform's own file."""
return self.writable(fe)
def names_anew(self, fe: NativeFile) -> bool:
"""Whether the render wrote, for the first time, a file the platform
layer already declares. Only a format whose unit is not the entry
does: a RetroPie help sentence can lack a name the inherited RetroArch
list carries."""
return False
@classmethod
def writable(cls, fe: NativeFile, require: str = "") -> bool:
"""Whether this format can carry the entry.
+5
View File
@@ -400,6 +400,11 @@ class Exporter(BaseExporter):
return self.writable(fe)
return id(fe) in getattr(self, "_named", set())
def names_anew(self, fe: NativeFile) -> bool:
"""flycast's naomi2.zip is in the RetroArch list RetroPie inherits,
yet no flycast help sentence named it: the render adds it there."""
return fe.platform is not None and id(fe) in getattr(self, "_named", set())
def outcome(
self,
systems: dict[str, NativeSystem],
+39 -7
View File
@@ -916,6 +916,33 @@ def resolve_by_shift(part: PartResult, shifts: dict[str, int]) -> PartResult:
)
def refuse_collapsing_moves(parts: list[PartResult]) -> list[PartResult]:
"""Hold back a recale that would land on another part of the same ref.
Two parts of one source_ref cite two places on purpose. dosbox_pure cited
the SHA-1 line of mt32emu.h and the ROMInfo line that ties it to a file
name, under two repository words: the second was self-checked alone,
found the hash once, and read MOVED onto the first line. Recaling it
would drop the ROMInfo citation without a word, so the part goes to
review instead.
"""
cited = {
(p.part.path, p.part.start, p.part.last)
for p in parts if p.part.start is not None
}
held = []
for part in parts:
target = (part.new_path or part.part.path, part.start, part.end or part.start)
own = (part.part.path, part.part.start, part.part.last)
if part.status in REBASE_STATUSES and target != own and target in cited:
part = replace(
part, status="AMBIGUOUS", candidates=[part.start],
reason="lands on a line another part of this ref already cites",
)
held.append(part)
return held
@dataclass
class EntryReport:
name: str
@@ -1268,14 +1295,19 @@ def reconcile_self_check(
against HEAD rather than self-checked is never rewritten.
"""
eligible = eligible if eligible is not None else [True] * len(parts)
anchored_files = {
part.part.path
for part, ok in zip(parts, eligible)
if ok and part.status == "ANCHORED"
}
# The settled part lies in the tree its anchor was found in: without the
# repository, attribution wrote dosbox-pure-unleashed's ROMInfo line
# under `source`, a repository that carries no mt32emu.h.
anchored_files: dict[str, str | None] = {}
for part, ok in zip(parts, eligible):
if ok and part.status == "ANCHORED":
anchored_files.setdefault(part.part.path, part.repo)
kept = ("ANCHORED", "GONE", "EXTERNAL", "BINARY")
return [
PartResult(part.part, "ANCHORED", None, None, None, [])
PartResult(
part.part, "ANCHORED", None, None, None, [],
repo=anchored_files[part.part.path],
)
if ok and part.status not in kept and part.part.path in anchored_files
else part
for part, ok in zip(parts, eligible)
@@ -1940,7 +1972,7 @@ def build_report(
shifts = dominant_shifts([p for _, _, _, parts in staged for p in parts])
for entry_name, ref, citation, parts in staged:
parts = [resolve_by_shift(p, shifts) for p in parts]
parts = refuse_collapsing_moves([resolve_by_shift(p, shifts) for p in parts])
status = worst_status([p.status for p in parts])
report.entries.append(EntryReport(
entry_name, ref, status, parts, citation.kind, citation.field
+27 -1
View File
@@ -64,7 +64,9 @@ _PARENT: dict[str, str] = {
REGIONS: frozenset[str] = frozenset({WORLD} | set(REGION_TREE) | set(_PARENT))
# Accepted on the CLI and for legacy profile values.
# Accepted on the CLI and for legacy profile values. Every territory also
# answers to its ISO 3166-1 code: `au` alone was unknown, and the closest
# spelling offered first was `auto`, which means world.
ALIASES: dict[str, str] = {
"jp": "japan",
"ntsc-j": "japan",
@@ -78,6 +80,30 @@ ALIASES: dict[str, str] = {
"korea": "south-korea",
"auto": WORLD,
"gb": "uk",
"ca": "canada",
"br": "brazil",
"mx": "mexico",
"ar": "argentina",
"fr": "france",
"de": "germany",
"it": "italy",
"es": "spain",
"nl": "netherlands",
"pt": "portugal",
"gr": "greece",
"pl": "poland",
"ru": "russia",
"se": "sweden",
"no": "norway",
"dk": "denmark",
"fi": "finland",
"cn": "china",
"tw": "taiwan",
"hk": "hong-kong",
"sg": "singapore",
"in": "india",
"au": "australia",
"nz": "new-zealand",
}