[arch] fix -> AUR: not displaying all available actions per package after a fresh install

This commit is contained in:
Vinicius Moreira
2020-09-11 14:52:18 -03:00
parent 6095c1a934
commit 1becd281fa

View File

@@ -2348,6 +2348,7 @@ class ArchManager(SoftwareManager):
if res: if res:
pkg.name = install_context.name # changes the package name in case the PKGBUILD was edited pkg.name = install_context.name # changes the package name in case the PKGBUILD was edited
if os.path.exists(pkg.get_disk_data_path()): if os.path.exists(pkg.get_disk_data_path()):
with open(pkg.get_disk_data_path()) as f: with open(pkg.get_disk_data_path()) as f:
data = f.read() data = f.read()
@@ -2376,14 +2377,20 @@ class ArchManager(SoftwareManager):
names=installed_to_load, names=installed_to_load,
internet_available=True).installed internet_available=True).installed
installed.extend(installed_loaded) if installed_loaded:
installed.extend(installed_loaded)
if len(installed_loaded) + 1 != len(install_context.installed): if len(installed_loaded) + 1 != len(install_context.installed):
missing = ','.join({p for p in installed_loaded if p.name not in install_context.installed}) missing = ','.join({p for p in installed_loaded if p.name not in install_context.installed})
self.logger.warning("Could not load all installed packages. Missing: {}".format(missing)) self.logger.warning("Could not load all installed packages. Missing: {}".format(missing))
removed = [*install_context.removed.values()] if install_context.removed else [] removed = [*install_context.removed.values()] if install_context.removed else []
if installed:
downgrade_enabled = self.is_downgrade_enabled()
for p in installed:
p.downgrade_enabled = downgrade_enabled
return TransactionResult(success=res, installed=installed, removed=removed) return TransactionResult(success=res, installed=installed, removed=removed)
def _install_from_repository(self, context: TransactionContext) -> bool: def _install_from_repository(self, context: TransactionContext) -> bool: