Files
rocm-systems/projects/rocm-core/rocm-core.prerm
T
systems-assistant[bot] ae5decac0f Add 'projects/rocm-core/' from commit '75be79f4708a419d3755500ca67ed9ec062e15bf'
git-subtree-dir: projects/rocm-core
git-subtree-mainline: c2312be1a2
git-subtree-split: 75be79f470
2025-07-22 22:52:38 +00:00

33 lines
970 B
Bash
Executable File

#!/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