Skip to content

Commit

Permalink
Merge pull request #157 from anxdpanic/dev
Browse files Browse the repository at this point in the history
add Nexus 20.5, webOS indentification
  • Loading branch information
anxdpanic authored Apr 5, 2024
2 parents eaeec08 + c9c42c3 commit a3118d0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
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

0 comments on commit a3118d0

Please sign in to comment.