[flatpak] able to differentiate system and user updates for Flatpak >= 1.5

This commit is contained in:
Vinícius Moreira
2020-01-13 11:51:28 -03:00
parent 4144631f49
commit 23941015c2
3 changed files with 11 additions and 9 deletions

View File

@@ -200,7 +200,7 @@ def read_updates(version: str, installation: str) -> Dict[str, set]:
for o in new_subprocess(['grep', '-E', reg, '-o', '--color=never'], stdin=updates).stdout:
if o:
line_split = o.decode().strip().split('\t')
update_id = line_split[2] + '/' + line_split[3]
update_id = '{}/{}/{}'.format(line_split[2], line_split[3], installation)
if len(line_split) == 7:
if line_split[4] != 'i':
@@ -217,7 +217,7 @@ def read_updates(version: str, installation: str) -> Dict[str, set]:
def downgrade(app_ref: str, commit: str, installation: str, root_password: str) -> subprocess.Popen:
cmd = [BASE_CMD, 'update', '--no-related', '--commit={}'.format(commit), app_ref, '-y']
cmd = [BASE_CMD, 'update', '--no-related', '--commit={}'.format(commit), app_ref, '-y', '--{}'.format(installation)]
if installation == 'system':
return new_root_subprocess(cmd, root_password)