diff --git a/resources/lib/version_check/service.py b/resources/lib/version_check/service.py index a823d72..ce2636a 100644 --- a/resources/lib/version_check/service.py +++ b/resources/lib/version_check/service.py @@ -11,7 +11,7 @@ See LICENSES/GPL-3.0-or-later.txt for more information. """ - +import json import platform import sys @@ -52,6 +52,15 @@ if not DISTRIBUTION: DISTRIBUTION = platform.uname()[0].lower() +# webOS +try: + with open('/var/run/nyx/os_info.json', 'r') as os_info_file: + json_info = json.load(os_info_file) + if 'webos_name' in json_info.keys(): + DISTRIBUTION = 'webos' +except IOError: + pass + def _version_check(): """ Check versions (non-linux) @@ -156,7 +165,7 @@ def run(): if wait_for_abort(5): sys.exit(0) - if (xbmc.getCondVisibility('System.Platform.Linux') and + if (DISTRIBUTION != 'webos' and xbmc.getCondVisibility('System.Platform.Linux') and ADDON.getSetting('upgrade_apt') == 'true'): _version_check_linux(['kodi']) else: diff --git a/resources/lib/version_check/shell_handler_apt.py b/resources/lib/version_check/shell_handler_apt.py index 97dd0b0..64577b1 100644 --- a/resources/lib/version_check/shell_handler_apt.py +++ b/resources/lib/version_check/shell_handler_apt.py @@ -17,10 +17,12 @@ from .common import log from .handler import Handler + try: from subprocess import check_output except ImportError: - check_output = None + def check_output(*args, **kwargs): + return log('ImportError: subprocess') @@ -53,7 +55,12 @@ def _check_versions(self, package): return False, False try: - result = check_output([_cmd], shell=True).decode('utf-8').split('\n') + result = check_output([_cmd], shell=True) + try: + result = result.decode('utf-8') + except (AttributeError, UnicodeDecodeError): + pass + result = result.split('\n') except Exception as error: # pylint: disable=broad-except log('ShellHandlerApt: exception while executing shell command %s: %s' % (_cmd, error)) return False, False diff --git a/resources/versions.txt b/resources/versions.txt index baa471c..bc73381 100644 --- a/resources/versions.txt +++ b/resources/versions.txt @@ -2,6 +2,15 @@ "jsonrpc": "2.0", "releases": { "stable": [ + { + "major": "20", + "minor": "5", + "tag": "stable", + "tagversion":"", + "revision": "20240303-4b95737efa", + "extrainfo": "final", + "addon_support": "yes" + }, { "major": "20", "minor": "2",