X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=scripts%2Fsdks%2Fagl%2Fget-sdk-info;h=485d5fe99f43414e4df7b4a03756a9bcbbf1b8ce;hb=ecef0475a0a9d51e1a8842fbf0e0b9a948565cbd;hp=19bf68546ba5515eba6e1a1d5d5e8d487202564a;hpb=1a8b7603899f30f052ad123b7607b45a6d4c8772;p=src%2Fxds%2Fxds-server.git diff --git a/scripts/sdks/agl/get-sdk-info b/scripts/sdks/agl/get-sdk-info index 19bf685..485d5fe 100755 --- a/scripts/sdks/agl/get-sdk-info +++ b/scripts/sdks/agl/get-sdk-info @@ -27,6 +27,7 @@ usage() { SDK_FILE="" MD5VAL="" URL="" +UUID="" while [ $# -ne 0 ]; do case $1 in @@ -45,6 +46,10 @@ while [ $# -ne 0 ]; do shift URL=$1 ;; + --uuid) + shift + UUID=$1 + ;; *) echo "Invalid argument: $1" usage @@ -119,8 +124,24 @@ installPath=${SDK_ROOT_DIR}/${profile}/${version}/${arch} [ "${version}" = "" ] && { echo "version not set"; exit 8; } [ "${arch}" = "" ] && { echo " arch not set"; exit 9; } +# 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) + if [ -d "${curInstDir}" ]; then + UUID="basename ${curInstDir}" + elif [ "$URL" != "" ]; then + UUID=$(echo "$URL" | md5sum |cut -d' ' -f1) + elif [ "$filename" != "" ]; then + UUID=$(echo $(basename $filename) | md5sum |cut -d' ' -f1) + else + echo "UUID value must be specify using --uuid option." + exit 1 + fi +fi +installPath="${installPath}/${UUID}" + status="Not Installed" -if [ -d ${installPath} ]; then +if [ -d "${installPath}" ]; then envFile=$(find "${installPath}" -maxdepth 1 -name "${SDK_ENV_SETUP_FILENAME}") [ "${envFile}" != "" ] && status="Installed" fi @@ -128,6 +149,7 @@ fi read -r -d '' res <<- EndOfMessage { "name": "${profile}_${arch}_${version}", + "uuid": "${UUID}", "description": "AGL SDK ${arch} (version ${version})", "profile": "${profile}", "version": "${version}",