diff options
author | Ted Ross <tross@apache.org> | 2009-11-30 15:16:21 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2009-11-30 15:16:21 +0000 |
commit | e1574fe486743fe0c162d5c4b9825cbfc116ee63 (patch) | |
tree | 2995953f67bb6d2c0fa25e3818932307fba6d6fe /qpid/cpp/examples/verify | |
parent | d4cebdd93030e253d40c8c08162704016cec8a3c (diff) | |
download | qpid-python-e1574fe486743fe0c162d5c4b9825cbfc116ee63.tar.gz |
Simplified the normalize function (as suggested by aconway) to be compatible with older shells.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@885443 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/examples/verify')
-rwxr-xr-x | qpid/cpp/examples/verify | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/qpid/cpp/examples/verify b/qpid/cpp/examples/verify index da37857b1a..c8d1d3dfcd 100755 --- a/qpid/cpp/examples/verify +++ b/qpid/cpp/examples/verify @@ -75,22 +75,15 @@ outputs() { done } -function normalize() { - local path=${1//\/.\//\/}\/ - while [[ $path =~ ([^/][^/]*/\.\./) ]] - do - path=${path/${BASH_REMATCH[0]}/} - done - echo $path | sed 's/\/$//' -} +normalize() { echo `cd $1 && pwd`; } verify() { FAIL= - arg=$(normalize $1) + arg=$1 srcdir=$(normalize $2) builddir=$(normalize $3) - if [ -d $arg ]; then dir=$arg; script=verify; - else dir=`dirname $arg`; script=`basename $arg`; fi + if [ -d $arg ]; then dir=$(normalize $arg); script=verify; + else dir=$(normalize `dirname $arg`); script=`basename $arg`; fi # if the example is in the "cpp" area, make sure we run from the build directory, not the source dir. rundir=${dir/$srcdir\/cpp/$builddir/} @@ -120,7 +113,7 @@ topbuilddir=$2 shift 2 for example in "$@"; do - echo "== $(normalize $example)" + echo "== $example" if ( verify $example $topsrcdir $topbuilddir; ) then echo "PASS"; else echo "FAIL"; RET=1; fi done exit $RET |