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 | dd297f92d257c8d6487d5af9d29228db2fb68519 (patch) | |
tree | 0690b1a4f31f5bfca0aef97333c7d84f85cd6e82 /cpp | |
parent | fd8245ef5198e69277940bc0252d8a6034daa252 (diff) | |
download | qpid-python-dd297f92d257c8d6487d5af9d29228db2fb68519.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/qpid@885443 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rwxr-xr-x | cpp/examples/verify | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/cpp/examples/verify b/cpp/examples/verify index da37857b1a..c8d1d3dfcd 100755 --- a/cpp/examples/verify +++ b/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 |