[aur] initial implementation to determine the best update order

This commit is contained in:
Vinícius Moreira
2020-02-05 18:46:55 -03:00
parent a11f418759
commit a10851a16f
11 changed files with 260 additions and 11 deletions

View File

@@ -12,6 +12,7 @@ from bauh.api.abstract.disk import DiskCacheLoader
from bauh.api.abstract.handler import ProcessWatcher
from bauh.api.abstract.model import SoftwarePackage, PackageUpdate, PackageHistory, PackageSuggestion, PackageAction
from bauh.api.abstract.view import FormComponent, ViewComponent
from build.lib.bauh.api.abstract.controller import SoftwareManager
class SearchResult:
@@ -82,6 +83,14 @@ class SoftwareManager(ABC):
if pkg.supports_disk_cache() and os.path.exists(pkg.get_disk_cache_path()):
shutil.rmtree(pkg.get_disk_cache_path())
def sort_update_order(self, pkgs: List[SoftwarePackage]) -> List[SoftwarePackage]:
"""
sorts the best order to perform the update of some packages
:param pkgs:
:return:
"""
return pkgs
@abstractmethod
def update(self, pkg: SoftwarePackage, root_password: str, watcher: ProcessWatcher) -> bool:
"""