Commit 5bb53891 authored by Julian Ospald's avatar Julian Ospald 🍵

Make uninstallation more robust

For an incomplete installation, we still want to remove
what is left over, so don't fail on non-existing symlinks
in $BIN_LOCATION.
parent eb79e390
......@@ -872,9 +872,13 @@ rm_ghc() {
if ghc_already_installed "${myghcver}" ; then
for f in "${BIN_LOCATION}"/*-"${myghcver}" ; do
# https://tanguy.ortolo.eu/blog/article113/test-symlink
[ ! -e "${f}" ] && [ ! -h "${f}" ] && die "Something went wrong, ${f} does not exist!"
[ ! -e "${f}" ] && [ ! -h "${f}" ] && {
warning_message "No existing symlinks for ${myghcver} in ${BIN_LOCATION}, skipping"
break
}
edo rm "${f}"
done
[ -z "${inst_location}" ] && die "internal error: inst_location empty!"
edo rm -r "${inst_location}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment