diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-wincomponents b/tools/linuxfs/overlay/usr/local/bin/droiddeck-wincomponents index cd2b44d55d..e2267bdc64 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-wincomponents +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-wincomponents @@ -507,8 +507,7 @@ def component_guests(compat, proton, machines, planned, owned): for rel, src in planned: if top_dll(rel) and (plain_x64(src) or machine_compatible(src, machines["system32"][1])): final[rel.lower()] = (rel, src) - planned_rels = {rel.lower() for rel, src in planned} - removed = {rel.lower(): rel for rel in owned if rel.lower() not in planned_rels and top_dll(rel)} + removed = {rel.lower(): rel for rel in owned if rel.lower() not in final and top_dll(rel)} names = {Path(rel).name for rel, src in final.values() if plain_x64(src)} replaced = {key for key, (rel, src) in final.items() if not plain_x64(src)} try: diff --git a/tools/tests/test_wincomponents.py b/tools/tests/test_wincomponents.py index d69eef4dc6..ee58274996 100644 --- a/tools/tests/test_wincomponents.py +++ b/tools/tests/test_wincomponents.py @@ -197,6 +197,18 @@ class WinComponentsTest(unittest.TestCase): self.apply(proton) self.assertFalse((self.pfx / "system32/d3dcompiler_43.dll").exists()) + def test_owned_x64_importer_with_a_rejected_new_source_does_not_keep_its_dependency(self): + proton = self.proton() + self.component("d3dx9", ["d3dx9_43"], {"system32/d3dx9_43.dll": self.pe_image(0x8664)}) + self.component("d3dcompiler", ["d3dcompiler_43"], {"system32/d3dcompiler_43.dll": self.pe_image(0x8664)}) + self.pick("d3dx9", "d3dcompiler") + self.apply(proton) + self.assertEqual(MODULE["pe_machine"](self.pfx / "system32/d3dcompiler_43.dll"), 0x8664) + (self.store / "d3dx9/system32/d3dx9_43.dll").write_bytes(pe_image_importing(0x14C)) + self.apply(proton) + self.assertFalse((self.pfx / "system32/d3dx9_43.dll").exists()) + self.assertFalse((self.pfx / "system32/d3dcompiler_43.dll").exists()) + def test_held_component_files_still_count_as_x64_importers(self): proton = self.proton() self.component("d3dx9", ["d3dx9_43"], {"system32/d3dx9_43.dll": self.pe_image(0x8664)})