summaryrefslogtreecommitdiff
path: root/tcwg-benchmark.sh
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2017-10-04 14:04:08 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2017-10-12 11:00:39 +0000
commitaf39a32dcfa801954424adf89e79e698515fee76 (patch)
treec6e6bd787dd21456cff3be8dcd8babcc3cba8578 /tcwg-benchmark.sh
parent9e5bde8abc04786c1673316be4740622248f1af9 (diff)
tcwg-benchmark.sh: Add support for fetching sysroot tarball via URL.
For this we add untar_url helper to jenkins-helpers.sh, which refactors code from fetching the toolchain tarball. Change-Id: I0b425afafaee0e7c53b93c1e6dc243bde3ca1314
Diffstat (limited to 'tcwg-benchmark.sh')
-rwxr-xr-xtcwg-benchmark.sh27
1 files changed, 17 insertions, 10 deletions
diff --git a/tcwg-benchmark.sh b/tcwg-benchmark.sh
index 72a7b4c4..9914d724 100755
--- a/tcwg-benchmark.sh
+++ b/tcwg-benchmark.sh
@@ -55,13 +55,7 @@ case "$toolchain_url" in
fi
;;
"http://"*".tar.xz"|"https://"*".tar.xz")
- wget_wildcard_url "$toolchain_url"
- # shellcheck disable=SC2046
- tarball="$(ls $(basename "$toolchain_url"))"
- dirname="${tarball%.tar.xz}"
- toolchaindir="$WORKSPACE/$dirname"
- mkdir "${toolchaindir}"
- tar xf "${tarball}" --directory "${toolchaindir}" --strip-components 1
+ toolchain_dir=$(untar_url "$toolchain_url" "$WORKSPACE" "--strip-components 1")
;;
"rsync://"*)
ccprefix="${toolchain_url##rsync://}"
@@ -115,9 +109,22 @@ case "$toolchain_url" in
# Copy toolchain to the build container.
rsync -a --delete -e "ssh -p$build_container_port" "$toolchaindir/" "$build_container_host:$toolchaindir/"
ccprefix="$build_container_host:$build_container_port:$ccprefix"
- if [ x"$sysroot" = x"tarball" ]; then
- sysroot="$build_container_host:$(find "$toolchaindir" -name "libc")"
- fi
+ ;;
+esac
+
+case "$sysroot" in
+ "tarball")
+ sysroot="$build_container_host:$(find "$toolchaindir" -name "libc")"
+ ;;
+ "http://"*|"https://"*)
+ sysrootdir=$(untar_url "$sysroot" "$WORKSPACE" "--strip-components 1")
+ # Copy toolchain to the build container.
+ rsync -a --delete -e "ssh -p$build_container_port" "$sysrootdir/" "$build_container_host:$sysrootdir/"
+ sysroot="$build_container_host:$sysrootdir"
+ ;;
+ *)
+ echo "ERROR: Cannot handle sysroot: $sysroot"
+ exit 1
;;
esac