Fixed sdk from local file installation
[src/xds/xds-server.git] / scripts / sdks / agl / add
index 80a0487..f602fa9 100755 (executable)
@@ -29,6 +29,7 @@ TMPDIR=""
 SDK_FILE=""
 URL=""
 DEBUG_OPT=""
+UUID=""
 do_cleanup=true
 do_force=false
 while [ $# -ne 0 ]; do
@@ -48,6 +49,10 @@ while [ $# -ne 0 ]; do
             shift
             URL=$1
             ;;
+        --uuid)
+            shift
+            UUID=$1
+            ;;
         -no-clean)
             do_cleanup=false
             ;;
@@ -85,8 +90,18 @@ if [ "$URL" != "" ]; then
     wget --no-check-certificate "$URL" -O "${SDK_FILE}" || exit 1
 fi
 
+# Compute uuid when needed
+if [ "$UUID" = "" ] && [ "$URL" != "" ]; then
+    UUID=$(echo "$URL" | md5sum |cut -d' ' -f1)
+elif [ "$SDK_FILE" != "" ]; then
+    UUID=$(echo $(basename $SDK_FILE) | md5sum |cut -d' ' -f1)
+else
+    echo "UUID value must be specify using --uuid option."
+    exit 1
+fi
+
 # Retreive SDK info
-sdkNfo=$(${SCRIPTS_DIR}/get-sdk-info --file "${SDK_FILE}")
+sdkNfo=$(${SCRIPTS_DIR}/get-sdk-info --file "${SDK_FILE}" --uuid "${UUID}")
 if [ "$?" != "0" ]; then
     echo "$sdkNfo"
     exit 1