From 39c968870a9a6af5aef45aa946a9462d1352e531 Mon Sep 17 00:00:00 2001 From: Leonardo Florez-Valencia Date: Mon, 25 Apr 2016 12:40:56 -0500 Subject: [PATCH] ... --- .../cpPlugins_Install_ITK.sh | 20 ++++++++++++++++++- .../cpPlugins_Install_QT4.sh | 20 ++++++++++++++++++- .../cpPlugins_Install_VTK.sh | 20 ++++++++++++++++++- 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/third_party_installers/cpPlugins_Install_ITK.sh b/third_party_installers/cpPlugins_Install_ITK.sh index baf70eb..d716a85 100755 --- a/third_party_installers/cpPlugins_Install_ITK.sh +++ b/third_party_installers/cpPlugins_Install_ITK.sh @@ -1,5 +1,23 @@ #!/bin/bash +function abspath() +{ + pushd . > /dev/null + if [ -d "$1" ]; then + cd "$1" + dirs -l +0 + else + cd "`dirname \"$1\"`" + cur_dir=`dirs -l +0` + if [ "$cur_dir" == "/" ]; then + echo "$cur_dir`basename \"$1\"`" + else + echo "$cur_dir/`basename \"$1\"`" + fi + fi + popd > /dev/null +} + ## Some configuration variables number_of_processes="-j4" comp_type=Debug @@ -37,7 +55,7 @@ if [ "$#" -eq 1 ]; then echo "$0: Invalid file type." exit 1 fi - canonical_path=`readlink -e $1` + canonical_path=`abspath $1` source_dir=`dirname $canonical_path`/`basename $1 .$actual_ext` build_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`-build echo -n "Cleaning directories... " diff --git a/third_party_installers/cpPlugins_Install_QT4.sh b/third_party_installers/cpPlugins_Install_QT4.sh index a80a12d..6d2c30d 100755 --- a/third_party_installers/cpPlugins_Install_QT4.sh +++ b/third_party_installers/cpPlugins_Install_QT4.sh @@ -1,5 +1,23 @@ #!/bin/bash +function abspath() +{ + pushd . > /dev/null + if [ -d "$1" ]; then + cd "$1" + dirs -l +0 + else + cd "`dirname \"$1\"`" + cur_dir=`dirs -l +0` + if [ "$cur_dir" == "/" ]; then + echo "$cur_dir`basename \"$1\"`" + else + echo "$cur_dir/`basename \"$1\"`" + fi + fi + popd > /dev/null +} + ## Some configuration variables number_of_processes="-j4" comp_type=-debug @@ -22,7 +40,7 @@ if [ "$#" -eq 1 ]; then echo "$0: Invalid file type." exit 1 fi - canonical_path=`readlink -e $1` + canonical_path=`abspath $1` source_dir=`dirname $canonical_path`/`basename $1 .$actual_ext` build_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`-build echo -n "Cleaning directories... " diff --git a/third_party_installers/cpPlugins_Install_VTK.sh b/third_party_installers/cpPlugins_Install_VTK.sh index 7cce532..0812809 100755 --- a/third_party_installers/cpPlugins_Install_VTK.sh +++ b/third_party_installers/cpPlugins_Install_VTK.sh @@ -1,5 +1,23 @@ #!/bin/bash +function abspath() +{ + pushd . > /dev/null + if [ -d "$1" ]; then + cd "$1" + dirs -l +0 + else + cd "`dirname \"$1\"`" + cur_dir=`dirs -l +0` + if [ "$cur_dir" == "/" ]; then + echo "$cur_dir`basename \"$1\"`" + else + echo "$cur_dir/`basename \"$1\"`" + fi + fi + popd > /dev/null +} + ## Some configuration variables number_of_processes="-j4" comp_type=Debug @@ -55,7 +73,7 @@ if [ "$#" -eq 1 ]; then echo "$0: Invalid file type." exit 1 fi - canonical_path=`readlink -e $1` + canonical_path=`abspath $1` source_dir=`dirname $canonical_path`/`basename $1 .$actual_ext` build_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`-build echo -n "Cleaning directories... " -- 2.47.1