+ htmlPage=$(${CURL} "${SDK_URL}")
+ files=$(echo ${htmlPage} | egrep -o 'href="[^"]*crosssdk[^"]*\.sh"' | cut -d '"' -f 2)
+ if [ "$?" != "0" ] || [ "${files}" = "" ]; then
+ dbg_warning " IGNORED ${url}: no valid files found"
+ return
+ fi
+
+ # 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}; }