mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 03:34:15 +02:00
[flatpak] fix -> history: not highlighting the correct version
This commit is contained in:
@@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
- some operations are keeping the wrong substatus during specific scenarios
|
- some operations are keeping the wrong substatus during specific scenarios
|
||||||
- Flatpak
|
- Flatpak
|
||||||
- crashing for Flatpak 1.6.5 when there are updates [#145](https://github.com/vinifmor/bauh/issues/145)
|
- crashing for Flatpak 1.6.5 when there are updates [#145](https://github.com/vinifmor/bauh/issues/145)
|
||||||
|
- history: not highlighting the correct version (regression introduced **0.9.9**)
|
||||||
|
|
||||||
## [0.9.10] 2020-12-11
|
## [0.9.10] 2020-12-11
|
||||||
### Features
|
### Features
|
||||||
|
|||||||
@@ -297,25 +297,30 @@ class FlatpakManager(SoftwareManager):
|
|||||||
|
|
||||||
def get_history(self, pkg: FlatpakApplication, full_commit_str: bool = False) -> PackageHistory:
|
def get_history(self, pkg: FlatpakApplication, full_commit_str: bool = False) -> PackageHistory:
|
||||||
pkg.commit = flatpak.get_commit(pkg.id, pkg.branch, pkg.installation)
|
pkg.commit = flatpak.get_commit(pkg.id, pkg.branch, pkg.installation)
|
||||||
|
pkg_commit = pkg.commit if pkg.commit else None
|
||||||
|
|
||||||
|
if pkg_commit and not full_commit_str:
|
||||||
|
pkg_commit = pkg_commit[0:8]
|
||||||
|
|
||||||
commits = flatpak.get_app_commits_data(pkg.ref, pkg.origin, pkg.installation, full_str=full_commit_str)
|
commits = flatpak.get_app_commits_data(pkg.ref, pkg.origin, pkg.installation, full_str=full_commit_str)
|
||||||
|
|
||||||
status_idx = 0
|
status_idx = 0
|
||||||
commit_found = False
|
commit_found = False
|
||||||
|
|
||||||
if pkg.commit is None and len(commits) > 1 and commits[0]['commit'] == '(null)':
|
if pkg_commit is None and len(commits) > 1 and commits[0]['commit'] == '(null)':
|
||||||
del commits[0]
|
del commits[0]
|
||||||
pkg.commit = commits[0]
|
pkg_commit = commits[0]
|
||||||
commit_found = True
|
commit_found = True
|
||||||
|
|
||||||
if not commit_found:
|
if not commit_found:
|
||||||
for idx, data in enumerate(commits):
|
for idx, data in enumerate(commits):
|
||||||
if data['commit'] == pkg.commit:
|
if data['commit'] == pkg_commit:
|
||||||
status_idx = idx
|
status_idx = idx
|
||||||
commit_found = True
|
commit_found = True
|
||||||
break
|
break
|
||||||
|
|
||||||
if not commit_found and pkg.commit and commits[0]['commit'] == '(null)':
|
if not commit_found and pkg_commit and commits[0]['commit'] == '(null)':
|
||||||
commits[0]['commit'] = pkg.commit
|
commits[0]['commit'] = pkg_commit
|
||||||
|
|
||||||
return PackageHistory(pkg=pkg, history=commits, pkg_status_idx=status_idx)
|
return PackageHistory(pkg=pkg, history=commits, pkg_status_idx=status_idx)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user