mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-09 21:14:15 +02:00
[flatpak] fix: not all selected runtime partials to upgrade are actually requested to be upgraded
This commit is contained in:
@@ -15,6 +15,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
- manage window minimum width related to the table columns
|
- manage window minimum width related to the table columns
|
||||||
- table columns width for maximized window
|
- table columns width for maximized window
|
||||||
|
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
- Flatpak
|
||||||
|
- not all selected runtime partials to upgrade are actually requested to be upgraded
|
||||||
|
|
||||||
## [0.10.2] 2022-04-16
|
## [0.10.2] 2022-04-16
|
||||||
### Improvements
|
### Improvements
|
||||||
- Arch
|
- Arch
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import re
|
|||||||
import traceback
|
import traceback
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from math import floor
|
from math import floor
|
||||||
|
from operator import attrgetter
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from typing import List, Set, Type, Tuple, Optional, Generator, Dict
|
from typing import List, Set, Type, Tuple, Optional, Generator, Dict
|
||||||
@@ -707,31 +708,22 @@ class FlatpakManager(SoftwareManager, SettingsController):
|
|||||||
return UpgradeRequirements(None, None, to_update, [])
|
return UpgradeRequirements(None, None, to_update, [])
|
||||||
|
|
||||||
def sort_update_order(self, pkgs: List[FlatpakApplication]) -> List[FlatpakApplication]:
|
def sort_update_order(self, pkgs: List[FlatpakApplication]) -> List[FlatpakApplication]:
|
||||||
partials, runtimes, apps = [], [], []
|
runtimes, apps = set(), set()
|
||||||
|
|
||||||
for p in pkgs:
|
for p in pkgs:
|
||||||
if p.runtime:
|
if p.runtime:
|
||||||
if p.partial:
|
runtimes.add(p)
|
||||||
partials.append(p)
|
|
||||||
else:
|
|
||||||
runtimes.append(p)
|
|
||||||
else:
|
else:
|
||||||
apps.append(p)
|
apps.add(p)
|
||||||
|
|
||||||
if not runtimes:
|
sorted_list = []
|
||||||
return [*partials, *apps]
|
for comps in (runtimes, apps):
|
||||||
elif partials:
|
if comps:
|
||||||
all_runtimes = []
|
comp_list = list(comps)
|
||||||
for runtime in runtimes:
|
comp_list.sort(key=attrgetter('installation', 'name'))
|
||||||
for partial in partials:
|
sorted_list.extend(comp_list)
|
||||||
if partial.installation == runtime.installation and partial.base_id == runtime.id:
|
|
||||||
all_runtimes.append(partial)
|
|
||||||
break
|
|
||||||
|
|
||||||
all_runtimes.append(runtime)
|
return sorted_list
|
||||||
return [*all_runtimes, *apps]
|
|
||||||
else:
|
|
||||||
return [*runtimes, *apps]
|
|
||||||
|
|
||||||
def _read_ignored_updates(self) -> Set[str]:
|
def _read_ignored_updates(self) -> Set[str]:
|
||||||
ignored = set()
|
ignored = set()
|
||||||
|
|||||||
@@ -125,7 +125,16 @@ class FlatpakApplication(SoftwarePackage):
|
|||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
if isinstance(other, FlatpakApplication):
|
if isinstance(other, FlatpakApplication):
|
||||||
return self.id == other.id and self.installation == other.installation and self.branch == other.branch
|
return self.id == other.id and self.installation == other.installation and self.branch == other.branch \
|
||||||
|
and self.runtime == other.runtime and self.partial == other.partial and \
|
||||||
|
self.update_component == other.update_component
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
hash_sum = 0
|
||||||
|
for attr in ('id', 'installation', 'branch', 'runtime', 'partial', 'update_component'):
|
||||||
|
hash_sum += hash(getattr(self, attr))
|
||||||
|
|
||||||
|
return hash_sum
|
||||||
|
|
||||||
def get_disk_icon_path(self) -> str:
|
def get_disk_icon_path(self) -> str:
|
||||||
if not self.runtime:
|
if not self.runtime:
|
||||||
|
|||||||
Reference in New Issue
Block a user