diff options
author | Andrew Eikum <aeikum@codeweavers.com> | 2022-02-09 20:11:11 +0300 |
---|---|---|
committer | Arkadiusz Hiler <ahiler@codeweavers.com> | 2022-06-22 23:00:45 +0300 |
commit | 265c5ffaedc73d309256f32fdf56d1848c94e656 (patch) | |
tree | 9228e6ce98b82d040d4290c91206bf9695e77fae | |
parent | 54c2347e15cc4ebafd6185e26796aafdc96865f8 (diff) |
proton: Better handle broken symlinksproton-6.3-8fproton_6.3
-rwxr-xr-x | proton | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -79,6 +79,9 @@ def file_is_wine_builtin_dll(path): def makedirs(path): try: + #replace broken symlinks with a new directory + if os.path.islink(path) and not file_exists(path, follow_symlinks=True): + os.remove(path) os.makedirs(path) except OSError: #already exists @@ -362,7 +365,7 @@ class CompatData: dirs = [] for f in tracked_files: path = self.prefix_dir + f.strip() - if file_exists(path, follow_symlinks=True): + if file_exists(path, follow_symlinks=False): if os.path.isfile(path) or os.path.islink(path): os.remove(path) else: @@ -527,8 +530,8 @@ class CompatData: if len(rel_dir) > 0: rel_dir = rel_dir + "/" dst_dir = src_dir.replace(g_proton.default_pfx_dir, self.prefix_dir, 1) - if not file_exists(dst_dir, follow_symlinks=False): - os.makedirs(dst_dir) + if not file_exists(dst_dir, follow_symlinks=True): + makedirs(dst_dir) tracked_files.write(rel_dir + "\n") for dir_ in dirs: src_file = os.path.join(src_dir, dir_) @@ -554,8 +557,8 @@ class CompatData: if len(rel_dir) > 0: rel_dir = rel_dir + "/" dst_dir = src_dir.replace(g_proton.default_pfx_dir, self.prefix_dir, 1) - if not file_exists(dst_dir, follow_symlinks=False): - os.makedirs(dst_dir) + if not file_exists(dst_dir, follow_symlinks=True): + makedirs(dst_dir) tracked_files.write(rel_dir + "\n") for file_ in files: src_file = os.path.join(src_dir, file_) @@ -820,9 +823,9 @@ class CompatData: else: nvapi64_dll = self.prefix_dir + "drive_c/windows/system32/nvapi64.dll" nvapi32_dll = self.prefix_dir + "drive_c/windows/syswow64/nvapi.dll" - if file_exists(nvapi64_dll, follow_symlinks=True): + if file_exists(nvapi64_dll, follow_symlinks=False): os.unlink(nvapi64_dll) - if file_exists(nvapi32_dll, follow_symlinks=True): + if file_exists(nvapi32_dll, follow_symlinks=False): os.unlink(nvapi32_dll) # Try to detect known DLLs that ship with the NVIDIA Linux Driver @@ -962,7 +965,7 @@ class Session: lfile_path = basedir + "/steam-" + os.environ["SteamGameId"] + ".log" - if file_exists(lfile_path, follow_symlinks=True): + if file_exists(lfile_path, follow_symlinks=False): os.remove(lfile_path) makedirs(basedir) |