Commit 7c95cb95 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add realpath if missed and always use it

parent 0af4f5db
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
# $1 - needed VERSION of etersoft-build-utils. f.i. 162 # $1 - needed VERSION of etersoft-build-utils. f.i. 162
# TODO: remove it and use appropriate command directly # add realpath if missed
# for systems without realpath command if ! which realpath 2>/dev/null >/dev/null ; then
realpath() realpath()
{ {
[ -n "$*" ] || return
readlink -f "$@" readlink -f "$@"
} }
fi
colorify() colorify()
{ {
...@@ -271,7 +273,7 @@ get_root_git_dir() ...@@ -271,7 +273,7 @@ get_root_git_dir()
fi fi
DIR=$(git rev-parse --git-dir 2>/dev/null)/../ || DIR= DIR=$(git rev-parse --git-dir 2>/dev/null)/../ || DIR=
readlink -f "$DIR" 2>/dev/null || realpath "$DIR" realpath "$DIR" 2>/dev/null
if [ -n "$LOCDIR" ] ; then if [ -n "$LOCDIR" ] ; then
cd - >/dev/null cd - >/dev/null
...@@ -396,7 +398,7 @@ do ...@@ -396,7 +398,7 @@ do
# Если файл или каталог существует, то добавляем, иначе считаем аргумент параметром. # Если файл или каталог существует, то добавляем, иначе считаем аргумент параметром.
if [ -e "$i" ]; then if [ -e "$i" ]; then
# echo is workaround for missed readlink # echo is workaround for missed readlink
LISTNAMES="$LISTNAMES $(readlink -f "$i" 2>/dev/null || realpath "$i" || echo "$i")" LISTNAMES="$LISTNAMES $(realpath "$i" 2>/dev/null || echo "$i")"
else else
# set target type if -M?? in param # set target type if -M?? in param
set_target_type ${i/-/} || LISTARGS="$LISTARGS $i" set_target_type ${i/-/} || LISTARGS="$LISTARGS $i"
......
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