Files
rocm-systems/rocm-core.prerm
T
AravindanC 61ad6381aa Enable distro id based checks in rocm-core post/pre scripts
Change-Id: I1970dc3a36b8bd47d238b032afe5714c3e7f8e57
2025-02-04 10:48:10 -06:00

33 rindas
970 B
Bash
Izpildāmais fails

#!/bin/bash
do_update_alternatives(){
# skip update if program doesn't exist
command -v update-alternatives >/dev/null || return 0
# Update the /opt/rocm symlink
if [[ ${ID_LIKE:-$ID} == "debian" ]] || [[ "$RPM_INSTALL_PREFIX0" == "/opt/rocm-"* ]] ; then
update-alternatives --remove "rocm" "@CPACK_PACKAGING_INSTALL_PREFIX@"
fi
if [[ ${ID_LIKE:-$ID} == "debian" ]] ; then
update-alternatives --remove "rocmmod@ROCM_VERSION@" "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/rocmmod"|| true
else
update-alternatives --remove "rocmmod@ROCM_VERSION@" "$RPM_INSTALL_PREFIX0/@CMAKE_INSTALL_LIBDIR@/rocmmod"|| true
fi
}
if [ -e /etc/os-release ] && source /etc/os-release && [[ ${ID_LIKE:-$ID} == "debian" ]]
then
case "$1" in
(remove | upgrade)
do_update_alternatives
;;
(purge)
;;
(*)
exit 0
;;
esac
else
do_update_alternatives
fi