refactor: one meaning for copy records

A copies record names its files under search_dir, the folder the code
copies from, and passes_to is the target, as the schema and RetroPie,
RetroDECK and AmberELEC already write it. KNULLI listed patches.zip
under the BIOS folder it is copied into, and KNULLI and RetroBat wrote
the target as prose with the condition. The condition of a copy now
goes in depends_on_option. Only launcher records change in knulli.yml
and retrobat.yml.
This commit is contained in:
Abdessamad Derraz committed 2026-11-09 17:58:37 +01:00
1 parent ffad06487c
commit cedeee2254
8 files changed
+105 -64

No files matched your search

+3 -2
View File
@@ -451,8 +451,9 @@ class BiosSites(unittest.TestCase):
(record,) = sites("ryujinx/ryujinxGenerator.py", "fixed_name")
self.assertEqual(record["kind"], "copies")
self.assertEqual(record["names"], ["switch/prod.keys"])
self.assertEqual(record["passes_to"], "copied to /userdata/system/configs/Ryujinx/system/prod.keys")
self.assertNotIn("depends_on_option", record)
self.assertEqual(record["search_dir"], "/userdata/bios")
self.assertEqual(record["passes_to"], "/userdata/system/configs/Ryujinx/system/prod.keys")
self.assertEqual(record["depends_on_option"], "ryujinxKeys.exists()")
def test_a_presence_test_over_a_literal_list(self):
(record,) = sites("dolphin/dolphinGenerator.py", "fixed_name")
+7 -3
View File
@@ -1042,7 +1042,10 @@ class HelpersAndCopies(unittest.TestCase):
)
self.assertEqual(segaboot["kind"], "copies")
self.assertEqual(segaboot["names"], ["triforce/segaboot.gcm", "segaboot.gcm"])
self.assertEqual(segaboot["depends_on_option"], "_triforce, !_crediar")
self.assertEqual(
segaboot["depends_on_option"],
"_triforce, !_crediar, first name found, the target is absent, smaller or older",
)
def test_dosbox_copies_grouped_by_target_folder(self):
sources = _sources(
@@ -1055,16 +1058,17 @@ class HelpersAndCopies(unittest.TestCase):
(
"dosbox-pure",
["MT32_CONTROL.ROM"],
"copied to <emulator>/mt32-roms/<name>, only when the target does not exist",
"<emulator>/mt32-roms/<name>",
),
(
"dosbox-pure",
["Roland_SC-55.sf2"],
"copied to <emulator>/soundfonts/<name>, only when the target does not exist",
"<emulator>/soundfonts/<name>",
),
],
)
self.assertEqual(records[0]["search_dir"], "bios/scummvm/extra")
self.assertEqual(records[0]["depends_on_option"], "the target does not exist")
def test_tsugaru_folder_chain(self):
[record] = rl.tsugaru(_sources(**{f"{G}/Tsugaru.Generator.cs": TSUGARU}))