don't use bashism just to remove trailing ':'

Change-Id: I9f86baa65406ac547cee70a273eb730ca47df66b
This commit is contained in:
Doug Zongker 2011-04-22 08:16:56 -07:00
parent ddbcad8c85
commit 2903498319
1 changed files with 5 additions and 4 deletions

View File

@ -100,8 +100,9 @@ function setpaths()
export PATH=${PATH/$ANDROID_BUILD_PATHS/} export PATH=${PATH/$ANDROID_BUILD_PATHS/}
fi fi
if [ -n $ANDROID_PRE_BUILD_PATHS ] ; then if [ -n $ANDROID_PRE_BUILD_PATHS ] ; then
shopt -s extglob export PATH=${PATH/$ANDROID_PRE_BUILD_PATHS/}
export PATH=${PATH/$ANDROID_PRE_BUILD_PATHS?(:)/} # strip trailing ':', if any
export PATH=${PATH/%:/}
fi fi
# and in with the new # and in with the new
@ -1065,7 +1066,7 @@ function godir () {
echo "" echo ""
fi fi
local lines local lines
lines=($(grep "$1" $T/filelist | sed -e 's/\/[^/]*$//' | sort | uniq)) lines=($(grep "$1" $T/filelist | sed -e 's/\/[^/]*$//' | sort | uniq))
if [[ ${#lines[@]} = 0 ]]; then if [[ ${#lines[@]} = 0 ]]; then
echo "Not found" echo "Not found"
return return
@ -1078,7 +1079,7 @@ function godir () {
local line local line
for line in ${lines[@]}; do for line in ${lines[@]}; do
printf "%6s %s\n" "[$index]" $line printf "%6s %s\n" "[$index]" $line
index=$(($index + 1)) index=$(($index + 1))
done done
echo echo
echo -n "Select one: " echo -n "Select one: "