fix: retrieving installed applications information for Ubuntu based distros

This commit is contained in:
Vinicius Moreira
2019-10-09 11:37:58 -03:00
parent 73a633e083
commit 45cd02cde8
2 changed files with 11 additions and 1 deletions

View File

@@ -18,6 +18,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- History panel can now me maximized, minimized and allows to copy column content.
- Minor UI improvements
### Fixes
- Snap:
- retrieving installed applications information for Ubuntu based distros
### AppImage support
- Search, install, uninstall, downgrade, launch and retrieve the applications history available in [AppImageHub](https://appimage.github.io)
- Adds desktop entries ( menu shortcuts ) for the installed applications ( **~/.local/share/applications **)

View File

@@ -9,6 +9,7 @@ from bauh.gems.snap.model import SnapApplication
BASE_CMD = 'snap'
RE_SNAPD_STATUS = re.compile('\s+')
SNAPD_RUNNING_STATUS = {'listening', 'running'}
UBUNTU_DISTRO = 'ubuntu' in run_cmd('cat /proc/version').lower()
def is_installed():
@@ -98,7 +99,12 @@ def read_installed() -> List[dict]:
if idx > 0 and app_str:
apps.append(app_str_to_json(app_str))
info_out = new_subprocess(['cat', *['/var/lib/snapd/snap/{}/current/meta/snap.yaml'.format(a['name']) for a in apps]]).stdout
if UBUNTU_DISTRO:
path = '/snap/{}/current/meta/snap.yaml'
else:
path = '/var/lib/snapd/snap/{}/current/meta/snap.yaml'
info_out = new_subprocess(['cat', *[path.format(a['name']) for a in apps]]).stdout
idx = -1
for o in new_subprocess(['grep', '-E', '(summary|apps)', '--colour=never'], stdin=info_out).stdout: