Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix installer's handling of duplicate directory paths #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions src/pyfomod/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,10 @@ def files(self):
pass
else:
conditional_files.extend(FileInfo.process_files(files, self.path))
file_dict = {} # src -> dst
priority_dict = {} # dst -> priority
for info in required_files + user_files + conditional_files:
if info.destination in priority_dict:
if priority_dict[info.destination] > info.priority:
continue
del file_dict[info.destination]
file_dict[info.destination] = info.source
priority_dict[info.destination] = info.priority
return {b: a for a, b in file_dict.items()}
file_dict = OrderedDict() # src -> dst
for info in sorted(required_files + user_files + conditional_files,key=lambda i:i.priority):
file_dict[info.source] = info.destination
return file_dict

def flags(self):
flag_dict = {}
Expand Down