[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
- 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
- not updating the table with the installed runtimes after a first Snap installation
- Web
- some environment variable are not available during the launch process
- UI

View File

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