[ui] fix: upgrading: only requesting the root password if required | [flatpak] fix -> crashing when trying to downgrade

This commit is contained in:
Vinicius Moreira
2020-12-10 19:15:34 -03:00
parent d435480165
commit bef465a1ea
19 changed files with 213 additions and 132 deletions

View File

@@ -17,7 +17,7 @@ from pkg_resources import parse_version
from bauh.api.abstract.context import ApplicationContext
from bauh.api.abstract.controller import SoftwareManager, SearchResult, UpgradeRequirements, UpgradeRequirement, \
TransactionResult
TransactionResult, SoftwareAction
from bauh.api.abstract.disk import DiskCacheLoader
from bauh.api.abstract.handler import ProcessWatcher, TaskManager
from bauh.api.abstract.model import SoftwarePackage, PackageHistory, PackageUpdate, PackageSuggestion, \
@@ -416,7 +416,8 @@ class AppImageManager(SoftwareManager):
app_tuple = cursor.fetchone()
if not app_tuple:
raise Exception("Could not retrieve {} from the database {}".format(pkg, DB_APPS_PATH))
self.logger.warning("Could not retrieve {} from the database {}".format(pkg, DB_APPS_PATH))
return res
finally:
self._close_connection(DB_APPS_PATH, connection)
@@ -582,7 +583,7 @@ class AppImageManager(SoftwareManager):
def can_work(self) -> bool:
return self._is_sqlite3_available() and self.file_downloader.can_work()
def requires_root(self, action: str, pkg: AppImage):
def requires_root(self, action: SoftwareAction, pkg: AppImage) -> bool:
return False
def prepare(self, task_manager: TaskManager, root_password: str, internet_available: bool):

View File

@@ -14,7 +14,7 @@ appimage.downgrade.first_version={} is in its first published version
appimage.downgrade.impossible.body={} has only one published version.
appimage.downgrade.impossible.title=Impossible to downgrade
appimage.downgrade.install_version=It was not possible to install the version {} ({})
appimage.downgrade.unknown_version.body=It was not possible to identify {} current version in its versions history
appimage.downgrade.unknown_version.body={} current version was not found in its release history
appimage.error.uninstall_current_version=It was not possible to uninstall the current version of {}
appimage.history.0_version=version
appimage.history.1_published_at=date