+ # assume that sdk name follow this format :
+ # _PROFILE_-_COMPILER_ARCH_-_TARGET_-crosssdk-_ARCH_-toolchain-_VERSION_.sh
+ # for example:
+ # poky-agl-glibc-x86_64-agl-demo-platform-crosssdk-corei7-64-toolchain-4.0.1.sh
+ if [ $(count files) -gt 1 ]
+ then
+ dbg_warning " IGNORE ${url}: multiple shell script containing 'crosssdk' in their names"
+ return
+ fi
+ sdkFile=${files}
+ dbg_info "Processing SDK: ${sdkFile} (from ${url})"
+ profile=$(echo "${sdkFile}" | sed -r 's/(.*)-glibc.*/\1/')
+ version=$(echo "${sdkFile}" | sed -r 's/.*toolchain-(.*).sh/\1/')
+ arch=$(echo "${sdkFile}" | sed -r 's/.*crosssdk-(.*)-toolchain.*/\1/')
+
+ endUrl=${url#$SDK_AGL_BASEURL}
+ if [ "${url::14}" = "http://iot.bzh" ]; then
+ endUrl=${url#$SDK_IOTBZH_BASEURL}
+ name=$(echo "IoTbzh-$(echo ${endUrl} | sed s:/:-:g)-${version}")
+ board=""
+ elif [ "${endUrl::4}" = "http" ]; then
+ name="${profile}_${arch}_${version}"
+ board=""
+ else
+ name=$(echo "AGL-$(echo ${endUrl} | cut -d'/' -f1,2,3,4)" | sed s:/:-:g)
+ board=$(echo ${endUrl} | cut -d'/' -f4)
+ board=${board%-nogfx}
+ fi
+
+ # Distringuish qemux86-64 and corei7-64
+ if [[ "$name" == *"qemux86-64"* && "$arch" == "corei7-64" ]]; then
+ arch="qemux86-64"
+ fi
+
+ [ "${profile}" = "" ] && { dbg_error "profile is not set" ; return ; }
+ [ "${version}" = "" ] && { dbg_error "version is not set" ; return ; }
+ [ "${arch}" = "" ] && { dbg_error "arch is not set" ; return ; }
+ [ "${name}" = "" ] && { name=${profile}_${arch}_${version}; }
+
+ sdkDate="$(echo "${htmlPage}" |egrep -o ${sdkFile/+/\\+}'</a>.*[0-9\-]+ [0-9]+:[0-9]+' |cut -d'>' -f 4|cut -d' ' -f1,2)"
+ sdkSize="$(echo "${htmlPage}" |egrep -o "${sdkFile/+/\\+}.*${sdkDate}.*[0-9\.MG]+</td>" |cut -d'>' -f7 |cut -d'<' -f1)"
+ md5sum="$(wget -q -O - ${SDK_URL}/${sdkFile/.sh/.md5} |cut -d' ' -f1)"
+
+ image_url=$(search_image_url ${IMG_URL}${board} ${arch})
+
+
+ read -r -d '' res <<- EndOfMessage