diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2014-06-19 11:31:58 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2014-06-19 11:31:59 +0200 |
commit | 2bcb00b98be26549b2a42b0a8072ca7d8200a062 (patch) | |
tree | d2e6f5c278ea6bc304827fc819d9da9a835838e0 /bin | |
parent | 7eb59956fdfb344b4ad613bbcbee0e49a5c4f0b1 (diff) | |
download | ptxdist-2bcb00b98be26549b2a42b0a8072ca7d8200a062.tar.gz ptxdist-2bcb00b98be26549b2a42b0a8072ca7d8200a062.tar.xz |
ptxdist: make icecc handling more robust
Create the reference link last and abort on error.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ptxdist | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index baf60f1ab..2183684af 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -706,25 +706,25 @@ check_compiler() { for cc in gcc g++ cpp ld; do ptxd_replace_link "$(which ${compiler_prefix}${cc})" "${wrapper_dir}/real/${compiler_prefix}${cc}" && ptxd_replace_link "${SCRIPTSDIR}/wrapper/${cc}-wrapper" "${wrapper_dir}/${compiler_prefix}${cc}" - done - PATH="${wrapper_dir}:${PATH}" + done && + PATH="${wrapper_dir}:${PATH}" && if [ -n "${PTXDIST_ICECC}" ]; then local icecc_dir="${sysroot_host}/lib/icecc" if [ "$(readlink -f "${icecc_dir}/toolchain")" != "${toolchain}" ]; then - rm -rf "${icecc_dir}" - mkdir -p "${icecc_dir}/target" "${icecc_dir}/host" - ln -s "${toolchain}" "${icecc_dir}/toolchain" + rm -rf "${icecc_dir}" && + mkdir -p "${icecc_dir}/target" "${icecc_dir}/host" && ( cd "${icecc_dir}/target" "${PTXDIST_ICECC_CREATE_ENV}" --gcc \ "${wrapper_dir}/real/${compiler_prefix}gcc" \ - "${wrapper_dir}/real/${compiler_prefix}g++" > /dev/null + "${wrapper_dir}/real/${compiler_prefix}g++" > /dev/null 2>&1 && cd "${icecc_dir}/host" "${PTXDIST_ICECC_CREATE_ENV}" --gcc \ "${wrapper_dir}/real/gcc" \ - "${wrapper_dir}/real/g++" > /dev/null - ) - fi + "${wrapper_dir}/real/g++" > /dev/null 2>&1 + ) && + ln -s "${toolchain}" "${icecc_dir}/toolchain" + fi || return export ICECC_VERSION_TARGET="$(ls "${icecc_dir}/target"/*.tar.gz)" export ICECC_VERSION_HOST="$(ls "${icecc_dir}/host"/*.tar.gz)" fi |