Don't download ARM Gnu toolchain if present (#5005)
* check for downloaded toolkit * rm if not * force * this might work better * don't move, just link * don't need glob * try * try correct path * check file to prevent error * fix quotes so globs work * using an executable which contains version stamp * docs etc * fix path * back to globs we go * maybe the path is right this time
This commit is contained in:
parent
e90f99fa27
commit
9c6804f81c
|
@ -6,6 +6,9 @@ set -e
|
||||||
|
|
||||||
# URL to download original toolchain from
|
# URL to download original toolchain from
|
||||||
URL="https://github.com/rusefi/build_support/raw/master/rusefi-arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz"
|
URL="https://github.com/rusefi/build_support/raw/master/rusefi-arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz"
|
||||||
|
# This is the md5sum of the /bin/arm-none-eabi-ld executable within the archive, used for verifying we have the proper version.
|
||||||
|
# If you change the above URL, you will need to update this checksum as well.
|
||||||
|
MANIFEST_SUM="8e50ee1adb41acfd56fc38d74d6bb18e"
|
||||||
# colloquial directory name, to afford re-use of script
|
# colloquial directory name, to afford re-use of script
|
||||||
COLLOQUIAL="gcc-arm-none-eabi"
|
COLLOQUIAL="gcc-arm-none-eabi"
|
||||||
# temporary working directory
|
# temporary working directory
|
||||||
|
@ -13,22 +16,23 @@ TMP_DIR="/tmp/rusefi-provide_gcc"
|
||||||
|
|
||||||
archive="${URL##*/}"
|
archive="${URL##*/}"
|
||||||
|
|
||||||
# Cleanup prior [failed] runs
|
SWD="$PWD"
|
||||||
rm -rf "${TMP_DIR}"
|
|
||||||
|
|
||||||
# Download and extract archive
|
# If the checksum file doesn't exist, or if its checksum doesn't match, then download and install the archive.
|
||||||
echo Downloading and extracting ${archive}
|
if [ ! -f "${TMP_DIR}"/*/bin/arm-none-eabi-ld ] ||\
|
||||||
mkdir -p "${TMP_DIR}"
|
[ "$MANIFEST_SUM" != "$(md5sum ${TMP_DIR}/*/bin/arm-none-eabi-ld | cut -d ' ' -f 1)" ]; then
|
||||||
cd "${TMP_DIR}"
|
rm -rf "${TMP_DIR}"
|
||||||
curl -L -o "${archive}" "${URL}"
|
# Download and extract archive
|
||||||
tar -xaf "${archive}"
|
echo Downloading and extracting ${archive}
|
||||||
rm "${archive}"
|
mkdir -p "${TMP_DIR}"
|
||||||
|
cd "${TMP_DIR}"
|
||||||
|
curl -L -o "${archive}" "${URL}"
|
||||||
|
tar -xaf "${archive}"
|
||||||
|
rm "${archive}"
|
||||||
|
else
|
||||||
|
echo "Toolkit already present"
|
||||||
|
fi
|
||||||
|
|
||||||
# Create colloquially named link
|
# Create colloquially named link
|
||||||
archive_dir="$(echo *)"
|
cd "$SWD"
|
||||||
cd - >/dev/null
|
ln -s "${TMP_DIR}"/* "${COLLOQUIAL}"
|
||||||
mv "${TMP_DIR}/${archive_dir}" "$(pwd)"
|
|
||||||
ln -s "${archive_dir%/}" "${COLLOQUIAL}"
|
|
||||||
|
|
||||||
# Delete downloaded archive
|
|
||||||
rm -rf "${TMP_DIR}"
|
|
||||||
|
|
Loading…
Reference in New Issue