[util] Also test for symlinks when installing/uninstalling

Fixes the broken `-f` test when dlls are linked to the prefix
and they change name due to different crosscompilers (.dll, .dll.so)
This commit is contained in:
Stelios Tsampas 2019-05-18 23:19:51 +03:00 committed by Philip Rebohle
parent 969aba16a7
commit 664199424b
1 changed files with 2 additions and 2 deletions

View File

@ -103,7 +103,7 @@ installFile() {
fi
if [ -n "$1" ]; then
if [ -f "${dstfile}" ]; then
if [ -f "${dstfile}" ] || [ -h "${dstfile}" ]; then
if ! [ -f "${dstfile}.old" ]; then
mv "${dstfile}" "${dstfile}.old"
else
@ -132,7 +132,7 @@ uninstallFile() {
return 1
fi
if ! [ -f "${dstfile}" ];then
if ! [ -f "${dstfile}" ] && ! [ -h "${dstfile}" ]; then
echo "${dstfile}: File not found. Skipping." >&2
return 1
fi