-parse_mpss_info() {
- local file="$1"
- local build="$2"
- local distro="$3"
-
- [ -r "$file" ] || fatal 1 "Could not find MPSS info file"
-
- # convert to MPSS distro naming
- distro=${distro/sles/suse}
- distro_name=${distro%%-*}
-
- # extract links from MPSS info file
- local urls=$(cat "$file" | \
- tr -d '\t\r\n' | sed -e 's?\(</[a-zA-Z]*>\)?\1\n?g' | \
- grep '.intel.com/' | \
- sed -e 's/^.*[hH][rR][eE][fF]="\([^>"]\+\)".*$/\1/g' | \
- grep '.tar')
- local res2=""
- local res3=""
- for url in $urls; do
- local ver2=""
- local ver3=""
- # Try to match with MPSS 3.3 package
- if [[ $url =~ mpss-[0-9].[0-9](.[0-9]*)?-linux.tar ]]; then
- ver3=${url##*mpss-}
- ver3=${ver3%%-linux.tar}
- # Try to match with MPSS 3.x or 3.x.x distro package
- elif [[ $url =~ mpss-[0-9].[0-9](.[0-9]*)?-$distro.tar ]]; then
- ver3=${url##*mpss-}
- ver3=${ver3%%-$distro.tar}
- # Try to match with MPSS 3.x or 3.x.x source package
- elif [[ $url =~ mpss-src-[0-9].[0-9](.[0-9]*)?.tar ]]; then
- ver3=${url##*mpss-src-}
- ver3=${ver3%%.tar}
- # Try to match with MPSS 3.x or 3.x.x cross compiler package
- elif [[ $url =~ mpss-[0-9].[0-9](.[0-9]*)?-k1om.tar ]]; then
- ver3=${url##*mpss-}
- ver3=${ver3%%-k1om.tar}
- # Try to match with MPSS 2.1.x source package
- elif [[ $url =~ _src-[0-9].[0-9].[0-9]*-[0-9]*_$distro_name.tar ]]; then
- ver2=${url##*_src-}
- ver2=${ver2%%_$distro_name.tar}
- fi
-
- if [ -n "$ver3" ]; then
- ver3="${ver3}-0"
- if [ -z "$build" ]; then
- res3="$ver3"
- elif [ "${build%%-*}" = "${ver3%%-*}" ]; then
- res3="$res3 $url"
- fi
- elif [ -n "$ver2" ]; then
- if [ -z "$build" ]; then
- res2="$ver2"
- elif [ "$build" = "$ver2" ]; then
- res2="$res2 $url"
- fi
- fi
-
- done
-
- if [ -z "$build" ]; then
- # return a last version of MPSS
- if [ -n "$res3" ]; then
- echo "$res3"
- else
- echo "$res2"
- fi
- elif [ "${build%%.*}" = "3" ]; then
- # return URLs from MPSS info file
- echo "$res3"
- else
- # return URLs from MPSS info file
- echo "$res2"
- fi
-}
-
-# Get public information about last releases of
-# Intel Manycore Platform Software Stack (MPSS)
-download_mpss_info() {
- local file="$1"
- local force="${2:-true}"
- local url=${MPSS_URL:-"http://software.intel.com/en-us/articles/intel-manycore-platform-software-stack-mpss"}
-
- download_file "$url" "$file" "$force"
-}
-
-download_mpss() {
- local file="$1"
- local force="${2:-false}"
- local urls=$(parse_mpss_info "$file" ${MPSS_VERSION} ${MPSS_DISTRO})
-
- [ -z "$urls" ] && return 0
-
- local url
- local i=0
- for url in $urls; do
- file="$KERNELTREE/mpss_src-${MPSS_VER}-${MPSS_BLD}-${MPSS_DISTRO}-part$i.tar"
- download_file "$url" "$file" "$force"
- i=$((i+1))
- done
-}
-