Avoid duplicate SDK install dir - SPEC-1252
[src/xds/xds-server.git] / scripts / sdks / agl / get-sdk-info
index 19bf685..8840bf0 100755 (executable)
@@ -113,14 +113,18 @@ fi
 profile=$(echo "${filename}" | sed -r 's/(.*)-glibc.*/\1/')
 version=$(echo "${filename}" | sed -r 's/.*toolchain-(.*).sh/\1/')
 arch=$(echo "${filename}" | sed -r 's/.*crosssdk-(.*)-toolchain.*/\1/')
-installPath=${SDK_ROOT_DIR}/${profile}/${version}/${arch}
 
 [ "${profile}" = "" ] && { echo "profile not set"; exit 7; }
 [ "${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
+uuid=$(echo "${sdkUrl}" | md5sum |cut -d' ' -f1)
+
+installPath=${SDK_ROOT_DIR}/${profile}/${version}/${arch}/${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