X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=scripts%2Fsdks%2Fagl%2Fdb-dump;h=ec2b1d8ac7adb1672e50e888426de28c29e78a5f;hb=a93832c2e3058c55e183c487dde595bd42238bb0;hp=379be3e979d63d380ddcd03c68d1414c7a153243;hpb=1775ce4b91aa9c871d510d23a7d037f773d52b09;p=src%2Fxds%2Fxds-server.git diff --git a/scripts/sdks/agl/db-dump b/scripts/sdks/agl/db-dump index 379be3e..ec2b1d8 100755 --- a/scripts/sdks/agl/db-dump +++ b/scripts/sdks/agl/db-dump @@ -1,6 +1,6 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # -#/************************************************************************** +# /************************************************************************** # * Copyright 2017-2018 IoT.bzh # * # * author: Romain Forlot @@ -46,8 +46,9 @@ SCRIPT_PATH = os.path.dirname(os.path.abspath( ENV = subprocess.check_output( [os.path.join(SCRIPT_PATH, './_env-init.sh'), '-print']).splitlines() +SDK_ROOT_DIR = None for elt in ENV: - k, v = elt.split('=', 1) + k, v = elt.decode().split('=', 1) if k == 'SDK_ROOT_DIR': SDK_ROOT_DIR = v.rstrip('/') elif k == 'SDK_ENV_SETUP_FILENAME': @@ -70,6 +71,7 @@ SDK_DB_JSON = json.load(open(SDK_DB_FILEPATH, 'r')) for one_sdk in SDK_DB_JSON: one_sdk['status'] = 'Not Installed' + one_sdk['uuid'] = '' INSTALLED_SDK = [] for root, dirs, files in os.walk(SDK_ROOT_DIR): @@ -105,6 +107,8 @@ for one_sdk in INSTALLED_SDK: logging.debug('Path not compliant, skipping') continue + UUID = os.path.basename(os.path.normpath(DIR)) + SDK_DATE = '' for line in open(one_sdk['VERSION_FILE']).readlines(): if line.startswith('Timestamp'): @@ -125,6 +129,7 @@ for one_sdk in INSTALLED_SDK: sdk['date'] = SDK_DATE sdk['setupFile'] = one_sdk['ENV_FILE'] sdk['path'] = DIR + sdk['uuid'] = UUID break if not found: @@ -132,6 +137,7 @@ for one_sdk in INSTALLED_SDK: PROFILE + '-' + ARCH + '-' + VERSION) NEW_SDK = { 'name': PROFILE + '-' + ARCH + '-' + VERSION, + 'uuid': UUID, 'description': 'AGL SDK ' + ARCH + ' (version ' + VERSION + ')', 'profile': PROFILE, 'version': VERSION,