From d8221a75a7a803473621e9b93d01e73dab8df43f Mon Sep 17 00:00:00 2001 From: Jaaaky <43599380+Jaaaky@users.noreply.github.com> Date: Fri, 16 Feb 2024 14:41:28 +0300 Subject: [PATCH] Tools: fix package_is_installed(), use for loop for ccache --- .../install-prereqs-openSUSE-Tumbleweed.sh | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Tools/environment_install/install-prereqs-openSUSE-Tumbleweed.sh b/Tools/environment_install/install-prereqs-openSUSE-Tumbleweed.sh index 3bcd8114f2c7b0..5895dbdeb5b2be 100755 --- a/Tools/environment_install/install-prereqs-openSUSE-Tumbleweed.sh +++ b/Tools/environment_install/install-prereqs-openSUSE-Tumbleweed.sh @@ -41,7 +41,7 @@ if $QUIET; then fi function package_is_installed() { - rpm -q ModemManager &>/dev/null + rpm -q $1 &>/dev/null } function heading() { @@ -111,18 +111,11 @@ $PIP3 install -U $PYTHON_PKGS ( cd /usr/lib64/ccache - if [ ! -f arm-none-eabi-g++ ]; then - sudo ln -s ../../bin/ccache arm-none-eabi-g++ - fi - if [ ! -f arm-none-eabi-gcc ]; then - sudo ln -s ../../bin/ccache arm-none-eabi-gcc - fi - if [ ! -f arm-linux-gnueabihf-g++ ]; then - sudo ln -s ../../bin/ccache arm-linux-gnueabihf-g++ - fi - if [ ! -f arm-linux-gnueabihf-gcc ]; then - sudo ln -s ../../bin/ccache arm-linux-gnueabihf-gcc - fi + for C in arm-none-eabi-g++ arm-none-eabi-gcc arm-linux-gnueabihf-g++ arm-linux-gnueabihf-gcc; do + if [ ! -f "$C" ]; then + sudo ln -s ../../bin/ccache "$C" + fi + done ) ccache --set-config sloppiness=file_macro,locale,time_macros