Skip to content

Commit

Permalink
no need for a separate function here
Browse files Browse the repository at this point in the history
  • Loading branch information
jwt27 committed Nov 13, 2023
1 parent 9fad7f8 commit c9d5c7d
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions script/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,13 @@ echo "Creating install directory: ${DST}"

export PATH="${DST}/bin:${PREFIX}/bin:$PATH"

remove_if_exists()
{
if [ -e $1 ]; then
${SUDO} rm -f $1 || exit 1
fi
}

if which ${TARGET}-gcc 2>&1 > /dev/null; then
echo "Removing previously-installed specs file"
remove_if_exists "${DST}/lib/gcc/${TARGET}/$(${TARGET}-gcc -dumpversion)/specs"
remove_if_exists "${PREFIX}/lib/gcc/${TARGET}/$(${TARGET}-gcc -dumpversion)/specs"
for i in {"${DST}","${PREFIX}"}/lib/gcc/${TARGET}/$(${TARGET}-gcc -dumpversion)/specs; do
if [ -e "$i" ]; then
${SUDO} rm -f "$i" || exit 1
fi
done
fi

rm -rf ${BASE}/tests
Expand Down

0 comments on commit c9d5c7d

Please sign in to comment.