Debian Codegraph @

DEBIAN/preinst

raw
1 #!/bin/bash
2
3 echo "Pre-install check for ROCr."
4
5 # Check for old installations...
6 if ls /usr/lib/libhsa-runtime* 1> /dev/null 2>&1; then
7 echo "An old version of libhsa-runtime was found in /usr/lib."
8 echo "This must be uninstalled before proceeding with the installation"
9 echo "to avoid potential incompatibilities."
10
11 read -r -p "Do you want to uninstall the old version? [y/N] " response
12 if [ "$response" = "y" ]; then
13 if ! rm -rf /usr/lib/libhsa-runtime*; then
14 echo "Failed to remove /usr/lib/libhsa-runtime* files."
15 echo "Try to uninstall these files manually."
16 exit 1
17 fi
18 echo "Old version uninstalled."
19 else
20 echo "The old and new versions of ROCm are incompatible. Installation aborted."
21 exit 1
22 fi
23 fi