File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,11 +74,9 @@ install_packages_apt()
7474 sudo apt-get --no-install-recommends install -y binutils-arm-none-eabi gcc-arm-none-eabi gdb-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
7575 elif [ " $PLATFORM " = " Ubuntu" ]; then
7676 sudo apt-get --no-install-recommends install -y bzip2 ca-certificates wget
77- (cd /tmp \
78- && wget --tries 4 --no-check-certificate --quiet -c https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-" $ARCH " -linux.tar.bz2 \
79- && sudo tar xjf gcc-arm-none-eabi-9-2020-q2-update-" $ARCH " -linux.tar.bz2 -C /opt \
80- && rm gcc-arm-none-eabi-9-2020-q2-update-" $ARCH " -linux.tar.bz2 \
81- && sudo ln -s -f /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/* /usr/local/bin/.)
77+ (wget --tries 4 --no-check-certificate -O - --quiet https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-" $ARCH " -linux.tar.bz2 \
78+ | sudo tar xj -C /opt) \
79+ && sudo ln -s -f /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/* /usr/local/bin/.
8280 fi
8381
8482 if [ " $PLATFORM " != " Raspbian" ] && [ " ${INSTALL_FORMAT_TOOLS} " = " 1" ]; then
Original file line number Diff line number Diff line change 2828#
2929# This script downloads and installs a specific version of clang-format and clang-tidy.
3030
31- set -e
31+ set -e -o pipefail
3232
3333LLVM_VERSION=" 19.1.7"
3434ARCH=$( uname -m)
4242LLVM_PACKAGE=" LLVM-${LLVM_VERSION} -Linux-X64"
4343LLVM_URL=" https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION} /${LLVM_PACKAGE} .tar.xz"
4444INSTALL_DIR=" /opt/llvm-${LLVM_VERSION} "
45- TEMP_DIR= $( mktemp -d )
45+ INSTALL_DIR_tmp= " $INSTALL_DIR .tmp "
4646
47- cleanup ()
48- {
49- rm -rf " ${TEMP_DIR} "
50- }
47+ sudo mkdir -p " ${INSTALL_DIR_tmp} "
48+ trap ' sudo rm -rf "${INSTALL_DIR_tmp}"' EXIT
5149
52- trap cleanup EXIT
53-
54- cd " ${TEMP_DIR} "
55-
56- echo " Downloading LLVM from ${LLVM_URL} ..."
57- wget -O llvm.tar.xz " ${LLVM_URL} "
58-
59- echo " Uncompressing to ${TEMP_DIR} ..."
60- tar xf llvm.tar.xz
61-
62- echo " Installing to ${INSTALL_DIR} ..."
63- sudo mkdir -p /opt
64- sudo mv " ${LLVM_PACKAGE} " " ${INSTALL_DIR} "
50+ echo " Downloading LLVM from '${LLVM_URL} ' into '${INSTALL_DIR} ' ..."
51+ wget -O - " ${LLVM_URL} " | sudo tar -f - -C " ${INSTALL_DIR_tmp} " --strip-components=1 -xJ
52+ sudo rm -rf " ${INSTALL_DIR} "
53+ sudo mv " ${INSTALL_DIR_tmp} " " ${INSTALL_DIR} "
6554
6655echo " Creating symlinks in /usr/local/bin..."
6756sudo ln -sf " ${INSTALL_DIR} /bin/clang-format" " /usr/local/bin/clang-format-19"
You can’t perform that action at this time.
0 commit comments