diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-09-07 11:59:30 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-09-07 12:02:20 +0200 |
commit | 3a08f00c1ba93127cd533b26852597e0a55076ce (patch) | |
tree | aee296b20e0d3263e39905b49e2c481e72ed98b6 /bin | |
parent | d0728b86f03184a4679d173ac9d47b0b5363bfdb (diff) | |
download | ptxdist-3a08f00c1ba93127cd533b26852597e0a55076ce.tar.gz ptxdist-3a08f00c1ba93127cd533b26852597e0a55076ce.tar.xz |
ptxdist: wrapper: handle toochain switching
Correctly update all symlinks and remove any that don't exist in the new
toolchain.
Without this, all extra tool links will still point to the old toolchain.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ptxdist | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index 931061efc..1c473809f 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -804,10 +804,16 @@ check_compiler() { done for tool in "${toolchain}/${compiler_prefix}"* ; do local toolname="$(basename "${tool}")" - if [ ! -e "${wrapper_dir}/${toolname}" ]; then + if [ -h "${wrapper_dir}/${toolname}" ]; then ptxd_replace_link "${tool}" "${wrapper_dir}/${toolname}" fi done && + for tool in "${wrapper_dir}/${compiler_prefix}"* ; do + local toolname="$(basename "${tool}")" + if [ -e "${tool}" -a ! -e "${toolchain}/${toolname}" ]; then + rm -f "${tool}" + fi + done && PATH="${wrapper_dir}:${PATH}" && check_compiler_icecc } |