From 4ca4f049a48110b211fac8ae468a40903b67a445 Mon Sep 17 00:00:00 2001 From: Ivan Duplenskikh <115665590+ivanduplenskikh@users.noreply.github.com> Date: Thu, 14 Nov 2024 18:46:53 +0100 Subject: [PATCH] Add support for AzureLinux 3 to installdependencies (#5036) * Add Azure Linux if condition * Add non empty check for is_sles --- src/Misc/layoutbin/installdependencies.sh | 24 ++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/Misc/layoutbin/installdependencies.sh b/src/Misc/layoutbin/installdependencies.sh index 4587d4acc9..cd2ed3adef 100644 --- a/src/Misc/layoutbin/installdependencies.sh +++ b/src/Misc/layoutbin/installdependencies.sh @@ -271,7 +271,7 @@ then is_sles=1 fi - if ([[ -n $OSTYPE ]] && ([[ $OSTYPE == *"suse"* ]] || [[$is_sles == 1]])) + if ([[ -n $OSTYPE ]] && ([[ $OSTYPE == *"suse"* ]] || ([[ -n $is_sles ]] && [[ $is_sles == 1 ]]))) then echo "The current OS is SUSE based" command -v zypper @@ -317,6 +317,28 @@ then print_errormessage exit 1 fi + elif [ -e /etc/azurelinux-release ] + then + echo "The current OS is Azure Linux based" + echo "--------Azure Linux Version--------" + cat /etc/azurelinux-release + echo "------------------------------" + + command -v tdnf + if [ $? -eq 0 ] + then + tdnf install -y icu + if [ $? -ne 0 ] + then + echo "'tdnf' failed with exit code '$?'" + print_errormessage + exit 1 + fi + else + echo "Can not find 'tdnf'" + print_errormessage + exit 1 + fi else echo "Can't detect current OS type based on $filepath." print_errormessage