[cli/lfs] Fix cleanup deleting in-use manifests using new naming convention

This commit is contained in:
derrod 2022-05-31 13:25:56 +02:00
parent 823d672c2c
commit 2b71b50d5c
2 changed files with 5 additions and 3 deletions

View file

@ -1893,8 +1893,8 @@ class LegendaryCLI:
if not args.keep_manifests:
logger.debug('Removing manifests...')
installed = [(ig.app_name, ig.version) for ig in self.core.get_installed_list()]
installed.extend((ig.app_name, ig.version) for ig in self.core.get_installed_dlc_list())
installed = [(ig.app_name, ig.version, ig.platform) for ig in self.core.get_installed_list()]
installed.extend((ig.app_name, ig.version, ig.platform) for ig in self.core.get_installed_dlc_list())
self.core.lgd.clean_manifests(installed)
logger.debug('Removing tmp data')

View file

@ -263,7 +263,9 @@ class LGDLFS:
self.log.warning(f'Failed to delete file "{f}": {e!r}')
def clean_manifests(self, in_use):
in_use_files = set(f'{clean_filename(f"{app_name}_{version}")}.manifest' for app_name, version in in_use)
in_use_files = set(f'{clean_filename(f"{app_name}_{version}")}.manifest' for app_name, version, _ in in_use)
in_use_files |= set(f'{clean_filename(f"{app_name}_{platform}_{version}")}.manifest'
for app_name, version, platform in in_use)
for f in os.listdir(os.path.join(self.path, 'manifests')):
if f not in in_use_files:
try: