Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Nexus 20.5, webOS indentification #157

Merged
merged 3 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions resources/lib/version_check/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
See LICENSES/GPL-3.0-or-later.txt for more information.

"""

import json
import platform
import sys

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down
11 changes: 9 additions & 2 deletions resources/lib/version_check/shell_handler_apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')


Expand Down Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions resources/versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading