mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 15:34:15 +02:00
[flatpak] able to differentiate system and user updates for Flatpak >= 1.5
This commit is contained in:
@@ -115,14 +115,17 @@ class FlatpakManager(SoftwareManager):
|
||||
|
||||
if update_map and (update_map['full'] or update_map['partial']):
|
||||
if version >= '1.5.0':
|
||||
update_id = '{}/{}'.format(app_json['id'], app_json['branch'])
|
||||
update_id = '{}/{}/{}'.format(app_json['id'], app_json['branch'], app_json['installation'])
|
||||
|
||||
if update_map['full'] and update_id in update_map['full']:
|
||||
model.update = True
|
||||
|
||||
if update_map['partial']:
|
||||
for partial in update_map['partial']:
|
||||
if app_json['id'] in partial and '/' + app_json['branch'] in partial:
|
||||
partial_data = partial.split('/')
|
||||
if app_json['id'] in partial_data[0] and\
|
||||
app_json['branch'] == partial_data[1] and\
|
||||
app_json['installation'] == partial_data[2]:
|
||||
partial_model = model.gen_partial(partial.split('/')[0])
|
||||
partial_model.update = True
|
||||
models.append(partial_model)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user