[flatpak] initial user installation level support

This commit is contained in:
Vinícius Moreira
2020-01-09 15:16:31 -03:00
parent 8b77c87dab
commit f65e77872b
3 changed files with 29 additions and 14 deletions

View File

@@ -121,7 +121,7 @@ class FlatpakManager(SoftwareManager):
watcher.change_progress(10)
watcher.change_substatus(self.i18n['flatpak.downgrade.commits'])
commits = flatpak.get_app_commits(pkg.ref, pkg.origin)
commits = flatpak.get_app_commits(pkg.ref, pkg.origin, pkg.installation)
commit_idx = commits.index(pkg.commit)
@@ -133,7 +133,7 @@ class FlatpakManager(SoftwareManager):
commit = commits[commit_idx + 1]
watcher.change_substatus(self.i18n['flatpak.downgrade.reverting'])
watcher.change_progress(50)
success = ProcessHandler(watcher).handle(SystemProcess(subproc=flatpak.downgrade(pkg.ref, commit, root_password),
success = ProcessHandler(watcher).handle(SystemProcess(subproc=flatpak.downgrade(pkg.ref, commit, pkg.installation, root_password),
success_phrases=['Changes complete.', 'Updates complete.'],
wrong_error_phrase='Warning'))
watcher.change_progress(100)
@@ -194,7 +194,7 @@ class FlatpakManager(SoftwareManager):
def get_history(self, pkg: FlatpakApplication) -> PackageHistory:
pkg.commit = flatpak.get_commit(pkg.id, pkg.branch)
commits = flatpak.get_app_commits_data(pkg.ref, pkg.origin)
commits = flatpak.get_app_commits_data(pkg.ref, pkg.origin, pkg.installation)
status_idx = 0
for idx, data in enumerate(commits):
@@ -229,7 +229,7 @@ class FlatpakManager(SoftwareManager):
return flatpak.is_installed()
def requires_root(self, action: str, pkg: FlatpakApplication):
return action == 'downgrade'
return action == 'downgrade' and pkg.installation == 'system'
def prepare(self):
pass