diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d11310a..ea910121 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - AUR: - build: error raised when the temporary directory does not exist (when changing the CPUs governors) - date parsing when checking for updates + - not caching the 'LastModified' field of installed AUR dependencies (could lead to wrong display updates) - Flatpak - not all selected runtime partials to upgrade are actually requested to be upgraded diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index b404ab57..a54809d0 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -1913,14 +1913,33 @@ class ArchManager(SoftwareManager, SettingsController): else: return repo_dep_names - for aur_context in aur_deps_context: - installed = self._install_from_aur(aur_context) + if aur_deps_context: + aur_deps_info = self.aur_client.get_info((c.name for c in aur_deps_context)) + aur_deps_data = None - if not installed: - return {aur_context.name} - else: - progress += progress_increment - self._update_progress(context, progress) + if aur_deps_info: + aur_deps_data = {data['Name']: data for data in aur_deps_info} + + for aur_context in aur_deps_context: + 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)