[arch] fix: not caching the 'LastModified' field of installed AUR dependencies

This commit is contained in:
Vinicius Moreira
2022-05-27 12:09:45 -03:00
parent 7875529fb6
commit d55bb2bb32
2 changed files with 27 additions and 7 deletions

View File

@@ -46,6 +46,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- AUR: - AUR:
- build: error raised when the temporary directory does not exist (when changing the CPUs governors) - build: error raised when the temporary directory does not exist (when changing the CPUs governors)
- date parsing when checking for updates - date parsing when checking for updates
- not caching the 'LastModified' field of installed AUR dependencies (could lead to wrong display updates)
- Flatpak - Flatpak
- not all selected runtime partials to upgrade are actually requested to be upgraded - not all selected runtime partials to upgrade are actually requested to be upgraded

View File

@@ -1913,14 +1913,33 @@ class ArchManager(SoftwareManager, SettingsController):
else: else:
return repo_dep_names return repo_dep_names
for aur_context in aur_deps_context: if aur_deps_context:
installed = self._install_from_aur(aur_context) aur_deps_info = self.aur_client.get_info((c.name for c in aur_deps_context))
aur_deps_data = None
if not installed: if aur_deps_info:
return {aur_context.name} aur_deps_data = {data['Name']: data for data in aur_deps_info}
else:
progress += progress_increment for aur_context in aur_deps_context:
self._update_progress(context, progress) if aur_deps_data:
dep_data = aur_deps_data.get(aur_context.name)
if dep_data:
last_modified = dep_data.get('LastModified')
if last_modified and isinstance(last_modified, int):
aur_context.last_modified = last_modified
else:
self.logger.warning(f"No valid 'LastModified' field returned for AUR package "
f"'{context.name}': {last_modified}")
installed = self._install_from_aur(aur_context)
if not installed:
return {aur_context.name}
else:
progress += progress_increment
self._update_progress(context, progress)
self._update_progress(context, 100) self._update_progress(context, 100)