[snap] fix -> not updating the table with the installed runtimes after a first Snap installation

This commit is contained in:
Vinicius Moreira
2020-08-26 15:06:10 -03:00
parent 1f68c9c9d4
commit 81d7dba7ea
2 changed files with 11 additions and 9 deletions

View File

@@ -85,6 +85,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- not able to install classic Snaps due to Ubuntu's old Snaps API shutdown - not able to install classic Snaps due to Ubuntu's old Snaps API shutdown
- some environment variables are not available during the common operations (install, upgrade, downgrade, uninstall, launch) - some environment variables are not available during the common operations (install, upgrade, downgrade, uninstall, launch)
- refresh app action: not returning an error when there is no update available - refresh app action: not returning an error when there is no update available
- not updating the table with the installed runtimes after a first Snap installation
- Web - Web
- some environment variable are not available during the launch process - some environment variable are not available during the launch process
- UI - UI

View File

@@ -1,5 +1,6 @@
import re import re
import time import time
import traceback
from threading import Thread from threading import Thread
from typing import List, Set, Type, Optional from typing import List, Set, Type, Optional
@@ -205,16 +206,16 @@ class SnapManager(SoftwareManager):
if success: if success:
new_installed = [pkg] new_installed = [pkg]
if installed: try:
try: current_installed = self.read_installed(disk_loader=disk_loader, internet_available=internet.is_available()).installed
current_installed = self.read_installed(disk_loader=disk_loader, internet_available=internet.is_available()).installed except:
except: traceback.print_exc()
current_installed = None current_installed = None
if current_installed and (not installed or len(current_installed) > len(installed) + 1): if current_installed:
for p in current_installed: for p in current_installed:
if p.name != pkg.name and (not installed or p.name not in installed): if p.name != pkg.name and (not installed or p.name not in installed):
new_installed.append(p) new_installed.append(p)
return TransactionResult(success=success, installed=new_installed, removed=[]) return TransactionResult(success=success, installed=new_installed, removed=[])
else: else: