mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-21 17:17:51 -06:00
fix: say when a RetroPie help is updated in part
This commit is contained in:
1 parent
144cd46df1
commit
6a5b384e02
2 files changed
+28
-11
No files matched your search
@@ -336,6 +336,8 @@ class Exporter(BaseExporter):
|
|||||||
systems_of.setdefault(str(name).lower(), set()).add(fe.native_system)
|
systems_of.setdefault(str(name).lower(), set()).add(fe.native_system)
|
||||||
known = set(systems_of)
|
known = set(systems_of)
|
||||||
self._skipped: dict[str, list[str]] = {}
|
self._skipped: dict[str, list[str]] = {}
|
||||||
|
# Rewritten, with a file of a system no clause lists left out.
|
||||||
|
self._partial: list[str] = []
|
||||||
self._named: set[int] = set()
|
self._named: set[int] = set()
|
||||||
produced: dict[str, str] = {}
|
produced: dict[str, str] = {}
|
||||||
|
|
||||||
@@ -400,12 +402,11 @@ class Exporter(BaseExporter):
|
|||||||
homes.setdefault(owners[0], []).append(fe)
|
homes.setdefault(owners[0], []).append(fe)
|
||||||
else:
|
else:
|
||||||
homeless = True
|
homeless = True
|
||||||
if homeless:
|
# No enumeration of that system to extend, and a sentence we
|
||||||
# No enumeration of that system to extend, and a sentence we
|
# would have to write ourselves is a documentation change, not a
|
||||||
# would have to write ourselves is a documentation change,
|
# correction. With nothing placed the package is left as is.
|
||||||
# not a correction.
|
|
||||||
skip("whose help text lists no files of that system to add to", module_id)
|
|
||||||
if not homes:
|
if not homes:
|
||||||
|
skip("whose help text lists no files of that system to add to", module_id)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
added = sum(len(self._in_search_order(fes)) for fes in homes.values())
|
added = sum(len(self._in_search_order(fes)) for fes in homes.values())
|
||||||
@@ -428,6 +429,8 @@ class Exporter(BaseExporter):
|
|||||||
f'rp_module_help="{new_help}"',
|
f'rp_module_help="{new_help}"',
|
||||||
1,
|
1,
|
||||||
)
|
)
|
||||||
|
if homeless:
|
||||||
|
self._partial.append(module_id)
|
||||||
|
|
||||||
return produced
|
return produced
|
||||||
|
|
||||||
@@ -454,12 +457,20 @@ class Exporter(BaseExporter):
|
|||||||
) -> str:
|
) -> str:
|
||||||
"""Packages are the unit here, not file entries."""
|
"""Packages are the unit here, not file entries."""
|
||||||
skipped: dict[str, list[str]] = getattr(self, "_skipped", {})
|
skipped: dict[str, list[str]] = getattr(self, "_skipped", {})
|
||||||
|
|
||||||
|
def shown(modules: list[str]) -> str:
|
||||||
|
names = ", ".join(sorted(modules)[:4])
|
||||||
|
return names + (f" and {len(modules) - 4} more" if len(modules) > 4 else "")
|
||||||
|
|
||||||
parts = [f"{len(produced)} packages updated"]
|
parts = [f"{len(produced)} packages updated"]
|
||||||
|
partial = getattr(self, "_partial", [])
|
||||||
|
if partial:
|
||||||
|
parts.append(
|
||||||
|
f"Updated in part: {shown(partial)}, whose help text lists no files "
|
||||||
|
"of one of their systems to add to"
|
||||||
|
)
|
||||||
for reason, modules in sorted(skipped.items()):
|
for reason, modules in sorted(skipped.items()):
|
||||||
shown = ", ".join(sorted(modules)[:4])
|
parts.append(f"Left as is: {shown(modules)}, {reason}")
|
||||||
if len(modules) > 4:
|
|
||||||
shown += f" and {len(modules) - 4} more"
|
|
||||||
parts.append(f"Left as is: {shown}, {reason}")
|
|
||||||
return ". ".join(parts)
|
return ". ".join(parts)
|
||||||
|
|
||||||
def validate(
|
def validate(
|
||||||
|
|||||||
@@ -801,14 +801,20 @@ class SearchOrder(unittest.TestCase):
|
|||||||
longest = ('rp_module_id="xm7"\nrp_module_help="Copy bios files '
|
longest = ('rp_module_id="xm7"\nrp_module_help="Copy bios files '
|
||||||
+ ", ".join(f"n{i}.rom" for i in range(12)) + ' and n12.rom to $biosdir"\n')
|
+ ", ".join(f"n{i}.rom" for i in range(12)) + ' and n12.rom to $biosdir"\n')
|
||||||
exporter = discover_exporters()["retropie"]()
|
exporter = discover_exporters()["retropie"]()
|
||||||
produced = exporter.render(
|
written = exporter.render(
|
||||||
systems, None,
|
systems, None,
|
||||||
{"scriptmodules/libretrocores/lr-flycast.sh": script,
|
{"scriptmodules/libretrocores/lr-flycast.sh": script,
|
||||||
"scriptmodules/emulators/xm7.sh": longest},
|
"scriptmodules/emulators/xm7.sh": longest},
|
||||||
)["scriptmodules/libretrocores/lr-flycast.sh"]
|
)
|
||||||
|
produced = written["scriptmodules/libretrocores/lr-flycast.sh"]
|
||||||
self.assertIn("Dreamcast BIOS file dc_boot.bin to", produced)
|
self.assertIn("Dreamcast BIOS file dc_boot.bin to", produced)
|
||||||
self.assertIn("BIOS files naomi.zip, awbios.zip and naomi2.zip to", produced)
|
self.assertIn("BIOS files naomi.zip, awbios.zip and naomi2.zip to", produced)
|
||||||
self.assertNotIn("other.zip", produced)
|
self.assertNotIn("other.zip", produced)
|
||||||
|
# Rewritten for naomi2.zip, other.zip left out: the summary said
|
||||||
|
# "Left as is" of a package in the diff.
|
||||||
|
outcome = exporter.outcome(systems, written)
|
||||||
|
self.assertIn("Updated in part: lr-flycast,", outcome)
|
||||||
|
self.assertNotIn("Left as is: lr-flycast", outcome)
|
||||||
|
|
||||||
def test_cores_that_disagree_keep_the_best_rank(self):
|
def test_cores_that_disagree_keep_the_best_rank(self):
|
||||||
"""Nothing is dropped on the rank here, so the best one wins.
|
"""Nothing is dropped on the rank here, so the best one wins.
|
||||||
|
|||||||
Reference in new issue
Block a user