Commit 60e866ca authored by Corey Moyer's avatar Corey Moyer

Rewrite "get_os_release" function

parent 36a97dd4
......@@ -762,30 +762,22 @@ def parse_os_release():
def get_os_release():
distribution = version = architecture = build = project = device = ''
architecture = distribution = project = version = ''
os_release_info = parse_os_release()
if os_release_info is not None:
if 'NAME' in os_release_info:
distribution = os_release_info['NAME']
if 'ARCH' in os_release_info:
architecture = os_release_info['ARCH']
if 'ID' in os_release_info:
distribution = os_release_info['ID']
if 'PROJECT' in os_release_info:
project = os_release_info['PROJECT']
if 'VERSION_ID' in os_release_info:
version = os_release_info['VERSION_ID']
if 'VERSION' in os_release_info:
version = os_release_info['VERSION']
if 'LIBREELEC_ARCH' in os_release_info:
architecture = os_release_info['LIBREELEC_ARCH']
if 'LIBREELEC_BUILD' in os_release_info:
build = os_release_info['LIBREELEC_BUILD']
if 'LIBREELEC_PROJECT' in os_release_info:
project = os_release_info['LIBREELEC_PROJECT']
if 'LIBREELEC_DEVICE' in os_release_info:
device = os_release_info['LIBREELEC_DEVICE']
return (
distribution,
version,
architecture,
build,
distribution,
project,
device
version
)
......@@ -796,12 +788,10 @@ minidom.Element.writexml = fixed_writexml
############################################################################################
os_release_data = get_os_release()
DISTRIBUTION = os_release_data[0]
VERSION = os_release_data[1]
ARCHITECTURE = os_release_data[2]
BUILD = os_release_data[3]
PROJECT = os_release_data[4]
DEVICE = os_release_data[5]
ARCHITECTURE = os_release_data[0]
DISTRIBUTION = os_release_data[1]
PROJECT = os_release_data[2]
VERSION = os_release_data[3]
DOWNLOAD_DIR = '/root/Downloads'
KODI_USER_HOME = os.environ.get('KODI_USER_HOME', '/root/.kodi')
CONFIG_CACHE = os.environ.get('CONFIG_CACHE', '/root/.cache')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment