1
1
Fork 0
mirror of https://github.com/tonydamage/nux-env.git synced 2025-12-11 13:24:28 +01:00

nuxfs: link issues warning if same target different def

This commit is contained in:
Tony Tkáčik 2016-11-24 13:46:55 +01:00
parent e4ae60fdb0
commit 850bf0d339

View file

@ -22,8 +22,15 @@ function task.verify {
local REAL_LINK=$(readlink "$1")
local TARGET="$2";
if test ! "$REAL_LINK" = "$TARGET"; then
nuxfs.error "$1" "links to $REAL_LINK instead of $TARGET"
return
MAT_REAL=$(realpath "$REAL_LINK")
local cdir=$(dirname "$1")
MAT_TARGET=$(realpath "$cdir/$TARGET")
if test "$MAT_REAL" = "$MAT_TARGET"; then
nuxfs.warning "$1" "links to target '$2', but is using different definition."
else
nuxfs.error "$1" "links to $REAL_LINK instead of $TARGET"
return
fi
fi
if test ! -e "$1"; then
nuxfs.warning "$1" "target '$NC_White$2$NC_No' does not exists."