diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-04-04 21:11:07 +0200 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-04-05 01:30:31 +0200 |
commit | 607fa1dcb03e482415cf70a50fcd094c8bd88c9d (patch) | |
tree | 567b0e2dbe5ec5dd7668b668b30c71e2a6091e3e /scripts/sdks/agl/get-sdk-info | |
parent | 4a199b578b3bdfca70cdbb1ecd399fda90116087 (diff) |
Fixed sdk uuid setting during install [SPEC-1377]
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'scripts/sdks/agl/get-sdk-info')
-rwxr-xr-x | scripts/sdks/agl/get-sdk-info | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/scripts/sdks/agl/get-sdk-info b/scripts/sdks/agl/get-sdk-info index 8840bf0..c28f2e4 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 @@ -113,15 +118,25 @@ 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} +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) + else + echo "UUID value must be specify using --uuid option." + exit 1 + fi +fi +installPath="${installPath}/${UUID}" status="Not Installed" if [ -d "${installPath}" ]; then |