mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
[fix][flatpak] not able to update partials for Flatpak < 1.5
This commit is contained in:
@@ -185,7 +185,17 @@ class FlatpakManager(SoftwareManager):
|
|||||||
self.api_cache.delete(pkg.id)
|
self.api_cache.delete(pkg.id)
|
||||||
|
|
||||||
def update(self, pkg: FlatpakApplication, root_password: str, watcher: ProcessWatcher) -> bool:
|
def update(self, pkg: FlatpakApplication, root_password: str, watcher: ProcessWatcher) -> bool:
|
||||||
return ProcessHandler(watcher).handle(SystemProcess(subproc=flatpak.update(pkg.ref, pkg.installation)))
|
related, deps = False, False
|
||||||
|
ref = pkg.ref
|
||||||
|
|
||||||
|
if pkg.partial and flatpak.get_version() < '1.5':
|
||||||
|
related, deps = True, True
|
||||||
|
ref = pkg.base_ref
|
||||||
|
|
||||||
|
return ProcessHandler(watcher).handle(SystemProcess(subproc=flatpak.update(app_ref=ref,
|
||||||
|
installation=pkg.installation,
|
||||||
|
related=related,
|
||||||
|
deps=deps)))
|
||||||
|
|
||||||
def uninstall(self, pkg: FlatpakApplication, root_password: str, watcher: ProcessWatcher) -> bool:
|
def uninstall(self, pkg: FlatpakApplication, root_password: str, watcher: ProcessWatcher) -> bool:
|
||||||
uninstalled = ProcessHandler(watcher).handle(SystemProcess(subproc=flatpak.uninstall(pkg.ref, pkg.installation)))
|
uninstalled = ProcessHandler(watcher).handle(SystemProcess(subproc=flatpak.uninstall(pkg.ref, pkg.installation)))
|
||||||
|
|||||||
@@ -149,13 +149,21 @@ def list_installed(version: str) -> List[dict]:
|
|||||||
return apps
|
return apps
|
||||||
|
|
||||||
|
|
||||||
def update(app_ref: str, installation: str):
|
def update(app_ref: str, installation: str, related: bool = False, deps: bool = False):
|
||||||
"""
|
"""
|
||||||
Updates the app reference
|
Updates the app reference
|
||||||
:param app_ref:
|
:param app_ref:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
return new_subprocess(['flatpak', 'update', '--no-related', '--no-deps', '-y', app_ref, '--{}'.format(installation)])
|
cmd = ['flatpak', 'update', '-y', app_ref, '--{}'.format(installation)]
|
||||||
|
|
||||||
|
if not related:
|
||||||
|
cmd.append('--no-related')
|
||||||
|
|
||||||
|
if not deps:
|
||||||
|
cmd.append('--no-deps')
|
||||||
|
|
||||||
|
return new_subprocess(cmd)
|
||||||
|
|
||||||
|
|
||||||
def uninstall(app_ref: str, installation: str):
|
def uninstall(app_ref: str, installation: str):
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class FlatpakApplication(SoftwarePackage):
|
|||||||
self.installation = installation if installation else 'system'
|
self.installation = installation if installation else 'system'
|
||||||
self.i18n = i18n
|
self.i18n = i18n
|
||||||
self.base_id = None
|
self.base_id = None
|
||||||
|
self.base_ref = None
|
||||||
|
|
||||||
if runtime:
|
if runtime:
|
||||||
self.categories = ['runtime']
|
self.categories = ['runtime']
|
||||||
@@ -81,6 +82,7 @@ class FlatpakApplication(SoftwarePackage):
|
|||||||
partial.base_id = self.id
|
partial.base_id = self.id
|
||||||
|
|
||||||
if self.ref:
|
if self.ref:
|
||||||
|
partial.base_ref = self.ref
|
||||||
partial.ref = '/'.join((partial_id, *self.ref.split('/')[1:]))
|
partial.ref = '/'.join((partial_id, *self.ref.split('/')[1:]))
|
||||||
|
|
||||||
partial.partial = True
|
partial.partial = True
|
||||||
|
|||||||
Reference in New Issue
Block a user