mirror of
https://github.com/derrod/legendary.git
synced 2024-12-31 12:05:27 +00:00
[core] Only attempt to delete untagged files that exist
This commit is contained in:
parent
f42d63767c
commit
1a015a3ba7
|
@ -960,11 +960,15 @@ class LegendaryCore:
|
||||||
if '' not in tags:
|
if '' not in tags:
|
||||||
tags.append('')
|
tags.append('')
|
||||||
|
|
||||||
filelist = [i.filename for i in manifest.file_manifest_list.elements if not any(
|
# Create list of files that are now no longer needed *and* actually exist on disk
|
||||||
(fit in i.install_tags) or (not fit and not i.install_tags) for fit in tags
|
filelist = [
|
||||||
)]
|
fm.filename for fm in manifest.file_manifest_list.elements if
|
||||||
if not delete_filelist(installed_game.install_path, filelist, silent=True):
|
not any(((fit in fm.install_tags) or (not fit and not fm.install_tags)) for fit in tags)
|
||||||
self.log.debug(f'Deleting some deselected files failed, but that\'s okay.')
|
and os.path.exists(os.path.join(installed_game.install_path, fm.filename))
|
||||||
|
]
|
||||||
|
|
||||||
|
if not delete_filelist(installed_game.install_path, filelist):
|
||||||
|
self.log.warning(f'Deleting some deselected files failed, please check/remove manually.')
|
||||||
|
|
||||||
def prereq_installed(self, app_name):
|
def prereq_installed(self, app_name):
|
||||||
igame = self.lgd.get_installed_game(app_name)
|
igame = self.lgd.get_installed_game(app_name)
|
||||||
|
|
Loading…
Reference in a new issue