aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/sdks/agl/get-sdk-info
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/sdks/agl/get-sdk-info')
-rwxr-xr-xscripts/sdks/agl/get-sdk-info24
1 files changed, 23 insertions, 1 deletions
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}",