Allow a sequence of digits at the end of the directory name when trying to
authorReid Spencer <rspencer@reidspencer.com>
Tue, 14 Mar 2006 06:08:05 +0000 (06:08 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Tue, 14 Mar 2006 06:08:05 +0000 (06:08 +0000)
determine the top directory. This allows the tool to find the correct top
directory when you have something like:

   /x/llvm
   /x/llvm2
   /x/llvm3

Previously the scripts would always find /x/llvm even if you were in the
llvm2 or llvm3 directory because the pattern didn't allow the digits at
the end of the path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26751 91177308-0d34-0410-b5e6-96231b3b80d8

utils/llvmdo
utils/llvmgrep

index 8d21eda427b10fea4f3dfd0923575e9b30f967ab..2924c55ebd84b64e3fcc89a1c65d87bb4fcb9fef 100755 (executable)
@@ -43,7 +43,7 @@ if test ! -x "$PROGRAM" ; then
   exit 1
 fi
 shift;
-TOPDIR=`pwd | sed -e 's#\(.*/llvm\).*#\1#'`
+TOPDIR=`pwd | sed -e 's#\(.*/llvm[0-9]*\).*#\1#'`
 if test -d "$TOPDIR" ; then
   cd $TOPDIR
   case `uname -s` in
index a1f77636c4fc518b4047c4bf1246b9bf5e18fb27..e5a08ad00512a0e1ea9dfbed315668c61725c227 100755 (executable)
@@ -18,7 +18,8 @@
 # details.
 ##===----------------------------------------------------------------------===##
 
-TOPDIR=`pwd | sed -e 's#\(.*/llvm\).*#\1#'`
+TOPDIR=`pwd | sed -e 's#\(.*/llvm[0-9]*\).*#\1#'`
+echo $TOPDIR
 if test -d "$TOPDIR" ; then
   cd $TOPDIR
   case `uname -s` in