Skip to content

Commit 6d6659b

Browse files
authored
Merge pull request #7997 from kcaisley/fix-build-AlmaLinux9-Ubuntu24.04
Fix issue with `openroad_deps_prefixes.txt` permissions & add case for AlmaLinux 9
2 parents a4b5d14 + 325fba1 commit 6d6659b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

etc/DependencyInstaller.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,11 +933,13 @@ case "${os}" in
933933
_installOrTools "ubuntu" "${ubuntuVersion}" "amd64"
934934
fi
935935
;;
936-
"Red Hat Enterprise Linux" | "Rocky Linux")
936+
"Red Hat Enterprise Linux" | "Rocky Linux" | "AlmaLinux")
937937
if [[ "${os}" == "Red Hat Enterprise Linux" ]]; then
938938
rhelVersion=$(rpm -q --queryformat '%{VERSION}' redhat-release | cut -d. -f1)
939939
elif [[ "${os}" == "Rocky Linux" ]]; then
940940
rhelVersion=$(rpm -q --queryformat '%{VERSION}' rocky-release | cut -d. -f1)
941+
elif [[ "${os}" == "AlmaLinux" ]]; then
942+
rhelVersion=$(rpm -q --queryformat '%{VERSION}' almalinux-release | cut -d. -f1)
941943
fi
942944
if [[ "${rhelVersion}" != "8" ]] && [[ "${rhelVersion}" != "9" ]]; then
943945
echo "ERROR: Unsupported ${rhelVersion} version. Versions '8' and '9' are supported."
@@ -1018,4 +1020,8 @@ esac
10181020
if [[ ! -z ${saveDepsPrefixes} ]]; then
10191021
mkdir -p "$(dirname $saveDepsPrefixes)"
10201022
echo "$CMAKE_PACKAGE_ROOT_ARGS" > $saveDepsPrefixes
1023+
# Fix permissions if running as root to allow user access
1024+
if [[ $(id -u) == 0 && ! -z "${SUDO_USER+x}" ]]; then
1025+
chown "$SUDO_USER:$(id -gn "$SUDO_USER")" "$saveDepsPrefixes" 2>/dev/null || true
1026+
fi
10211027
fi

0 commit comments

Comments
 (0)