summaryrefslogtreecommitdiffstats
path: root/scripts/sdks
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/sdks')
-rw-r--r--scripts/sdks/README.md2
-rwxr-xr-xscripts/sdks/agl/db-dump1
-rwxr-xr-xscripts/sdks/agl/get-sdk-info24
3 files changed, 26 insertions, 1 deletions
diff --git a/scripts/sdks/README.md b/scripts/sdks/README.md
index c887293..0b11b5f 100644
--- a/scripts/sdks/README.md
+++ b/scripts/sdks/README.md
@@ -42,6 +42,7 @@ Returned the list all SDKs (available and installed) using JSON format.
"arch": "architecture",
"path": "path where sdk installed locally",
"url": "https://website.url.to.download.sdk",
+ "image_url": "https://website.url.to.download.image",
"status": "Not Installed | Installed",
"date": "2017-12-25 00:00",
"size": "123 MB",
@@ -110,6 +111,7 @@ returned the following JSON structure:
"arch": "architecture",
"path": "",
"url": "https://website.url.to.download.sdk",
+ "image_url": "https://website.url.to.download.image",
"status": "Not Installed",
"date": "2017-12-25 00:00",
"size": "123 MB",
diff --git a/scripts/sdks/agl/db-dump b/scripts/sdks/agl/db-dump
index d375177..fecdcd3 100755
--- a/scripts/sdks/agl/db-dump
+++ b/scripts/sdks/agl/db-dump
@@ -184,6 +184,7 @@ for one_sdk in INSTALLED_SDK:
'arch': ARCH,
'path': DIR,
'url': '',
+ 'image_url': '',
'status': 'Installed',
'date': SDK_DATE,
'size': '',
diff --git a/scripts/sdks/agl/get-sdk-info b/scripts/sdks/agl/get-sdk-info
index 485d5fe..12892ac 100755
--- a/scripts/sdks/agl/get-sdk-info
+++ b/scripts/sdks/agl/get-sdk-info
@@ -89,6 +89,7 @@ if [ "${SDK_FILE}" != "" ]; then
filename=$(basename "${SDK_FILE}")
sdkUrl=file://${SDK_FILE}
+ imageUrl=""
sdkDate=$(stat -c %y "${SDK_FILE}")
sdkSize=$(/bin/ls -sh "${SDK_FILE}" |cut -d' ' -f1)
@@ -96,6 +97,7 @@ elif [ "${URL}" != "" ]; then
filename=$(basename "${URL}")
sdkUrl=${URL}
+ imageUrl=""
sdkDate=""
sdkSize=""
@@ -124,6 +126,8 @@ installPath=${SDK_ROOT_DIR}/${profile}/${version}/${arch}
[ "${version}" = "" ] && { echo "version not set"; exit 8; }
[ "${arch}" = "" ] && { echo " arch not set"; exit 9; }
+sdkName=${profile}_${arch}_${version}
+
# Define a unique ID to be able to distinguish for example corei7-64 from qemux86-64
if [ "${UUID}" = "" ]; then
curInstDir=$(ls -d "${installPath}/*" 2> /dev/null)
@@ -146,9 +150,26 @@ if [ -d "${installPath}" ]; then
[ "${envFile}" != "" ] && status="Installed"
fi
+sdkDef=""
+if [ "${UUID}" != "" ]; then
+ sdkDef=$($(dirname "$0")/db-dump | jq '.[] | select(.uuid=="'${UUID}'")')
+elif [ "${URL}" != "" ]; then
+ sdkDef=$($(dirname "$0")/db-dump | jq '.[] | select(.url=="'${URL}'")')
+fi
+
+if [ "${sdkDef}" != "" ]; then
+ sdkName=$(echo "$sdkDef" | jq -r .name)
+ [ "$UUID" = "" ] && UUID=$(echo "$sdkDef" | jq -r .uuid)
+ [ "$sdkUrl" = "" ] && sdkUrl=$(echo "$sdkDef" | jq -r .url)
+ [ "$imageUrl" = "" ] && imageUrl=$(echo "$sdkDef" | jq -r .image_url)
+ [ "$sdkDate" = "" ] && sdkDate=$(echo "$sdkDef" | jq -r .date)
+ [ "$sdkSize" = "" ] && sdkSize=$(echo "$sdkDef" | jq -r .size)
+ [ "$MD5VAL" = "" ] && MD5VAL=$(echo "$sdkDef" | jq -r .md5sum)
+fi
+
read -r -d '' res <<- EndOfMessage
{
- "name": "${profile}_${arch}_${version}",
+ "name": "${sdkName}",
"uuid": "${UUID}",
"description": "AGL SDK ${arch} (version ${version})",
"profile": "${profile}",
@@ -156,6 +177,7 @@ read -r -d '' res <<- EndOfMessage
"arch": "${arch}",
"path": "${installPath}",
"url": "${sdkUrl}",
+ "image_url": "${imageUrl}",
"status": "${status}",
"date": "${sdkDate}",
"size": "${sdkSize}",